Index: CHANGES-beta =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/CHANGES-beta,v retrieving revision 1.209 retrieving revision 1.210 diff -u -r1.209 -r1.210 --- CHANGES-beta 5 Jan 2003 05:13:26 -0000 1.209 +++ CHANGES-beta 16 Feb 2003 06:13:17 -0000 1.210 @@ -1,3 +1,152 @@ +to 21.5.11 "cabbage" + +Lots of improvements and fixes this time around. One of our key +players, Ben Wing, has drastically improved font-locking (go turn on +lazy-lock to check it out). Apart from many other bug fixes, Ben +has also given us a speed up to the build process (--quick-build +configure option). + +Other stars we should mention are: Mike Sperber, for window +configuration fixes and updates; Stephen Turnbull for build fixes, +documentation and typo fixes. Stephen also gave us some major updates +to autoload.el and wid-edit.el. And also Jerry James with some more +DSO updates. + +Here are the highlights: + +Build + +-- Updates to test suite - Turnbull. +-- Use -no-autoloads with update-elc-2 - Wing. +-- Check for strupr and strlwr - Sperber. +-- Delete auto-autoloads.el* & cutom-load.el* files on make clean - Turnbull. +-- Fix --srcdir processing - Turnbull. +-- Define DLSYM_NEEDS_UNDERSCORE on Darwin - Turnbull. +-- Use opsys=aix4-2 for AIX 5 and above - Buchholz. +-- Make ellcc search XEmacs directories for include files 1st - James. +-- Set stack-trace-on-error, load-always-display-messages - Wing. +-- Overhaul update-elc.el, cus-dep, autoload (speed ups) - Wing. +-- Various compiler warning fixes - Wing. +-- FreeBSD updates in modules/Makefile.common - Pluim. +-- Warning fix in eldap.c - James. +-- Support C++ & KKCC compilation in Windows - Wing. +-- Various fixups in nt/config.in.samp - Wing. +-- Fixes in xemacs.mak - Wing. +-- Clean up compile errors with C++ under Windows - Wing. +-- Re-order sections in ldflags for gcc 3.2 - Okhapkin. +-- Restore USE_XFONTSET - Turnbull. +-- New symbol: DLSYM_NEEDS_UNDERSCORE - Turnbull. +-- Guard against multiple definitions of _ALL_SOURCE - Buchholz. +-- QUICK_BUILD updates - Wing. + +Documentation + +-- Major update to configure.usage - Wing. +-- New developer bio's - James, Skyttä, Golubev. +-- Amendments/additions to PROBLEMS: + - PostgreSQL DSO with --error-checking=all - James. + - Consolidate Motif problems into one section - Turnbull. +-- Amendments/additions to INSTALL: + - Recommend Mule - Turnbull. + - Deprecate stripped binaries - Turnbull. +-- General tidy up of etc/BETA, rewrite sections dealing with packages + and building from scratch - Youngs. +-- General doc fixes, typos etc - Youngs, Turnbull, Palmer, Wing. +-- Fix xref in Auto-Saving - Aichner. +-- Update Local.rules File section in packages.texi - Youngs. +-- Clarify package hierarchy structure - Turnbull. +-- Major fixup of internals.texi - Wing. +-- Lots of Mule rewriting in lispref/mule.texi - Wing. +-- Document USE_UNION_TYPE evilness - Wing. +-- Document event-matches-key-specifier-p better - Wing. +-- Change illegal (for C) '//' comments to '/* */' - Shelton, Turnbull. + +Internals + +-- Synch rcs2log to GNU upstream - Youngs. +-- Use symbolic name `XtExposeCompressMaximal' instead of `TRUE' in + xlwMenuClassRec - Buchholz. +-- In xm_update_progress, don't define unless LWLIB_WIDGETS_MOTIF - Buchholz. +-- Rename class -> class_ & new -> new_ - Wing. +-- KKCC update in postgresql.c - Wing. +-- KKCC update in eldap.c - James. +-- Fix for unix_create_process - Ueno. +-- Set stack reserve size during unexec() - Piper. +-- Use 'struct htentry' not 'struct hentry' in elhash.c - Wing. +-- New macros ALIST_LOOP_3, ALIST_LOOP_4. +-- Fix 'xemacs -batch -l dunnet' under Cygwin - Wing. +-- Implement delaying of XFlush() if pending expose events - Wing. +-- Fix some longstanding bugs in X quit handling - Wing. +-- Correct the message output upon crashing to be more up-to-date - Wing. +-- Add dp() & db() as short synonyms of debug_print() & + debug_backtrace() - Wing. +-- Add C++ error-checking code to verify problems with GCPRO/UNGCPRO - Wing. +-- Change the way gap arrays are allocated (for KKCC) - Wing. +-- Now lcrecords set the type of items sitting on the free list to + lcrecord_type_free - Wing. +-- All lcrecord allocation functions now zero out the returned + lcrecords - Wing. +-- Additional asserts in FREE_FIXED_TYPE - Wing. +-- Make bit vectors lcrecords, like vectors - Wing. +-- MARKED_SLOT() call no longer includes semicolon - Wing. +-- Factor out some code duplicated in KKCC and pdump - Wing. +-- KKCC updates - Wing. +-- Add a fifth field "flags" to memory_description - Wing. +-- Add support for "description maps" - Wing. +-- Redo XD_UNION so it works inline and change format to provide info + for pdump - Wing. +-- Textual changes: + - lrecord_description -> memory_description - Wing. + - struct_description -> sized_memory_description - Wing. +-- Initialize protect_me field of popup_data in set_frame_menubar - Sperber +-- GTK updates - Sperber. +-- Don't lead to a crash if dealing with a dead + window/frame/device/console - Sperber. +-- Prevent crash for combination windows - Sperber. +-- Window fixes in Fdelete_window - Sperber. +-- Module updates in emodules.h - James. +-- Fprovide from 'vars_of_file_coding' not 'syms_of_file_coding' - Turnbull. +-- Fix syntax of macro in 'mark_object_maybe_checking_free - Turnbull. +-- Eliminate bogus require-prints-loading-message - Wing. +-- Turn on `load-warn-when-source-newer' by default - Wing. +-- Fix up crashes when selecting menubar items due to lack of GCPROing + - Wing. +-- Implement tail-recursion in KKCC - Wing. +-- Fix UTF-(8|16) detector - Wing. +-- Fix problems with reentrant calling of lwlib and associated crashes + when selecting menu items - Wing. +-- Improve redisplay handling of preemption - Wing. +-- Return the parameter from strlvr, strupr, depend on !HAVE_STRUPR - James. +-- In sysdll.c included lisp.h to define needed alloca_array - Begel. +-- Pull GC_CHECK_NOT_FREE out of USE_KKCC - Sperber. +-- Abort when any attempts to output a stream console are made - Wing. +-- Formatting fixes in redisplay-output.c - Wing. +-- Clean up redisplay a bit - Wing. +-- Fix scrollbar code TTY devices don't have them - Sperber. +-- Major reworking of profile code - Wing. +-- Dramatically improve redisplay speed over slow X connections - Buchholz. +-- Move syntax table description from buffer.c to syntax.c - Wing. +-- Updates to char,mirror,syntax tables code - Wing. +-- Niggly whitespace fixups - Wing. + +Lisp API + +-- Updates to (japan|cryil)-util.el - Turnbull. +-- Updates to how XEmacs computes various paths - Sperber. +-- Window configuration fixes - Sperber, Wing. +-- Make Info-insert-dir end n separator - Buchholz. +-- Drastically reorganise autoload.el - Turnbull. +-- Omit M-S-home/end from motion keys - Wing. +-- Synch wid-edit to GNU/Emacs 21.3.50 - Turnbull. +-- Updates to hyper-apropos - Wing. +-- Reorganise Help -> Info submenu - Wing. +-- Fix bug when end > start in text-props - Wing. +-- Fix walk-windows - Wing. +-- Fix for call to set-language-unicode-precedence-list - Nyyss~nen. +-- Synch up byte-optimize.el - Wing. +-- Include FUNLIST argument to generate-c-file-autoloads-1 - Wing. + + to 21.5.10 "burdock" Please accept my apologies for the very long wait between releases Index: ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/ChangeLog,v retrieving revision 1.339 retrieving revision 1.349 diff -u -r1.339 -r1.349 --- ChangeLog 5 Jan 2003 05:13:26 -0000 1.339 +++ ChangeLog 16 Feb 2003 06:13:17 -0000 1.349 @@ -1,3 +1,90 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-02-15 Ben Wing + + * Makefile.in.in (batch_packages): Run update-elc-2 with -no-autoloads + to avoid multiple autoload-loading problem. + * configure.usage (--error-checking): Document quick-build better. + +2003-01-28 Martin Buchholz + + * configure.in (opsys): (AIX specific) + Use opsys=aix4-2 for AIX 5 and all future versions. + +2003-02-10 Stephen J. Turnbull + + * INSTALL: Recommend Mule, deprecate stripped binaries. + +2003-02-05 Stephen J. Turnbull + + * configure.in (DLSYM_NEEDS_UNDERSCORE): Define on darwin. + + * configure.in: Fix --srcdir processing. + +2003-01-31 Stephen J. Turnbull + + * PROBLEMS: Collect Motif information in one place. + +2002-10-19 Stephen Turnbull + + * Makefile.in.in (clean): Delete auto-autoloads.e* and custom-load.* + in lisp, lisp/mule, and modules. + +2003-01-14 Jerry James + + * PROBLEMS: Describe Steve Youngs' problem with the PostgreSQL + module and --error-checking=all. + +2003-01-13 Ilya Golubev + + * etc/photos/golubev.png, etc/photos/golubevm.png: New. + +2003-01-12 Mike Sperber + + * configure.in: Check for strupr and strlwr. + +2002-12-16 Ben Wing + + * INSTALL (Rationale): + * configure.in (XE_COMPUTE_RUNPATH): + * configure.usage (Usage): + * configure.usage (--xemacs-compiler): + * configure.usage (--srcdir): + * configure.usage (--with-prefix): + * configure.usage (--bindir): New. + * configure.usage (--datadir): New. + * configure.usage (--statedir): New. + * configure.usage (--libdir): New. + * configure.usage (--infodir): New. + * configure.usage (--mandir): New. + * configure.usage (--lispdir): New. + * configure.usage (--sitelispdir): New. + * configure.usage (--etcdir): New. + * configure.usage (--lockdir): New. + * configure.usage (--archlibdir): New. + * configure.usage (--docdir): New. + * configure.usage (--moduledir): New. + * configure.usage (--with-site-lisp): New. + * configure.usage (--with-site-modules): New. + * configure.usage (--package-path): New. + * configure.usage (--infopath): New. + * configure.usage (--with-xmu): + * configure.usage (--with-tty): + * configure.usage (--with-gif): + * configure.usage (--native-sound-lib): + * configure.usage (--with-xim): New. + * configure.usage (--with-clash-detection): New. + * configure.usage (--with-database): + * configure.usage (--mail-locking): + * configure.usage (--with-ipv6-cname): Removed. + * configure.usage (--error-checking): + Redo usage message more logically, fix some problems. In configure, + when outputting the compilation options, put in a big ugly warning + about using union-type, since it's been known to trigger so many + compiler bugs, invariably leading to weird crashes. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: INSTALL =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/INSTALL,v retrieving revision 1.35 retrieving revision 1.37 diff -u -r1.35 -r1.37 --- INSTALL 10 Oct 2002 14:47:23 -0000 1.35 +++ INSTALL 10 Feb 2003 14:28:09 -0000 1.37 @@ -277,10 +277,6 @@ The `--without-xmu' option can be used if your vendor doesn't ship the Xmu library. -The `--puresize' option can be used to change the amount of purespace -allocated for the dumped XEmacs. As of XEmacs 20.1 usage of this -parameter is deprecated and will be ignored. - 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 @@ -314,10 +310,11 @@ intended for use only by the developers and may be obtained from . -The `--debug' and `--error-checking' options are intended for use only -by the developers. `--debug' adds code to be compiled in for -performing various tests. `--error-checking' adds additional tests to -many of the commonly used macros. +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 @@ -327,10 +324,12 @@ 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. The Mule support -is not yet as stable or efficient as the `Latin1' support. Enabling -Mule support requires the mule-base package installed prior to -building XEmacs. The following options require Mule support: +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-xim' option enables use of the X11 XIM mechanism to allow an input method to input text into XEmacs. The input method is shared @@ -668,6 +667,15 @@ Using GNU Make allows for simultaneous builds with and without the --srcdir option. + +STRIPPING BINARIES +================== + +This saves nothing but a small (by modern standards) amount of disk +space; the symbol table is not loaded into memory at execution time. +If you do encounter a crash or other serious bug, the first thing the +developers will do is ask you to build an XEmacs with a full symbol +table, anyway. Don't strip the XEmacs binary. MAIL-LOCKING POST-INSTALLATION ============================== Index: Makefile.in.in =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/Makefile.in.in,v retrieving revision 1.10 retrieving revision 1.12 diff -u -r1.10 -r1.12 --- Makefile.in.in 13 Dec 2002 04:29:49 -0000 1.10 +++ Makefile.in.in 15 Feb 2003 10:16:14 -0000 1.12 @@ -285,7 +285,7 @@ ## the way. all-elc all-elcs: lib-src lwlib dump-elcs src ${blddir}/src/${PROGNAME} ${batch} \ - -l update-elc-2.el -f batch-update-elc-2 lisp + -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 @@ -555,9 +555,16 @@ ## 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 + $(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 Index: PROBLEMS =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/PROBLEMS,v retrieving revision 1.61 retrieving revision 1.63 diff -u -r1.61 -r1.63 --- PROBLEMS 11 Nov 2002 18:52:57 -0000 1.61 +++ PROBLEMS 31 Jan 2003 12:14:00 -0000 1.63 @@ -40,6 +40,7 @@ =============================== ** General + Much general information is in INSTALL. If it's covered in INSTALL, we don't repeat it here. @@ -170,6 +171,132 @@ libz.a in the X11 binary directory. +** Motif + +Motif is the X11 version of the Gnus torture test: if there's a way to +crash, Motif will find it. With the open source release of Motif, it +seems like a good idea to collect all Motif-related issues in one +place. + +You should also look in your OS's section, as it may not be Motif's +fault. + +*** XEmacs crashes on exit (#1). + +The backtrace is something like: + + (gdb) where + #0 0xfeb9a480 in _libc_kill () from /usr/lib/libc.so.1 + #1 0x000b0388 in fatal_error_signal () + #2 + #3 YowIter (ht=0xb, id=0x0, v=0x74682074, client=0x47e3c0) + at ImageCache.c:1159 + #4 0xff26cc5c in _LTHashTableForEachItem (ht=0x4725e8, + iter=0xff26dda0 , ClientData=0x47e3c0) at Hash.c:671 + #5 0xff2a4664 in destroy (w=0x496550) at Screen.c:352 + #6 0xfef92118 in Phase2Destroy () from /usr/openwin/lib/libXt.so.4 + #7 0xfef91940 in Recursive () from /usr/openwin/lib/libXt.so.4 + #8 0xfef91e44 in XtPhase2Destroy () from /usr/openwin/lib/libXt.so.4 + #9 0xfef91ae8 in _XtDoPhase2Destroy () from /usr/openwin/lib/libXt.so.4 + #10 0xfef918cc in XtDestroyWidget () from /usr/openwin/lib/libXt.so.4 + #11 0xfef91438 in CloseDisplay () from /usr/openwin/lib/libXt.so.4 + #12 0xfef91394 in XtCloseDisplay () from /usr/openwin/lib/libXt.so.4 + #13 0x0025b8b0 in x_delete_device () + #14 0x000940b0 in delete_device_internal () + #15 0x000806a0 in delete_console_internal () + +This is known to happen with Lesstif version 0.93.36. Similar +backtraces have also been observed on HP/UX and Solaris. There is a +patch for Lesstif. (This is not a solution; it just stops the crash. +It may or may not be harmless, but "it works for the author".) + +Note that this backtrace looks a lot like the one in the next item. +However, this one is invulnerable to the Solaris patches mentioned there. + +Frank McIngvale says: + + Ok, 0.93.34 works, and I tracked down the crash to a section + marked "experimental" in 0.93.36. Patch attached, "works for me". + +diff -u -r lesstif-0.93.36/lib/Xm/ImageCache.c lesstif-0.93.36-mod/lib/Xm/ImageCache.c +--- lesstif-0.93.36/lib/Xm/ImageCache.c 2002-08-05 14:53:24.000000000 -0500 ++++ lesstif-0.93.36-mod/lib/Xm/ImageCache.c 2002-11-11 11:13:12.000000000 -0600 +@@ -1166,5 +1166,4 @@ + DEBUGOUT(_LtDebug0(__FILE__, NULL, "_LtImageCacheScreenDestroy (XmGetPixmapByDepth) %p\n", + s)); + +- (void) _LTHashTableForEachItem(PixmapCache, YowIter, (XtPointer)s); + } + +*** XEmacs crashes on exit (#2) + +Especially frequent with multiple frames. Crashes that produce C +backtraces like this: + +#0 0xfec9a118 in _libc_kill () from /usr/lib/libc.so.1 +#1 0x77f48 in fatal_error_signal (sig=11) + at /codes/rpluim/xemacs-21.4/src/emacs.c:539 +#2 +#3 0xfee929f4 in XFindContext () from /usr/openwin/lib/libX11.so.4 +#4 0xfee92930 in XFindContext () from /usr/openwin/lib/libX11.so.4 +#5 0xff297e54 in DisplayDestroy () from /usr/dt/lib/libXm.so.4 +#6 0xfefbece0 in XtCallCallbackList () from /usr/openwin/lib/libXt.so.4 +#7 0xfefc486c in XtPhase2Destroy () from /usr/openwin/lib/libXt.so.4 +#8 0xfefc45d0 in _XtDoPhase2Destroy () from /usr/openwin/lib/libXt.so.4 +#9 0xfefc43b4 in XtDestroyWidget () from /usr/openwin/lib/libXt.so.4 +#10 0x15cf9c in x_delete_device (d=0x523f00) + +are caused by buggy Motif libraries. Installing the following patches +has been reported to solve the problem on Solaris 2.7: + +107081-40 107656-07 + +For information (although they have not been confirmed to work), the +equivalent patches for Solaris 2.8 are: + +108940-33 108652-25 + +*** On HP-UX 11.0 XEmacs causes excessive X11 errors when running. + (also appears on AIX as reported in comp.emacs.xemacs) + +Marcus Thiessel + + Unfortunately, XEmacs releases prior to 21.0 don't work with + Motif2.1. It will compile but you will get excessive X11 errors like + + xemacs: X Error of failed request: BadGC (invalid GC parameter) + + and finally XEmacs gets killed. A workaround is to use the + Motif1.2_R6 libraries. You can the following line to your call to + configure: + + --x-libraries="/usr/lib/Motif1.2_R6 -L/usr/lib/X11R6" + + Make sure /usr/lib/Motif1.2_R6/libXm.sl is a link to + /usr/lib/Motif1.2_R6/libXm.3. + +*** On HP-UX 11.0: Object "" does not have windowed ancestor + +Marcus Thiessel + + XEmacs dies without core file and reports: + + Error: Object "" does not have windowed ancestor. + + This is a bug. Please apply the patch PHSS_19964 (check if + superseded). The other alternative is to link with Motif1.2_R6 (see + previous item). + +*** Motif dialog boxes lose on Irix. + +Larry Auton writes: +Beware of not specifying + + --with-dialogs=athena + +if it builds with the motif dialogs [boom!] you're a dead man. + + ** AIX *** IBM compiler fails: "The character # is not a valid C source character." @@ -233,33 +360,6 @@ ** SunOS/Solaris -*** Crashes when using Motif libraries, especially with multiple frames. - -Crashes that produce C-backtraces like this: - -#0 0xfec9a118 in _libc_kill () from /usr/lib/libc.so.1 -#1 0x77f48 in fatal_error_signal (sig=11) - at /codes/rpluim/xemacs-21.4/src/emacs.c:539 -#2 -#3 0xfee929f4 in XFindContext () from /usr/openwin/lib/libX11.so.4 -#4 0xfee92930 in XFindContext () from /usr/openwin/lib/libX11.so.4 -#5 0xff297e54 in DisplayDestroy () from /usr/dt/lib/libXm.so.4 -#6 0xfefbece0 in XtCallCallbackList () from /usr/openwin/lib/libXt.so.4 -#7 0xfefc486c in XtPhase2Destroy () from /usr/openwin/lib/libXt.so.4 -#8 0xfefc45d0 in _XtDoPhase2Destroy () from /usr/openwin/lib/libXt.so.4 -#9 0xfefc43b4 in XtDestroyWidget () from /usr/openwin/lib/libXt.so.4 -#10 0x15cf9c in x_delete_device (d=0x523f00) - -are caused by buggy Motif libraries. Installing the following patches -has been reported to solve the problem on Solaris 2.7: - -107081-40 107656-07 - -For information (although they have not been confirmed to work), the -equivalent patches for Solaris 2.8 are: - -108940-33 108652-25 - *** Dumping error when using GNU binutils / GNU ld on a Sun. Errors similar to the following: @@ -564,37 +664,6 @@ This might be a sed problem. For your own safety make sure to use GNU sed while dumping XEmacs. -*** On HP-UX 11.0 XEmacs causes excessive X11 errors when running. - (also appears on AIX as reported in comp.emacs.xemacs) - -Marcus Thiessel - - Unfortunately, XEmacs releases prior to 21.0 don't work with - Motif2.1. It will compile but you will get excessive X11 errors like - - xemacs: X Error of failed request: BadGC (invalid GC parameter) - - and finally XEmacs gets killed. A workaround is to use the - Motif1.2_R6 libraries. You can the following line to your call to - configure: - - --x-libraries="/usr/lib/Motif1.2_R6 -L/usr/lib/X11R6" - - Make sure /usr/lib/Motif1.2_R6/libXm.sl is a link to - /usr/lib/Motif1.2_R6/libXm.3. - -*** On HP-UX 11.0: Object "" does not have windowed ancestor - -Marcus Thiessel - - XEmacs dies without core file and reports: - - Error: Object "" does not have windowed ancestor. - - This is a bug. Please apply the patch PHSS_19964 (check if - superseded). The other alternative is to link with Motif1.2_R6 (see - previous item). - ** SCO OpenServer *** Native cc on SCO OpenServer 5 is now OK. Icc may still throw you @@ -1247,6 +1316,22 @@ Emacs*EmacsFrame.geometry: 81x56--9--1 +*** When I try to use the PostgreSQL functions, I get a message about +undefined symbols. + +The only known case in which this happens is if you are using gcc, you +configured with --error-checking=all and --with-modules, and you +compiled with no optimization. If you encounter this problem in any +other situation, please inform xemacs-beta@xemacs.org. + +This problem stems from a gcc bug. With no optimization, functions +declared `extern inline' sometimes are not completely compiled away. An +undefined symbol with the function's name is put into the resulting +object file. In this case, when the postgresql module is loaded, the +linker is unable to resolve that symbol, so the module load fails. The +workaround is to recompile the module with optimization turned on. Any +optimization level, including -Os, appears to work. + ** MacOS/X, Darwin *** XEmacs crashes on MacOS within font-lock, or when dealing @@ -1464,27 +1549,6 @@ ** Linux -*** XEmacs crashes on exit. - -This is known to happen with Lesstif version 0.93.36. It is -apparently due to breakage in Lesstif. There is a patch for Lesstif. - -Frank McIngvale says: - - Ok, 0.93.34 works, and I tracked down the crash to a section - marked "experimental" in 0.93.36. Patch attached, "works for me". - -diff -u -r lesstif-0.93.36/lib/Xm/ImageCache.c lesstif-0.93.36-mod/lib/Xm/ImageCache.c ---- lesstif-0.93.36/lib/Xm/ImageCache.c 2002-08-05 14:53:24.000000000 -0500 -+++ lesstif-0.93.36-mod/lib/Xm/ImageCache.c 2002-11-11 11:13:12.000000000 -0600 -@@ -1166,5 +1166,4 @@ - DEBUGOUT(_LtDebug0(__FILE__, NULL, "_LtImageCacheScreenDestroy (XmGetPixmapByDepth) %p\n", - s)); - -- (void) _LTHashTableForEachItem(PixmapCache, YowIter, (XtPointer)s); - } - - *** XEmacs crashes on startup, in make-frame. Typically the Lisp backtrace includes @@ -1672,15 +1736,6 @@ The program mkpts (which may be in `/usr/adm' or `/usr/sbin') needs to be set-UID to root, or non-root programs like Emacs will not be able to allocate ptys reliably. - -*** Motif dialog boxes lose on Irix. - -Larry Auton writes: -Beware of not specifying - - --with-dialogs=athena - -if it builds with the motif dialogs [boom!] you're a dead man. *** Beware of the default image & graphics library on Irix Index: configure =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/configure,v retrieving revision 1.186 retrieving revision 1.190 diff -u -r1.186 -r1.190 --- configure 16 Dec 2002 02:33:04 -0000 1.186 +++ configure 14 Feb 2003 23:31:47 -0000 1.190 @@ -62,6 +62,16 @@ if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi fi +for xe_parse_arg in ""; do + case $xe_parse_arg in + --srcdir) (echo "$progname: Usage error:" +echo " " "The \`--srcdir' option requires a boolean value: \`yes' or \`no'." +echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; + --srcdir=*) srcdir=`echo $xe_parse_arg | sed -e 's/--srcdir=//'` ;; + *) ;; + esac +done + exec_prefix=NONE host=NONE no_create= @@ -73,7 +83,6 @@ program_transform_name=s,x,x, silent= site= -srcdir= target=NONE verbose= x_includes=NONE @@ -261,8 +270,6 @@ with_ipv6_cname="no" - - arguments="$@" quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g @@ -283,6 +290,7 @@ arg="$1"; shift case "$arg" in --no-create|--no-recursion) ;; + --srcdir=*) ;; -* ) case "$arg" in -*=*) @@ -377,8 +385,7 @@ eval "$opt=\"$val\"" ;; - srcdir | \ - compiler | \ + compiler | \ xemacs_compiler | \ cflags | \ cflags_warning | \ @@ -826,11 +833,11 @@ done if test -z "$srcdir" ; then (echo "$progname: Usage error:" -echo " " "Neither the current directory nor its parent seem to - contain the XEmacs sources. If you do not want to build XEmacs in its - source tree, you should run \`$progname' in the directory in which - you wish to build XEmacs, using the \`--srcdir' option to say where the - sources may be found." +echo " " "None of the path to configure, the current directory, + and its parent seem to contain the XEmacs sources. If you do not want + to build XEmacs in its source tree, you should run \`$progname' in the + directory in which you wish to build XEmacs, using the \`--srcdir' option + to say where the sources may be found." echo " Use \`$progname --help' to show usage.") >&2 && exit 1 fi ;; @@ -859,7 +866,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:863: checking whether ln -s works" >&5 +echo "configure:870: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -1145,7 +1152,7 @@ echo $ac_n "checking "host system type"""... $ac_c" 1>&6 -echo "configure:1149: checking "host system type"" >&5 +echo "configure:1156: 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/'` @@ -1196,12 +1203,12 @@ *-*-ultrix4.[12]* ) opsys=bsd4-3 ;; *-*-ultrix* ) opsys=ultrix4-3 ;; - *-*-aix3.1* ) opsys=aix3-1 ;; - *-*-aix3.2.5 ) opsys=aix3-2-5 ;; - *-*-aix3* ) opsys=aix3-2 ;; - *-*-aix4.0* ) opsys=aix4 ;; - *-*-aix4.1* ) opsys=aix4-1 ;; - *-*-aix4* ) opsys=aix4-2 ;; + *-*-aix3.1* ) opsys=aix3-1 ;; + *-*-aix3.2.5 ) opsys=aix3-2-5 ;; + *-*-aix3* ) opsys=aix3-2 ;; + *-*-aix4.0* ) opsys=aix4 ;; + *-*-aix4.1* ) opsys=aix4-1 ;; + *-*-aix[4-9]* ) opsys=aix4-2 ;; *-gnu* ) opsys=gnu ;; *-*-bsd4.[01] ) opsys=bsd4-1 ;; @@ -1580,7 +1587,7 @@ if test -z "$pdump"; then case "$opsys" in - linux* ) pdump=yes ;; *-*-darwin* ) pdump=yes ;; *) pdump=no ;; + linux* ) pdump=yes ;; darwin ) pdump=yes ;; *) pdump=no ;; esac fi @@ -1594,6 +1601,14 @@ case "$opsys" in hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;; decosf* ) ld_call_shared="-call_shared" ;; + darwin ) { test "$extra_verbose" = "yes" && cat << \EOF + Defining DLSYM_NEEDS_UNDERSCORE +EOF +cat >> confdefs.h <<\EOF +#define DLSYM_NEEDS_UNDERSCORE 1 +EOF +} + ;; esac else case "$opsys" in sol2 ) @@ -1669,7 +1684,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:1673: checking for $ac_word" >&5 +echo "configure:1688: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1696,7 +1711,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:1700: checking for $ac_word" >&5 +echo "configure:1715: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1744,7 +1759,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:1748: checking for $ac_word" >&5 +echo "configure:1763: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1773,7 +1788,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1777: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1792: 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' @@ -1786,12 +1801,12 @@ cat > conftest.$ac_ext << EOF -#line 1790 "configure" +#line 1805 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1810: \"$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 @@ -1819,19 +1834,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:1823: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1838: 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:1828: checking whether we are using GNU C" >&5 +echo "configure:1843: 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:1850: \"$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 @@ -1849,7 +1864,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1853: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1868: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1882,7 +1897,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:1886: checking for $ac_word" >&5 +echo "configure:1901: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1909,7 +1924,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:1913: checking for $ac_word" >&5 +echo "configure:1928: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1957,7 +1972,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:1961: checking for $ac_word" >&5 +echo "configure:1976: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1986,7 +2001,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1990: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2005: 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' @@ -1999,12 +2014,12 @@ cat > conftest.$ac_ext << EOF -#line 2003 "configure" +#line 2018 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2023: \"$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 @@ -2032,19 +2047,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:2036: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2051: 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:2041: checking whether we are using GNU C" >&5 +echo "configure:2056: 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:2063: \"$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 @@ -2062,7 +2077,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2066: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2081: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2095,7 +2110,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:2099: checking for $ac_word" >&5 +echo "configure:2114: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2122,7 +2137,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:2126: checking for $ac_word" >&5 +echo "configure:2141: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2170,7 +2185,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:2174: checking for $ac_word" >&5 +echo "configure:2189: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2199,7 +2214,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2203: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2218: 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' @@ -2212,12 +2227,12 @@ cat > conftest.$ac_ext << EOF -#line 2216 "configure" +#line 2231 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2236: \"$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 @@ -2245,19 +2260,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:2249: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2264: 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:2254: checking whether we are using GNU C" >&5 +echo "configure:2269: 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:2276: \"$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 @@ -2275,7 +2290,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2279: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2294: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2308,7 +2323,7 @@ if test "$GCC" = "yes"; then cat > conftest.$ac_ext <= 3 @@ -2318,7 +2333,7 @@ #endif } EOF -if { (eval echo configure:2322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:2337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -2339,7 +2354,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:2343: checking how to run the C preprocessor" >&5 +echo "configure:2358: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2352,13 +2367,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:2362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2377: \"$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 : @@ -2369,13 +2384,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:2379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2394: \"$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 : @@ -2386,13 +2401,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:2396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2411: \"$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 : @@ -2418,9 +2433,9 @@ echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2422: checking for AIX" >&5 +echo "configure:2437: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:2451: checking for GNU libc" >&5 +echo "configure:2466: checking for GNU libc" >&5 cat > conftest.$ac_ext < int main() { @@ -2461,7 +2476,7 @@ ; return 0; } EOF -if { (eval echo configure:2465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_glibc=yes else @@ -2538,7 +2553,7 @@ esac cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:2571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -2804,17 +2819,17 @@ if test "$__USLC__" = yes; then echo $ac_n "checking for whether the -Kalloca compiler flag is needed""... $ac_c" 1>&6 -echo "configure:2808: checking for whether the -Kalloca compiler flag is needed" >&5 +echo "configure:2823: 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:2833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* : else @@ -2825,14 +2840,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:2851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* need_kalloca=yes else @@ -2892,7 +2907,7 @@ if test "$GCC" = "yes"; then echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6 -echo "configure:2896: checking for buggy gcc versions" >&5 +echo "configure:2911: 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.*) @@ -2950,7 +2965,7 @@ if test "$pdump" != "yes"; then echo $ac_n "checking for \"-z nocombreloc\" linker flag""... $ac_c" 1>&6 -echo "configure:2954: checking for \"-z nocombreloc\" linker flag" >&5 +echo "configure:2969: 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 ;; @@ -3039,7 +3054,7 @@ fi echo $ac_n "checking for dynodump""... $ac_c" 1>&6 -echo "configure:3043: checking for dynodump" >&5 +echo "configure:3058: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -3077,12 +3092,12 @@ done echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6 -echo "configure:3081: checking for terminateAndUnload in -lC" >&5 +echo "configure:3096: 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:3112: \"$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 @@ -3201,7 +3216,7 @@ if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:3205: checking "for runtime libraries flag"" >&5 +echo "configure:3220: checking "for runtime libraries flag"" >&5 case "$opsys" in sol2 ) dash_r="-R" ;; decosf* | linux* | irix*) dash_r="-rpath " ;; @@ -3223,14 +3238,14 @@ done fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* dash_r="$try_dash_r" else @@ -3331,10 +3346,10 @@ fi after_morecore_hook_exists=yes echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6 -echo "configure:3335: checking for malloc_set_state" >&5 +echo "configure:3350: 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:3376: \"$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 @@ -3377,16 +3392,16 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:3381: checking whether __after_morecore_hook exists" >&5 +echo "configure:3396: 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:3405: \"$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 @@ -3442,7 +3457,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:3446: checking for $ac_word" >&5 +echo "configure:3461: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -3497,7 +3512,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:3501: checking for a BSD compatible install" >&5 +echo "configure:3516: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" @@ -3551,7 +3566,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:3555: checking for $ac_word" >&5 +echo "configure:3570: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -3583,15 +3598,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3587: checking for $ac_hdr" >&5 +echo "configure:3602: 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:3595: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3610: \"$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* @@ -3621,10 +3636,10 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3625: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:3640: checking for sys/wait.h that is POSIX.1 compatible" >&5 cat > conftest.$ac_ext < #include @@ -3640,7 +3655,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -3664,10 +3679,10 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3668: checking for ANSI C header files" >&5 +echo "configure:3683: checking for ANSI C header files" >&5 cat > conftest.$ac_ext < #include @@ -3675,7 +3690,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3694: \"$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* @@ -3692,7 +3707,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 @@ -3710,7 +3725,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 @@ -3728,7 +3743,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') @@ -3739,7 +3754,7 @@ exit (0); } EOF -if { (eval echo configure:3743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:3758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -3765,10 +3780,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3769: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3784: checking whether time.h and sys/time.h may both be included" >&5 cat > conftest.$ac_ext < #include @@ -3777,7 +3792,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3801,10 +3816,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3805: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:3820: checking for sys_siglist declaration in signal.h or unistd.h" >&5 cat > conftest.$ac_ext < #include @@ -3816,7 +3831,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3842,9 +3857,9 @@ echo $ac_n "checking for utime""... $ac_c" 1>&6 -echo "configure:3846: checking for utime" >&5 +echo "configure:3861: checking for utime" >&5 cat > conftest.$ac_ext < #include @@ -3852,7 +3867,7 @@ struct utimbuf x; x.actime = x.modtime = 0; utime ("/", &x); ; return 0; } EOF -if { (eval echo configure:3856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3871: \"$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 @@ -3871,10 +3886,10 @@ for ac_func in utimes do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3875: checking for $ac_func" >&5 +echo "configure:3890: 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:3916: \"$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 @@ -3929,10 +3944,10 @@ echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3933: checking return type of signal handlers" >&5 +echo "configure:3948: checking return type of signal handlers" >&5 cat > conftest.$ac_ext < #include @@ -3949,7 +3964,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3971,10 +3986,10 @@ echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3975: checking for size_t" >&5 +echo "configure:3990: checking for size_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4005,10 +4020,10 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:4009: checking for pid_t" >&5 +echo "configure:4024: checking for pid_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4039,10 +4054,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:4043: checking for uid_t in sys/types.h" >&5 +echo "configure:4058: checking for uid_t in sys/types.h" >&5 cat > conftest.$ac_ext < EOF @@ -4078,10 +4093,10 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:4082: checking for mode_t" >&5 +echo "configure:4097: checking for mode_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4112,10 +4127,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:4116: checking for off_t" >&5 +echo "configure:4131: checking for off_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4146,10 +4161,10 @@ fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:4150: checking for ssize_t" >&5 +echo "configure:4165: checking for ssize_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4181,9 +4196,9 @@ echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:4185: checking for socklen_t" >&5 +echo "configure:4200: checking for socklen_t" >&5 cat > conftest.$ac_ext < socklen_t x; @@ -4192,7 +4207,7 @@ ; return 0; } EOF -if { (eval echo configure:4196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -4201,7 +4216,7 @@ rm -rf conftest* cat > conftest.$ac_ext < int accept (int, struct sockaddr *, size_t *); @@ -4210,7 +4225,7 @@ ; return 0; } EOF -if { (eval echo configure:4214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""size_t" 1>&6 @@ -4242,9 +4257,9 @@ rm -f conftest* echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:4246: checking for struct timeval" >&5 +echo "configure:4261: checking for struct timeval" >&5 cat > conftest.$ac_ext < @@ -4260,7 +4275,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:4264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -4282,10 +4297,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:4286: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:4301: checking whether struct tm is in sys/time.h or time.h" >&5 cat > conftest.$ac_ext < #include @@ -4293,7 +4308,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:4297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -4317,10 +4332,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:4321: checking for tm_zone in struct tm" >&5 +echo "configure:4336: checking for tm_zone in struct tm" >&5 cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -4328,7 +4343,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:4332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -4351,10 +4366,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:4355: checking for tzname" >&5 +echo "configure:4370: checking for tzname" >&5 cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -4364,7 +4379,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:4368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -4390,10 +4405,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4394: checking for working const" >&5 +echo "configure:4409: checking for working const" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4467,7 +4482,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:4471: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:4486: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -4492,12 +4507,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4496: checking whether byte ordering is bigendian" >&5 +echo "configure:4511: 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 @@ -4508,11 +4523,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:4512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -4523,7 +4538,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:4527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4540,7 +4555,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:4572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_bigendian=no else @@ -4580,10 +4595,10 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4584: checking size of short" >&5 +echo "configure:4599: checking size of short" >&5 cat > conftest.$ac_ext < main() @@ -4594,7 +4609,7 @@ exit(0); } EOF -if { (eval echo configure:4598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -4622,10 +4637,10 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4626: checking size of int" >&5 +echo "configure:4641: checking size of int" >&5 cat > conftest.$ac_ext < main() @@ -4636,7 +4651,7 @@ exit(0); } EOF -if { (eval echo configure:4640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -4658,10 +4673,10 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4662: checking size of long" >&5 +echo "configure:4677: checking size of long" >&5 cat > conftest.$ac_ext < main() @@ -4672,7 +4687,7 @@ exit(0); } EOF -if { (eval echo configure:4676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -4694,10 +4709,10 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4698: checking size of long long" >&5 +echo "configure:4713: checking size of long long" >&5 cat > conftest.$ac_ext < main() @@ -4708,7 +4723,7 @@ exit(0); } EOF -if { (eval echo configure:4712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4727: \"$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 @@ -4730,10 +4745,10 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4734: checking size of void *" >&5 +echo "configure:4749: checking size of void *" >&5 cat > conftest.$ac_ext < main() @@ -4744,7 +4759,7 @@ exit(0); } EOF -if { (eval echo configure:4748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4763: \"$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 @@ -4767,7 +4782,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:4771: checking for long file names" >&5 +echo "configure:4786: 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: @@ -4813,10 +4828,10 @@ echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4817: checking for sin" >&5 +echo "configure:4832: checking for sin" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4858: \"$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 @@ -4857,12 +4872,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:4861: checking for sin in -lm" >&5 +echo "configure:4876: 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:4892: \"$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 @@ -4908,14 +4923,14 @@ cat > conftest.$ac_ext < int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4934: \"$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 @@ -4934,10 +4949,10 @@ for ac_func in mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4938: checking for $ac_func" >&5 +echo "configure:4953: 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:4979: \"$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 @@ -4989,14 +5004,14 @@ echo "checking type of mail spool file locking" 1>&6 -echo "configure:4993: checking type of mail spool file locking" >&5 +echo "configure:5008: 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:4997: checking for $ac_func" >&5 +echo "configure:5012: 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:5038: \"$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 @@ -5101,12 +5116,12 @@ case "$opsys" in decosf*) echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:5105: checking for cma_open in -lpthreads" >&5 +echo "configure:5120: 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:5136: \"$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 @@ -5154,7 +5169,7 @@ echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:5158: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:5173: 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; @@ -5166,7 +5181,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:5170: checking for \"-z ignore\" linker flag" >&5 +echo "configure:5185: 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 ;; @@ -5177,7 +5192,7 @@ echo "checking "for specified window system"" 1>&6 -echo "configure:5181: checking "for specified window system"" >&5 +echo "configure:5196: checking "for specified window system"" >&5 GNOME_CONFIG=no @@ -5185,7 +5200,7 @@ if test "$with_gnome" != "no"; then echo $ac_n "checking for GNOME configuration script""... $ac_c" 1>&6 -echo "configure:5189: checking for GNOME configuration script" >&5 +echo "configure:5204: checking for GNOME configuration script" >&5 for possible in gnome-config do possible_version=`${possible} --version 2> /dev/null` @@ -5216,7 +5231,7 @@ if test "$with_gtk" != "no";then echo $ac_n "checking for GTK configuration script""... $ac_c" 1>&6 -echo "configure:5220: checking for GTK configuration script" >&5 +echo "configure:5235: checking for GTK configuration script" >&5 for possible in gtk12-config gtk14-config gtk-config do possible_version=`${possible} --version 2> /dev/null` @@ -5238,18 +5253,18 @@ if test "${GTK_CONFIG}" != "no"; then echo $ac_n "checking gtk version""... $ac_c" 1>&6 -echo "configure:5242: checking gtk version" >&5 +echo "configure:5257: 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:5247: checking gtk libs" >&5 +echo "configure:5262: 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:5253: checking gtk cflags" >&5 +echo "configure:5268: checking gtk cflags" >&5 GTK_CFLAGS=`${GTK_CONFIG} --cflags` if test "$GCC" = "yes"; then GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow" @@ -5259,19 +5274,19 @@ echo $ac_n "checking for main in -lgdk_imlib""... $ac_c" 1>&6 -echo "configure:5263: checking for main in -lgdk_imlib" >&5 +echo "configure:5278: 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:5290: \"$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 @@ -5293,12 +5308,12 @@ echo $ac_n "checking for Imlib_init in -lImlib""... $ac_c" 1>&6 -echo "configure:5297: checking for Imlib_init in -lImlib" >&5 +echo "configure:5312: 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:5328: \"$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 @@ -5332,10 +5347,10 @@ for ac_func in gdk_imlib_init do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5336: checking for $ac_func" >&5 +echo "configure:5351: 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:5377: \"$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 @@ -5424,15 +5439,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5428: checking for $ac_hdr" >&5 +echo "configure:5443: 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:5436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5451: \"$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* @@ -5463,19 +5478,19 @@ echo $ac_n "checking for main in -lxml""... $ac_c" 1>&6 -echo "configure:5467: checking for main in -lxml" >&5 +echo "configure:5482: 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:5494: \"$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 @@ -5497,19 +5512,19 @@ echo $ac_n "checking for main in -lglade""... $ac_c" 1>&6 -echo "configure:5501: checking for main in -lglade" >&5 +echo "configure:5516: 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:5528: \"$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 @@ -5531,19 +5546,19 @@ echo $ac_n "checking for main in -lglade-gnome""... $ac_c" 1>&6 -echo "configure:5535: checking for main in -lglade-gnome" >&5 +echo "configure:5550: 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:5562: \"$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 @@ -5564,7 +5579,7 @@ cat > conftest.$ac_ext < EOF @@ -5623,7 +5638,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:5627: checking for X" >&5 +echo "configure:5642: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5683,12 +5698,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:5692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5707: \"$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* @@ -5757,14 +5772,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:5783: \"$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. @@ -5873,17 +5888,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:5877: checking whether -R must be followed by a space" >&5 +echo "configure:5892: 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:5902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -5899,14 +5914,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:5925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -5942,12 +5957,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:5946: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:5961: 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:5977: \"$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 @@ -5982,12 +5997,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:5986: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:6001: 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:6017: \"$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 @@ -6027,10 +6042,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:6031: checking for gethostbyname" >&5 +echo "configure:6046: checking for gethostbyname" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6072: \"$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 @@ -6074,12 +6089,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:6078: checking for gethostbyname in -lnsl" >&5 +echo "configure:6093: 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:6109: \"$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 @@ -6120,10 +6135,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:6124: checking for connect" >&5 +echo "configure:6139: checking for connect" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -6169,12 +6184,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:6173: checking "$xe_msg_checking"" >&5 +echo "configure:6188: 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:6204: \"$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 @@ -6209,10 +6224,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:6213: checking for remove" >&5 +echo "configure:6228: checking for remove" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6254: \"$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 @@ -6256,12 +6271,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:6260: checking for remove in -lposix" >&5 +echo "configure:6275: 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:6291: \"$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 @@ -6296,10 +6311,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:6300: checking for shmat" >&5 +echo "configure:6315: checking for shmat" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6341: \"$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 @@ -6343,12 +6358,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:6347: checking for shmat in -lipc" >&5 +echo "configure:6362: 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:6378: \"$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 @@ -6395,12 +6410,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:6399: checking "$xe_msg_checking"" >&5 +echo "configure:6414: 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:6430: \"$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 @@ -6578,7 +6593,7 @@ echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:6582: checking for X defines extracted by xmkmf" >&5 +echo "configure:6597: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -6627,15 +6642,15 @@ ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 -echo "configure:6631: checking for X11/Intrinsic.h" >&5 +echo "configure:6646: 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:6639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6654: \"$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* @@ -6659,12 +6674,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:6663: checking for XOpenDisplay in -lX11" >&5 +echo "configure:6678: 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:6694: \"$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 @@ -6700,12 +6715,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:6704: checking "$xe_msg_checking"" >&5 +echo "configure:6719: 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:6735: \"$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 @@ -6743,12 +6758,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:6747: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:6762: 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:6778: \"$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 @@ -6782,12 +6797,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:6786: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:6801: 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:6817: \"$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 @@ -6821,14 +6836,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:6825: checking the version of X11 being used" >&5 +echo "configure:6840: 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:6832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:6847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest foobar; x11_release=$? else @@ -6859,10 +6874,10 @@ for ac_func in XConvertCase do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6863: checking for $ac_func" >&5 +echo "configure:6878: 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:6904: \"$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 @@ -6917,15 +6932,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6921: checking for $ac_hdr" >&5 +echo "configure:6936: 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:6929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6944: \"$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* @@ -6958,10 +6973,10 @@ for ac_func in XRegisterIMInstantiateCallback do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6962: checking for $ac_func" >&5 +echo "configure:6977: 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:7003: \"$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 @@ -7012,9 +7027,9 @@ done echo $ac_n "checking for standard XRegisterIMInstantiateCallback prototype""... $ac_c" 1>&6 -echo "configure:7016: checking for standard XRegisterIMInstantiateCallback prototype" >&5 +echo "configure:7031: checking for standard XRegisterIMInstantiateCallback prototype" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -7047,12 +7062,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:7051: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:7066: 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:7082: \"$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 @@ -7102,19 +7117,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:7106: checking for main in -lXbsd" >&5 +echo "configure:7121: 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:7133: \"$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 @@ -7151,22 +7166,22 @@ fi if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:7155: checking for MS-Windows" >&5 +echo "configure:7170: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:7158: checking for main in -lgdi32" >&5 +echo "configure:7173: 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:7185: \"$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 @@ -7217,12 +7232,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:7226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7241: \"$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 @@ -7283,15 +7298,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:7287: checking for X11/extensions/shape.h" >&5 +echo "configure:7302: 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:7295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7310: \"$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* @@ -7341,7 +7356,7 @@ esac echo "checking for WM_COMMAND option" 1>&6 -echo "configure:7345: checking for WM_COMMAND option" >&5; +echo "configure:7360: checking for WM_COMMAND option" >&5; if test "$with_wmcommand" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_WMCOMMAND @@ -7356,15 +7371,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:7360: checking for X11/Xauth.h" >&5 +echo "configure:7375: 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:7368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7383: \"$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* @@ -7387,12 +7402,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:7391: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:7406: 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:7422: \"$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 @@ -7450,22 +7465,22 @@ if test "$with_modules" != "no"; then echo "checking for module support" 1>&6 -echo "configure:7454: checking for module support" >&5 +echo "configure:7469: checking for module support" >&5 if test "$with_msw" = "yes"; then have_dl=yes; else ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:7461: checking for dlfcn.h" >&5 +echo "configure:7476: 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:7469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7484: \"$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* @@ -7482,16 +7497,16 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:7486: checking for dlopen in -lc" >&5 +echo "configure:7501: checking for dlopen in -lc" >&5 cat > conftest.$ac_ext < int main() { dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:7495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7500,18 +7515,18 @@ rm -rf conftest* echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:7504: checking for dlopen in -ldl" >&5 +echo "configure:7519: checking for dlopen in -ldl" >&5 ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext < int main() { dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:7515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7540,12 +7555,12 @@ else echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:7544: checking for shl_load in -ldld" >&5 +echo "configure:7559: 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:7575: \"$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 @@ -7583,12 +7598,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:7587: checking for dld_init in -ldld" >&5 +echo "configure:7602: 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:7618: \"$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 @@ -7644,7 +7659,7 @@ xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:7648: checking how to build dynamic libraries for ${xehost}" >&5 +echo "configure:7663: checking how to build dynamic libraries for ${xehost}" >&5 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. case "$xehost" in *-*-linux-gnu*) ;; @@ -7672,9 +7687,9 @@ XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:7676: checking checking whether we are using GNU C" >&5 +echo "configure:7691: checking checking whether we are using GNU C" >&5 cat > conftest.$ac_ext <&6 -echo "configure:7700: checking how to produce PIC code" >&5 +echo "configure:7715: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -7802,18 +7817,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:7806: checking if PIC flag ${dll_cflags} really works" >&5 +echo "configure:7821: 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:7832: \"$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 @@ -7848,7 +7863,7 @@ xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:7852: checking if C compiler can produce shared libraries" >&5 +echo "configure:7867: checking if C compiler can produce shared libraries" >&5 if test "$XEGCC" = yes; then xcldf="-shared" xldf="-shared" @@ -7899,14 +7914,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:7925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cc_produces_so=yes else @@ -7931,7 +7946,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:7935: checking for ld used by GCC" >&5 +echo "configure:7950: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -7957,7 +7972,7 @@ esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:7961: checking for GNU ld" >&5 +echo "configure:7976: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -7995,7 +8010,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:7999: checking if the linker is GNU ld" >&5 +echo "configure:8014: 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 @@ -8023,7 +8038,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:8027: checking whether the linker supports shared libraries" >&5 +echo "configure:8042: checking whether the linker supports shared libraries" >&5 dll_ld=$CC dll_ldflags=$LDFLAGS ld_shlibs=yes @@ -8231,10 +8246,10 @@ for ac_func in dlerror _dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8235: checking for $ac_func" >&5 +echo "configure:8250: 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:8276: \"$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 @@ -8319,15 +8334,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:8323: checking for ${dir}tt_c.h" >&5 +echo "configure:8338: 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:8331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8346: \"$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* @@ -8363,12 +8378,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:8367: checking "$xe_msg_checking"" >&5 +echo "configure:8382: 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:8398: \"$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 @@ -8433,15 +8448,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:8437: checking for Dt/Dt.h" >&5 +echo "configure:8452: 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:8445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8460: \"$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* @@ -8464,12 +8479,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:8468: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:8483: 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:8499: \"$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 @@ -8561,7 +8576,7 @@ if test "$with_dragndrop" != "no" ; then echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 -echo "configure:8565: checking if drag and drop API is needed" >&5 +echo "configure:8580: 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 @@ -8581,19 +8596,19 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:8585: checking for LDAP" >&5 +echo "configure:8600: 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:8589: checking for ldap.h" >&5 +echo "configure:8604: 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:8597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8612: \"$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* @@ -8616,15 +8631,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:8620: checking for lber.h" >&5 +echo "configure:8635: 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:8628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8648,12 +8663,12 @@ if test "$with_ldap" != "no"; then echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6 -echo "configure:8652: checking for ldap_search in -lldap" >&5 +echo "configure:8667: 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:8683: \"$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 @@ -8689,12 +8704,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:8693: checking "$xe_msg_checking"" >&5 +echo "configure:8708: 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:8724: \"$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 @@ -8730,12 +8745,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:8734: checking "$xe_msg_checking"" >&5 +echo "configure:8749: 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:8765: \"$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 @@ -8771,12 +8786,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:8775: checking "$xe_msg_checking"" >&5 +echo "configure:8790: 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:8806: \"$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 @@ -8836,10 +8851,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:8840: checking for $ac_func" >&5 +echo "configure:8855: 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:8881: \"$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 @@ -8901,20 +8916,20 @@ postgresql_libs= if test "$with_postgresql" != "no"; then echo "checking for PostgreSQL" 1>&6 -echo "configure:8905: checking for PostgreSQL" >&5 +echo "configure:8920: 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:8910: checking for ${header_dir}libpq-fe.h" >&5 +echo "configure:8925: 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:8918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8933: \"$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* @@ -8938,12 +8953,12 @@ test -n "$libpq_fe_h_file" && { echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6 -echo "configure:8942: checking for PQconnectdb in -lpq" >&5 +echo "configure:8957: 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:8973: \"$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 @@ -8987,12 +9002,12 @@ echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6 -echo "configure:8991: checking for PQconnectStart in -lpq" >&5 +echo "configure:9006: 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:9022: \"$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 @@ -9054,7 +9069,7 @@ if test "$window_system" != "none"; then echo "checking for graphics libraries" 1>&6 -echo "configure:9058: checking for graphics libraries" >&5 +echo "configure:9073: checking for graphics libraries" >&5 libpath_xpm= incpath_xpm= @@ -9080,10 +9095,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:9084: checking for Xpm - no older than 3.4f" >&5 +echo "configure:9099: checking for Xpm - no older than 3.4f" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext < @@ -9092,7 +9107,7 @@ XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30406 ? 2 : 0 ;} EOF -if { (eval echo configure:9096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:9111: \"$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 @@ -9136,17 +9151,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:9140: checking for \"FOR_MSW\" xpm" >&5 +echo "configure:9155: 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:9165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* xpm_for_msw=no else @@ -9172,15 +9187,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:9176: checking for compface.h" >&5 +echo "configure:9191: 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:9184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9199: \"$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* @@ -9203,12 +9218,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:9207: checking for UnGenFace in -lcompface" >&5 +echo "configure:9222: 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:9238: \"$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 @@ -9268,12 +9283,12 @@ if test "$with_png $with_tiff" != "no no"; then echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:9272: checking for inflate in -lc" >&5 +echo "configure:9287: 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:9303: \"$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 @@ -9303,12 +9318,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:9307: checking for inflate in -lz" >&5 +echo "configure:9322: 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:9338: \"$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 @@ -9338,12 +9353,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:9342: checking for inflate in -lgz" >&5 +echo "configure:9357: 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:9373: \"$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 @@ -9384,15 +9399,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:9388: checking for jpeglib.h" >&5 +echo "configure:9403: 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:9396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9411: \"$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* @@ -9415,12 +9430,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:9419: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:9434: 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:9450: \"$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 @@ -9467,10 +9482,10 @@ png_problem="" test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:9471: checking for pow" >&5 +echo "configure:9486: checking for pow" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9512: \"$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 @@ -9514,15 +9529,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:9518: checking for png.h" >&5 +echo "configure:9533: 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:9526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9541: \"$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* @@ -9545,12 +9560,12 @@ } test -z "$with_png" && { echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:9549: checking for png_read_image in -lpng" >&5 +echo "configure:9564: 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:9580: \"$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 @@ -9584,10 +9599,10 @@ } if test -z "$with_png"; then echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 -echo "configure:9588: checking for workable png version information" >&5 +echo "configure:9603: checking for workable png version information" >&5 xe_check_libs="-lpng -lz" cat > conftest.$ac_ext < int main(int c, char **v) { @@ -9595,7 +9610,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:9599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:9614: \"$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 @@ -9638,15 +9653,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:9642: checking for tiffio.h" >&5 +echo "configure:9657: 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:9650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9665: \"$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* @@ -9669,12 +9684,12 @@ } test -z "$with_tiff" && { echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:9673: checking for TIFFClientOpen in -ltiff" >&5 +echo "configure:9688: 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:9704: \"$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 @@ -9724,15 +9739,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:9728: checking for compface.h" >&5 +echo "configure:9743: 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:9736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9751: \"$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* @@ -9755,12 +9770,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:9759: checking for UnGenFace in -lcompface" >&5 +echo "configure:9774: 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:9790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9810,7 +9825,7 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:9814: checking for X11 graphics libraries" >&5 +echo "configure:9829: checking for X11 graphics libraries" >&5 fi case "$with_widgets" in @@ -9820,7 +9835,7 @@ if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then echo "checking for the Athena widgets" 1>&6 -echo "configure:9824: checking for the Athena widgets" >&5 +echo "configure:9839: checking for the Athena widgets" >&5 case "$with_athena" in "xaw" | "") athena_variant=Xaw athena_3d=no ;; @@ -9834,12 +9849,12 @@ if test "$athena_3d" = "no"; then echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:9838: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 +echo "configure:9853: 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:9869: \"$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 @@ -9866,12 +9881,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:9870: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:9885: 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:9901: \"$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 @@ -9913,12 +9928,12 @@ else echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:9917: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:9932: 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:9948: \"$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 @@ -9947,12 +9962,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6 -echo "configure:9951: checking for threeDClassRec in -lXaw" >&5 +echo "configure:9966: 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:9982: \"$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 @@ -9994,15 +10009,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:9998: checking for X11/Xaw/ThreeD.h" >&5 +echo "configure:10013: 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:10006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10021: \"$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* @@ -10022,15 +10037,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:10026: checking for X11/Xaw/XawInit.h" >&5 +echo "configure:10041: 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:10034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10049: \"$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* @@ -10056,15 +10071,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:10060: checking for X11/$athena_variant/XawInit.h" >&5 +echo "configure:10075: 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:10068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10083: \"$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* @@ -10081,15 +10096,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:10085: checking for X11/$athena_variant/ThreeD.h" >&5 +echo "configure:10100: 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:10093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10108: \"$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* @@ -10117,15 +10132,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:10121: checking for $athena_variant/XawInit.h" >&5 +echo "configure:10136: 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:10129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10144: \"$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* @@ -10142,15 +10157,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:10146: checking for $athena_variant/ThreeD.h" >&5 +echo "configure:10161: 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:10154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10169: \"$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* @@ -10179,15 +10194,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:10183: checking for X11/Xaw3d/XawInit.h" >&5 +echo "configure:10198: 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:10191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10204,15 +10219,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:10208: checking for X11/Xaw3d/ThreeD.h" >&5 +echo "configure:10223: 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:10216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10231: \"$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* @@ -10244,15 +10259,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:10248: checking for Xaw3d/XawInit.h" >&5 +echo "configure:10263: 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:10256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10271: \"$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* @@ -10269,15 +10284,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:10273: checking for Xaw3d/ThreeD.h" >&5 +echo "configure:10288: 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:10281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10296: \"$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* @@ -10309,15 +10324,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:10313: checking for X11/Xaw/ThreeD.h" >&5 +echo "configure:10328: 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:10321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10336: \"$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* @@ -10356,15 +10371,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:10360: checking for Xm/Xm.h" >&5 +echo "configure:10375: 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:10368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10383: \"$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* @@ -10381,12 +10396,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:10385: checking for XmStringFree in -lXm" >&5 +echo "configure:10400: 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:10416: \"$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 @@ -10426,9 +10441,9 @@ if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:10430: checking for Lesstif" >&5 +echo "configure:10445: checking for Lesstif" >&5 cat > conftest.$ac_ext < #ifdef LESSTIF_VERSION @@ -10801,7 +10816,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:10805: checking for Mule-related features" >&5 +echo "configure:10820: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -10815,15 +10830,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10819: checking for $ac_hdr" >&5 +echo "configure:10834: 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:10827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10842: \"$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* @@ -10854,12 +10869,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:10858: checking for strerror in -lintl" >&5 +echo "configure:10873: 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:10889: \"$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 @@ -10903,18 +10918,18 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:10907: checking for Mule input methods" >&5 +echo "configure:10922: checking for Mule input methods" >&5 case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:10910: checking for XIM" >&5 +echo "configure:10925: checking for XIM" >&5 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6 -echo "configure:10913: checking for XOpenIM in -lX11" >&5 +echo "configure:10928: 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:10944: \"$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 @@ -10949,12 +10964,12 @@ if test "$have_motif $have_lesstif" = "yes no"; then echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:10953: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:10968: 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:10984: \"$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 @@ -11030,15 +11045,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:11034: checking for XFontSet" >&5 +echo "configure:11049: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:11037: checking for XmbDrawString in -lX11" >&5 +echo "configure:11052: 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:11068: \"$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 @@ -11089,15 +11104,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:11093: checking for wnn/jllib.h" >&5 +echo "configure:11108: 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:11101: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11116: \"$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* @@ -11120,15 +11135,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:11124: checking for wnn/commonhd.h" >&5 +echo "configure:11139: 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:11132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11147: \"$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* @@ -11153,10 +11168,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11157: checking for $ac_func" >&5 +echo "configure:11172: 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:11198: \"$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 @@ -11208,12 +11223,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:11212: checking for crypt in -lcrypt" >&5 +echo "configure:11227: 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:11243: \"$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 @@ -11259,12 +11274,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:11263: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:11278: 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:11294: \"$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 @@ -11293,12 +11308,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:11297: checking for jl_dic_list_e in -lwnn4" >&5 +echo "configure:11312: 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:11328: \"$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 @@ -11327,12 +11342,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:11331: checking for jl_dic_list_e in -lwnn6" >&5 +echo "configure:11346: 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:11362: \"$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 @@ -11361,12 +11376,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:11365: checking for dic_list_e in -lwnn6_fromsrc" >&5 +echo "configure:11380: 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:11396: \"$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 @@ -11422,12 +11437,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:11426: checking for jl_fi_dic_list in -l$libwnn" >&5 +echo "configure:11441: 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:11457: \"$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 @@ -11473,15 +11488,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:11477: checking for canna/jrkanji.h" >&5 +echo "configure:11492: 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:11485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11500: \"$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* @@ -11508,15 +11523,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:11512: checking for canna/jrkanji.h" >&5 +echo "configure:11527: 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:11520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11535: \"$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* @@ -11544,15 +11559,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:11548: checking for canna/RK.h" >&5 +echo "configure:11563: 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:11556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11571: \"$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* @@ -11575,12 +11590,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:11579: checking for RkBgnBun in -lRKC" >&5 +echo "configure:11594: 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:11610: \"$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 @@ -11614,12 +11629,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:11618: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:11633: 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:11649: \"$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 @@ -11676,12 +11691,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:11680: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:11695: 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:11711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11776,13 +11791,13 @@ fi -for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask wcslen wcscmp +for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize 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:11783: checking for $ac_func" >&5 +echo "configure:11798: 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:11824: \"$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 @@ -11846,10 +11861,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:11850: checking for $ac_func" >&5 +echo "configure:11865: 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:11891: \"$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 @@ -11901,10 +11916,10 @@ echo $ac_n "checking for openpty""... $ac_c" 1>&6 -echo "configure:11905: checking for openpty" >&5 +echo "configure:11920: checking for openpty" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11946: \"$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 @@ -11946,12 +11961,12 @@ echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 -echo "configure:11950: checking for openpty in -lutil" >&5 +echo "configure:11965: 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:11981: \"$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 @@ -11997,15 +12012,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12001: checking for $ac_hdr" >&5 +echo "configure:12016: 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:12009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12024: \"$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* @@ -12042,15 +12057,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12046: checking for $ac_hdr" >&5 +echo "configure:12061: 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:12054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12069: \"$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* @@ -12083,15 +12098,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12087: checking for $ac_hdr" >&5 +echo "configure:12102: 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:12095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12110: \"$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* @@ -12124,15 +12139,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12128: checking for $ac_hdr" >&5 +echo "configure:12143: 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:12136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12151: \"$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* @@ -12168,15 +12183,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12172: checking for $ac_hdr" >&5 +echo "configure:12187: 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:12180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12195: \"$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* @@ -12209,10 +12224,10 @@ for ac_func in isastream do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12213: checking for $ac_func" >&5 +echo "configure:12228: 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:12254: \"$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 @@ -12266,15 +12281,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12270: checking for $ac_hdr" >&5 +echo "configure:12285: 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:12278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12293: \"$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* @@ -12307,10 +12322,10 @@ for ac_func in getloadavg do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12311: checking for $ac_func" >&5 +echo "configure:12326: 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:12352: \"$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 @@ -12366,15 +12381,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12370: checking for $ac_hdr" >&5 +echo "configure:12385: 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:12378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12393: \"$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* @@ -12410,12 +12425,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:12414: checking for kstat_open in -lkstat" >&5 +echo "configure:12429: 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:12445: \"$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 @@ -12461,15 +12476,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12465: checking for $ac_hdr" >&5 +echo "configure:12480: 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:12473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12488: \"$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* @@ -12501,12 +12516,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:12505: checking for kvm_read in -lkvm" >&5 +echo "configure:12520: 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:12536: \"$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 @@ -12551,16 +12566,16 @@ fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:12555: checking whether netdb declares h_errno" >&5 +echo "configure:12570: checking whether netdb declares h_errno" >&5 cat > conftest.$ac_ext < int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:12564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12579: \"$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 @@ -12580,16 +12595,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:12584: checking for sigsetjmp" >&5 +echo "configure:12599: checking for sigsetjmp" >&5 cat > conftest.$ac_ext < int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:12593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12608: \"$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 @@ -12609,11 +12624,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:12613: checking whether localtime caches TZ" >&5 +echo "configure:12628: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext < #if STDC_HEADERS @@ -12648,7 +12663,7 @@ exit (0); } EOF -if { (eval echo configure:12652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:12667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then emacs_cv_localtime_cache=no else @@ -12678,9 +12693,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:12682: checking whether gettimeofday accepts one or two arguments" >&5 +echo "configure:12697: 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:12720: \"$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 @@ -12723,19 +12738,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:12727: checking for inline" >&5 +echo "configure:12742: 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:12754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -12776,17 +12791,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:12780: checking for working alloca.h" >&5 +echo "configure:12795: 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:12790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12805: \"$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 @@ -12810,10 +12825,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:12814: checking for alloca" >&5 +echo "configure:12829: checking for alloca" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12860: \"$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 @@ -12880,10 +12895,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:12884: checking whether alloca needs Cray hooks" >&5 +echo "configure:12899: checking whether alloca needs Cray hooks" >&5 cat > conftest.$ac_ext <&6 -echo "configure:12911: checking for $ac_func" >&5 +echo "configure:12926: 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:12952: \"$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 @@ -12963,10 +12978,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:12967: checking stack direction for C alloca" >&5 +echo "configure:12982: 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:13004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_stack_direction=1 else @@ -13014,10 +13029,10 @@ fi echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:13018: checking for working strcoll" >&5 +echo "configure:13033: checking for working strcoll" >&5 cat > conftest.$ac_ext < main () @@ -13027,7 +13042,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:13031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -13055,10 +13070,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13059: checking for $ac_func" >&5 +echo "configure:13074: 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:13100: \"$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 @@ -13109,10 +13124,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:13113: checking whether getpgrp takes no argument" >&5 +echo "configure:13128: 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:13186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -13194,10 +13209,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:13198: checking for working mmap" >&5 +echo "configure:13213: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext < #include @@ -13230,7 +13245,7 @@ return 1; } EOF -if { (eval echo configure:13234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then have_mmap=yes else @@ -13259,9 +13274,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:13263: checking for M_MMAP_THRESHOLD" >&5 +echo "configure:13278: checking for M_MMAP_THRESHOLD" >&5 cat > conftest.$ac_ext < int main() { @@ -13273,7 +13288,7 @@ ; return 0; } EOF -if { (eval echo configure:13277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rel_alloc=no; echo "$ac_t""yes" 1>&6; else @@ -13298,15 +13313,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:13302: checking for termios.h" >&5 +echo "configure:13317: 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:13310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13325: \"$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* @@ -13349,15 +13364,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:13353: checking for termio.h" >&5 +echo "configure:13368: 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:13361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13376: \"$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* @@ -13389,10 +13404,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:13393: checking for socket" >&5 +echo "configure:13408: checking for socket" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13434: \"$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 @@ -13430,15 +13445,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:13434: checking for netinet/in.h" >&5 +echo "configure:13449: 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:13442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13457: \"$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* @@ -13455,15 +13470,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:13459: checking for arpa/inet.h" >&5 +echo "configure:13474: 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:13467: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13482: \"$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* @@ -13488,9 +13503,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:13492: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:13507: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext < @@ -13501,7 +13516,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:13505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13520: \"$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 @@ -13519,9 +13534,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:13523: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:13538: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext < @@ -13531,7 +13546,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:13535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13550: \"$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 @@ -13562,10 +13577,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:13566: checking for msgget" >&5 +echo "configure:13581: checking for msgget" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13607: \"$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 @@ -13603,15 +13618,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:13607: checking for sys/ipc.h" >&5 +echo "configure:13622: 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:13615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13630: \"$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* @@ -13628,15 +13643,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:13632: checking for sys/msg.h" >&5 +echo "configure:13647: 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:13640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13655: \"$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* @@ -13674,15 +13689,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:13678: checking for dirent.h" >&5 +echo "configure:13693: 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:13686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13701: \"$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* @@ -13709,15 +13724,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:13713: checking for sys/dir.h" >&5 +echo "configure:13728: 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:13721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13736: \"$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* @@ -13750,15 +13765,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:13754: checking for nlist.h" >&5 +echo "configure:13769: 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:13762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13777: \"$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* @@ -13788,22 +13803,22 @@ echo "checking "for sound support"" 1>&6 -echo "configure:13792: checking "for sound support"" >&5 +echo "configure:13807: 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:13799: checking for multimedia/audio_device.h" >&5 +echo "configure:13814: 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:13807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13822: \"$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* @@ -13851,12 +13866,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:13855: checking for ALopenport in -laudio" >&5 +echo "configure:13870: 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:13886: \"$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 @@ -13898,12 +13913,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:13902: checking for AOpenAudio in -lAlib" >&5 +echo "configure:13917: 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:13933: \"$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 @@ -13962,15 +13977,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:13966: checking for ${dir}/soundcard.h" >&5 +echo "configure:13981: 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:13974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13989: \"$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* @@ -14024,15 +14039,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:14028: checking for audio/audiolib.h" >&5 +echo "configure:14043: 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:14036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14051: \"$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* @@ -14050,12 +14065,12 @@ echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6 -echo "configure:14054: checking for AuOpenServer in -laudio" >&5 +echo "configure:14069: 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:14085: \"$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 @@ -14105,7 +14120,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 @@ -14136,7 +14151,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:14140: checking for $ac_word" >&5 +echo "configure:14155: 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. @@ -14165,10 +14180,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:14169: checking for esd_play_stream" >&5 +echo "configure:14184: 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:14210: \"$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 @@ -14242,7 +14257,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:14246: checking for TTY-related features" >&5 +echo "configure:14261: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -14255,12 +14270,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:14259: checking for tgetent in -lncurses" >&5 +echo "configure:14274: 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:14290: \"$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 @@ -14304,15 +14319,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:14308: checking for ncurses/curses.h" >&5 +echo "configure:14323: 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:14316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14331: \"$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* @@ -14334,15 +14349,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:14338: checking for ncurses/term.h" >&5 +echo "configure:14353: 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:14346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14361: \"$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* @@ -14372,15 +14387,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:14376: checking for ncurses/curses.h" >&5 +echo "configure:14391: 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:14384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14399: \"$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* @@ -14415,12 +14430,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:14419: checking for tgetent in -l$lib" >&5 +echo "configure:14434: 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:14450: \"$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 @@ -14462,12 +14477,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:14466: checking for tgetent in -lcurses" >&5 +echo "configure:14481: 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:14497: \"$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 @@ -14496,12 +14511,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:14500: checking for tgetent in -ltermcap" >&5 +echo "configure:14515: 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:14531: \"$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 @@ -14560,15 +14575,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:14564: checking for gpm.h" >&5 +echo "configure:14579: 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:14572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14587: \"$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* @@ -14591,12 +14606,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:14595: checking for Gpm_Open in -lgpm" >&5 +echo "configure:14610: 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:14626: \"$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 @@ -14650,20 +14665,20 @@ test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ != "no no no" && echo "checking for database support" 1>&6 -echo "configure:14654: checking for database support" >&5 +echo "configure:14669: 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:14659: checking for ndbm.h" >&5 +echo "configure:14674: 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:14667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14682: \"$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* @@ -14693,12 +14708,12 @@ if test "$with_database_gdbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:14697: checking for dbm_open in -lgdbm" >&5 +echo "configure:14712: 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:14728: \"$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 @@ -14737,10 +14752,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:14741: checking for dbm_open" >&5 +echo "configure:14756: 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:14782: \"$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 @@ -14782,12 +14797,12 @@ echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:14786: checking for dbm_open in -ldbm" >&5 +echo "configure:14801: 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: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 @@ -14839,10 +14854,10 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6 -echo "configure:14843: checking for Berkeley db.h" >&5 +echo "configure:14858: checking for Berkeley db.h" >&5 for header in "db/db.h" "db.h"; do cat > conftest.$ac_ext < @@ -14864,7 +14879,7 @@ ; return 0; } EOF -if { (eval echo configure:14868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_file="$header"; break else @@ -14880,9 +14895,9 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6 -echo "configure:14884: checking for Berkeley DB version" >&5 +echo "configure:14899: checking for Berkeley DB version" >&5 cat > conftest.$ac_ext < #if DB_VERSION_MAJOR > 1 @@ -14894,7 +14909,7 @@ egrep "yes" >/dev/null 2>&1; then rm -rf conftest* cat > conftest.$ac_ext < #if DB_VERSION_MAJOR > 2 @@ -14921,10 +14936,10 @@ rm -f conftest* echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6 -echo "configure:14925: checking for $dbfunc" >&5 +echo "configure:14940: checking for $dbfunc" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14966: \"$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 @@ -14966,12 +14981,12 @@ echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:14970: checking for $dbfunc in -ldb" >&5 +echo "configure:14985: 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:15001: \"$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 @@ -15043,12 +15058,12 @@ if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:15047: checking for SOCKSinit in -lsocks" >&5 +echo "configure:15062: 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:15078: \"$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 @@ -15113,11 +15128,11 @@ fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:15136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -15909,7 +15924,16 @@ test "$with_socks" = yes && echo " Compiling in support for SOCKS." test "$with_dnet" = yes && echo " Compiling in support for DNET." test "$with_modules" = "yes" && echo " Compiling in support for dynamic shared object modules." -test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." +if test "$use_union_type" = yes ; then + echo " Using the union type for Lisp_Objects." + echo " WARNING: ---------------------------------------------------------" + echo " WARNING: This tends to trigger compiler bugs, especially when" + echo " WARNING: combined with MULE and ERROR_CHECKING. Crashes have" + echo " WARNING: been seen with various versions of GCC, and recently" + echo " WARNING: with Visual C++ as well." + echo " WARNING: ---------------------------------------------------------" +fi +test "$use_union_type" = yes && echo " WARNING: Use of the union type may cause crashes due to compiler bugs." test "$use_kkcc" = yes && echo " Using the new GC algorithms." test "$pdump" = yes && echo " Using the new portable dumper." test "$debug" = yes && echo " Compiling in support for extra debugging code." Index: configure.in =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.in,v retrieving revision 1.188 retrieving revision 1.191 diff -u -r1.188 -r1.191 --- configure.in 12 Dec 2002 03:22:50 -0000 1.188 +++ configure.in 14 Feb 2003 07:38:22 -0000 1.191 @@ -252,6 +252,11 @@ dnl The variables have the same names as the options, with dnl dashes changed to underlines. +define([USAGE_ERROR], +[(echo "$progname: Usage error:" +echo " " $1 +echo " Use \`$progname --help' to show usage.") >&2 && exit 1]) + define([AC_INIT_PARSE_ARGS],[ dnl Get sane consistent behavior from various shells @@ -274,6 +279,16 @@ if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi fi +dnl srcdir is used internally by autoconf macros +dnl parse it here +for xe_parse_arg in "$@"; do + case $xe_parse_arg in + --srcdir) USAGE_ERROR("The \`--srcdir' option requires a boolean value: \`yes' or \`no'.") ;; + --srcdir=*) srcdir=`echo $xe_parse_arg | sed -e 's/--srcdir=//'` ;; + *) ;; + esac +done + dnl Initialize some variables set by options. dnl The variables have the same names as the options, with dnl dashes changed to underlines. @@ -288,7 +303,6 @@ program_transform_name=s,x,x, silent= site= -srcdir= target=NONE verbose= x_includes=NONE @@ -393,11 +407,6 @@ dnl Options Processing dnl ------------------ -define([USAGE_ERROR], -[(echo "$progname: Usage error:" -echo " " $1 -echo " Use \`$progname --help' to show usage.") >&2 && exit 1]) - dnl Record all the arguments, so we can save them in config.status. arguments="$@" @@ -429,6 +438,7 @@ arg="$1"; shift case "$arg" in --no-create|--no-recursion) ;; + --srcdir=*) ;; dnl Anything starting with a hyphen we assume is an option. -* ) dnl Separate the switch name from the value it is being given. @@ -539,7 +549,6 @@ dnl Options that take a user-supplied value, as in --x-includes=/usr/X11R6/include dnl The cache-file option is ignored (for compatibility with other configures) - srcdir | \ compiler | \ xemacs_compiler | \ cflags | \ @@ -886,7 +895,7 @@ dnl Find the source directory. case "$srcdir" in - dnl If srcdir is not specified, see if "." or ".." might work. + dnl If srcdir is not specified, try directory part of $0, ".", or "..". "" ) for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[[^/]]*$||'`" "." ".." ; do if test -f "$dir/src/lisp.h" -a \ @@ -896,11 +905,11 @@ fi done if test -z "$srcdir" ; then - USAGE_ERROR(["Neither the current directory nor its parent seem to - contain the XEmacs sources. If you do not want to build XEmacs in its - source tree, you should run \`$progname' in the directory in which - you wish to build XEmacs, using the \`--srcdir' option to say where the - sources may be found."]) + USAGE_ERROR(["None of the path to configure, the current directory, + and its parent seem to contain the XEmacs sources. If you do not want + to build XEmacs in its source tree, you should run \`$progname' in the + directory in which you wish to build XEmacs, using the \`--srcdir' option + to say where the sources may be found."]) fi ;; @@ -1142,12 +1151,12 @@ *-*-ultrix* ) opsys=ultrix4-3 ;; dnl AIX - *-*-aix3.1* ) opsys=aix3-1 ;; - *-*-aix3.2.5 ) opsys=aix3-2-5 ;; - *-*-aix3* ) opsys=aix3-2 ;; - *-*-aix4.0* ) opsys=aix4 ;; - *-*-aix4.1* ) opsys=aix4-1 ;; - *-*-aix4* ) opsys=aix4-2 ;; + *-*-aix3.1* ) opsys=aix3-1 ;; + *-*-aix3.2.5 ) opsys=aix3-2-5 ;; + *-*-aix3* ) opsys=aix3-2 ;; + *-*-aix4.0* ) opsys=aix4 ;; + *-*-aix4.1* ) opsys=aix4-1 ;; + *-*-aix[[4-9]]* ) opsys=aix4-2 ;; dnl Other generic OSes *-gnu* ) opsys=gnu ;; @@ -1601,9 +1610,9 @@ if test -z "$pdump"; then case "$opsys" in - linux* ) pdump=yes ;; dnl glibc 2.3.1 seems to hose unexec - *-*-darwin* ) pdump=yes ;; dnl No "native" working dumper available - *) pdump=no ;; + linux* ) pdump=yes ;; dnl glibc 2.3.1 seems to hose unexec + darwin ) pdump=yes ;; dnl No "native" working dumper available + *) pdump=no ;; esac fi @@ -1617,6 +1626,7 @@ case "$opsys" in hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;; decosf* ) ld_call_shared="-call_shared" ;; + darwin ) AC_DEFINE(DLSYM_NEEDS_UNDERSCORE) ;; esac else dnl "$dynamic" = "no" case "$opsys" in @@ -3973,7 +3983,7 @@ dnl Check for POSIX functions. dnl ---------------------------------------------------------------- -AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask wcslen wcscmp) +AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize 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) dnl getaddrinfo() is borked under hpux11 if test "$ac_cv_func_getaddrinfo" != "no" ; then @@ -5167,7 +5177,16 @@ test "$with_socks" = yes && echo " Compiling in support for SOCKS." test "$with_dnet" = yes && echo " Compiling in support for DNET." test "$with_modules" = "yes" && echo " Compiling in support for dynamic shared object modules." -test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." +if test "$use_union_type" = yes ; then + echo " Using the union type for Lisp_Objects." + echo " WARNING: ---------------------------------------------------------" + echo " WARNING: This tends to trigger compiler bugs, especially when" + echo " WARNING: combined with MULE and ERROR_CHECKING. Crashes have" + echo " WARNING: been seen with various versions of GCC, and recently" + echo " WARNING: with Visual C++ as well." + echo " WARNING: ---------------------------------------------------------" +fi +test "$use_union_type" = yes && echo " WARNING: Use of the union type may cause crashes due to compiler bugs." test "$use_kkcc" = yes && echo " Using the new GC algorithms." test "$pdump" = yes && echo " Using the new portable dumper." test "$debug" = yes && echo " Compiling in support for extra debugging code." Index: configure.usage =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.usage,v retrieving revision 1.29 retrieving revision 1.31 diff -u -r1.29 -r1.31 --- configure.usage 18 Nov 2002 06:53:01 -0000 1.29 +++ configure.usage 15 Feb 2003 10:16:14 -0000 1.31 @@ -20,6 +20,7 @@ General options: +---------------- --help Issue this usage message. --verbose Accepted but ignored. @@ -27,9 +28,13 @@ Compilation options: +-------------------- --compiler=PROG C compiler to use ---xemacs-compiler=PROG compiler to use to compile just the xemacs executable +--xemacs-compiler=PROG compiler to use to compile just the xemacs executable. + If you want to compile XEmacs as C++, use e.g. + `--xemacs-compiler=g++'. This turns on a lot of + additional error-checking. --with-gcc (*) Use GCC to compile XEmacs. --cflags=FLAGS Compiler flags (such as -O); setting this overrides all default compiler flags except those that control @@ -53,17 +58,65 @@ --dynamic=no Force static linking on systems where dynamic linking is the default. --srcdir=DIR Look for the XEmacs source files in DIR. - Works best when using GNU Make. + Works best when using GNU Make. Allows you to build + XEmacs in various different ways using the same + source tree. Installation options: +--------------------- --prefix=DIR Install files below DIR. Defaults to `/usr/local'. --with-prefix=no Don't compile the value of --prefix into the executable. +--with-netinstall Compile in support for installation over the internet. + Only functional on the MS Windows platforms. +--bindir=DIR +--datadir=DIR +--statedir=DIR +--libdir=DIR +--infodir=DIR +--mandir=DIR +--lispdir=DIR +--sitelispdir=DIR +--etcdir=DIR +--lockdir=DIR +--archlibdir=DIR +--docdir=DIR +--moduledir=DIR + You may also control individually where various + parts of XEmacs are installed. Note that we + recommend against explicitly setting any of these + variables. See the INSTALL file for a complete list + plus the reasons we advise not changing them. + + +Run-time path-searching options: +-------------------------------- + +--with-site-lisp=yes Allow for a site-lisp directory in the XEmacs hierarchy + searched before the installation packages. +--with-site-modules=no Disable site-modules directory in the XEmacs hierarchy, + which is searched before the installation modules. +--package-path=PATH Directories to search for packages to dump with xemacs. + PATH splits into three parts separated by double + colons (::), an early, a late, and a last part, + corresponding to their position in the various + system paths: The early part is always first, + the late part somewhere in the middle, and the + last part at the very back. + Only the late part gets seen at dump time. + If PATH has only one component, that component + is late. + If PATH has two components, the first is + early, the second is late. +--infopath=PATH Directories to search for Info documents, info dir + and localdir files in case run-time searching + for them fails. Window-system options: +---------------------- --with-gtk Support GTK on the X Window System. (EXPERIMENTAL) --with-gnome Support GNOME on the X Window System. (EXPERIMENTAL) @@ -107,6 +160,7 @@ TTY (character terminal) options: +--------------------------------- --with-tty=no Don't support ttys. --with-ncurses (*) Use the ncurses library for tty support. @@ -114,6 +168,7 @@ Image options: +-------------- --with-xpm (*) Compile with support for XPM images. PRACTICALLY REQUIRED. Although this library is nonstandard and @@ -135,6 +190,7 @@ Sound options: +-------------- --with-sound=TYPE[,TYPE[,...]] (*) Compile with sound support. Valid types are `native', `nas' and `esd'. @@ -148,7 +204,47 @@ libraries are called libaudio. +Internationalization options: +----------------------------- + +--with-mule Compile with Mule (MUlti-Lingual Emacs) support, + needed to support non-Latin-1 (including Asian) + languages. +--with-xim=xlib Compile with support for X input methods, +--with-xim=motif (*) Used in conjunction with Mule support. + Use either raw Xlib to provide XIM support, or + the Motif XmIm* routines (when available). + NOTE: On some systems bugs in X11's XIM support + will cause XEmacs to crash, so by default, + no XIM support is compiled in, unless running + on Solaris and the XmIm* routines are detected. +--with-canna (*) Compile with support for Canna (a Japanese input method + used in conjunction with Mule support). +--with-wnn (*) Compile with support for Wnn (a multi-language input + method used in conjunction with Mule support). +--with-wnn6 (*) Compile with support for the commercial package Wnn6. +--with-i18n3 Compile with I18N level 3 (support for message + translation). This doesn't currently work. +--with-xfs Compile with XFontSet support for internationalized + menubar. Incompatible with `--with-xim=motif'. + `--with-menubars=lucid' (the default) is desirable. + + +File-related options: +--------------------- + +--with-default-eol-detection + Turns on by default auto-detection of end-of-line type + when reading a file. Applies to those platforms where + auto-detection is off by default (non-Mule Unix). Has + no effect otherwise. +--with-clash-detection=no + Disable use of lock files to detect multiple edits + of the same file. + + Database options: +----------------- --with-database=TYPE (*) Compile with database support. Valid types are `no' or a comma-separated list of one or more @@ -158,6 +254,7 @@ Mail options: +------------- --mail-locking=TYPE (*) Specify the locking to be used by movemail to prevent concurrent updates of mail spool files. Valid types @@ -167,78 +264,31 @@ --with-hesiod Support Hesiod to get the POP server host. -Additional features: +Networking options: +------------------- --with-tooltalk (*) Support the ToolTalk IPC protocol. ---with-workshop Support the Sun WorkShop (formerly Sparcworks) - development environment. --with-socks Compile with support for SOCKS (an Internet proxy). --with-dnet (*) Compile with support for DECnet. ---with-modules (*) Compile in experimental support for dynamically - loaded libraries (Dynamic Shared Objects). ---with-netinstall Compile in support for installation over the internet. - Only functional on the MS Windows platforms. ---with-ipv6-cname=yes Try IPv6 information first when canonicalizing host +--with-ipv6-cname Try IPv6 information first when canonicalizing host names. This option has no effect unless system supports getaddrinfo(3) and getnameinfo(3). ---with-site-lisp=yes Allow for a site-lisp directory in the XEmacs hierarchy - searched before the installation packages. ---with-site-modules=no Disable site-modules directory in the XEmacs hierarchy, - which is searched before the installation modules. ---package-path=PATH Directories to search for packages to dump with xemacs. - PATH splits into three parts separated by double - colons (::), an early, a late, and a last part, - corresponding to their position in the various - system paths: The early part is always first, - the late part somewhere in the middle, and the - last part at the very back. - Only the late part gets seen at dump time. - If PATH has only one component, that component - is late. - If PATH has two components, the first is - early, the second is late. ---infodir=DIR Directory to install XEmacs Info manuals and dir in. ---infopath=PATH Directories to search for Info documents, info dir - and localdir files in case run-time searching - for them fails. ---moduledir=DIR Directory to install dynamic modules in. ---pdump New, experimental, don't-sue-me-if-your-house- - collapses-and-your-wife-leaves-you, portable dumper. - (Actually, not as experimental or non-working as - Olivier claims. Works quite well, in fact.) ---with-default-eol-detection - Turns on by default auto-detection of end-of-line type - when reading a file. Applies to those platforms where - auto-detection is off by default (non-Mule Unix). Has - no effect otherwise. -Internationalization options: +Memory allocation options: +-------------------------- ---with-mule Compile with Mule (MUlti-Lingual Emacs) support, - needed to support non-Latin-1 (including Asian) - languages. ---with-xim=xlib Compile with support for X input methods, ---with-xim=motif (*) Used in conjunction with Mule support. - Use either raw Xlib to provide XIM support, or - the Motif XmIm* routines (when available). - NOTE: On some systems bugs in X11's XIM support - will cause XEmacs to crash, so by default, - no XIM support is compiled in, unless running - on Solaris and the XmIm* routines are detected. ---with-canna (*) Compile with support for Canna (a Japanese input method - used in conjunction with Mule support). ---with-wnn (*) Compile with support for Wnn (a multi-language input - method used in conjunction with Mule support). ---with-wnn6 (*) Compile with support for the commercial package Wnn6. ---with-i18n3 Compile with I18N level 3 (support for message - translation). This doesn't currently work. ---with-xfs Compile with XFontSet support for internationalized - menubar. Incompatible with `--with-xim=motif'. - `--with-menubars=lucid' (the default) is desirable. +--rel-alloc Use the relocating allocator (default for this option + is system-dependent). +--with-dlmalloc Control usage of Doug Lea malloc on systems that have + it in the standard C library (default is to use it if + it is available). +--with-system-malloc Force use of the system malloc, rather than GNU malloc. +--with-debug-malloc Use the debugging malloc package. Debugging options: +------------------ --debug Compile with support for debugging XEmacs. (Causes code-size increase and little loss of speed.) @@ -256,35 +306,47 @@ XEmacs will still work (more or less) without them. Potentially dangerous if you don't know what you're doing. This (1) doesn't garbage-collect after loading - each file during dumping, and (2) doesn't - automatically rebuild the DOC file. (Remove it by hand - to get it rebuilt.) + each file during dumping, (2) doesn't + automatically rebuild the DOC file (remove it by hand + to get it rebuilt), (3) Removes config.h, lisp.h and + associated files from the dependency lists, so changes + to these files don't automatically cause all .c files + to be rebuilt. --use-union-type Enable or disable use of a union, instead of an int, for the fundamental Lisp_Object type; this - provides stricter type-checking. Only works with - some systems and compilers. ---use-kkcc Enable the use of new GC algorithms. (EXPERIMENTAL) + provides stricter type-checking. WARNING: This has + a tendency to trigger compiler bugs, especially in + combination with other features that increase the + complexity of expressions, for example `--with-mule' + and `--error-checking=all'. Crashes have been + observed with union type in combination with the + two options just mentioned under various versions of + GCC as well as MSVC++ 6.0. Furthermore, many + debuggers have problems (i.e. bugs) dealing with + unions, and even for those that don't, debugging can + be inconvenient because of no syntax for entering a + union. We recommend `--use-union-type' *ONLY* for + testing purposes, not for production builds. If you + are using `-use-union-type' and get some weird + crash, try redoing without union type. --with-quantify Add support for performance debugging using Quantify. --with-purify Add support for memory debugging using Purify. -Other options: +Developer options: +------------------ ---rel-alloc Use the relocating allocator (default for this option - is system-dependent). ---with-dlmalloc Control usage of Doug Lea malloc on systems that have - it in the standard C library (default is to use it if - it is available). ---with-system-malloc Force use of the system malloc, rather than GNU malloc. ---with-debug-malloc Use the debugging malloc package. ---with-clash-detection Use lock files to detect multiple edits of the same - file. The default is to do clash detection. +--with-workshop Support the Sun WorkShop (formerly Sparcworks) + development environment. +--pdump New, portable, relocatable dumper. Currently works + quite well, somewhere in beta-to-late-beta, we + might say. (Infamous for being the former + "experimental, don't-sue-me-if-your-house-collapses- + and-your-wife-leaves-you" portable dumper.) +--use-kkcc Enable the use of new GC algorithms. (EXPERIMENTAL) +--with-modules (*) Compile in experimental support for dynamically + loaded libraries (Dynamic Shared Objects). -You may also specify any of the `path' variables found in Makefile.in.in, -including --bindir, --libdir, --docdir, --lispdir, --sitelispdir, ---datadir, --infodir, --mandir and so on. Note that we recommend -against explicitly setting any of these variables. See the INSTALL -file for a complete list plus the reasons we advise not changing them. If successful, configure leaves its status in config.status. If unsuccessful after disturbing the status quo, it removes config.status. Index: version.sh =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/version.sh,v retrieving revision 1.305 retrieving revision 1.348 diff -u -r1.305 -r1.348 --- version.sh 5 Jan 2003 05:13:26 -0000 1.305 +++ version.sh 16 Feb 2003 06:13:18 -0000 1.348 @@ -2,8 +2,8 @@ emacs_is_beta=t emacs_major_version=21 emacs_minor_version=5 -emacs_beta_version=10 -xemacs_codename="burdock" +emacs_beta_version=11 +xemacs_codename="cabbage" xemacs_extra_name= emacs_kit_version= infodock_major_version=4 Index: etc/BETA =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/etc/BETA,v retrieving revision 1.30 retrieving revision 1.34 diff -u -r1.30 -r1.34 --- etc/BETA 9 Oct 2002 12:43:12 -0000 1.30 +++ etc/BETA 14 Feb 2003 23:33:15 -0000 1.34 @@ -5,7 +5,8 @@ You are running a potentially unstable version of XEmacs. Please do not report problems with Beta XEmacs to comp.emacs.xemacs. Report -them to xemacs-beta@xemacs.org. +them to , preferably with +'M-x report-xemacs-bug RET'. ** Mailing Lists ================ @@ -44,12 +45,12 @@ In the descriptions below, the word LIST (all uppercase) is a variable. Substitute "beta", "design", or "patches" as appropriate (to get "xemacs-beta" as the mailbox for the XEmacs Beta mailing list, -or http://www.xemacs.org/Lists/#xemacs-beta for its URL). +or for its URL). The XEmacs mailing lists are managed by the Mailman mailing list package, and the usual Mailman commands work. Do not send mailing -list requests to the main address (xemacs-LIST@xemacs.org), always -send them to xemacs-LIST-request@xemacs.org. If you have problems +list requests to the main address (), always +send them to . If you have problems with the list itself, they should be brought to the attention of the XEmacs Mailing List manager (the same mailbox, "list-manager", for all lists). All public mailing lists @@ -65,37 +66,48 @@ Subscription, unsubscription, and options (such as digests and temporarily suspending delivery) can be accomplished via the web -interface at http://www.xemacs.org/Lists/#xemacs-LIST. +interface at . *** Subscribing by e-mail ------------------------- -Send an email message to xemacs-LIST-request@xemacs.org with +Send an email message to with `subscribe' (without the quotes) as the BODY of the message. *** Unsubscribing by e-mail --------------------------- -Send an email message to xemacs-LIST-request@xemacs.org with +Send an email message to with `unsubscribe' (without the quotes) as the BODY of the message. ** Beta Release Schedule ======================== -Betas are now released rather sporadically. We would like to achieve -a weekly release schedule, but personnel availability does not -permit. For access to the most recent code, use CVS (see -http://www.xemacs.org/Develop/cvsaccess.html for more information). -If you have need for FTP access, please let us know. It will make it -more likely that we release betas more often. +We would like to achieve a weekly or fortnightly release cycle (you +know the Open Source model: release early, release often), and in a +perfect world that would indeed be the case. There are at least three +things that often get in the way of that goal: 1) The Release Manager +has a life outside of XEmacs (hard to believe, I know, but true), +2) we like to make releases that will build (at least on the Release +Manager's box), and 3) Murphy likes to throw a spanner in the works +right when you least expect it (Murphy's Law: Whatever can go wrong, +will go wrong). + +If you'd like to keep right up to date and ride the bleeding edge, use +CVS (see ). If you +can't use CVS for some reason and must use FTP, please let us know. +it will make it more likely that we release betas more often. + ** Reporting Problems ===================== The best way to get problems fixed in XEmacs is to submit good problem -reports. Since this is beta software, problems are certain to exist. -Please read through all of part II of the XEmacs FAQ for an overview -of problem reporting. Other items which are most important are: +reports, 'M-x report-xemacs-bug RET' will help you do this (assuming +you have a usable XEmacs). Since this is beta software, problems are +certain to exist. Please read through all of part II of the XEmacs +FAQ for an overview of problem reporting. Other items which are most +important are: 1. Do not submit C stack backtraces without line numbers. Since it is possible to compile optimized with debug information with GCC @@ -106,16 +118,16 @@ problem is actually occurring. 2. Attempt to recreate the problem starting with an invocation of - XEmacs with `xemacs -q -no-site-file -no-autoloads'. Quite often, - problems are due to package interdependencies, and the like. An - actual bug in XEmacs should be reproducible in a default - configuration without loading any special packages (or the one or - two specific packages that cause the bug to appear). If you have - trouble getting anything to work at all with the above invocation, - use `xemacs -q -no-site-file' instead. If you need to load your - user init file or the site file to get the problem to occur, then - it has something to do with them, and you should try to isolate - the issue in those files. + XEmacs with `xemacs -no-autoloads'. Quite often, problems are + due to package interdependencies, and the like. An actual bug + in XEmacs should be reproducible in a default configuration + without loading any special packages (or the one or two specific + packages that cause the bug to appear). If you have trouble + getting anything to work at all with the above invocation, use + `xemacs -vanilla' instead. If you need to load your user init + file or the site file to get the problem to occur, then it has + something to do with them, and you should try to isolate the + issue in those files. 3. A picture can be worth a thousand words. When reporting an unusual display, it is generally best to capture the problem in a @@ -139,15 +151,15 @@ ** Building an XEmacs from patches ================================== -All beta releases of XEmacs are included with patches from the -previous version in an attempt to keep bandwidth requirements down. -Patches should be applied with the GNU patch program in something like -the following. Let's say you're upgrading XEmacs 20.15-beta10 to -XEmacs 20.15-beta11 and you have a full unmodified XEmacs 20.15-beta10 -source tree to work with. Cd to the top level directory and issue the +All beta releases of XEmacs are included with patches from the previous +version in an attempt to keep bandwidth requirements down. Patches +should be applied with the GNU patch program in something like the +following. Let's say you're upgrading XEmacs 21.5-beta9 to XEmacs +21.5-beta10 and you have a full unmodified XEmacs 21.5-beta9 source +tree to work with. Change to the top level directory and issue the shell command: -$ gunzip -c /tmp/xemacs-20.15-b10-20.15-b11.patch.gz | patch -p1 +$ gunzip -c /tmp/xemacs-21.5.9-21.5.10.patch.gz | patch -p1 After patching, check to see that no patches were missed by doing $ find . -name \*.rej -print @@ -158,10 +170,11 @@ After seeing that there were no rejections, issue the commands $ ./config.status --recheck -$ make beta +$ make beta > ./beta.err 2>&1 +$ make check > ./xemacs-make-check.err 2>&1 -and go play minesweep for a while on an older XEmacs while the binary -is rebuilt. +Redirect the output from make to those files because you'll use them +later when you send off a build report with 'M-x build-report RET' ** Building XEmacs from a full distribution =========================================== @@ -169,72 +182,98 @@ Locate a convenient place where you have at least 100MB of free space and issue the command -$ gunzip -c /tmp/xemacs-20.15-b11.tar.gz | tar xvf - +$ gunzip -c /tmp/xemacs-21.5.10.tar.gz | tar xvf - -(or simply `tar zxvf /tmp/xemacs-20.15-b11.tar.gz' if you use GNU tar). +(or simply `tar zxvf /tmp/xemacs-21.5.10.tar.gz' if you use GNU tar). cd to the top level directory and issue an appropriate configure command. One maintainer uses the following at the time of this writing: ./configure \ - --cflags="-mpentium -march=pentium -O6 -g -fno-peep-spills" \ - --error-checking=all --debug=yes \ - --with-scrollbars=athena3d --with-dialogs=athena3d \ - --with-mule --with-xfs --with-xim=xlib - -Part of the configure output is a summary that looks something like -the following. (In XEmacs 21.1 and later, this summary is also -available as the file Installation in the top directory of your build -tree, and via the command M-x describe-installation.) - -uname -a: Linux altair.xemacs.org 2.0.32 #2 Sun Nov 16 18:52:14 PST 1997 i586 - -./configure '--cflags=-mpentium -march=pentium -O6 -g -fno-peep-spills' '--error-checking=all' '--debug=yes' '--with-scrollbars=athena3d' '--with-dialogs=athena3d' '--with-mule' '--with-xfs' '--with-xim=xlib' - - -XEmacs 21.0-b34 "Oberhasli-pre2" configured for `i586-pc-linux'. - - Where should the build process find the source code? /home/xemacs/xemacs-20.0 - What installation prefix should install use? /usr/local - What operating system and machine description files should XEmacs use? - `s/linux.h' and `m/intel386.h' - What compiler should XEmacs be built with? gcc -mpentium -march=pentium -O6 -g -fno-peep-spills - Should XEmacs use the GNU version of malloc? yes - (Using Doug Lea's new malloc from the GNU C Library.) - Should XEmacs use the relocating allocator for buffers? yes - What window system should XEmacs use? x11 - Where do we find X Windows header files? /usr/X11/include - Where do we find X Windows libraries? /usr/X11/lib - Compiling in support for XAUTH. - Compiling in support for XPM images. - Compiling in support for X-Face message headers. - Compiling in support for GIF image conversion. - Compiling in support for JPEG image conversion. - Compiling in support for PNG image conversion. - Compiling in support for TIFF image conversion. - Compiling in native sound support. - Compiling in support for Berkeley DB. - Compiling in support for GNU DBM. + --extra-verbose \ + --site-prefixes=/usr/local/pgsql:/usr/local/BerkeleyDB.4.1 \ + --dynamic=yes --with-gtk=no --with-gnome=no --with-toolbars \ + --with-wmcommand --with-athena=next --with-menubars=lucid \ + --with-scrollbars=athena --with-dialogs=athena --with-widgets=athena \ + --with-gif --with-sound=native,noesd --with-site-lisp=no \ + --with-site-modules --pdump --with-mule --with-xfs --debug \ + --error-checking=all --memory-usage-stats --use-kkcc \ + --with-clash-detection + +Part of the configure output is a summary that looks something +like the following. (this summary is also available as the file +'Installation' in the top directory of your build tree, and via +the command 'M-x describe-installation RET'). + +uname -a: Linux eicq 2.4.20 #1 Wed Dec 18 02:14:29 EST 2002 i586 unknown + +./configure '--extra-verbose' '--site-prefixes=/usr/local/pgsql:/usr/local/BerkeleyDB.4.1' '--dynamic=yes' '--with-gtk=no' '--with-gnome=no' '--with-toolbars' '--with-wmcommand' '--with-athena=next' '--with-menubars=lucid' '--with-scrollbars=athena' '--with-dialogs=athena' '--with-widgets=athena' '--with-gif' '--with-sound=native,noesd' '--with-site-lisp=no' '--with-site-modules' '--pdump' '--with-mule' '--with-xfs' '--debug' '--error-checking=all' '--memory-usage-stats' '--use-kkcc' '--with-clash-detection' + + +XEmacs 21.5-b10 "burdock" (+CVS-20030131) configured for `i586-pc-linux'. + + +Compilation / Installation: + Source code location: /usr/local/src/xemacs + Installation prefix: /usr/local + Additional prefixes: /usr/local/pgsql /usr/local/BerkeleyDB.4.1 + Operating system description file: `s/linux.h' + Machine description file: `m/intel386.h' + Compiler: gcc -Wall -Wno-switch -Winline -Wmissing-prototypes -Wsign-compare -Wundef -Wstrict-prototypes -Wshadow -Wmissing-declarations -O1 -ggdb3 -Wall -Wchar-subscripts -Wunused -Wundef -Wshadow -Wsign-compare -Wmissing-declarations -march=k6 + Relocating allocator for buffers: no + GNU version of malloc: yes + - Using Doug Lea's new malloc from the GNU C Library. + +Window System: + Compiling in support for the X window system: + - X Windows headers location: /usr/X11/include + - X Windows libraries location: /usr/X11/lib + - Handling WM_COMMAND properly. + Compiling in support for the Athena widget set: + - Athena headers location: X11/neXtaw + - Athena library to link: neXtaw + Using Lucid menubars. + Using Athena scrollbars. + Using Athena dialog boxes. + Using Athena native widgets. + +TTY: Compiling in support for ncurses. Compiling in support for GPM (General Purpose Mouse). - Compiling in Mule (multi-lingual) support. - Compiling in XIM (X11R5+ I18N input method) support. - Using raw Xlib to provide XIM support. - Using XFontSet to provide bilingual menubar. - Compiling in support for Canna on Mule. - Compiling in support for the WNN input method on Mule. - Using WNN version 6. - Compiling in support for OffiX. - Compiling in support for proper session-management. - Using Lucid menubars. - Using Athena-3d scrollbars. - Using Athena-3d dialog boxes. - Compiling in DLL support. - movemail will use "dot-locking" for locking mail spool files. - Using Lisp_Objects with minimal tagbits. - Compiling in extra code for debugging. - Compiling in code for checking XEmacs memory usage. + +Images: + Compiling in support for GIF images (builtin). + Compiling in support for XPM images. + Compiling in support for PNG images. + Compiling in support for JPEG images. + Compiling in support for TIFF images. + Compiling in support for X-Face message headers. + +Sound: + Compiling in support for sound (native). + +Databases: + Compiling in support for Berkeley database. + Compiling in support for PostgreSQL. + - Using PostgreSQL header file: libpq-fe.h + - Using PostgreSQL V7 bindings. + +Internationalization: + Compiling in support for Mule (multi-lingual Emacs). + Compiling in support for XIM (X11R5+ I18N input method). + - Using raw Xlib to provide XIM support. + - Using XFontSet to provide bilingual menubar. + +Mail: + Compiling in support for "dot-locking" mail spool file locking method. + +Other Features: + Inhibiting IPv6 canonicalization at startup. + Compiling in support for dynamic shared object modules. + Using the new GC algorithms. + Using the new portable dumper. + Compiling in support for extra debugging code. WARNING: --------------------------------------------------------- WARNING: Compiling in support for runtime error checking. WARNING: XEmacs will run noticeably more slowly as a result. @@ -243,19 +282,24 @@ -Then type `make' and you should have a working XEmacs. +Then... + +$ make > ./beta.err 2>&1 +$ make check > ./xemacs-make-check.err 2>&1 + +...and you should have a working XEmacs. After you have verified that you have a functional editor, fire up your favorite mail program and send a build report to -xemacs-build-reports@xemacs.org. +. -Preferrably this is done from XEmacs, following these simple steps: +Preferably this is best done from XEmacs, following these simple steps: M-x customize-group RET build-report RET M-x build-report RET See also -http://www.xemacs.org/Releases/Public-21.2/tester.html#reporting + If you create the report manually by other means, here is what the build report should include: @@ -292,7 +336,7 @@ When bootstrapping XEmacs, you may need to manually install some packages (at least xemacs-base and efs). These packages are available -by FTP at ftp://ftp.xemacs.org/pub/xemacs/packages/. +by FTP at . ** Binary package installation ============================== @@ -315,59 +359,60 @@ directory called `lisp-utils', the command to rebuild the auto-autoloads.el file is: -xemacs -vanilla -batch -l autoload -f batch-update-directory lisp-utils +xemacs -vanilla -batch \ + -eval \("setq autoload-package-name \"lisp-utils\""\) \ + -f batch-update-directory lisp-utils The command to rebuild the custom-load.el file is: -xemacs -vanilla -batch -l cus-dep -f Custom-make-dependencies lisp-utils +xemacs -vanilla -batch -f Custom-make-dependencies lisp-utils -To bytecompile both of these files the command is: +To byte-compile both of these files the command is: xemacs -vanilla -batch -f batch-byte-compile \ lisp-utils/auto-autoloads.el lisp-utils/custom-load.el +Of course, being a beta tester, you'd be aware that it is much easier +to manage your XEmacs packages with PUI. + ** Building XEmacs and XEmacs packages from scratch =================================================== -To build everything completely from scratch (not a high priority as a -design goal), the following procedure should work. (I don't recommend -building this way). - -*** Phase 1 -- Get a minimal XEmacs binary with mule to build the package - lisp with. - -**** Grab a mule-base tarball and install it into a newly created package - directory. +To build everything completely from scratch isn't hard, just time +consuming. -**** Configure XEmacs with mule and a package-path including the - directory created above. +*** Step 1 - grab the sources (core and packages) -**** Do a `make dist' to build an XEmacs binary. +$ cvs -d :pserver:cvs@cvs.xemacs.org:/pack/xemacscvs login + [password: "cvs" (sans quotes)] -*** Phase 2 -- Build and install the package lisp. +$ cvs -d :pserver:cvs@cvs.xemacs.org:/pack/xemacscvs co -d xemacs-21.5 xemacs -**** Modify XEmacs.rules for local paths and the XEmacs binary created in - Phase 1. +$ cvs -d :pserver:cvs@cvs.xemacs.org:/pack/xemacscvs co packages -**** Do a make from the top level package lisp source directory.[1] +*** Step 2 - build XEmacs -**** Do `make bindist's on all the packages you wish to install and - remove the byproduct .tar.gz's. +$ cd xemacs-21.5 +$ ./configure [options...] +$ make > ./beta.err 2>&1 +$ make check > ./xemacs-make-check.err 2>&1 -*** Phase 3 -- If necessary, redump XEmacs - with the packages that require dump-time support and install it. +And optionally: -**** Reconfigure without Mule if you don't wish a Mule-ish XEmacs, and - rebuild XEmacs. +$ make install > ./xemacs-make-install.err 2>&1 -- or - +*** Step 3 - build and install the packages -**** rm lib-src/DOC src/xemacs; make +$ cd packages +$ cp Local.rules.template Local.rules -**** Install or run in-place. +Then edit Local.rules to suit your needs/environment +see: (Info-goto-node "(xemacs)Local.rules file") for details about +this file. -Note that this is in essence what `make all-elc' has always done. +And then: +$ make install * Improving XEmacs ================= @@ -382,7 +427,7 @@ explanation. Progress of the patch is tracked on the XEmacs Patches mailing list, which is open subscription. (If a patch is simply intended to facilitate discussion, "I mean something that works like -this but this is really rough", a CC to XEmacs Patches is optional, +this but this is really rough", a Cc to XEmacs Patches is optional, but doesn't hurt.) Patches to XEmacs Lisp packages should be sent to the maintainer of @@ -432,12 +477,12 @@ be very difficult to place into the right slot. They are much easier to deal with when broken down into functional or conceptual chunks. The patches submitted by Kyle Jones and Hrvoje Niksic are stellar -examples of how to Do The Right Thing. +examples of how to "Do The Right Thing". Each patch should be accompanied by an update to the appropriate ChangeLog file. Guidelines for writing ChangeLog entries is governed by the GNU coding standards. Please see - http://www.gnu.org/prep/standards_toc.html [Change Logs section] + [Change Logs section] for details. Do not submit context diffs (either -c or -u) of ChangeLogs. Because @@ -446,8 +491,8 @@ succeed. Simply cutting and pasting the entry from an Emacs buffer to the mail buffer (beware of tab expansion!) is probably easiest. The Patcher library also will set up your ChangeLogs for you, and copy -them to the mail. Contextless unified diffs (-U 0) are also -acceptable but perhaps more trouble than they are worth. +them to the mail. Context-less unified diffs (-U 0) are also +acceptable. *** Patch discussion etiquette ------------------------------- @@ -457,7 +502,7 @@ like to have discussed by others. Not doing so will resulting in patches getting "lost". If you expect that the patch will not be acceptable, but are using it to stimulate discussion, then don't post -to xemacs-patches. Intermediate cases are up to your judgement; +to xemacs-patches. Intermediate cases are up to your judgment; unless you're sure you'll follow up with a "real" patch, better to err on the side of posting to xemacs-patches. @@ -536,10 +581,10 @@ 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 Youngs and Stephen Turnbull - also can help) is the most likely source of advice. +Package Release Engineer (Ville Skyttä is currently +serving with Peter Brown assisting; Steve +Youngs and Stephen Turnbull +also can help) are the most likely sources of advice. *** Syncing with GNU Emacs -------------------------- @@ -567,7 +612,7 @@ in the source file itself, as the last element of the prefatory material (copyright notice and commentary). Obviously the comment -market needs to be changed to leading semicolons for Lisp, but +marker needs to be changed to leading semicolons for Lisp, but otherwise the format is the same. Of course you should note syncing as the purpose in the ChangeLog, Index: etc/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/etc/ChangeLog,v retrieving revision 1.14 retrieving revision 1.19 diff -u -r1.14 -r1.19 --- etc/ChangeLog 5 Jan 2003 05:13:30 -0000 1.14 +++ etc/ChangeLog 16 Feb 2003 06:13:21 -0000 1.19 @@ -1,3 +1,26 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-02-13 Chris Palmer + + * BETA: Fixed typos and made consistent use of <...> for Internet + addresses. + +2003-02-12 Jerry James + + * photos/james.png, photos/jamesm.png: New files. + +2003-02-04 Steve Youngs + + * BETA: '-no-autoloads' implies '-vanilla' so suggest people + invoke 'xemacs -no-autoloads' when trying to reproduce a bug. + +2003-02-03 Steve Youngs + + * BETA: Update. General tidy up and rewrite sections dealing with + packages and building from scratch. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: etc/photos/golubev.png =================================================================== RCS file: etc/photos/golubev.png diff -N etc/photos/golubev.png Binary files /dev/null and /tmp/cvsyVay5T differ Index: etc/photos/golubevm.png =================================================================== RCS file: etc/photos/golubevm.png diff -N etc/photos/golubevm.png Binary files /dev/null and /tmp/cvszVay5T differ Index: etc/photos/james.png =================================================================== RCS file: etc/photos/james.png diff -N etc/photos/james.png Binary files /dev/null and /tmp/cvsAVay5T differ Index: etc/photos/jamesm.png =================================================================== RCS file: etc/photos/jamesm.png diff -N etc/photos/jamesm.png Binary files /dev/null and /tmp/cvsBVay5T differ Index: lib-src/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/ChangeLog,v retrieving revision 1.152 retrieving revision 1.155 diff -u -r1.152 -r1.155 --- lib-src/ChangeLog 5 Jan 2003 05:13:32 -0000 1.152 +++ lib-src/ChangeLog 16 Feb 2003 06:13:23 -0000 1.155 @@ -1,3 +1,16 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-01-14 Jerry James + + * ellcc.c (do_compile_mode): Search XEmacs directories first for + include files. Thanks to Raymond Toy. + +2003-01-28 Steve Youngs + + * rcs2log: Synch to GNU version. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: lib-src/ellcc.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/ellcc.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- lib-src/ellcc.c 18 Nov 2002 06:52:23 -0000 1.4 +++ lib-src/ellcc.c 7 Feb 2003 15:33:35 -0000 1.5 @@ -613,6 +613,7 @@ char **exec_argv = xnew (exec_argc + 20, char *); exec_argv = add_to_argv (exec_argv, ellcc); + exec_argv = add_to_argv (exec_argv, ELLCC_CF_ALL); exec_argv = add_to_argv (exec_argv, ellcflags); exec_argv = add_to_argv (exec_argv, ellpicflags); exec_argv = add_to_argv (exec_argv, "-DPIC"); @@ -623,7 +624,6 @@ exec_argv = add_to_argv (exec_argv, "-Dxemacs"); #endif exec_argv = add_to_argv (exec_argv, "-Demacs"); - exec_argv = add_to_argv (exec_argv, ELLCC_CF_ALL); for (i = 1; i < exec_argc; i++) { exec_argv = add_string (exec_argv, xstrdup (prog_argv[exec_args[i]])); Index: lib-src/rcs2log =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/rcs2log,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- lib-src/rcs2log 9 Jul 1997 04:31:03 -0000 1.2 +++ lib-src/rcs2log 28 Jan 2003 03:19:04 -0000 1.3 @@ -18,6 +18,7 @@ -h HOSTNAME Use HOSTNAME in change log entries (default current host). -i INDENT Indent change log lines by INDENT spaces (default 8). -l LENGTH Try to limit log lines to LENGTH characters (default 79). + -L FILE Use rlog-format FILE for source of logs. -R If no FILEs are given and RCS is used, recurse through working directory. -r OPTION Pass OPTION to subsidiary log command. -t TABWIDTH Tab stops are every TABWIDTH characters (default 8). @@ -26,11 +27,12 @@ --help Output help. --version Output version number. -Report bugs to .' +Report bugs to .' -Id='$Id: rcs2log,v 1.2 1997/07/09 04:31:03 steve Exp $' +Id='$Id: rcs2log,v 1.3 2003/01/28 03:19:04 youngs Exp $' -# Copyright 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002 +# Free Software Foundation, Inc. # 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 @@ -47,13 +49,29 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -Copyright='Copyright 1997 Free Software Foundation, Inc. +Copyright='Copyright (C) 2002 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING. Author: Paul Eggert ' +# Use the traditional C locale. +LANG=C +LANGUAGE=C +LC_ALL=C +LC_COLLATE=C +LC_CTYPE=C +LC_MESSAGES=C +LC_NUMERIC=C +LC_TIME=C +export LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_TIME + +# These variables each contain a single ASCII character. +# Unfortunately, there's no portable way of writing these characters +# in older Unix implementations, other than putting them directly into +# this text file. +SOH='' # SOH, octal code 001 tab=' ' nl=' ' @@ -61,8 +79,8 @@ # Parse options. # defaults -: ${AWK=awk} -: ${TMPDIR=/tmp} +AWK=${AWK-awk} +TMPDIR=${TMPDIR-/tmp} changelog=ChangeLog # change log file name datearg= # rlog date option hostname= # name of local host (if empty, will deduce it later) @@ -74,6 +92,7 @@ recursive= # t if we want recursive rlog revision= # t if we want revision numbers rlog_options= # options to pass to rlog +rlogfile= # log file to read from tabwidth=8 # width of horizontal tab while : @@ -83,14 +102,16 @@ -i) indent=${2?}; shift;; -h) hostname=${2?}; shift;; -l) length=${2?}; shift;; + -L) rlogfile=${2?}; shift;; -[nu]) # -n is obsolescent; it is replaced by -u. case $1 in -n) case ${2?}${3?}${4?} in *"$tab"* | *"$nl"*) echo >&2 "$0: -n '$2' '$3' '$4': tabs, newlines not allowed" - exit 1 + exit 1;; esac - loginFullnameMailaddrs=$loginFullnameMailaddrs$nl$2$tab$3$tab$4 + login=$2 + lfm=$2$tab$3$tab$4 shift; shift; shift;; -u) # If $2 is not tab-separated, use colon for separator. @@ -101,24 +122,41 @@ *"$tab"*) t=$tab;; *) - t=: + t=':';; esac case $2 in *"$t"*"$t"*"$t"*) echo >&2 "$0: -u '$2': too many fields" exit 1;; *"$t"*"$t"*) - ;; + uf="[^$t]*$t" # An unselected field, followed by a separator. + sf="\\([^$t]*\\)" # The selected field. + login=`expr "X$2" : "X$sf"` + lfm="$login$tab"` + expr "X$2" : "$uf$sf" + `"$tab"` + expr "X$2" : "$uf$uf$sf" + `;; *) echo >&2 "$0: -u '$2': not enough fields" - exit 1 + exit 1;; esac - loginFullnameMailaddrs=$loginFullnameMailaddrs$nl$2 - shift + shift;; esac - logins=$logins$nl$login - ;; - -r) rlog_options=$rlog_options$nl${2?}; shift;; + case $logins in + '') logins=$login;; + ?*) logins=$logins$nl$login;; + esac + case $loginFullnameMailaddrs in + '') loginFullnameMailaddrs=$lfm;; + ?*) loginFullnameMailaddrs=$loginFullnameMailaddrs$nl$lfm;; + esac;; + -r) + case $rlog_options in + '') rlog_options=${2?};; + ?*) rlog_options=$rlog_options$nl${2?};; + esac + shift;; -R) recursive=t;; -t) tabwidth=${2?}; shift;; -v) revision=t;; @@ -130,9 +168,9 @@ -*) echo >&2 "Usage: $0 [OPTION]... [FILE ...]$nl$Help" case $1 in --help) exit 0;; - *) exit 1 + *) exit 1;; esac;; - *) break + *) break;; esac shift done @@ -144,148 +182,182 @@ m[9]="Oct"; m[10]="Nov"; m[11]="Dec" ' +logdir=$TMPDIR/rcs2log$$ +llogout=$logdir/l +trap exit 1 2 13 15 +trap "rm -fr $logdir 2>/dev/null" 0 +(umask 077 && exec mkdir $logdir) || exit -# Put rlog output into $rlogout. - -# If no rlog options are given, -# log the revisions checked in since the first ChangeLog entry. -# Since ChangeLog is only by date, some of these revisions may be duplicates of -# what's already in ChangeLog; it's the user's responsibility to remove them. -case $rlog_options in +# If no rlog-format log file is given, generate one into $rlogfile. +case $rlogfile in '') + rlogfile=$logdir/r + + # If no rlog options are given, + # log the revisions checked in since the first ChangeLog entry. + # Since ChangeLog is only by date, some of these revisions may be duplicates of + # what's already in ChangeLog; it's the user's responsibility to remove them. + case $rlog_options in + '') + if test -s "$changelog" + then + e=' + /^[0-9]+-[0-9][0-9]-[0-9][0-9]/{ + # ISO 8601 date + print $1 + exit + } + /^... ... [ 0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9]+ /{ + # old-fashioned date and time (Emacs 19.31 and earlier) + '"$month_data"' + year = $5 + for (i=0; i<=11; i++) if (m[i] == $2) break + dd = $3 + printf "%d-%02d-%02d\n", year, i+1, dd + exit + } + ' + d=`$AWK "$e" <"$changelog"` || exit + case $d in + ?*) datearg="-d>$d";; + esac + fi;; + esac + + # Use TZ specified by ChangeLog local variable, if any. if test -s "$changelog" then - e=' - /^[0-9]+-[0-9][0-9]-[0-9][0-9]/{ - # ISO 8601 date - print $1 - exit + extractTZ=' + /^.*change-log-time-zone-rule['"$tab"' ]*:['"$tab"' ]*"\([^"]*\)".*/{ + s//\1/; p; q } - /^... ... [ 0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9]+ /{ - # old-fashioned date and time (Emacs 19.31 and earlier) - '"$month_data"' - year = $5 - for (i=0; i<=11; i++) if (m[i] == $2) break - dd = $3 - printf "%d-%02d-%02d\n", year, i+1, dd - exit + /^.*change-log-time-zone-rule['"$tab"' ]*:['"$tab"' ]*t.*/{ + s//UTC0/; p; q } ' - d=`$AWK "$e" <"$changelog"` || exit - case $d in - ?*) datearg="-d>$d" + logTZ=`tail "$changelog" | sed -n "$extractTZ"` + case $logTZ in + ?*) TZ=$logTZ; export TZ;; esac fi -esac -# Use TZ specified by ChangeLog local variable, if any. -if test -s "$changelog" -then - extractTZ=' - /^.*change-log-time-zone-rule['"$tab"' ]*:['"$tab"' ]*"\([^"]*\)".*/{ - s//\1/; p; q - } - /^.*change-log-time-zone-rule['"$tab"' ]*:['"$tab"' ]*t.*/{ - s//UTC0/; p; q - } - ' - logTZ=`tail "$changelog" | sed -n "$extractTZ"` - case $logTZ in - ?*) TZ=$logTZ; export TZ - esac -fi + # If CVS is in use, examine its repository, not the normal RCS files. + if test ! -f CVS/Repository + then + rlog=rlog + repository= + else + rlog='cvs -q log' + repository=`sed 1q &2 "$0: $CVSROOT: CVSROOT has multiple ':/'s" + exit 1;; + *:/*) + # remote repository + pository=`expr "X$repository" : '.*:\(/.*\)'`;; + *) + # local repository + case $repository in + /*) ;; + *) repository=${CVSROOT?}/$repository;; + esac + if test ! -d "$repository" + then + echo >&2 "$0: $repository: bad repository (see CVS/Repository)" + exit 1 + fi + pository=$repository;; + esac + + # Ensure that $pository ends in exactly one slash. + while : + do + case $pository in + *//) pository=`expr "X$pository" : 'X\(.*\)/'`;; + */) break;; + *) pository=$pository/; break;; + esac + done + + fi -# If CVS is in use, examine its repository, not the normal RCS files. -if test ! -f CVS/Repository -then - rlog=rlog - repository= -else - rlog='cvs -q log' - repository=`sed 1q &1` in + *' option'*) ;; *) - # local repository - case $repository in - /*) ;; - *) repository=${CVSROOT?}/$repository - esac - if test ! -d "$repository" - then - echo >&2 "$0: $repository: bad repository (see CVS/Repository)" - exit 1 - fi + case $rlog_options in + '') rlog_options=-zLT;; + ?*) rlog_options=-zLT$nl$rlog_options;; + esac;; esac -fi - -# Use $rlog's -zLT option, if $rlog supports it. -case `$rlog -zLT 2>&1` in -*' option'*) ;; -*) rlog_options=-zLT$nl$rlog_options -esac -# With no arguments, examine all files under the RCS directory. -case $# in -0) - case $repository in - '') - oldIFS=$IFS - IFS=$nl - case $recursive in - t) - RCSdirs=`find . -name RCS -type d -print` - filesFromRCSfiles='s|,v$||; s|/RCS/|/|; s|^\./||' - files=` - { - case $RCSdirs in - ?*) find $RCSdirs \ - -type f \ - ! -name '*_' \ - ! -name ',*,' \ - ! -name '.*_' \ - ! -name .rcsfreeze.log \ - ! -name .rcsfreeze.ver \ - -print + # With no arguments, examine all files under the RCS directory. + case $# in + 0) + case $repository in + '') + oldIFS=$IFS + IFS=$nl + case $recursive in + t) + RCSdirs=`find . -name RCS -type d -print` + filesFromRCSfiles='s|,v$||; s|/RCS/|/|; s|^\./||' + files=` + { + case $RCSdirs in + ?*) find $RCSdirs \ + -type f \ + ! -name '*_' \ + ! -name ',*,' \ + ! -name '.*_' \ + ! -name .rcsfreeze.log \ + ! -name .rcsfreeze.ver \ + -print;; + esac + find . -name '*,v' -print + } | + sort -u | + sed "$filesFromRCSfiles" + `;; + *) + files= + for file in RCS/.* RCS/* .*,v *,v + do + case $file in + RCS/. | RCS/.. | RCS/,*, | RCS/*_) continue;; + RCS/.rcsfreeze.log | RCS/.rcsfreeze.ver) continue;; + RCS/.\* | RCS/\* | .\*,v | \*,v) test -f "$file" || continue;; + RCS/*,v | RCS/.*,v) ;; + RCS/* | RCS/.*) test -f "$file" || continue;; esac - find . -name '*,v' -print - } | - sort -u | - sed "$filesFromRCSfiles" - `;; - *) - files= - for file in RCS/.* RCS/* .*,v *,v - do - case $file in - RCS/. | RCS/.. | RCS/,*, | RCS/*_) continue;; - RCS/.rcsfreeze.log | RCS/.rcsfreeze.ver) continue;; - RCS/.\* | RCS/\* | .\*,v | \*,v) test -f "$file" || continue - esac - files=$files$nl$file - done - case $files in - '') exit 0 + case $files in + '') files=$file;; + ?*) files=$files$nl$file;; + esac + done + case $files in + '') exit 0;; + esac;; esac - esac - set x $files - shift - IFS=$oldIFS + set x $files + shift + IFS=$oldIFS;; + esac;; esac + + case $datearg in + ?*) $rlog $rlog_options "$datearg" ${1+"$@"} >$rlogfile;; + '') $rlog $rlog_options ${1+"$@"} >$rlogfile;; + esac || exit;; esac -llogout=$TMPDIR/rcs2log$$l -rlogout=$TMPDIR/rcs2log$$r -trap exit 1 2 13 15 -trap "rm -f $llogout $rlogout; exit 1" 0 -case $datearg in -?*) $rlog $rlog_options "$datearg" ${1+"$@"} >$rlogout;; -'') $rlog $rlog_options ${1+"$@"} >$rlogout -esac || exit +# Prefer the POSIX-style -k options, since POSIX 1003.1-2001 prohibits +# support for the traditional-style +M -N options. +SORT_K_OPTIONS='-k 3,4r -k 5 -k 1' +sort $SORT_K_OPTIONS /dev/null || SORT_K_OPTIONS='+2 -4r +4 +0' # Get the full name of each author the logs mention, and set initialize_fullname @@ -303,17 +375,14 @@ sed 's/["\\]/\\&/g' >$llogout <$llogout || exit + output_authors='/^date: / { if ($2 ~ /^[0-9]*[-\/][0-9][0-9][-\/][0-9][0-9]$/ && $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9:]*;$/ && $4 == "author:" && $5 ~ /^[^;]*;$/) { print substr($5, 1, length($5)-1) } }' authors=` - $AWK "$output_authors" <$rlogout | - case $llogout in - '') sort -u;; - ?*) sort -u | comm -23 - $llogout - esac + $AWK "$output_authors" <"$rlogfile" | sort -u | comm -23 - $llogout ` case $authors in ?*) @@ -402,21 +472,24 @@ ' initialize_fullname=` - ( - cat /etc/passwd - for author in $authors - do nismatch $author passwd.org_dir - done - ypmatch $authors passwd - ) 2>/dev/null | + { + (getent passwd $authors) || + ( + cat /etc/passwd + for author in $authors + do NIS_PATH= nismatch $author passwd.org_dir + done + ypmatch $authors passwd + ) + } 2>/dev/null | $AWK -F: "$awkscript" - `$initialize_fullname + `$initialize_fullname;; esac # Function to print a single log line. # We don't use awk functions, to stay compatible with old awk versions. -# `Log' is the log message (with \n replaced by \r). +# `Log' is the log message. # `files' contains the affected files. printlogline='{ @@ -424,21 +497,27 @@ # * file: (function): comment # to # * file (function): comment - if (Log ~ /^\([^)]*\): /) { + if (Log ~ /^\([^)]*\):[\t\n ]/) { i = index(Log, ")") - files = files " " substr(Log, 1, i) + filefunc = substr(Log, 1, i) + while ((j = index(filefunc, "\n"))) { + files = files " " substr(filefunc, 1, j-1) + filefunc = substr(filefunc, j+1) + } + files = files " " filefunc Log = substr(Log, i+3) } # If "label: comment" is too long, break the line after the ":". sep = " " - if ('"$length"' <= '"$indent"' + 1 + length(files) + index(Log, CR)) sep = "\n" indent_string + i = index(Log, "\n") + if ('"$length"' <= '"$indent"' + 1 + length(files) + i) sep = "\n" indent_string # Print the label. printf "%s*%s:", indent_string, files - # Print each line of the log, transliterating \r to \n. - while ((i = index(Log, CR)) != 0) { + # Print each line of the log. + while (i) { logline = substr(Log, 1, i-1) if (logline ~ /[^'"$tab"' ]/) { printf "%s%s\n", sep, logline @@ -447,6 +526,7 @@ } sep = indent_string Log = substr(Log, i+1) + i = index(Log, "\n") } }' @@ -467,24 +547,27 @@ *) domainname=`(domainname) 2>/dev/null` && case $domainname in - *.*) hostname=$hostname.$domainname - esac - esac + *.*) hostname=$hostname.$domainname;; + esac;; + esac;; esac # Process the rlog output, generating ChangeLog style entries. # First, reformat the rlog output so that each line contains one log entry. -# Transliterate \n to \r so that multiline entries fit on a single line. +# Transliterate \n to SOH so that multiline entries fit on a single line. # Discard irrelevant rlog output. -$AWK <$rlogout ' - BEGIN { repository = "'"$repository"'" } - /^RCS file:/ { - if (repository != "") { - filename = $3 - if (substr(filename, 1, length(repository) + 1) == repository "/") { - filename = substr(filename, length(repository) + 2) +$AWK ' + BEGIN { + pository = "'"$pository"'" + SOH="'"$SOH"'" + } + /^RCS file: / { + if (pository != "") { + filename = substr($0, 11) + if (substr(filename, 1, length(pository)) == pository) { + filename = substr(filename, length(pository) + 1) } if (filename ~ /,v$/) { filename = substr(filename, 1, length(filename) - 2) @@ -497,13 +580,14 @@ } rev = "?" } - /^Working file:/ { if (repository == "") filename = $3 } + /^Working file: / { if (repository == "") filename = substr($0, 15) } /'"$rlog_revision_pattern"'/, /^(-----------*|===========*)$/ { - if ($0 ~ /'"$rlog_revision_pattern"'/) { + line = $0 + if (line ~ /'"$rlog_revision_pattern"'/) { rev = $2 next } - if ($0 ~ /^date: [0-9][- +\/0-9:]*;/) { + if (line ~ /^date: [0-9][- +\/0-9:]*;/) { date = $2 if (date ~ /\//) { # This is a traditional RCS format date YYYY/MM/DD. @@ -517,38 +601,34 @@ } time = substr($3, 1, length($3) - 1) author = substr($5, 1, length($5)-1) - printf "%s %s %s %s %s %c", filename, rev, date, time, author, 13 + printf "%s%s%s%s%s%s%s%s%s%s", filename, SOH, rev, SOH, date, SOH, time, SOH, author, SOH rev = "?" next } - if ($0 ~ /^branches: /) { next } - if ($0 ~ /^(-----------*|===========*)$/) { print ""; next } - if ($0 == "Initial revision" || $0 ~ /^file .+ was initially added on branch .+\.$/) { - $0 = "New file." - } - printf "%s%c", $0, 13 + if (line ~ /^branches: /) { next } + if (line ~ /^(-----------*|===========*)$/) { print ""; next } + if (line == "Initial revision" || line ~ /^file .+ was initially added on branch .+\.$/) { + line = "New file." + } + printf "%s%s", line, SOH } -' | +' <"$rlogfile" | # Now each line is of the form -# FILENAME REVISION YYYY-MM-DD HH:MM:SS[+-TIMEZONE] AUTHOR \rLOG -# where \r stands for a carriage return, -# and each line of the log is terminated by \r instead of \n. +# FILENAME@REVISION@YYYY-MM-DD@HH:MM:SS[+-TIMEZONE]@AUTHOR@LOG +# where @ stands for an SOH (octal code 001), +# and each line of LOG is terminated by SOH instead of \n. # Sort the log entries, first by date+time (in reverse order), # then by author, then by log entry, and finally by file name and revision # (just in case). -sort +2 -4r +4 +0 | +sort -t"$SOH" $SORT_K_OPTIONS | # Finally, reformat the sorted log entries. -$AWK ' +$AWK -F"$SOH" ' BEGIN { logTZ = "'"$logTZ"'" revision = "'"$revision"'" - # Some awk variants do not understand "\r" or "\013", so we have to - # put a carriage return directly in the file. - CR=" " # <-- There is a single CR between the " chars here. - # Initialize the fullname and mailaddr associative arrays. '"$initialize_fullname"' '"$initialize_mailaddr"' @@ -564,7 +644,8 @@ } { - newlog = substr($0, 1 + index($0, CR)) + newlog = "" + for (i = 6; i < NF; i++) newlog = newlog $i "\n" # Ignore log entries prefixed by "#". if (newlog ~ /^#/) { next } @@ -588,7 +669,7 @@ newclumpname = substr(newlog, 1, i) while (substr(newlog, i+1) ~ /^['"$tab"' ]/) i++ newlog = substr(newlog, i+1) - if (clumpname == newclumpname) sep = "" + if (clumpname == newclumpname && date == $3 && author == $5) sep = "" } printf sep clumpname = newclumpname @@ -643,7 +724,7 @@ # Exit successfully. -exec rm -f $llogout $rlogout +exec rm -fr $logdir # Local Variables: # tab-width:4 Index: lisp/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v retrieving revision 1.459 retrieving revision 1.478 diff -u -r1.459 -r1.478 --- lisp/ChangeLog 5 Jan 2003 05:13:33 -0000 1.459 +++ lisp/ChangeLog 16 Feb 2003 06:13:24 -0000 1.478 @@ -1,3 +1,407 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-02-15 Ben Wing + + * make-docfile.el: + * make-docfile.el (message): New. + * make-docfile.el (format-decode): New. + * make-docfile.el (process-args): New. + * make-docfile.el ((preloaded-file-list)): + * make-docfile.el (docfile-out-of-date): + Use `message' (defined in this file) in place of `princ'/`print', + and put in a terpri, so that we get correct newline behavior. + Rewrite if-progn -> when and a few similar stylistic niceties. + And the big change: Allow MS Windows to specify the object files + directly and frob them into C files here (formerly this was done + in xemacs.mak, and very slooooooooooooooooooowly). Due to + line-length limitations in CMD, we need to use a "response file" + to hold the arguments, so when we see a response file argument + (preceded by an @), read in the args (a bit of trickiness to do + this), and process recursively. Also frob .obj -> .c as mentioned + earlier and handle other junk dependencies that need to be removed + (NEEDTODUMP, make-docfile.exe). + + * update-elc-2.el (do-update-elc-2): + Use :test `equal' in call to set-difference. + + * update-elc.el: + Put back commented out kill-emacs, update header comment. + +2003-02-14 Ben Wing + + * autoload.el (generate-file-autoloads): + Include FUNLIST argument to generate-c-file-autoloads-1. + +2003-02-14 Ben Wing + + * byte-optimize.el: + * byte-optimize.el (byte-compile-inline-expand): + * byte-optimize.el (byte-compile-unfold-lambda): + * byte-optimize.el (byte-optimize-form-code-walker): + * byte-optimize.el (byte-optimize-form): + * byte-optimize.el (byte-decompile-bytecode-1): + * byte-optimize.el (byte-optimize-lapcode): + Review carefully and sync up to 20.7 except for areas as noted. + Fixes problem with JDE compilation. + +2003-02-14 Ben Wing + + * autoload.el: + * autoload.el (generate-file-autoloads): + * autoload.el (generate-autoload-ish-1): + * autoload.el (generate-file-autoloads-1): + * autoload.el (generate-c-file-autoloads-1): + Factor out common code in generate-{c-,}file-autoloads-1 into new + function generate-autoload-ish-1. \(I was originally going to use + this for custom as well but ended up thinking better of it.) + + * cus-dep.el: + * cus-dep.el (cusload-hash-table-marker): New. + * cus-dep.el (Custom-make-dependencies-1): + Cache the old computed values in custom-load.el and reuse them as + necessary, to speed up running cus-dep (which would take 25-30 + seconds to do all files in lisp/*, lisp/*/* on my Pentium III + 700). Use `message' not `princ' to get correct newline behavior. + Output messages showing each file we do actually process. + + * update-elc-2.el: + * update-elc-2.el (dirfiles-table): New. + * update-elc-2.el (do-update-elc-2): + * update-elc-2.el (batch-update-elc-2): + Rewrite algorithm to be much faster -- cache calls to + directory-files and don't make needless calls to file-exists-p, + file-directory-p because they're way way slow. + Autoload early and only when update-elc has told us to. + + * update-elc.el: + * update-elc.el (dumped-exe): Removed. + * update-elc.el (dumped-exe-out-of-date-wrt-undumped-exe): Removed. + * update-elc.el (lisp-files-ignored-when-checking-for-autoload-updating): New. + * update-elc.el ((preloaded-file-list site-load-packages files-to-process)): + If no files need byte compilation, signal to update-elc-2 to do + any necessary autoload updating (using the file REBUILD_AUTOLOADS) + rather than doing it ourselves, which would be way slow. Ignore + updates to custom-load.el and auto-autoloads.el when checking to + see whether autoloads need updating. Optimize out many + unnecessary calls to file-exists-p to speed it up somewhat. (#### + The remaining time is 50% or more in locate-file; this is + presumably because, even though it has a cache, it's still + statting each file to determine it's actually there. By calling + directory-files ourselves, building a tree, and then looking in + that tree, we could drastically shorten the time needed to do the + locate operation.) + +2003-02-12 Jerry James + + * about.el (about-url-alist): Add my home page. + * about.el (about-personal-info): Flatter myself. + +2002-11-01 Ilpo Nyyss~nen + + * mule/mule-cmds.el (finish-set-language-environment): Fix for + call to set-language-unicode-precedence-list. + +2003-02-09 Ben Wing + + * window.el (walk-windows): + walk-windows was broken when a frame was given to WHICH-FRAMES. + it would loop forever. The FSF version fixes this but i didn't + sync to them because (a) it conses (bad for lazy-lock), (b) it + calls select-window. + +2003-02-07 Ben Wing + + * hyper-apropos.el: + * hyper-apropos.el (hyper-apropos): + * hyper-apropos.el (hyper-apropos-grok-functions): + * hyper-apropos.el (hyper-apropos-grok-variables): + Separate obsolete and non-obsolete stuff and make sure we note + when obsolete funs are just aliases for others. Also fix some + problems with doc string hacking. + + * menubar-items.el: + * menubar-items.el (default-menubar): + Change the Help->Info submenu a bit. + + * text-props.el (text-property-any): + * text-props.el (text-property-not-all): + Fix bug when end > start. + + * update-elc.el (unbytecompiled-lisp-files): + Add raw-process.el. + +2002-12-27 Stephen J. Turnbull + + Synch to GNU Emacs 21.3.50: + + * wid-edit.el: Update Copyright notice and Commentary. + (other): + (float): + (plist): + (widget-plist-value-type): + (widget-plist-convert-widget): + (widget-plist-convert-option): + (alist): + (widget-alist-value-type): + (widget-alist-convert-widget): + (widget-alist-convert-option): + New widgets and ancillary objects. + (coding-system): + (widget-coding-system-prompt-value-history): + (widget-coding-system-prompt-value): + (widget-coding-system-prompt-action): + Reenabled widget. + (default): Use `ignore' instead of lambda form. + (editable-field): New help-echo, better error. + (text): Use conventional argument order. + (character): Specify :size property. + (widget-menu-max-shortcuts): New user variable. + (widget-remove-if): + (widgetp): + (widget-copy): + (widget-types-copy): + (widget-field-at): + New functions. + (widget-convert): Use keywordp. + (widget-insert): Auto-autoload. + (widget-types-convert-widget): Make defsubst. + (widget-convert): + (widget-get-sibling): + (widget-insert): + (widget-default-complete): + (widget-item-value-create): + (widget-field-prompt-value): + (widget-field-validate): + (widget-choice-validate): + (widget-radio-value-inline): + (widget-editable-list-value-create): + (widget-regexp-validate): + (widget-file-complete): + (widget-color-complete): + Eliminate pointless let-bindings. + (widget-field-find): Delete old version; comment XEmacs use of + map-extents. + (widget-default-create): + (widget-checklist-add-item): + (widget-radio-add-item): + (widget-radio-chosen): + (widget-editable-list-entry-create): + (widget-documentation-string-value-create): + Insert characters, not one-element strings. + (widget-default-create): Use stream argument of princ. + (widget-default-format-handler): Check functionp before funcalling. + (widget-url-link-action): Fix if-fboundp typo and too-long line. + (widget-sublist): + (cons :value-to-external): + Use Common Lisp functions. + (widget-echo-help): + (widget-default-value-set): + Use `if' rather than `and' and `when'. + (widget-princ-to-string): + (widget-specify-sample): + (widget-specify-doc): + (widget-glyph-directory): + (widget-glyph-enable): + (widget-after-change): + Docstrings from comments or improve docstrings. + (widget-image-conversion): New GNU Emacs-compatible alias. + (widget-field-face): Handle light-background TTYs. + +2003-02-06 Stephen J. Turnbull + + * update-elc.el (lisp-files-needing-early-byte-compilation): + Comment referred to wrong variable. + (do-autoload-commands ...): Remove duplicate comment. + +2003-02-05 Ben Wing + + * mule/cyril-util.el: + * mule/cyril-util.el (standard-display-table): + * mule/cyril-util.el (standard-display-table)): New. + Fix compile warning. + +2003-02-05 Ben Wing + + * loadup.el: + * loadup.el (really-early-error-handler): + * loadup.el (load-warn-when-source-only): + * loadup.el ((member "dump" command-line-args)): + * make-docfile.el: + * update-elc-2.el: + * update-elc.el: + Set stack-trace-on-error, load-always-display-messages so we + get better debug results. + + * update-elc-2.el (batch-update-elc-2): + Fix typo in name of lisp/mule, leading to compile failure. + + * simple.el: + * simple.el (motion-keys-for-shifted-motion): + Omit M-S-home/end from motion keys. + + * update-elc.el (undumped-exe): New. + * update-elc.el (dumped-exe): New. + * update-elc.el (dumped-exe-out-of-date-wrt-dump-files): New. + * update-elc.el (dumped-exe-out-of-date-wrt-undumped-exe): New. + * update-elc.el ("very-early-lisp.el"): + * update-elc.el (lisp-files-needed-for-byte-compilation): New. + * update-elc.el (lisp-files-needing-early-byte-compilation): New. + * update-elc.el (unbytecompiled-lisp-files): New. + * update-elc.el ((preloaded-file-list site-load-packages files-to-process)): + Overhaul: + + -- allow list of "early-compile" files to be specified, not hardcoded + -- fix autoload checking to include all .el files, not just dumped ones + -- be smarter about regenerating autoloads, so we don't need to use + loadup-el if not necessary + -- use standard methods for loading/not loading auto-autoloads.el + (maybe fixes "Already loaded" error?) + -- rename misleading NOBYTECOMPILE flag file. + + * window-xemacs.el (window-list): + Fix bug in default param. + + * window-xemacs.el (really-set-window-configuration): + * window-xemacs.el (restore-saved-window-parameters): + Fix compile warnings. + +2003-02-02 Steve Youngs + + * about.el (xemacs-hackers): Add Jerry, Ville, + (about-current-release-maintainers): Remove Martin, Jason. Add + Jerry, Ville. + (about-other-current-hackers): Add Martin, Jason. + (about-personal-info): Update me. Add Jerry, Ville. + (about-hacker-contribution): Update me, Martin, Steve T. Add + Jerry, Ville. + +2003-01-18 Stephen J. Turnbull + + * autoload.el: Drastically reorganized. + + API improvement: + + (autoload-target-directory): + (batch-update-autoloads): + (batch-update-directory): + (batch-update-one-directory): + (batch-force-update-one-directory): + Deprecated. + (autoload-feature-prefix): New special. + (autoload-package-name): Obsolete alias for autoload-feature-prefix. + (autoload-batch-update-autoloads): New function. Main + command-line API. + + Documentation: + + Improve many docstrings. + (Header summary): Update. + (Commentary): Completely rewritten. + (ChangeLog): Redundant, so removed. + + General sanitation: + + (generated-autoload-file): Default changed to lisp-directory. + (generate-file-autoloads): Better argument checking. + (generate-c-file-autoloads-1): Make the output code prettier, + clean up long lines. + (autoload-featurep-protect-autoloads): + (autoload-make-feature-name): + New functions for handling feature checking and provide'ing. + (update-autoload-files): Use them. Don't try tricky things to + guess feature names. + (update-autoloads-here): Remove extra arg to a call + to format. Warn of probable bitrot in the docstring. + (batch-force-update-one-directory): + (batch-update-one-directory): + Fix typo in error message. + + Related changes: + + * update-elc.el: Use `autoload-update-directory-autoloads'. + + * update-elc-2.el (batch-update-elc-2): Use full API for + `update-autoload-files'. + + * startup.el (startup-load-autoloads): Oops. Ben generates Mule + autoloads in lisp/mule, Mike doesn't load them in startup.el. + Also, use `when' and `unless' for clarity. + (command-line): Comment typo. + (splash-frame-body): Grammatical nits. + +2003-01-17 Stephen J. Turnbull + + * info.el (Info-insert-dir): Make default-directory end in + separator. Patch due to Martin Buchholz. + +2003-01-10 Mike Sperber + + * window-xemacs.el: Revert his change + + 2003-01-10 Mike Sperber + + * window-xemacs.el (window-reduce-to-one): Rewrite in terms of + `delete-other-windows.' + (window-find-buffer-subwindow): Add. + + It caused subtle breakage. (And add a comment to that effect.) + +2003-01-13 Mike Sperber + + * packages.el: + * find-paths.el: Revert this change + + 2000-04-01 Mike Sperber + + * packages.el (packages-find-package-directories): Added support + for external package hierarchies with in-place installations. + + * find-paths.el (paths-root-in-place-p): Added. + (paths-find-emacs-directory): Added support for external + directories with in-place installations. + (paths-find-site-directory): Ditto. + +2003-01-19 Mike Sperber + + * startup.el (normal-top-level): Compute `emacs-data-roots.' Call + `startup-setup-paths' with data-roots argument. + (emacs-data-roots): Add. + + * dump-paths.el: Call `startup-setup-paths' with + data-roots argument. + (startup-setup-paths): Use `data-roots' instead of `roots' to find + packages. + Call `paths-find-emacs-roots' with `root-p' argument. + + * make-docfile.el: Call `paths-find-emacs-roots' with `root-p' argument. + + * find-paths.el (paths-emacs-data-root-p): Add. + (paths-find-emacs-roots): Parmeterize over `root-p.' + +2003-01-13 Ilya Golubev + + * about.el: Update golubev data. + +2003-01-10 Mike Sperber + + * window-xemacs.el (window-reduce-to-one): Rewrite in terms of + `delete-other-windows.' + (window-find-buffer-subwindow): Add. + +2003-01-09 Stephen J. Turnbull + + * mule/japan-util.el (setup-japanese-environment-internal): + usg-unix-v is not a suitable catchall. + + * mule/viet-util.el: + * mule/ethio-util.el: + characater -> character. + + * mule/cyril-util.el (cyrillic-language-alist): There is no such + language as Serbo-Croatian, according to Hrvoje, who oughtta know. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. @@ -6,6 +410,10 @@ * wid-edit.el: Synch trivia to GNU Emacs 21.3.50. Make docstrings from comments, fix typos & whitespace, add some comments and fixmes. + +2002-12-17 Daiki Ueno + + * process.el (shell-command-to-string): Synch with GNU Emacs 21. 2002-12-15 Ben Wing Index: lisp/about.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/about.el,v retrieving revision 1.53 retrieving revision 1.57 diff -u -r1.53 -r1.57 --- lisp/about.el 1 Sep 2002 22:13:53 -0000 1.53 +++ lisp/about.el 16 Feb 2003 06:08:02 -0000 1.57 @@ -114,13 +114,14 @@ (dv "Didier Verna" "didier@xemacs.org") (eb "Eric Benson" "eb@xemacs.org") (fabrice "Fabrice Popineau" "fabrice@xemacs.org") - (golubev "I N Golubev" "golubev@xemacs.org") + (golubev "Ilya Golubev" "golubev@xemacs.org") (gunnar "Gunnar Evermann" "gunnar@xemacs.org") (hbs "Harlan Sexton" "hbs@xemacs.org") (hisashi "Hisashi Miyashita" "hisashi@xemacs.org") (hmuller "Hans Muller" "hmuller@xemacs.org") (hniksic "Hrvoje Niksic" "hniksic@xemacs.org") (hobley "David hobley" "hobley@xemacs.org") + (james "Jerry James" "james@xemacs.org") (jan "Jan Vroonhof" "jan@xemacs.org") (jareth "Jareth Hein" "jareth@xemacs.org") (jason "Jason R. Mastaler" "jason@xemacs.org") @@ -149,6 +150,7 @@ (rickc "Rick Campbell" "rickc@xemacs.org") (rose "John Rose" "rose@xemacs.org") (rossini "Anthony Rossini" "rossini@xemacs.org") + (scop "Ville Skyttä" "scop@xemacs.org") (slb "Steve Baur" "steve@xemacs.org") (sperber "Michael Sperber" "mike@xemacs.org") (stig "Jonathan Stigelman" "stig@xemacs.org") @@ -167,13 +169,13 @@ (defvar about-current-release-maintainers ;; this list should not necessarily be in sorted order. - '(turnbull adrian ben hniksic jason martin piper sperber youngs)) + '(youngs adrian ben hniksic james piper scop sperber turnbull)) (defvar about-other-current-hackers ;; to sort this list or the one below, use: ;; M-x sort-regexp-fields RET [a-z]+ RET \(.*\) RET '(aj alastair cgw craig daiki dan dv fabrice golubev gunnar hisashi - jan jareth jmiller jonathan kazz kirill larsi morioka mta ograf + jan jareth jason jmiller jonathan kazz kirill larsi martin morioka mta ograf olivier oscar pittman tomonori tuck vin wmperry yoshiki)) (defvar about-once-and-future-hackers @@ -201,6 +203,7 @@ (dv . "http://www.lrde.epita.fr/~didier/") (fabrice . "http://www.ese-metz.fr/~popineau/") (fptex . "http://www.fptex.org/") + (james . "http://www.ittc.ku.edu/~james/") (jason . "http://www.mastaler.com/") (juhp . "http://www.01.246.ne.jp/~juhp/") (jwz . "http://www.jwz.org/") @@ -955,7 +958,19 @@ (golubev (widget-insert "\ -Sorry, no personal information available about me yet.\n")) +I appreciate power of XEmacs, but elementary editing operations should +be done by single keystrokes with no modifiers. So would not use +XEmacs until discovered viper, and now can't live without viper. +Occasionally dislike something in there or in other free software, and +try to get it fixed. .plan file contains classic \(perhaps reinvented +independently\) formula: + +Hacking world for ever + +\(borrowed from \"Hacking X for Y\" in ") + (about-url-link "http://www.jargon.org/" + "Jargon File" "www.jargon.org") + (widget-insert ").\n")) (gunnar (widget-insert "\ @@ -1015,6 +1030,22 @@ will get to finish it sometime sooner rather than later. I do vaguely remember University where it seems like I had more spare time that I can believe now. Oh well, such is life.\n")) + (james + (widget-insert + "\ +Jerry James was managing a software development project as a Ph.D. +student when two of his M.S. student helpers convinced him to switch +from FSF Emacs to XEmacs. He thought that Gnus looked a lot cooler in +XEmacs, and soon had a web page containing small patches to XEmacs +20.3, which were picked up by the Debian Linux distribution. + +He has since given up his native California to join the faculty at the +University of Kansas. He is learning to like the weather in Lawrence, +Kansas, where he lives with his wife and 3 children. His work on XEmacs +mostly consists of extensions to the loadable module support in XEmacs, +which was introduced by J. Kean Johnston and others. He has a ") + (about-url-link 'james "home page" "Visit Jerry's home page") + (widget-insert " (doesn't everybody?)\n")) (jan (widget-insert "\ Jan Vroonhof has been using XEmacs since he needed to write .tex files @@ -1277,6 +1308,10 @@ See ") (about-url-link 'rossini nil "Visit Anothony's home page") (widget-insert ".\n")) + (scop + (widget-insert + "\ +Sorry, no personal information available about me yet.\n")) (slb (widget-insert "\ Peaches Baur, 1986-1999. @@ -1360,19 +1395,17 @@ Sorry, no personal information available about me yet.\n")) (youngs (widget-insert "\ -I live in Brisbane, Australia with my wife, Michelle and our daughter, -Kaitlyn. I've only been hacking XEmacs for a short time (approx 18 -mths), but I've been fooling around with computers since the early -80's. +I live in Brisbane, Australia with my wife, Michelle and our two +children, Kaitlyn and Blake. In the past, I've been a bank officer, car salesman, insurance agent, managed a computer firm and owned and operated my own business. I now divide my time between my family, planning my next business idea (a -computer consulting firm that uses zero Microsoft products), looking -after the XEmacs Packages and hacking my own XEmacs package, Eicq. +computer consulting firm that uses zero Microsoft products), hacking +XEmacs, and hacking my own XEmacs package, Eicq. \tSee: ") - (about-url-link 'youngs nil "Visit the Eicq homepage") + (about-url-link 'youngs "Eicq Homepage" "Visit the Eicq homepage\n") (widget-insert ".\n")) )) @@ -1522,7 +1555,10 @@ (golubev (widget-insert "\ -Sorry, no information about my XEmacs contributions yet.\n")) +Used XEmacs since early 1997. Fixed bugs that annoy me, both in +XEmacs core and in packages I use, mostly viper. Hoping to get +coding-cookie package distributed, which is also a fix of what I +consider a bug.\n")) (gunnar (widget-insert "\ @@ -1569,6 +1605,11 @@ (widget-insert "\ Creator of the earliest version of the MS Windows port of XEmacs.\n")) + (james + (widget-insert + "\ +Jerry made lots of enhancements to the DSO code, including moving +PostgreSQL and LDAP to modules.\n")) (jan (widget-insert "\ Apart from hunting down redisplay bugs Jan has worked on such @@ -1636,7 +1677,7 @@ (martin (widget-insert "\ -Beta release manager and author of many stability fixes and speed +Former beta release manager and author of many stability fixes and speed improvements in XEmacs.\n")) (mcook (widget-insert "\ @@ -1705,6 +1746,10 @@ Author of the first XEmacs FAQ; Development lead on Emacs Speaks Statistics; Assisted Jareth Hein with setting up the JitterBug tracking system.\n")) + (scop + (widget-insert + "\ +Co Maintainer & Release Manager of the Packages.\n")) (slb (widget-insert "\ @@ -1739,8 +1784,7 @@ (turnbull (widget-insert "\ -Responsible for getting the current release of XEmacs out the -door.\n")) +Former XEmacs Beta Release Manager.\n")) (vin (widget-insert "\ Vin helps maintain the older, more mature (read: moldy) versions of @@ -1764,7 +1808,13 @@ Sorry, no information about my XEmacs contributions yet.\n")) (youngs (widget-insert "\ -Maintainer and release manager of the packages.\n")) +Steve is the current XEmacs Beta Release Manager (the guy responsible +for getting this version of XEmacs out the door). + +Steve used to be our Packages Release Manager and as such is one of +our resident PUI experts. He fixed the \"has never worked before\" +PGP code in package-get, added the balloon-help to PUI, and a few +other package related enhancements/fixes.\n")) )) ;; Setup the buffer for a maintainer. Index: lisp/autoload.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/autoload.el,v retrieving revision 1.14 retrieving revision 1.17 diff -u -r1.14 -r1.17 --- lisp/autoload.el 11 Oct 2002 14:10:01 -0000 1.14 +++ lisp/autoload.el 15 Feb 2003 00:31:58 -0000 1.17 @@ -1,8 +1,8 @@ -;;; autoload.el --- maintain autoloads in loaddefs.el. +;;; autoload.el --- maintain autoloads in auto-autoloads files. ;; Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. -;; Copyright (C) 1996, 2000, 2002 Ben Wing. +;; Copyright (C) 1996, 2000, 2002, 2003 Ben Wing. ;; Author: Roland McGrath ;; Keywords: maint @@ -28,19 +28,194 @@ ;;; Commentary: -;; This code helps XEmacs maintainers keep the loaddefs.el file up to -;; date. It interprets magic cookies of the form ";;;###autoload" in -;; lisp source files in various useful ways. To learn more, read the -;; source; if you're going to use this, you'd better be able to. +;; This code keeps auto-autoloads.el files up to date. It interprets +;; magic cookies (of the form ";;;###autoload" in Lisp source files +;; and "/* ###autoload */" in C source files) in various useful ways. + +;; Usage +;; ===== + +;; Recommended usage for this library, as implemented in the core +;; build process, is + +;; xemacs -no-packages -batch \ +;; -eval "(setq generated-autoload-file \"PATH\")" \ +;; -l autoload -f autoload-update-directory-autoloads PREFIX DIRECTORY + +;; which causes XEmacs to update the file named by PATH from the .el +;; files in DIRECTORY (but not recursing into subdirectories) and (if +;; the autoload file is not already protected with a feature test) add +;; a check and provide for 'PREFIX-autoloads. Currently there is no +;; sanity check for the provided feature; it is recommended that you +;; nuke any existing auto-autoloads.el before running the command. + +;; There is not yet a recommended API for updating multiple directories +;; into a single auto-autoloads file. Using the recipe above for each +;; DIRECTORY with the same PATH should work but has not been tested. +;; There is no API for recursing into subdirectories. There probably +;; won't be; given the wide variety of ways that existing Lisp packages +;; arrange their files, and the fact that source packages and installed +;; packages have a somewhat different directory structure, this seems far +;; too risky. Use a script or a Lisp library with an explicit list of +;; PATHs; see update-elc.el for how to do this without recursive invocation +;; of XEmacs). + +;; The probable next step is to fix up the packages to use the +;; `autoload-update-directory-autoloads' API. However, for backward +;; compatibility with XEmacs 21.4 and 21.1, this can't be done quickly. + +;; For now the API used in update-elc-2.el: + +;; (let* ((dir "DIRECTORY") +;; (generated-autoload-file (expand-file-name "auto-autoloads.el" dir)) +;; (autoload-package-name "PREFIX")) +;; (update-autoload-files (list muledir)) +;; (byte-recompile-file generated-autoload-file 0)) + +;; is available, but this ugly kludge is deprecated. It will be removed +;; in favor of using proper arguments instead of special variables. + +;; For backward compatibility the API used in the packages/XEmacs.rules: + +;; xemacs -vanilla -batch -eval "$(AUTOLOAD_PACKAGE_NAME)" \ +;; -l autoload -f batch-update-directory $(AUTOLOAD_PATH) + +;; is supported, and the implementation is unchanged. However, +;; revision of the API (in a backward compatible way) and the +;; implementation are planned, and until those stabilize it is too +;; risky to use this version of XEmacs for package releases. + +;; Implementation: +;; =============== + +;; #### This section should be moved to the Internals manual, or +;; (maybe) the Lispref, and integrated with the information above. +;; Don't believe anything written here; the code is still a mess, and +;; this is a lot of guesswork. + +;; Autoloads are used in a number of contexts, including core Lisp, +;; packaged Lisp, and ELLs (dynamically loadable compiled objects +;; providing Lisp functionality). There two general strategies for +;; collecting autoloads. The first is to put autoloads for a package +;; in a package-specific auto-autoloads file. This is easy to +;; implement, and allows packages to be distributed with prebuilt +;; auto-autoloads files. The second is to collect all the autoloads +;; in a single global auto-autoloads file. This is alleged to speed +;; up initialization significantly, but requires care to ensure that +;; auto-autoloads files remain synchronized with the libraries. + +;; The traditional logic for determining where to put autoload +;; definitions is complex and is now deprecated. The special variable +;; `generated-autoload-file' is used to hold the path to the file, and +;; is initialized to the traditional (well, it's a new tradition with +;; XEmacs 20) $blddir/lisp/auto-autoloads.el. However, this variable +;; may be bound by calling code, or may be generated at collect time +;; and I'm not even sure the initialized value was ever used any more. + +;; Because there may be multiple auto-autoloads files in use (in XEmacs +;; 21.x with a full complement of packages there are dozens), and they may +;; contain initializations that would be dangerous to reexecute, each is +;; protected by a feature test. By convention, the feature symbol is of +;; the form "NAME-autoloads". For packages, the special variable +;; `autoload-package-name' is used to determine NAME. In the core, +;; autoloads are defined in the modules (all of which are collected in a +;; single auto-autoloads file), using NAME=modules, in the lisp directory +;; using NAME=lisp, and in the lisp/mule directory, using NAME=mule, for +;; the autoloads feature. These latter are computed by the autoloads +;; function at collect time. ;; ChangeLog: -;; Jun-25-2002: Jerry James added code for processing C files, to -;; support modularization -;; Sep-26-1997: slb removed code dealing with customization. +;; See ./ChangeLog. ;;; Code: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard file and directory names + +;; `autoload-file-name' is defvar'd and initialized in packages.el, +;; which is loaded (and dumped) very early. If you find it isn't, you +;; know what you're doing. + +(defconst autoload-target-directory "../lisp/" + "Standard directory containing autoload declaration file. + +Use `generated-autoload-file' (q.v.) to change its installation location.") + +;; Dynamic variables for communication among functions + +(defvar generated-autoload-file + (expand-file-name autoload-file-name lisp-directory) + "*File `update-file-autoloads' puts autoloads into. +A .el file can set this in its local variables section to make its +autoloads go somewhere else. + +Note that `batch-update-directory' binds this variable to its own value, +generally the file named by `autoload-file-name' in the directory being +updated. XEmacs.rules setq's this variable for package autoloads.") + +(define-obsolete-variable-alias 'autoload-package-name + 'autoload-feature-prefix) +(defvar autoload-feature-prefix nil + "If non-nil, use this string to prefix the autoload feature name. + +Usually a package name (from AUTOLOAD_PACKAGE_NAME, defined in XEmacs.rules +in the top of the package hierarchy), or \"auto\" (reserved for the core Lisp +auto-autoloads file). Highest priority candidate except for an explicit +argument to `autoload-make-feature-name' (q.v.).") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Magic strings in source files + +(defconst generate-autoload-cookie ";;;###autoload" + "Magic comment indicating the following form should be autoloaded. +Used by `update-file-autoloads'. This string should be +meaningless to Lisp (e.g., a comment). + +This string is used: + +;;;###autoload +\(defun function-to-be-autoloaded () ...) + +If this string appears alone on a line, the following form will be +read and an autoload made for it. If it is followed by the string +\"immediate\", then the form on the following line will be copied +verbatim. If there is further text on the line, that text will be +copied verbatim to `generated-autoload-file'.") + +(defconst generate-c-autoload-cookie "/* ###autoload" + "Magic C comment indicating the following form should be autoloaded. +Used by `update-file-autoloads'. This string should be +meaningless to C (e.g., a comment). + +This string is used: + +/* ###autoload */ +DEFUN (\"function-to-be-autoloaded\", ... ) + +If this string appears alone on a line, the following form will be +read and an autoload made for it. If there is further text on the line, +that text will be copied verbatim to `generated-autoload-file'.") + +(defconst generate-c-autoload-module "/* ###module" + "Magic C comment indicating the module containing autoloaded functions. +Since a module can consist of multiple C files, the module name may not be +the same as the C source file base name. In that case, use this comment to +indicate the actual name of the module from which to autoload functions.") + +(defconst generate-autoload-section-header "\f\n;;;### " + "String inserted before the form identifying +the section of autoloads for a file.") + +(defconst generate-autoload-section-trailer "\n;;;***\n" + "String which indicates the end of the section of autoloads for a file.") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Parsing the source file text. +;; Autoloads in C source differ from those in Lisp source. For historical +;; reasons, functions handling only Lisp don't have "lisp" in their names; +;; maybe this should be changed. + (defun make-autoload (form file) "Turn a definition generator FORM into an autoload for source file FILE. Returns nil if FORM is not a defun, defun*, defmacro, defmacro*, @@ -104,118 +279,46 @@ (list 'autoload (list 'quote func-name) module (buffer-substring begin (point)) interact nil)))) -(defvar generate-autoload-cookie ";;;###autoload" - "Magic comment indicating the following form should be autoloaded. -Used by `update-file-autoloads'. This string should be -meaningless to Lisp (e.g., a comment). - -This string is used: - -;;;###autoload -\(defun function-to-be-autoloaded () ...) - -If this string appears alone on a line, the following form will be -read and an autoload made for it. If it is followed by the string -\"immediate\", then the form on the following line will be copied -verbatim. If there is further text on the line, that text will be -copied verbatim to `generated-autoload-file'.") - -(defvar generate-c-autoload-cookie "/* ###autoload" - "Magic C comment indicating the following form should be autoloaded. -Used by `update-file-autoloads'. This string should be -meaningless to C (e.g., a comment). - -This string is used: - -/* ###autoload */ -DEFUN (\"function-to-be-autoloaded\", ... ) - -If this string appears alone on a line, the following form will be -read and an autoload made for it. If there is further text on the line, -that text will be copied verbatim to `generated-autoload-file'.") - -(defvar generate-c-autoload-module "/* ###module" - "Magic C comment indicating the module containing autoloaded functions. -Since a module can consist of multiple C files, the module name may not be -the same as the C source file base name. In that case, use this comment to -indicate the actual name of the module from which to autoload functions.") - -(defvar generate-autoload-section-header "\f\n;;;### " - "String inserted before the form identifying -the section of autoloads for a file.") - -(defvar generate-autoload-section-trailer "\n;;;***\n" - "String which indicates the end of the section of autoloads for a file.") - -(defvar autoload-package-name nil) - -;;; Forms which have doc-strings which should be printed specially. -;;; A doc-string-elt property of ELT says that (nth ELT FORM) is -;;; the doc-string in FORM. -;;; -;;; There used to be the following note here: -;;; ;;; Note: defconst and defvar should NOT be marked in this way. -;;; ;;; We don't want to produce defconsts and defvars that -;;; ;;; make-docfile can grok, because then it would grok them twice, -;;; ;;; once in foo.el (where they are given with ;;;###autoload) and -;;; ;;; once in loaddefs.el. -;;; -;;; Counter-note: Yes, they should be marked in this way. -;;; make-docfile only processes those files that are loaded into the -;;; dumped Emacs, and those files should never have anything -;;; autoloaded here. The above-feared problem only occurs with files -;;; which have autoloaded entries *and* are processed by make-docfile; -;;; there should be no such files. - -(put 'autoload 'doc-string-elt 3) -(put 'defun 'doc-string-elt 3) -(put 'defun* 'doc-string-elt 3) -(put 'defvar 'doc-string-elt 3) -(put 'defconst 'doc-string-elt 3) -(put 'defmacro 'doc-string-elt 3) -(put 'defmacro* 'doc-string-elt 3) -(put 'define-skeleton 'doc-string-elt 3) -(put 'define-derived-mode 'doc-string-elt 4) - -(defun autoload-trim-file-name (file) - "Returns a relative pathname of FILE including the last directory." - (setq file (expand-file-name file)) - (replace-in-string - (file-relative-name file (file-name-directory - (directory-file-name - (file-name-directory file)))) - "\\\\" "/")) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Generating autoloads for a single file ;;;###autoload (defun generate-file-autoloads (file &optional funlist) - "Insert at point a loaddefs autoload section for FILE. + "Insert at point an autoload section for FILE. autoloads are generated for defuns and defmacros in FILE marked by `generate-autoload-cookie' (which see). If FILE is being visited in a buffer, the contents of the buffer are used." (interactive "fGenerate autoloads for file: ") - (if (string-match "\\.el$" file) - (generate-file-autoloads-1 file funlist) - (generate-c-file-autoloads-1 file funlist))) - -(defun* generate-file-autoloads-1 (file funlist) - "Insert at point a loaddefs autoload section for FILE. -autoloads are generated for defuns and defmacros in FILE -marked by `generate-autoload-cookie' (which see). -If FILE is being visited in a buffer, the contents of the buffer -are used." + (cond ((string-match "\\.el$" file) + (generate-autoload-ish-1 + file + (replace-in-string (file-name-nondirectory file) "\\.elc?$" "") + nil #'generate-file-autoloads-1 + funlist)) + ;; #### jj, are C++ modules possible? + ((string-match "\\.c$" file) + (generate-autoload-ish-1 + file + (replace-in-string (file-name-nondirectory file) "\\.c$" "") + t #'generate-c-file-autoloads-1 + funlist)) + (t + (error 'wrong-type-argument file "not a C or Elisp source file")))) + +(defun* generate-autoload-ish-1 (file load-name literal fun-to-call &rest args) + "Insert at point an autoload-type section for FILE. +If LITERAL, open the file literally, without decoding. +Calls FUN-TO-CALL to compute the autoloads, passing it OUTBUF, LOAD-NAME, + TRIM-NAME, and ARGS." (let ((outbuf (current-buffer)) - (autoloads-done '()) - (load-name (replace-in-string (file-name-nondirectory file) - "\\.elc?$" - "")) (trim-name (autoload-trim-file-name file)) - (dofiles (not (null funlist))) + (autoloads-done '()) (print-length nil) (print-readably t) ; XEmacs (float-output-format nil) - ;; (done-any nil) (visited (get-file-buffer file)) + ;; (done-any nil) output-end) ;; If the autoload section we create here uses an absolute @@ -232,74 +335,19 @@ (progn (let ((find-file-hooks nil) (enable-local-variables nil)) - (set-buffer (or visited (find-file-noselect file))) + (set-buffer (or visited (find-file-noselect file literal literal + ))) + ;; This doesn't look right for C files, but it is. The only + ;; place we need the syntax table is when snarfing the Lisp + ;; function name. (set-syntax-table emacs-lisp-mode-syntax-table)) - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (unless (search-forward generate-autoload-cookie nil t) - (message "No autoloads found in %s" trim-name) - (return-from generate-file-autoloads-1)) - - (message "Generating autoloads for %s..." trim-name) - (goto-char (point-min)) - (while (if dofiles funlist (not (eobp))) - (if (not dofiles) - (skip-chars-forward " \t\n\f") - (goto-char (point-min)) - (re-search-forward - (concat "(def\\(un\\|var\\|const\\|macro\\) " - (regexp-quote (symbol-name (car funlist))) - "\\s ")) - (goto-char (match-beginning 0))) - (cond - ((or dofiles - (looking-at (regexp-quote generate-autoload-cookie))) - (if dofiles - nil - (search-forward generate-autoload-cookie) - (skip-chars-forward " \t")) - ;; (setq done-any t) - (if (or dofiles (eolp)) - ;; Read the next form and make an autoload. - (let* ((form (prog1 (read (current-buffer)) - (or (bolp) (forward-line 1)))) - (autoload (make-autoload form load-name)) - (doc-string-elt (get (car-safe form) - 'doc-string-elt))) - (if autoload - (setq autoloads-done (cons (nth 1 form) - autoloads-done)) - (setq autoload form)) - (print-autoload autoload doc-string-elt outbuf "")) - ;; Copy the rest of the line to the output. - (let ((begin (point))) - ;; (terpri outbuf) - (cond ((looking-at "immediate\\s *$") ; XEmacs - ;; This is here so that you can automatically - ;; have small hook functions copied to - ;; loaddefs.el so that it's not necessary to - ;; load a whole file just to get a two-line - ;; do-nothing find-file-hook... --Stig - (forward-line 1) - (setq begin (point)) - (forward-sexp) - (forward-line 1)) - (t - (forward-line 1))) - (princ (buffer-substring begin (point)) outbuf)))) - ((looking-at ";") - ;; Don't read the comment. - (forward-line 1)) - (t - (forward-sexp 1) - (forward-line 1))) - (if dofiles - (setq funlist (cdr funlist))))))) + (unless (setq autoloads-done + (apply fun-to-call outbuf load-name trim-name args)) + (return-from generate-autoload-ish-1)) + ) (unless visited - ;; We created this buffer, so we should kill it. - (kill-buffer (current-buffer))) + ;; We created this buffer, so we should kill it. + (kill-buffer (current-buffer))) (set-buffer outbuf) (setq output-end (point-marker)))) (if t ;; done-any @@ -312,7 +360,7 @@ (terpri outbuf) ;;;; (insert ";;; Generated autoloads from " ;;;; (autoload-trim-file-name file) "\n") - ;; Warn if we put a line in loaddefs.el + ;; Warn if we put a line in auto-autoloads.el ;; that is long enough to cause trouble. (when (< output-end (point)) (setq output-end (point-marker))) @@ -332,119 +380,155 @@ (or noninteractive ; XEmacs: only need one line in -batch mode. (message "Generating autoloads for %s...done" file)))) -(defun* generate-c-file-autoloads-1 (file funlist) - "Insert at point a loaddefs autoload section for the C file FILE. +(defun* generate-file-autoloads-1 (outbuf load-name trim-name funlist) + "Insert at point an autoload section for FILE. +autoloads are generated for defuns and defmacros in FILE +marked by `generate-autoload-cookie' (which see). +If FILE is being visited in a buffer, the contents of the buffer +are used." + (let ((autoloads-done '()) + (dofiles (not (null funlist))) + ) + + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (unless (search-forward generate-autoload-cookie nil t) + (message "No autoloads found in %s" trim-name) + (return-from generate-file-autoloads-1 nil)) + + (message "Generating autoloads for %s..." trim-name) + (goto-char (point-min)) + (while (if dofiles funlist (not (eobp))) + (if (not dofiles) + (skip-chars-forward " \t\n\f") + (goto-char (point-min)) + (re-search-forward + (concat "(def\\(un\\|var\\|const\\|macro\\) " + (regexp-quote (symbol-name (car funlist))) + "\\s ")) + (goto-char (match-beginning 0))) + (cond + ((or dofiles + (looking-at (regexp-quote generate-autoload-cookie))) + (if dofiles + nil + (search-forward generate-autoload-cookie) + (skip-chars-forward " \t")) + ;; (setq done-any t) + (if (or dofiles (eolp)) + ;; Read the next form and make an autoload. + (let* ((form (prog1 (read (current-buffer)) + (or (bolp) (forward-line 1)))) + (autoload (make-autoload form load-name)) + (doc-string-elt (get (car-safe form) + 'doc-string-elt))) + (if autoload + (setq autoloads-done (cons (nth 1 form) + autoloads-done)) + (setq autoload form)) + (print-autoload autoload doc-string-elt outbuf "")) + ;; Copy the rest of the line to the output. + (let ((begin (point))) + ;; (terpri outbuf) + (cond ((looking-at "immediate\\s *$") ; XEmacs + ;; This is here so that you can automatically + ;; have small hook functions copied to + ;; auto-autoloads.el so that it's not necessary + ;; to load a whole file just to get a two-line + ;; do-nothing find-file-hook... --Stig + (forward-line 1) + (setq begin (point)) + (forward-sexp) + (forward-line 1)) + (t + (forward-line 1))) + (princ (buffer-substring begin (point)) outbuf)))) + ((looking-at ";") + ;; Don't read the comment. + (forward-line 1)) + (t + (forward-sexp 1) + (forward-line 1))) + (if dofiles + (setq funlist (cdr funlist)))))) + autoloads-done)) + +(defun* generate-c-file-autoloads-1 (outbuf load-name trim-name funlist) + "Insert at point an autoload section for the C file FILE. autoloads are generated for defuns and defmacros in FILE marked by `generate-c-autoload-cookie' (which see). If FILE is being visited in a buffer, the contents of the buffer are used." - (let ((outbuf (current-buffer)) + (let ((exists-p-format + "(file-exists-p (expand-file-name \"%s.%s\" module-directory))") (autoloads-done '()) - (load-name (replace-in-string (file-name-nondirectory file) - "\\.c?$" - "")) - (trim-name (autoload-trim-file-name file)) - (print-length nil) - (print-readably t) - (float-output-format nil) - ;; (done-any nil) - (visited (get-file-buffer file)) - output-end) - - ;; If the autoload section we create here uses an absolute - ;; pathname for FILE in its header, and then Emacs is installed - ;; under a different path on another system, - ;; `update-autoloads-here' won't be able to find the files to be - ;; autoloaded. So, if FILE is in the same directory or a - ;; subdirectory of the current buffer's directory, we'll make it - ;; relative to the current buffer's directory. - (setq file (expand-file-name file)) + ) (save-excursion - (unwind-protect - (progn - (let ((find-file-hooks nil) - (enable-local-variables nil)) - (set-buffer (or visited (find-file-noselect file t t))) - ;; This doesn't look right, but it is. The only place we need - ;; the syntax table is when snarfing the Lisp function name. - (set-syntax-table emacs-lisp-mode-syntax-table)) - (save-excursion - (save-restriction - (widen) + (save-restriction + (widen) + (goto-char (point-min)) + ;; Is there a module name comment? + (when (search-forward generate-c-autoload-module nil t) + (skip-chars-forward " \t") + (let ((begin (point))) + (skip-chars-forward "^ \t\n\f") + (setq load-name (buffer-substring begin (point))))) + (if funlist + (progn + (message "Generating autoloads for %s..." trim-name) + (princ "(when (or\n " outbuf) + (princ (format exists-p-format load-name "ell") outbuf) + (princ "\n " outbuf) + (princ (format exists-p-format load-name "dll") outbuf) + (princ "\n " outbuf) + (princ (format exists-p-format load-name "so") outbuf) + ;; close the princ'd `or' form + (princ ")\n " outbuf) + (dolist (arg funlist) (goto-char (point-min)) - ;; Is there a module name comment? - (when (search-forward generate-c-autoload-module nil t) - (skip-chars-forward " \t") - (let ((begin (point))) - (skip-chars-forward "^ \t\n\f") - (setq load-name (buffer-substring begin (point))))) - (if funlist - (progn - (message "Generating autoloads for %s..." trim-name) - (princ "(when (or\n" outbuf) - (princ (format - " (file-exists-p (expand-file-name \"%s.ell\" module-directory))\n" - load-name) outbuf) - (princ (format - " (file-exists-p (expand-file-name \"%s.dll\" module-directory))\n" - load-name) outbuf) - (princ (format - " (file-exists-p (expand-file-name \"%s.so\" module-directory)))\n" - load-name) outbuf) - (dolist (arg funlist) - (goto-char (point-min)) - (re-search-forward - (concat "DEFUN (\"" - (regexp-quote (symbol-name arg)) - "\"")) - (goto-char (match-beginning 0)) - (let ((autoload (make-c-autoload load-name))) - (when autoload - (push (nth 1 (nth 1 autoload)) autoloads-done) - (print-autoload autoload 3 outbuf " ")))) - (princ ")" outbuf)) - (goto-char (point-min)) - (let ((match - (search-forward generate-c-autoload-cookie nil t))) - (unless match - (message "No autoloads found in %s" trim-name) - (return-from generate-c-file-autoloads-1)) - - (message "Generating autoloads for %s..." trim-name) - (princ "(when (or\n" outbuf) - (princ (format - " (file-exists-p (expand-file-name \"%s.ell\" module-directory))\n" - load-name) outbuf) - (princ (format - " (file-exists-p (expand-file-name \"%s.dll\" module-directory))\n" - load-name) outbuf) - (princ (format - " (file-exists-p (expand-file-name \"%s.so\" module-directory)))\n" - load-name) outbuf) - (while match - (forward-line 1) - (let ((autoload (make-c-autoload load-name))) - (when autoload - (push (nth 1 (nth 1 autoload)) autoloads-done) - (print-autoload autoload 3 outbuf " "))) - (setq match - (search-forward generate-c-autoload-cookie nil t))) - (princ ")" outbuf)))))) - (unless visited - ;; We created this buffer, so we should kill it. - (kill-buffer (current-buffer))) - (set-buffer outbuf) - (setq output-end (point-marker)))) - (insert generate-autoload-section-header) - (prin1 (list 'autoloads autoloads-done load-name trim-name) outbuf) - (terpri outbuf) - (when (< output-end (point)) - (setq output-end (point-marker))) - (goto-char output-end) - (insert generate-autoload-section-trailer) - (or noninteractive ; XEmacs: only need one line in -batch mode. - (message "Generating autoloads for %s...done" trim-name)))) + (re-search-forward + (concat "DEFUN (\"" + (regexp-quote (symbol-name arg)) + "\"")) + (goto-char (match-beginning 0)) + (let ((autoload (make-c-autoload load-name))) + (when autoload + (push (nth 1 (nth 1 autoload)) autoloads-done) + (print-autoload autoload 3 outbuf " ")))) + ;; close the princ'd `when' form + (princ ")" outbuf)) + (goto-char (point-min)) + (let ((match + (search-forward generate-c-autoload-cookie nil t))) + (unless match + (message "No autoloads found in %s" trim-name) + (return-from generate-c-file-autoloads-1 nil)) + + (message "Generating autoloads for %s..." trim-name) + (princ "(when (or\n " outbuf) + (princ (format exists-p-format load-name "ell") outbuf) + (princ "\n " outbuf) + (princ (format exists-p-format load-name "dll") outbuf) + (princ "\n " outbuf) + (princ (format exists-p-format load-name "so") outbuf) + ;; close the princ'd `or' form + (princ ")\n " outbuf) + (while match + (forward-line 1) + (let ((autoload (make-c-autoload load-name))) + (when autoload + (push (nth 1 (nth 1 autoload)) autoloads-done) + (print-autoload autoload 3 outbuf " "))) + (setq match + (search-forward generate-c-autoload-cookie nil t))) + ;; close the princ'd `when' form + (princ ")" outbuf))))) + autoloads-done)) + +;; Assorted utilities for generating autoloads and pieces thereof (defun print-autoload (autoload doc-string-elt outbuf margin) "Print an autoload form, handling special characters. @@ -514,36 +598,45 @@ (insert "\\^L"))) (goto-char p2))))) - -(defconst autoload-file-name "auto-autoloads.el" - "Generic filename to put autoloads into. -Unless you are an XEmacs maintainer, it is probably unwise to change this.") - -(defvar autoload-target-directory "../lisp/" - "Directory to put autoload declaration file into. -Unless you know what you're doing, don't mess with this.") +;;; Forms which have doc-strings which should be printed specially. +;;; A doc-string-elt property of ELT says that (nth ELT FORM) is +;;; the doc-string in FORM. +;;; +;;; defvar and defconst should be also be marked in this way. There is +;;; no interference from make-docfile, which only processes those files +;;; that are loaded into the dumped Emacs, and those files should +;;; never have anything autoloaded here. Problems only occur with files +;;; which have autoloaded entries *and* are processed by make-docfile; +;;; there should be no such files. -(defvar generated-autoload-file - (expand-file-name (concat autoload-target-directory - autoload-file-name) - data-directory) - "*File `update-file-autoloads' puts autoloads into. -A .el file can set this in its local variables section to make its -autoloads go somewhere else. +(put 'autoload 'doc-string-elt 3) +(put 'defun 'doc-string-elt 3) +(put 'defun* 'doc-string-elt 3) +(put 'defvar 'doc-string-elt 3) +(put 'defconst 'doc-string-elt 3) +(put 'defmacro 'doc-string-elt 3) +(put 'defmacro* 'doc-string-elt 3) +(put 'define-skeleton 'doc-string-elt 3) +(put 'define-derived-mode 'doc-string-elt 4) -Note that `batch-update-directory' binds this variable to its own value, -generally the file named `autoload-file-name' in the directory being -updated.") +(defun autoload-trim-file-name (file) + "Returns relative pathname of FILE including the last directory. -(defconst cusload-file-name "custom-load.el" - "Generic filename to put custom loads into. -Unless you are an XEmacs maintainer, it is probably unwise to change this.") +Hard-codes the directory separator as a forward slash." + (setq file (expand-file-name file)) + (replace-in-string + (file-relative-name file (file-name-directory + (directory-file-name + (file-name-directory file)))) + ;; #### is this a good idea? + "\\\\" "/")) ;;;###autoload (defun update-file-autoloads (file) "Update the autoloads for FILE in `generated-autoload-file' \(which FILE might bind in its local variables). -This function refuses to update autoloads files." +This function is a no-op for an autoloads file (ie, a file whose name is +equal to `autoload-file-name')." (interactive "fUpdate autoloads for file: ") (setq file (expand-file-name file)) (when (and (file-newer-than-file-p file generated-autoload-file) @@ -638,6 +731,78 @@ (if (stringp file) (generate-file-autoloads file))))))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Utilities for batch updates + +;;;###autoload +(defun autoload-update-directory-autoloads () + "Update the autoloads for a directory, using a specified feature prefix. +Must be used only with -batch. The feature prefix and directory to update +are taken from the first and second elements of `command-line-args-left', +respectively, and they are then removed from `command-line-args-left'. + +Runs `update-file-autoloads' on each file in the given directory. Always +rewrites the autoloads file, even if unchanged. Makes a feature name by +applying `autoload-make-feature-name' to the specified feature prefix. + +#### The API and semantics of this function are subject to change." + (unless noninteractive + (error "autoload-batch-update-autoloads: may be used only with -batch")) + (let* ((autoload-feature-prefix (car command-line-args-left)) + (dir (cadr command-line-args-left)) + (generated-autoload-file (expand-file-name autoload-file-name dir))) + (update-autoload-files (list dir) t t) + (setq command-line-args-left (cddr command-line-args-left)))) + +;;;###autoload +(defun update-autoload-files (files-or-dirs &optional all-into-one-file force) + "Update all the autoload files associated with FILES-OR-DIRS. +FILES-OR-DIRS is a list of files and/or directories to be processed. + +An appropriate autoload file is chosen and a feature constructed for +each element of FILES-OR-DIRS. Fixup code testing for the autoload file's +feature and to provide the feature is added. + +If optional ALL-INTO-ONE-FILE is non-`nil', `generated-autoload-file' +should be set to the name of an autoload file and all autoloads will be +placed in that file. `autoload-feature-prefix' should be set to an +appropriate prefix which will be concatenated with \"-autoloads\" to +produce the feature name. Otherwise the appropriate autoload file for +each file or directory (located in that directory, or in the directory of +the specified file) will be updated with the directory's or file's +autoloads and the protective forms will be added, and the files will be +saved. Use of the default here is unreliable, and therefore deprecated. + +Note that if some of FILES-OR-DIRS are directories, recursion goes only +one level deep. + +If FORCE is non-nil, always save out the autoload files even if unchanged." + (let ((defdir (directory-file-name default-directory)) + ;; value for all-into-one-file + (autoload-feature-name (autoload-make-feature-name)) + (enable-local-eval nil)) ; Don't query in batch mode. + (dolist (arg files-or-dirs) + (setq arg (expand-file-name arg defdir)) + (cond + ((file-directory-p arg) + (message "Updating autoloads for directory %s..." arg) + (update-autoloads-from-directory arg)) + ((file-exists-p arg) + (update-file-autoloads arg)) + (t (error "No such file or directory: %s" arg))) + (when (not all-into-one-file) + (autoload-featurep-protect-autoloads + (autoload-make-feature-name + (file-name-nondirectory (directory-file-name arg)))) + (if force (set-buffer-modified-p + t (find-file-noselect generated-autoload-file))))) + (when all-into-one-file + (autoload-featurep-protect-autoloads autoload-feature-name) + (if force (set-buffer-modified-p + t (find-file-noselect generated-autoload-file)))) + (save-some-buffers t) + )) + ;;;###autoload (defun update-autoloads-from-directory (dir) "Update `generated-autoload-file' with all the current autoloads from DIR. @@ -652,7 +817,7 @@ (setq dir (expand-file-name dir)) (let ((simple-dir (file-name-as-directory (file-name-nondirectory - (directory-file-name dir)))) + (directory-file-name dir)))) (enable-local-eval nil)) (save-excursion (let ((find-file-hooks nil)) @@ -678,7 +843,7 @@ (unless noninteractive (save-buffer))))) -(defun fixup-autoload-buffer (sym) +(defun autoload-featurep-protect-autoloads (sym) (save-excursion (set-buffer (find-file-noselect generated-autoload-file)) (goto-char (point-min)) @@ -691,61 +856,45 @@ (goto-char (point-max)) (insert "\n(provide '" sym ")\n"))))) -(defvar autoload-package-name nil) +(defun autoload-make-feature-name (&optional prefix) + "Generate the feature name to protect this auto-autoloads file from PREFIX. -;;;###autoload -(defun update-autoload-files (files-or-dirs &optional all-into-one-file force) - "Update all the autoload files associated with FILES-OR-DIRS. -FILES-OR-DIRS should be a list of files or directories to be -processed. If ALL-INTO-ONE-FILE is not given, the appropriate -autoload file for each file or directory (located in that directory, -or in the directory of the specified file) will be updated with the -directory's or file's autoloads, some additional fixup text will be -added, and the files will be saved. If ALL-INTO-ONE-FILE is given, -`generated-autoload-file' should be set to the name of the autoload -file into which the autoloads will be generated, and the autoloads -for all files and directories will go into that same file. +If PREFIX is nil, it defaults to the value of `autoload-feature-prefix' if +that is non-nil. -If FORCE is non-nil, always save out the autoload files even if unchanged." - (let ((defdir (directory-file-name default-directory)) - (enable-local-eval nil)) ; Don't query in batch mode. - ;; (message "Updating autoloads in %s..." generated-autoload-file) - (dolist (arg files-or-dirs) - (setq arg (expand-file-name arg defdir)) - (let ((generated-autoload-file - (if all-into-one-file generated-autoload-file - (expand-file-name autoload-file-name - (if (file-directory-p arg) arg - (file-name-directory arg)))))) - (cond - ((file-directory-p arg) - (message "Updating autoloads for directory %s..." arg) - (update-autoloads-from-directory arg)) - ((file-exists-p arg) - (update-file-autoloads arg)) - (t (error "No such file or directory: %s" arg))) - (when (not all-into-one-file) - (fixup-autoload-buffer (concat (if autoload-package-name - autoload-package-name - (file-name-nondirectory defdir)) - "-autoloads")) - (if force (set-buffer-modified-p - t (find-file-noselect generated-autoload-file)))))) - (when all-into-one-file - (fixup-autoload-buffer (concat (if autoload-package-name - autoload-package-name - (file-name-nondirectory defdir)) - "-autoloads")) - (if force (set-buffer-modified-p - t (find-file-noselect generated-autoload-file)))) - (save-some-buffers t) - ;; (message "Done") - )) +The feature name must be globally unique for this version of XEmacs, +including packages. + +For backward compatibility, if PREFIX and `autoload-feature-prefix' are both +`nil', PREFIX is computed as the last directory component of +`generated-autoload-file'. This is likely to result in non-uniqueness, so +do not use this feature." + (concat + (cond (prefix) + (autoload-feature-prefix) + ((stringp generated-autoload-file) + (message "Warning: autoload computing feature prefix. +You should specify it as an argument to `autoload-make-feature-name'.") + (file-name-nondirectory + (directory-file-name + (file-name-directory generated-autoload-file)))) + (t (error 'invalid-argument + "Could not compute a feature name"))) + "-autoloads")) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Deprecated entry points + +;; A grep of the core and packages shows use of `batch-update-autoloads' +;; by XEmacs.rules, pcomplete, eshell, oort-gnus; `batch-update-directory' +;; by liece. ;; #### these entry points below are a big mess, especially the ;; first two. there don't seem to be very many packages that use the ;; first one (the "all-into-one-file" variety), and do they actually ;; rely on this functionality? --ben +;; but XEmacs.rules does, though maybe it doesn't "rely" on it, and +;; modules do now, and that relies on it. --sjt ;;;###autoload (defun batch-update-autoloads () @@ -765,7 +914,9 @@ (defun batch-update-directory () "Update the autoloads for the directories on the command line. Runs `update-file-autoloads' on each file in the given directory, and must -be used only with -batch." +be used only with -batch. + +Uses and removes the first element of `command-line-args-left'." (unless noninteractive (error "batch-update-directory is to be used only with -batch")) (update-autoload-files command-line-args-left) @@ -778,7 +929,7 @@ Runs `update-file-autoloads' on each file in the given directory, and must be used only with -batch." (unless noninteractive - (error "batch-update-directory is to be used only with -batch")) + (error "batch-update-one-directory is to be used only with -batch")) (let ((arg (car command-line-args-left))) (setq command-line-args-left (cdr command-line-args-left)) (update-autoload-files (list arg)))) @@ -787,13 +938,28 @@ (defun batch-force-update-one-directory () "Update the autoloads for a single directory on the command line. Runs `update-file-autoloads' on each file in the given directory, and must -be used only with -batch. Always rewrite the autoloads file, even if -unchanged." +be used only with -batch. Always rewrites the autoloads file, even if +unchanged. + +Uses and removes the first element of `command-line-args-left'." (unless noninteractive - (error "batch-update-directory is to be used only with -batch")) + (error "batch-force-update-directory is to be used only with -batch")) (let ((arg (car command-line-args-left))) (setq command-line-args-left (cdr command-line-args-left)) (update-autoload-files (list arg) nil t))) + +;; Declare obsolescence + +(make-obsolete-variable 'autoload-target-directory + "Don't use this. Bind `generated-autoload-file' to an absolute path.") +(make-obsolete 'batch-update-autoloads + 'autoload-update-directory-autoloads) +(make-obsolete 'batch-update-directory + 'autoload-update-directory-autoloads) +(make-obsolete 'batch-update-one-directory + 'autoload-update-directory-autoloads) +(make-obsolete 'batch-force-update-one-directory + 'autoload-update-directory-autoloads) (provide 'autoload) Index: lisp/byte-optimize.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/byte-optimize.el,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- lisp/byte-optimize.el 21 May 2001 02:15:12 -0000 1.9 +++ lisp/byte-optimize.el 14 Feb 2003 11:50:36 -0000 1.10 @@ -24,7 +24,11 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. -;;; Synched up with: FSF 20.7. +;;; Synched up with: FSF 20.7 except where marked. +;;; [[ Synched up with: FSF 20.7. ]] +;;; DO NOT PUT IN AN INVALID SYNC MESSAGE WHEN YOU DO A PARTIAL SYNC. --ben + +;; BEGIN SYNC WITH 20.7. ;;; Commentary: @@ -292,8 +296,10 @@ (compiled-function-constants fn) (compiled-function-stack-depth fn))) (cdr form))) - (if (not (eq (car fn) 'lambda)) (error "%s is not a lambda" name)) - (cons fn (cdr form))))))) + (if (eq (car-safe fn) 'lambda) + (cons fn (cdr form)) + ;; Give up on inlining. + form)))))) ;;; ((lambda ...) ...) ;;; @@ -351,6 +357,7 @@ (byte-compile-warn "attempt to open-code %s with too many arguments" name)) form) + (setq body (mapcar 'byte-optimize-form body)) (let ((newform (if bindings (cons 'let (cons (nreverse bindings) body)) @@ -520,6 +527,14 @@ byte-compile-macro-environment)))) (byte-optimize-form form for-effect)) + ;; Support compiler macros as in cl.el. + ((and (fboundp 'compiler-macroexpand) + (symbolp (car-safe form)) + (get (car-safe form) 'cl-compiler-macro) + (not (eq form + (setq form (compiler-macroexpand form))))) + (byte-optimize-form form for-effect)) + ((not (symbolp fn)) (or (eq 'mocklisp (car-safe fn)) ; ha! (byte-compile-warn "%s is a malformed function" @@ -567,7 +582,8 @@ (progn ;; (if (equal form new) (error "bogus optimizer -- %s" opt)) (byte-compile-log " %s\t==>\t%s" form new) - (byte-optimize-form new for-effect)) + (setq new (byte-optimize-form new for-effect)) + new) form))) @@ -699,6 +715,8 @@ (list (apply fun (nreverse constants))))))))) form)) +;; END SYNC WITH 20.7. + ;;; It is not safe to optimize calls to arithmetic ops with one arg ;;; away entirely (actually, it would be safe if we know the sole arg ;;; is not a marker or if it appears in other arithmetic). @@ -762,6 +780,8 @@ ;; We don't have to check for divide-by-zero because `/' does. (t (byte-optimize-predicate form))))) +;; BEGIN SYNC WITH 20.7. + (defun byte-optimize-logmumble (form) (setq form (byte-optimize-delay-constants-math form 1 (car form))) (byte-optimize-predicate @@ -945,6 +965,8 @@ (byte-optimize-predicate form) (nth 1 form)))) +;; END SYNC WITH 20.7. + ;;; For the byte optimizer, `cond' is just overly sweet syntactic sugar. ;;; So we rewrite (cond ...) in terms of `if' and `or', ;;; which are easier to optimize. @@ -963,6 +985,8 @@ (when (cdr clauses) (list (byte-optimize-cond-1 (cdr clauses)))))) (t (error "malformed cond clause %s" (car clauses))))) +;; BEGIN SYNC WITH 20.7. + (defun byte-optimize-if (form) ;; (if ) ==> ;; (if ) ==> (progn ) @@ -1355,7 +1379,9 @@ tags))))))) ((cond ((eq op 'byte-constant2) (setq op 'byte-constant) t) ((memq op byte-constref-ops))) - (setq tmp (aref constvec offset) + (setq tmp (if (>= offset (length constvec)) + (list 'out-of-range offset) + (aref constvec offset)) offset (if (eq op 'byte-constant) (byte-compile-get-constant tmp) (or (assq tmp byte-compile-variables) @@ -1467,33 +1493,7 @@ ;;; variables. ;(defconst byte-boolean-vars -; '(abbrev-all-caps purify-flag find-file-compare-truenames -; find-file-use-truenames delete-auto-save-files byte-metering-on -; x-seppuku-on-epipe zmacs-regions zmacs-region-active-p -; zmacs-region-stays atomic-extent-goto-char-p -; suppress-early-error-handler-backtrace noninteractive -; inhibit-early-packages inhibit-autoloads debug-paths -; inhibit-site-lisp debug-on-quit debug-on-next-call -; modifier-keys-are-sticky x-allow-sendevents -; mswindows-dynamic-frame-resize focus-follows-mouse -; inhibit-input-event-recording enable-multibyte-characters -; disable-auto-save-when-buffer-shrinks -; allow-deletion-of-last-visible-frame indent-tabs-mode -; load-in-progress load-warn-when-source-newer -; load-warn-when-source-only load-ignore-elc-files -; load-force-doc-strings fail-on-bucky-bit-character-escapes -; popup-menu-titles menubar-show-keybindings completion-ignore-case -; canna-empty-info canna-through-info canna-underline -; canna-inhibit-hankakukana enable-multibyte-characters -; re-short-flag x-handle-non-fully-specified-fonts -; print-escape-newlines print-readably delete-exited-processes -; windowed-process-io visible-bell no-redraw-on-reenter -; cursor-in-echo-area inhibit-warning-display -; column-number-start-at-one parse-sexp-ignore-comments -; words-include-escapes scroll-on-clipped-lines) -; "DEFVAR_BOOL variables. Giving these any non-nil value sets them to t. -;If this does not enumerate all DEFVAR_BOOL variables, the byte-optimizer -;may generate incorrect code.") +; ...) (defun byte-optimize-lapcode (lap &optional for-effect) "Simple peephole optimizer. LAP is both modified and returned." @@ -1954,14 +1954,16 @@ (while rest (setq lap0 (car rest) lap1 (nth 1 rest)) - (case (car lap0) - ((byte-varref byte-varset byte-varbind) - (incf (gethash (cdr lap0) variable-frequency 0)) - (unless (memq (cdr lap0) byte-compile-variables) - (push (cdr lap0) byte-compile-variables))) - ((byte-constant) - (unless (memq (cdr lap0) byte-compile-constants) - (push (cdr lap0) byte-compile-constants)))) + (if (memq (car lap0) byte-constref-ops) + (if (not (eq (car lap0) 'byte-constant)) + (progn + (incf (gethash (cdr lap0) variable-frequency 0)) + (or (memq (cdr lap0) byte-compile-variables) + (setq byte-compile-variables + (cons (cdr lap0) byte-compile-variables)))) + (or (memq (cdr lap0) byte-compile-constants) + (setq byte-compile-constants (cons (cdr lap0) + byte-compile-constants))))) (cond (;; ;; const-C varset-X const-C --> const-C dup varset-X ;; const-C varbind-X const-C --> const-C dup varbind-X @@ -2046,5 +2048,7 @@ byte-optimize-form-code-walker byte-optimize-lapcode)))) nil) + +;; END SYNC WITH 20.7. ;;; byte-optimize.el ends here Index: lisp/cus-dep.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/cus-dep.el,v retrieving revision 1.7 retrieving revision 1.9 diff -u -r1.7 -r1.9 --- lisp/cus-dep.el 12 Apr 2001 18:21:15 -0000 1.7 +++ lisp/cus-dep.el 14 Feb 2003 12:05:07 -0000 1.9 @@ -1,6 +1,7 @@ ;;; cus-dep.el --- Find customization dependencies. ;; ;; Copyright (C) 1997 Free Software Foundation, Inc. +;; Copyright (C) 2003 Ben Wing. ;; ;; Author: Per Abrahamsen , then ;; Richard Stallman , then @@ -76,6 +77,11 @@ ;; files. This is not necessary under FSF (they simply use `put'), ;; since they have only one file with custom dependencies. With the ;; advent of packages, we cannot afford the same luxury. +;; +;; Feb 2003: Added code to speed up building by caching the values we've +;; constructed, and using them instead of scanning a file when custom-load +;; is up-to-date w.r.t. the file. Also use `message' not `princ' to print +;; out messages so nl's are correctly inserted when necessary. --ben ;;; Code: @@ -84,9 +90,13 @@ (require 'widget) (require 'cus-face) +;; #### This and the autoloads file naming variables belong in a separate +;; file to be required here. +;; #### Compare this with the autoloads handling. ;; Don't change this, unless you plan to change the code in ;; cus-start.el, too. (defconst cusload-base-file "custom-load.el") +(defconst cusload-hash-table-marker ";old-cus-dep-hash: ") ;; Be very careful when changing this function. It looks easy to ;; understand, but is in fact very easy to break. Be sure to read and @@ -96,9 +106,11 @@ (setq subdirs (mapcar #'expand-file-name subdirs)) (with-temp-buffer (let ((enable-local-eval nil) - (hash (make-hash-table :test 'eq))) + (hash (make-hash-table :test 'eq)) + (hash-cache (make-hash-table :test 'equal)) + old-hash) (dolist (dir subdirs) - (princ (format "Processing %s\n" dir)) + (message "Processing %s\n" dir) (let ((cusload-file (expand-file-name cusload-base-file dir)) (files (directory-files dir t "\\`[^=].*\\.el\\'"))) ;; A trivial optimization: if no file in the directory is @@ -107,46 +119,77 @@ (dolist (file files t) (when (file-newer-than-file-p file cusload-file) (return nil)))) - (princ "(No changes need to be written)\n") + (message "(No changes need to be written)") + (when (file-exists-p cusload-file) + (let ((buf (find-file-noselect cusload-file))) + (with-current-buffer buf + (goto-char (point-min)) + (when (search-forward cusload-hash-table-marker nil t) + (setq old-hash (read buf)))) + (kill-buffer buf))) ;; Process directory (dolist (file files) - (when (file-exists-p file) - (erase-buffer) - (insert-file-contents file) - (goto-char (point-min)) - (let ((name (file-name-sans-extension - (file-name-nondirectory file)))) - ;; Search for defcustom/defface/defgroup - ;; expressions, and evaluate them. - (while (re-search-forward - "^(defcustom\\|^(defface\\|^(defgroup" - nil t) - (beginning-of-line) - (let ((expr (read (current-buffer)))) - ;; We need to ignore errors here, so that - ;; defcustoms with :set don't bug out. Of - ;; course, their values will not be assigned in - ;; case of errors, but their `custom-group' - ;; properties will by that time be in place, and - ;; that's all we care about. - (ignore-errors - (eval expr)) - ;; Hash the file of the affected symbol. - (setf (gethash (nth 1 expr) hash) name)))))) + (let ((old-cache (if (hash-table-p old-hash) + (gethash file old-hash t) + t))) + (if (and (not (file-newer-than-file-p file cusload-file)) + (not (eq old-cache t))) + (progn + (dolist (c old-cache) + (puthash (car c) (cdr c) hash)) + (puthash file old-cache hash-cache)) + (erase-buffer) + (insert-file-contents file) + (goto-char (point-min)) + (let ((name (file-name-sans-extension + (file-name-nondirectory file))) + cache + (first t)) + ;; Search for defcustom/defface/defgroup + ;; expressions, and evaluate them. + (while (re-search-forward + "^(defcustom\\|^(defface\\|^(defgroup" + nil t) + (when first + (message "Computing custom-loads for %s..." name) + (setq first nil)) + (beginning-of-line) + (let ((expr (read (current-buffer)))) + ;; We need to ignore errors here, so that + ;; defcustoms with :set don't bug out. Of + ;; course, their values will not be assigned in + ;; case of errors, but their `custom-group' + ;; properties will by that time be in place, and + ;; that's all we care about. + (ignore-errors + (eval expr)) + ;; Hash the file of the affected symbol. + (setf (gethash (nth 1 expr) hash) name) + ;; Remember the values computed. + (push (cons (nth 1 expr) name) cache))) + (or cache + (message "No custom-loads for %s" name)) + (puthash file cache hash-cache))) + )) (cond ((zerop (hash-table-count hash)) - (princ "(No customization dependencies") - (when (file-exists-p cusload-file) - (princ (format ", deleting %s" cusload-file)) - (delete-file cusload-file)) - (princ ")\n")) + (if (not (file-exists-p cusload-file)) + (message "(No customization dependencies)") + (message "(No customization dependencies, deleting %s)" + cusload-file) + (delete-file cusload-file))) (t - (princ (format "Generating %s...\n" cusload-base-file)) + (message "Generating %s...\n" cusload-base-file) (with-temp-file cusload-file (insert ";;; " cusload-base-file " --- automatically extracted custom dependencies\n" - "\n;;; Code:\n\n" - "(autoload 'custom-add-loads \"cus-load\")\n\n") + "\n;;; Code:\n\n") + (insert cusload-hash-table-marker) + (let ((print-readably t) + (standard-output (current-buffer))) + (princ hash-cache) + (terpri)) + (insert "(autoload 'custom-add-loads \"cus-load\")\n\n") (mapatoms (lambda (sym) (let ((members (get sym 'custom-group)) Index: lisp/dump-paths.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/dump-paths.el,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- lisp/dump-paths.el 11 Oct 2002 14:10:03 -0000 1.8 +++ lisp/dump-paths.el 22 Jan 2003 20:31:52 -0000 1.9 @@ -31,7 +31,7 @@ ;; 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 user-init-directory +(defun startup-setup-paths (roots data-roots user-init-directory &optional inhibit-packages inhibit-site-lisp debug-paths called-early) @@ -56,18 +56,17 @@ last)) ) (packages-find-packages - roots + data-roots (packages-compute-package-locations user-init-directory))) - (setq early-package-load-path (packages-find-package-load-path - early-packages)) + (setq early-package-load-path (packages-find-package-load-path early-packages)) (setq late-package-load-path (packages-find-package-load-path late-packages)) (setq last-package-load-path (packages-find-package-load-path last-packages)) (if debug-paths (progn - (princ (format "arguments:\nroots: %S\nuser-init-directory: %S\n" - roots user-init-directory) + (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) @@ -185,13 +184,21 @@ (and (getenv "EMACSDEBUGPATHS") t))) (roots (paths-find-emacs-roots invocation-directory - invocation-name))) + invocation-name + #'paths-emacs-root-p)) + (data-roots (paths-find-emacs-roots invocation-directory + invocation-name + #'paths-emacs-data-root-p))) (if debug-paths - (princ (format "XEmacs thinks the roots of its hierarchy are:\n%S\n" - roots) - 'external-debugging-output)) - (startup-setup-paths roots + (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)) Index: lisp/find-paths.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/find-paths.el,v retrieving revision 1.23 retrieving revision 1.25 diff -u -r1.23 -r1.25 --- lisp/find-paths.el 4 Jun 2002 16:45:54 -0000 1.23 +++ lisp/find-paths.el 22 Jan 2003 20:31:52 -0000 1.25 @@ -100,7 +100,7 @@ max-depth paths-no-lisp-directory-regexp)) (defun paths-emacs-root-p (directory) - "Check if DIRECTORY is a plausible installation root for XEmacs." + "Check if DIRECTORY is a plausible installation root." (or ;; installed (paths-file-readable-directory-p (paths-construct-path (list directory @@ -111,9 +111,22 @@ (paths-file-readable-directory-p (paths-construct-path (list directory "lisp"))) (paths-file-readable-directory-p (paths-construct-path (list directory "etc")))))) -(defun paths-root-in-place-p (root) - "Check if ROOT is an in-place installation root for XEmacs." - (paths-file-readable-directory-p (paths-construct-path (list root "lisp")))) +(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." @@ -165,8 +178,7 @@ base)))) (defun paths-find-emacs-directory (roots suffix base - &optional envvar default keep-suffix - in-place-external) + &optional envvar default keep-suffix) "Find a directory in the XEmacs hierarchy. ROOTS must be a list of installation roots. SUFFIX is the subdirectory from there. @@ -175,9 +187,7 @@ specify the directory. DEFAULT is the preferred value. If KEEP-SUFFIX is non-nil, the suffix must be respected in searching -the directory. -If IN-PLACE-EXTERNAL is non-nil, the directory might be found outside -an in-place root-hierarchy." +the directory." (let ((preferred-value (or (and envvar (getenv envvar)) default))) (if (and preferred-value @@ -185,39 +195,28 @@ (file-name-as-directory preferred-value) (catch 'gotcha (while roots - (let ((root (car roots))) - ;; installed - (let ((path (paths-construct-emacs-directory root suffix base))) - (if (paths-file-readable-directory-p path) - (throw 'gotcha path))) - ;; in-place - (if (null keep-suffix) - (let ((path (paths-construct-emacs-directory root "" base))) - (if (paths-file-readable-directory-p path) - (throw 'gotcha path)))) - (if (and in-place-external - (paths-root-in-place-p root)) - (let ((path (paths-construct-emacs-directory - (paths-construct-path '("..") root) - "" base))) - (if (paths-file-readable-directory-p path) - (throw 'gotcha path))))) + (let* ((root (car roots)) + ;; installed + (path (paths-construct-emacs-directory root suffix base))) + (if (paths-file-readable-directory-p path) + (throw 'gotcha path) + ;; in-place + (if (null keep-suffix) + (let ((path (paths-construct-emacs-directory root "" base))) + (if (paths-file-readable-directory-p path) + (throw 'gotcha path)))))) (setq roots (cdr roots))) nil)))) -(defun paths-find-site-directory (roots base &optional envvar default in-place-external) - "Find a site-specific directory in the XEmacs hierarchy. -If IN-PLACE-EXTERNAL is non-nil, the directory might be found outside -an in-place root-hierarchy." +(defun paths-find-site-directory (roots base &optional envvar default) + "Find a site-specific directory in the XEmacs hierarchy." (paths-find-emacs-directory roots (file-name-as-directory (paths-construct-path (list "lib" emacs-program-name))) base - envvar default - nil - in-place-external)) + envvar default)) (defun paths-find-version-directory (roots base &optional envvar default enforce-version) @@ -300,8 +299,13 @@ directories))) (defun paths-find-emacs-roots (invocation-directory - invocation-name) - "Find all plausible installation roots for XEmacs." + 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 @@ -316,7 +320,7 @@ (list (file-name-as-directory configure-prefix-directory))))) (installation-roots - (paths-filter #'paths-emacs-root-p potential-installation-roots))) + (paths-filter root-p potential-installation-roots))) (paths-uniq-append invocation-roots installation-roots))) Index: lisp/hyper-apropos.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/hyper-apropos.el,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- lisp/hyper-apropos.el 8 Oct 2002 03:45:12 -0000 1.13 +++ lisp/hyper-apropos.el 8 Feb 2003 02:29:52 -0000 1.14 @@ -3,7 +3,7 @@ ;; Copyright (C) 1997 Free Software Foundation, Inc. ;; Copyright (C) 1994, 1995 Tinker Systems and INS Engineering Corp. ;; Copyright (C) 1995 Sun Microsystems. -;; Copyright (C) 1996 Ben Wing. +;; Copyright (C) 1996, 2003 Ben Wing. ;; Author: Jonathan Stigelman ;; Maintainer: XEmacs Development Team @@ -296,10 +296,15 @@ a = autoloaded, b = byte-compiled, i = internal, l = lambda, m = macro.\n\n" 'hyper-apropos-documentation) (insert-face "Functions and Macros:\n\n" 'hyper-apropos-major-heading) - (hyper-apropos-grok-functions flist) + (hyper-apropos-grok-functions flist nil) + (insert-face "\n\nObsolete Functions and Macros:\n\n" 'hyper-apropos-major-heading) + (hyper-apropos-grok-functions flist t) (insert-face "\n\nVariables and Constants:\n\n" 'hyper-apropos-major-heading) - (hyper-apropos-grok-variables vlist) + (hyper-apropos-grok-variables vlist nil) + (insert-face "\n\nObsolete Variables and Constants:\n\n" + 'hyper-apropos-major-heading) + (hyper-apropos-grok-variables vlist t) (goto-char (point-min)))) (switch-to-buffer hyper-apropos-apropos-buf) (hyper-apropos-mode regexp)) @@ -312,57 +317,76 @@ (message "Re-running apropos...") (hyper-apropos hyper-apropos-last-regexp nil)) -(defun hyper-apropos-grok-functions (fns) - (let (bind doc type) - (dolist (fn fns) - (setq bind (symbol-function fn) - type (cond ((subrp bind) ?i) +(defun hyper-apropos-grok-functions (fns obsolete-p) + (loop for fn in fns + if (eq (function-obsolete-p fn) obsolete-p) do + (let* ((bind (symbol-function fn)) + (type (cond ((subrp bind) ?i) ((compiled-function-p bind) ?b) ((consp bind) (or (cdr (assq (car bind) '((autoload . ?a) (lambda . ?l) (macro . ?m)))) ??)) - (t ?\ ))) + (t ?\ )))) (insert type (if (commandp fn) "* " " ")) (let ((e (insert-face (format "%S" fn) 'hyper-apropos-hyperlink))) (set-extent-property e 'mouse-face 'highlight)) (insert-char ?\ (let ((l (- 30 (length (format "%S" fn))))) (if (natnump l) l 0))) (and hyper-apropos-show-brief-docs - (setq doc - ;; A symbol's function slot can point to an unbound symbol. - ;; In that case, `documentation' will fail. - (ignore-errors - (documentation fn))) - (if (string-match - "^([^\n\t )]+[\t ]*\\([^\n)]+\\)?)\\(:[\t ]*\\|\n?\\'\\)" - doc) - (setq doc (substring doc (match-end 0) (string-match "\n" doc))) - t) - (insert-face (if doc - (concat " - " - (substring doc 0 (string-match "\n" doc))) - " Not documented.") - 'hyper-apropos-documentation)) + (let ((doc + (if (and obsolete-p + (symbolp fn) + (symbolp (symbol-function fn))) + (function-obsoleteness-doc fn) + ;; A symbol's function slot can point to an unbound symbol. + ;; In that case, `documentation' will fail. + (ignore-errors + (documentation fn))))) + (if (and + doc + (string-match + "\\`([^\n\t )]+[\t ]*\\([^\n)]+\\)?)\\(:[\t ]*\\|\n?\\'\\)" + doc)) + (setq doc (substring doc (match-end 0) + (string-match "\n" doc)))) + ;; Skip errant newlines at beginning of doc + (if (and doc + (string-match "\\`\n+" doc)) + (setq doc (substring doc (match-end 0)))) + (insert-face (if doc + (concat " - " + (substring doc 0 + (string-match "\n" doc))) + " - Not documented.") + 'hyper-apropos-documentation))) (insert ?\n)))) -(defun hyper-apropos-grok-variables (vars) - (let (doc userp) - (dolist (var vars) - (setq userp (user-variable-p var)) +(defun hyper-apropos-grok-variables (vars obsolete-p) + (loop for var in vars + if (eq (variable-obsolete-p var) obsolete-p) do + (let ((userp (user-variable-p var))) (insert (if userp " * " " ")) (let ((e (insert-face (format "%S" var) 'hyper-apropos-hyperlink))) (set-extent-property e 'mouse-face 'highlight)) (insert-char ?\ (let ((l (- 30 (length (format "%S" var))))) (if (natnump l) l 0))) (and hyper-apropos-show-brief-docs - (setq doc (documentation-property var 'variable-documentation)) - (insert-face (if doc - (concat " - " (substring doc (if userp 1 0) - (string-match "\n" doc))) - " - Not documented.") - 'hyper-apropos-documentation)) + (let ((doc + (if (and obsolete-p (variable-alias var)) + (variable-obsoleteness-doc var) + (documentation-property var 'variable-documentation)))) + ;; Skip errant newlines at beginning of doc + (if (and doc + (string-match "\\`\n+" doc)) + (setq doc (substring doc (match-end 0)))) + (insert-face (if doc + (concat " - " (substring + doc (if userp 1 0) + (string-match "\n" doc))) + " - Not documented.") + 'hyper-apropos-documentation))) (insert ?\n)))) ;; ---------------------------------------------------------------------- ;; Index: lisp/info.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/info.el,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- lisp/info.el 7 May 2002 16:14:04 -0000 1.30 +++ lisp/info.el 23 Jan 2003 11:39:01 -0000 1.31 @@ -1040,7 +1040,7 @@ (setq lbuffers (cdr lbuffers))) (message "Composing main Info directory...done")) (setq Info-dir-contents (buffer-string))) - (setq default-directory Info-dir-contents-directory) + (setq default-directory (file-name-as-directory Info-dir-contents-directory)) (setq buffer-file-name (caar Info-dir-file-attributes))) (defmacro Info-directory-files (dir-file &optional all full nosort files-only) Index: lisp/loadup.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/loadup.el,v retrieving revision 1.25 retrieving revision 1.27 diff -u -r1.25 -r1.27 --- lisp/loadup.el 12 Apr 2001 18:21:30 -0000 1.25 +++ lisp/loadup.el 6 Feb 2003 06:35:47 -0000 1.27 @@ -2,7 +2,7 @@ ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1996 Richard Mlynarik. -;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 1995, 1996, 2003 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: internal, dumped @@ -28,12 +28,17 @@ ;;; Commentary: -;; Please do not edit this file. Use site-init.el or site-load.el instead. +;; If you are wanting to add files to be dumped into your local version of +;; XEmacs, DO NOT add them here. Use site-init.el or site-load.el instead. ;; This is loaded into a bare XEmacs to make a dumpable one. ;;; Code: +;; Help debug problems. +(setq stack-trace-on-error t + load-always-display-messages t) + (when (fboundp 'error) (error "loadup.el already loaded!")) @@ -53,6 +58,10 @@ (if (and purify-flag (not (memq 'quick-build internal-error-checking))) 30000 3000000))) + +;; really-early-error-handler outputs a stack trace so let's not do it +;; twice. +(let ((stack-trace-on-error nil)) ;; This is awfully damn early to be getting an error, right? (call-with-condition-handler 'really-early-error-handler @@ -85,7 +94,7 @@ (buffer-disable-undo (get-buffer "*scratch*")) ;; Load our first bootstrap support - (load "very-early-lisp" nil t) + (load "very-early-lisp.el") ;; lread.c (or src/Makefile.in.in) has prepended ;; "${srcdir}/../lisp/" to load-path, which is how this file @@ -102,8 +111,7 @@ (cons (file-name-as-directory temp-path) load-path)))) - (setq load-warn-when-source-newer t ; Used to be set to nil at the end - load-warn-when-source-only t) ; Set to nil at the end + (setq load-warn-when-source-only t) ; Set to nil at the end ;; garbage collect after loading every file in an attempt to ;; minimize the size of the dumped image (if we don't do this, @@ -124,7 +132,8 @@ file)) ;; Uncomment in case of trouble ;;(print (format "late-packages: %S" late-packages)) - ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name))) + ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-root-p))) + ;;(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")) @@ -145,13 +154,14 @@ (packages-load-package-dumped-lisps late-package-load-path) )) ;; end of call-with-condition-handler + +) ; (let ((stack-trace-on-error nil))) ;; Fix up the preloaded file list (setq preloaded-file-list (mapcar #'file-name-sans-extension preloaded-file-list)) -(setq load-warn-when-source-newer t ; set to t at top of file - load-warn-when-source-only nil) +(setq load-warn-when-source-only nil) (setq debugger 'debug) @@ -162,8 +172,8 @@ ;; doc strings kept in the DOC file rather than in core, ;; you may load them with a "site-load.el" file. ;; But you must also cause them to be scanned when the DOC file -;; is generated. For VMS, you must edit ../../vms/makedoc.com. -;; For other systems, you must edit ../../src/Makefile.in.in. +;; is generated. For MS Windows, you must edit ../nt/xemacs.mak. +;; For other systems, you must edit ../src/Makefile.in.in. (when (load "site-load" t) (garbage-collect) ) @@ -201,7 +211,7 @@ ;;; At this point, we're ready to resume undo recording for scratch. (buffer-enable-undo "*scratch*") -) ;; frequent garbage collection +) ;; (let ((gc-cons-threshold [frequent garbage collection when dumping]))) ;(stop-profiling) @@ -275,6 +285,9 @@ ;; (condition-case () (delete-file "xemacs") (file-error nil)) (when (fboundp 'really-free) (really-free)) + ;; Make sure we don't dump with debugging messages turned on. + (setq stack-trace-on-error nil + load-always-display-messages nil) (dump-emacs (cond ((featurep 'infodock) "infodock") Index: lisp/make-docfile.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/make-docfile.el,v retrieving revision 1.21 retrieving revision 1.24 diff -u -r1.21 -r1.24 --- lisp/make-docfile.el 14 Apr 2002 12:42:04 -0000 1.21 +++ lisp/make-docfile.el 15 Feb 2003 10:15:55 -0000 1.24 @@ -1,7 +1,7 @@ ;;; make-docfile.el --- Cache docstrings in external file ;; Copyright (C) 1985, 1986, 1992-1995, 1997 Free Software Foundation, Inc. -;; Copyright (C) 2002 Ben Wing. +;; Copyright (C) 2002, 2003 Ben Wing. ;; Author: Unknown ;; Maintainer: Steven L Baur @@ -34,6 +34,10 @@ ;;; Code: +;; Help debug problems. +(setq stack-trace-on-error t + load-always-display-messages t) + (defvar options nil) (defvar processed nil) (defvar docfile nil) @@ -41,6 +45,10 @@ (defvar site-file-list nil) (defvar docfile-out-of-date nil) +(defun message (fmt &rest args) + (princ (apply #'format fmt args)) + (terpri)) + ;; Gobble up the stuff we don't wish to pass on. (setq command-line-args (cdr (cdr (cdr (cdr command-line-args))))) @@ -62,35 +70,79 @@ (setq command-line-args (cdr (cdr command-line-args))))))) (setq options (nreverse options)) -;; (print (concat "Options: " (prin1-to-string options))) +;; (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 say, "NOOOOOOOOOOOOO! Basta! Ca soufit! Enough, already, OK?" +(defun format-decode (fuck me harder) 0) ;; Next process the list of C files. -(while command-line-args - (let ((arg (car command-line-args))) - (if (null (member arg processed)) - (progn +(defun process-args (args) + (while args + (let ((arg (car args))) + ;; When called from xemacs.mak, we need to do some frobbing on the + ;; args given to us -- remove NEEDTODUMP and make-docfile.exe, + ;; convert .obj files into .c files in the source directory, + ;; handle response files (beginning with @, specifying arguments), + ;; due to line-length limitations in the shell. + (if (string-match "^@" arg) + ;; MS Windows response file + ;; no generate-new-buffer so use its implementation. + (let ((buf (get-buffer-create (generate-new-buffer-name "foo")))) + (set-buffer buf) + (insert-file-contents-internal (substring arg 1)) + ;; now majorly grind up the response file. + ;; backslashes get doubled, quotes around strings, + ;; get rid of pesky CR's and NL's, and put parens around + ;; the whole thing so we have a valid list of strings. + (goto-char (point-max)) + (insert "\")") + (goto-char (point-min)) + (insert "(\"") + (while (search-forward "\\" nil t) + (replace-match "\\\\" nil t)) + (goto-char (point-min)) + (while (search-forward "\n" nil t) + (replace-match "" nil t)) + (goto-char (point-min)) + (while (search-forward "\r" nil t) + (replace-match "" nil t)) + (goto-char (point-min)) + (while (search-forward " " nil t) + (replace-match "\" \"" nil t)) + (goto-char (point-min)) + (process-args (read buf))) + ;; remove NEEDTODUMP and make-docfile.exe, convert .obj files into + ;; .c files in the source directory. + (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"))) (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 command-line-args (cdr command-line-args))) + (setq processed (cons arg processed)))) + (setq args (cdr args))))) + +(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)))) -(load "very-early-lisp" nil t) - ;; Then process the autoloads (setq autoload-file-name "auto-autoloads.elc") +(load "very-early-lisp.el") (load "find-paths.el") (load "packages.el") (load "setup-paths.el") (load "dump-paths.el") -(require 'custom) -(load "process") -;; need for stuff called from C by process code -(if (featurep 'windows-nt) (load "win32-native")) +(load "raw-process.el") (let (preloaded-file-list) (load (expand-file-name "../lisp/dumped-lisp.el")) @@ -109,10 +161,11 @@ (setq arg (locate-library arg0)) (if (null arg) (progn - (princ (format "Error: dumped file %s does not exist\n" arg0)) + (message "Error: dumped file %s does not exist" arg0) ;; Uncomment in case of difficulties - ;;(print (format "late-packages: %S" late-packages)) - ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name))) + ;;(message "late-packages: %S" late-packages) + ;;(message "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-root-p)) + ;;(message "guessed-data-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-data-root-p)) ) (if (null (member arg processed)) (progn @@ -137,12 +190,12 @@ (setq site-load-packages (cdr site-load-packages))))) ;(let ((autoloads (packages-list-autoloads-path))) -; ;; (print (concat "Autoloads: " (prin1-to-string autoloads))) +; ;; (message (concat "Autoloads: " (prin1-to-string autoloads))) ; (while autoloads ; (let ((arg (car autoloads))) ; (if (null (member arg processed)) ; (progn -; ;; (print arg) +; ;; (message arg) ; (if (and (null docfile-out-of-date) ; (file-newer-than-file-p arg docfile)) ; (setq docfile-out-of-date t)) @@ -153,45 +206,49 @@ (setq processed (nreverse processed)) -;; (print (prin1-to-string (append options processed))) +(terpri) + +;(message (prin1-to-string (append options processed))) -(if docfile-out-of-date - (progn - (princ "Spawning make-docfile ...") - ;; (print (prin1-to-string (append options processed))) - - (setq exec-path (list (concat default-directory "../lib-src"))) - - ;; (locate-file-clear-hashing nil) - (if (memq system-type '(berkeley-unix next-mach)) - ;; Suboptimal, but we have a unresolved bug somewhere in the - ;; low-level process code. #### Now that we've switched to using - ;; the regular asynch process code, we should try removing this. - (call-process-internal - "/bin/csh" +(when docfile-out-of-date + (condition-case nil + (delete-file docfile) + (error nil)) + (message "Spawning make-docfile ...") + ;; (message (prin1-to-string (append options processed))) + + (setq exec-path (list (concat default-directory "../lib-src"))) + + ;; (locate-file-clear-hashing nil) + (if (memq system-type '(berkeley-unix next-mach)) + ;; Suboptimal, but we have a unresolved bug somewhere in the + ;; low-level process code. #### Now that we've switched to using + ;; the regular asynch process code, we should try removing this. + (call-process-internal + "/bin/csh" + nil + t + nil + "-fc" + (mapconcat + #'identity + (append + (list (concat default-directory "../lib-src/make-docfile")) + options processed) + " ")) + ;; (message (prin1-to-string (append options processed))) + (apply 'call-process-internal + ;; (concat default-directory "../lib-src/make-docfile") + "make-docfile" nil t nil - "-fc" - (mapconcat - #'identity - (append - (list (concat default-directory "../lib-src/make-docfile")) - options processed) - " ")) - ;; (print (prin1-to-string (append options processed))) - (apply 'call-process-internal - ;; (concat default-directory "../lib-src/make-docfile") - "make-docfile" - nil - t - nil - (append options processed))) - - (princ "Spawning make-docfile ...done\n") - ;; (write-region-internal (point-min) (point-max) "/tmp/DOC") - ) - (princ "DOC file is up to date\n")) + (append options processed))) + + (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.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- lisp/menubar-items.el 6 Jul 2002 05:48:15 -0000 1.37 +++ lisp/menubar-items.el 8 Feb 2003 02:29:53 -0000 1.38 @@ -3,7 +3,7 @@ ;; Copyright (C) 1991-1995, 1997-1998 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. ;; Copyright (C) 1995 Sun Microsystems. -;; Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing. +;; Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing. ;; Copyright (C) 1997 MORIOKA Tomohiko. ;; Maintainer: XEmacs Development Team @@ -1608,13 +1608,13 @@ ["What's %_New in XEmacs" view-emacs-news] "-----" ("%_Info (Online Docs)" - ["Info Con%_tents" (Info-goto-node "(dir)")] + ["%_Info Contents" (Info-goto-node "(dir)")] "-----" ["XEmacs %_User's Manual" (Info-goto-node "(XEmacs)")] ["XEmacs %_Lisp Reference Manual" (Info-goto-node "(Lispref)")] ["All About %_Packages" (Info-goto-node "(xemacs)Packages")] ["%_Getting Started with XEmacs" (Info-goto-node "(New-Users-Guide)")] - ["XEmacs In%_ternals Manual" (Info-goto-node "(Internals)")] + ["%_XEmacs Internals Manual" (Info-goto-node "(Internals)")] ["%_How to Use Info" (Info-goto-node "(Info)")] "-----" ["Lookup %_Key Sequence in User's Manual..." @@ -1622,7 +1622,7 @@ ["Lookup %_Command in User's Manual..." Info-goto-emacs-command-node] ["Lookup %_Function in Lisp Reference..." Info-elisp-ref] "-----" - ["Search %_Index in User's Manual/Lispref..." + ["Find %_Topic in User's Manual/Lispref..." Info-search-index-in-xemacs-and-lispref] ["%_Search Text in User's Manual..." Info-search-text-in-xemacs] ["S%_earch Text in Lisp Reference..." Index: lisp/packages.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/packages.el,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- lisp/packages.el 29 Mar 2002 04:46:36 -0000 1.44 +++ lisp/packages.el 16 Jan 2003 08:59:47 -0000 1.45 @@ -358,7 +358,7 @@ ;; make sure paths-find-version-directory and paths-find-site-directory ;; don't both pick up version-independent directories ... (let ((version-directory (paths-find-version-directory roots base nil nil t)) - (site-directory (paths-find-site-directory roots base nil nil t))) + (site-directory (paths-find-site-directory roots base))) (paths-uniq-append (and version-directory (list version-directory)) (and site-directory (list site-directory))))) Index: lisp/process.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/process.el,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- lisp/process.el 23 Jul 2002 08:35:05 -0000 1.17 +++ lisp/process.el 5 Jan 2003 18:38:37 -0000 1.18 @@ -512,7 +512,8 @@ (defun shell-command-to-string (command) "Execute shell command COMMAND and return its output as a string." (with-output-to-string - (call-process shell-file-name nil t nil shell-command-switch command))) + (with-current-buffer standard-output + (call-process shell-file-name nil t nil shell-command-switch command)))) (defalias 'exec-to-string 'shell-command-to-string) Index: lisp/raw-process.el =================================================================== RCS file: lisp/raw-process.el diff -N lisp/raw-process.el --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lisp/raw-process.el 6 Feb 2003 10:44:06 -0000 1.1 @@ -0,0 +1,37 @@ +;;; raw-process.el --- In a raw temacs, load stuff so processes work + +;; Copyright (C) 2002 Ben Wing. + +;; Author: Ben Wing +;; Maintainer: XEmacs Development Team +;; Keywords: internal + +;; 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 is a front-end to the make-docfile program that gathers up all the +;; lisp files that will be dumped with XEmacs. It would probably be best +;; to just move make-docfile.c completely to lisp and be done with it. + +(require 'custom) +(load "process") +;; need for stuff called from C by process code +(if (featurep 'windows-nt) (load "win32-native")) Index: lisp/simple.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/simple.el,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- lisp/simple.el 12 Aug 2002 07:44:28 -0000 1.43 +++ lisp/simple.el 6 Feb 2003 06:35:47 -0000 1.44 @@ -2,7 +2,7 @@ ;; Copyright (C) 1985-7, 1993-5, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. -;; Copyright (C) 2000, 2001, 2002 Ben Wing. +;; Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: lisp, extensions, internal, dumped @@ -1999,8 +1999,12 @@ :group 'editing-basics) (defcustom motion-keys-for-shifted-motion - '(left right up down home end prior next - kp-left kp-right kp-up kp-down kp-home kp-end kp-prior kp-next) + ;; meta-shift-home/end are NOT shifted motion commands. + '(left right up down (home) (control home) (meta control home) + (end) (control end) (meta control end) prior next + kp-left kp-right kp-up kp-down (kp-home) (control kp-home) + (meta control kp-home) (kp-end) (control kp-end) (meta control kp-end) + kp-prior kp-next) "*List of keys considered motion keys for the purpose of shifted selection. When one of these keys is pressed along with the Shift key, and the command invoked moves the cursor and preserves the active region (see @@ -2021,11 +2025,20 @@ either a character or a symbol, uppercase or lowercase." :type '(repeat (choice (const :tag "normal cursor-pad (\"gray\") keys" :inline t - (left right up down home end prior next)) + (left + right up down + (home) (control home) (meta control home) + (end) (control end) (meta control end) + prior next)) (const :tag "keypad motion keys" :inline t - (kp-left kp-right kp-up kp-down - kp-home kp-end kp-prior kp-next)) + (kp-left + kp-right kp-up kp-down + (kp-home) (control kp-home) + (meta control kp-home) + (kp-end) (control kp-end) + (meta control kp-end) + kp-prior kp-next)) (const :tag "alphabetic motion keys" :inline t ((control b) (control f) Index: lisp/startup.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/startup.el,v retrieving revision 1.45 retrieving revision 1.47 diff -u -r1.45 -r1.47 --- lisp/startup.el 27 Nov 2002 07:15:07 -0000 1.45 +++ lisp/startup.el 23 Jan 2003 11:39:01 -0000 1.47 @@ -133,6 +133,9 @@ (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.") @@ -517,7 +520,11 @@ t)))) (setq emacs-roots (paths-find-emacs-roots invocation-directory - invocation-name)) + 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) @@ -525,7 +532,7 @@ (if (null emacs-roots) (startup-find-roots-warning)) - (startup-setup-paths emacs-roots + (startup-setup-paths emacs-roots emacs-data-roots user-init-directory (cond (inhibit-all-packages t) (inhibit-early-packages '(early)) @@ -535,6 +542,9 @@ 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 + ;; frame? (startup-load-autoloads) (let (error-data) @@ -740,7 +750,7 @@ ;; In this case, I completely agree. --ben (if (featurep 'menubar) (init-menubar-at-startup)) - ;; perhaps this should go earlier in the proecess? + ;; perhaps this should go earlier in the process? (if (featurep 'mule) (declare-fboundp (init-mule-at-startup))) @@ -1240,7 +1250,7 @@ (defun splash-frame-body () `[((face (blue bold underline) "\nDistribution, copying license, warranty:\n\n") - "Please visit the XEmacs website at http://www.xemacs.org !\n\n" + "Please visit the XEmacs website at http://www.xemacs.org/ !\n\n" ,@(if (featurep 'sparcworks) `( "\ Sun provides support for the WorkShop/XEmacs integration package only. @@ -1296,7 +1306,7 @@ ((key about-xemacs) ": see who's developing XEmacs\n")) ((face (blue bold underline) "\nUseful stuff:\n\n") - "Things that you should know rather quickly...\n\n" + "Things that you should learn rather quickly...\n\n" ((key find-file) ": visit a file\n") ((key save-buffer) ": save changes\n") ((key undo) ": undo changes\n") @@ -1423,20 +1433,24 @@ t))))) (defun startup-load-autoloads () - (if (and (not inhibit-autoloads) - lisp-directory) + (when (and (not inhibit-autoloads) lisp-directory) + (load (expand-file-name (file-name-sans-extension autoload-file-name) + lisp-directory) + nil t) + (when (featurep 'mule) (load (expand-file-name (file-name-sans-extension autoload-file-name) - lisp-directory) nil t)) + (file-name-as-directory + (expand-file-name "mule" lisp-directory))) + nil t))) ;; Hey! Let's use a packages-* function for a non-package purpose! - (if (and (not inhibit-autoloads) (featurep 'modules)) - (packages-load-package-auto-autoloads module-load-path)) + (when (and (not inhibit-autoloads) (featurep 'modules)) + (packages-load-package-auto-autoloads module-load-path)) - (if (and (not inhibit-autoloads) (not inhibit-all-packages)) - (progn - (if (not inhibit-early-packages) - (packages-load-package-auto-autoloads early-package-load-path)) - (packages-load-package-auto-autoloads late-package-load-path) - (packages-load-package-auto-autoloads last-package-load-path)))) + (unless (or inhibit-autoloads inhibit-all-packages) + (unless inhibit-early-packages + (packages-load-package-auto-autoloads early-package-load-path)) + (packages-load-package-auto-autoloads late-package-load-path) + (packages-load-package-auto-autoloads last-package-load-path))) ;;; startup.el ends here Index: lisp/text-props.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/text-props.el,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- lisp/text-props.el 12 Apr 2001 18:21:36 -0000 1.4 +++ lisp/text-props.el 8 Feb 2003 02:29:53 -0000 1.5 @@ -234,7 +234,7 @@ (setq start (next-single-property-change start prop buffer-or-string end))) ;; we have to insert a special check for end due to the illogical ;; definition of next-single-property-change (blame FSF for this). - (if (eq start end) nil start)) + (if (and start (>= start end)) nil start)) (defun text-property-not-all (start end prop value &optional buffer-or-string) "Check text from START to END to see if PROP is ever not `eq' to VALUE. @@ -248,7 +248,7 @@ buffer-or-string end))) ;; we have to insert a special check for end due to the illogical ;; definition of previous-single-property-change (blame FSF for this). - (if (eq retval end) nil retval)))) + (if (and retval (>= retval end)) nil retval)))) ;; Older versions that only work sometimes (when VALUE is non-nil ;; for text-property-any, and maybe only when VALUE is nil for Index: lisp/update-elc-2.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/update-elc-2.el,v retrieving revision 1.5 retrieving revision 1.9 diff -u -r1.5 -r1.9 --- lisp/update-elc-2.el 10 Sep 2002 15:27:08 -0000 1.5 +++ lisp/update-elc-2.el 15 Feb 2003 10:15:55 -0000 1.9 @@ -1,7 +1,7 @@ ;;; update-elc-2.el --- Recompile remaining .el files, post-dumping ;; Copyright (C) 1997 by Free Software Foundation, Inc. -;; Copyright (C) 2000 Ben Wing. +;; Copyright (C) 2000, 2003 Ben Wing. ;; Author: Ben Wing , based on cleantree.el by ;; Steven L Baur @@ -46,6 +46,10 @@ ;;; Code: +;; Help debug problems. +(setq stack-trace-on-error t + load-always-display-messages t) + (defvar update-elc-ignored-dirs `("." ".." "CVS" "SCCS" "RCS" ,@(unless (featurep 'mule) '("mule")))) @@ -65,6 +69,8 @@ "^version\\.el$" "^very-early-lisp\\.el$")) +(defvar dirfiles-table (make-hash-table :test 'equal)) + ;; SEEN accumulates the list of already-handled dirs. (defun do-update-elc-2 (dir compile-stage-p seen) (setq dir (file-name-as-directory dir)) @@ -72,65 +78,104 @@ (unless (member (file-truename dir) seen) (push (file-truename dir) seen) - ;; Do this directory. - (if compile-stage-p - ;; Stage 2: Recompile necessary .els - (let ((files (directory-files dir t "\\.el$")) - file file-c) - (while (setq file (car files)) - (setq files (cdr files)) - (setq file-c (concat file "c")) - (when (and (file-exists-p file) - (or (not (file-exists-p file-c)) - (file-newer-than-file-p file file-c)) - (let (ignore) - (mapcar - #'(lambda (regexp) - (if (string-match regexp - (file-name-nondirectory file)) - (setq ignore t))) - update-elc-ignored-files) - (not ignore))) - (byte-compile-file file)))) - - ;; Stage 1. - ;; Remove out-of-date elcs - (let ((files (directory-files dir t "\\.el$")) - file file-c) - (while (setq file (car files)) - (setq files (cdr files)) - (setq file-c (concat file "c")) - (when (and (file-exists-p file-c) - (file-newer-than-file-p file file-c)) - (message "Removing out-of-date %s" file-c) - (delete-file file-c)))) - ;; Remove elcs without corresponding el - (let ((files (directory-files dir t "\\.elc$")) - file file-c) - (while (setq file-c (car files)) - (setq files (cdr files)) - (setq file (replace-in-string file-c "c$" "")) - (when (and (file-exists-p file-c) - (not (file-exists-p file))) - (message "Removing %s; no corresponding .el" file-c) - (delete-file file-c))))) - - ;; We descend recursively - (let ((dirs (directory-files dir t nil t)) - dir) - (while (setq dir (pop dirs)) - (when (and (not (member (file-name-nondirectory dir) - update-elc-ignored-dirs)) - (file-directory-p dir)) - (do-update-elc-2 dir compile-stage-p seen)))) + (let ((files (or (gethash dir dirfiles-table) + (directory-files dir t nil t)))) - )) + ;; Do this directory. + (if compile-stage-p + ;; Stage 2: Recompile necessary .els + (dolist (file files) + (when (string-match "\\.el$" file) + (let ((file-c (concat file "c"))) + (when (and (not (member file-c files)) + ;; no need to check for out-of-date-ness because + ;; that was already done, and .elc removed. + (let (ignore) + (mapcar + #'(lambda (regexp) + (if (string-match + regexp + (file-name-nondirectory file)) + (setq ignore t))) + update-elc-ignored-files) + (not ignore))) + (byte-compile-file file))))) + + ;; Stage 1. + ;; Remove out-of-date elcs + (let (deleted) + (dolist (file files) + (when (string-match "\\.el$" file) + (let ((file-c (concat file "c"))) + (when (and (member file-c files) + (file-newer-than-file-p file file-c)) + (message "Removing out-of-date %s" file-c) + (delete-file file-c) + (push file-c deleted))))) + + ;; Remove elcs without corresponding el + (dolist (file-c files) + (when (string-match "\\.elc$" file-c) + (let ((file (replace-in-string file-c "c$" ""))) + (when (not (member file files)) + (message "Removing %s; no corresponding .el" file-c) + (delete-file file-c) + (push file-c deleted))))) + + (setq files (set-difference files deleted :test 'equal)))) + + (puthash dir files dirfiles-table) + + ;; We descend recursively. On my Windows machine, it is much faster + ;; to call directory-files again to recompute than to call + ;; file-directory-p on each member of the files list. + (dolist (dir (directory-files dir t nil t 'dir)) + (when (not (member (file-name-nondirectory dir) + update-elc-ignored-dirs)) + (do-update-elc-2 dir compile-stage-p seen)))))) (defun batch-update-elc-2 () (defvar command-line-args-left) (unless noninteractive (error "`batch-update-elc-2' is to be used only with -batch")) (let ((dir (car command-line-args-left))) + ;; don't depend on being able to autoload `update-autoload-files'! + (load "autoload") + (load "bytecomp") + (load "byte-optimize") + ;; #### the API used here is deprecated, convert to one with explicit + ;; arguments when it is available + ;; 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") + (let ((generated-autoload-file (expand-file-name "auto-autoloads.el" dir)) + (autoload-package-name "auto")) ; feature prefix + (update-autoload-files (list dir)) + (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)) + (byte-recompile-file generated-autoload-file 0)))) + (when (featurep 'modules) + (let* ((moddir (expand-file-name "../modules" (file-truename dir))) + (generated-autoload-file + (expand-file-name "auto-autoloads.el" moddir)) + (autoload-package-name "modules")) ; feature prefix + (update-autoload-files + (delete (concat (file-name-as-directory moddir) ".") + (delete (concat (file-name-as-directory moddir) "..") + (directory-files moddir t nil nil 0))) + t) + (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") + (when (featurep 'mule) + (load "../lisp/mule/auto-autoloads")) ;; 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 @@ -142,19 +187,6 @@ (message "Recompiling updated .els in directory tree `%s'..." dir) (do-update-elc-2 dir t nil) (message "Recompiling updated .els in directory tree `%s'...done" dir) - ;; don't depend on being able to autoload `update-autoload-files'! - (load "autoload") - (update-autoload-files (list dir)) - (byte-recompile-file (expand-file-name "auto-autoloads.el" dir) 0) - (if (featurep 'modules) - (let* ((moddir (expand-file-name "../modules" (file-truename dir))) - (generated-autoload-file - (expand-file-name "auto-autoloads.el" moddir))) - (update-autoload-files (directory-files moddir t nil nil 0) t) - (byte-recompile-file generated-autoload-file 0))) - (when (featurep 'mule) - (update-autoload-files (list (expand-file-name "mule" dir))) - (byte-recompile-file (expand-file-name "mule/auto-autoloads.el" dir) 0)) ;; likewise here. (load "cus-dep") (Custom-make-dependencies dir) Index: lisp/update-elc.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/update-elc.el,v retrieving revision 1.24 retrieving revision 1.30 diff -u -r1.24 -r1.30 --- lisp/update-elc.el 22 Jun 2001 01:49:59 -0000 1.24 +++ lisp/update-elc.el 15 Feb 2003 10:15:55 -0000 1.30 @@ -1,8 +1,8 @@ -;;; update-elc.el --- Bytecompile out-of-date dumped files +;;; update-elc.el --- Bytecompile out-of-date dumped files, pre-dumping ;; Copyright (C) 1997 Free Software Foundation, Inc. ;; Copyright (C) 1996 Sun Microsystems, Inc. -;; Copyright (C) 2001 Ben Wing. +;; Copyright (C) 2001, 2003 Ben Wing. ;; Author: Ben Wing ;; Based On: Original by Steven L Baur @@ -31,6 +31,8 @@ ;;; Commentary: ;; Byte compile the .EL files necessary to dump out xemacs. +;; Also update the auto-autoloads.el files. + ;; Use this file like this: ;; temacs -batch -l ../lisp/update-elc.el $lisp @@ -46,12 +48,20 @@ ;;; Code: +;; Help debug problems. +(setq stack-trace-on-error t + load-always-display-messages t) + (defvar processed nil) (defvar update-elc-files-to-compile nil) (defvar need-to-rebuild-autoloads nil) (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) ;(setq update-elc-files-to-compile ; (delq nil @@ -71,12 +81,41 @@ (let ((build-root (expand-file-name ".." invocation-directory))) (setq load-path (list (expand-file-name "lisp" build-root)))) -(load "very-early-lisp" nil t) - +(load "very-early-lisp.el") (load "find-paths.el") (load "packages.el") (load "setup-paths.el") -(load "dump-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 +;; .elc's. +(defvar lisp-files-needed-for-byte-compilation + '("bytecomp" + "byte-optimize")) + +;; Lisp files not in `lisp-files-needed-for-byte-compilation' that need +;; early byte compilation. These are files loaded by update-elc.el in +;; order to do the compilation of all the rest of the files. +(defvar lisp-files-needing-early-byte-compilation + '(;"easy-mmode" + "autoload" + "shadow" + "cl-macs")) + +(defvar unbytecompiled-lisp-files + '("paths.el" + "dumped-lisp.el" + "dumped-pkg-lisp.el" + "raw-process.el" + "version.el" + "very-early-lisp.el") + "Lisp files that should not be byte compiled.") + +(defvar lisp-files-ignored-when-checking-for-autoload-updating + '("custom-load.el" + "auto-autoloads.el") + "Lisp files that should not trigger auto-autoloads rebuilding.") (defun update-elc-chop-extension (file) (if (string-match "\\.elc?$" file) @@ -87,8 +126,7 @@ ;; we need to handle each autoload file differently and there are only ;; two of them. -(let (preloaded-file-list site-load-packages need-to-dump dumped-exe - files-to-process) +(let (preloaded-file-list site-load-packages files-to-process) (load (expand-file-name "../lisp/dumped-lisp.el")) @@ -97,6 +135,32 @@ ((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)))) + ;; Path setup (let ((package-preloaded-file-list (packages-collect-package-dumped-lisps late-package-load-path))) @@ -111,9 +175,11 @@ (append packages-hardcoded-lisp preloaded-file-list site-load-packages)) - ;; bytecomp, byte-optimize, and autoload are mentioned in - ;; packages-useful-lisp. - (setq files-to-process (append packages-useful-lisp preloaded-file-list)) + ;; bytecomp, byte-optimize, autoload, etc. are mentioned specially + ;; in the lisp-files-need* variables. + (setq files-to-process (append lisp-files-needed-for-byte-compilation + lisp-files-needing-early-byte-compilation + preloaded-file-list)) (while files-to-process (let* ((arg (car files-to-process)) (arg-is-preloaded (member arg preloaded-file-list)) @@ -123,6 +189,7 @@ (if (null full-arg) (progn (print (format "Error: Library file %s not found" arg)) + (backtrace) ;; Uncomment in case of trouble ;;(print (format "late-packages: %S" late-packages)) ;;(print (format "guessed-roots: %S" @@ -132,39 +199,56 @@ (update-elc-chop-extension full-arg))) (full-arg-el (concat full-arg-sans-extension ".el")) (full-arg-elc (concat full-arg-sans-extension ".elc")) - (full-arg-dir (file-name-directory full-arg-el)) - (autoload-file (expand-file-name "auto-autoloads.el" full-arg-dir)) - (autoload-is-mule (string-match "[/\\]mule[/\\]$" full-arg-dir))) + (full-arg-dir (file-name-directory full-arg-el))) ;; (print full-arg-el) ;; now check if .el or .elc is newer than the dumped exe. ;; if so, need to redump. (when (and dumped-exe arg-is-preloaded - (or (and (file-exists-p full-arg-el) - (file-newer-than-file-p full-arg-el dumped-exe)) - (and (file-exists-p full-arg-elc) - (file-newer-than-file-p full-arg-elc dumped-exe)))) - (setq need-to-dump t)) - - (when (or (not (file-exists-p autoload-file)) - (and (file-exists-p full-arg-el) - (file-newer-than-file-p full-arg-el autoload-file))) - (if autoload-is-mule - (setq need-to-rebuild-mule-autoloads t) - (setq need-to-rebuild-autoloads t))) + ;; 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)) (if (and (not (member (file-name-nondirectory arg) - packages-unbytecompiled-lisp)) + unbytecompiled-lisp-files)) (not (member full-arg-el processed)) - (file-exists-p full-arg-el) - (or (not (file-exists-p full-arg-elc)) - (file-newer-than-file-p full-arg-el full-arg-elc))) + ;; no need to check for existence of either of the files + ;; because of the definition of file-newer-than-file-p. + (file-newer-than-file-p full-arg-el full-arg-elc)) (setq processed (cons full-arg-el processed))) (setq files-to-process (cdr files-to-process)))) - (if need-to-dump + ;; 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"))) + (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"))) + (while all-files-in-dir + (let* ((full-arg (car all-files-in-dir))) + ;; custom-load.el always gets regenerated so don't let that + ;; trigger us. + (when (and (not + (member + (file-name-nondirectory full-arg) + lisp-files-ignored-when-checking-for-autoload-updating + )) + (file-newer-than-file-p full-arg autoload-file)) + (if autoload-is-mule + (setq need-to-rebuild-mule-autoloads t) + (setq need-to-rebuild-autoloads t)))) + (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 (condition-case nil (write-region-internal "foo" nil "../src/NEEDTODUMP") (file-error nil))) @@ -172,15 +256,22 @@ ) (when (or need-to-rebuild-autoloads + ;; no real need for the following check either, because if the file + ;; 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 "../lisp/auto-autoloads.elc")) + ;; 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")) (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 "../lisp/mule/auto-autoloads.elc")) + ;; 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")) (setq need-to-recompile-mule-autoloads t)) @@ -193,73 +284,118 @@ (setq update-elc-files-to-compile (append update-elc-files-to-compile (nreverse processed))) -;; (print update-elc-files-to-compile) +;(print update-elc-files-to-compile) -(if (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)) - (condition-case nil - (delete-file "../src/NOBYTECOMPILE") - (file-error nil)) - (let* ( - (bytecomp-arg (concat (update-elc-chop-extension - (locate-library "bytecomp")) ".el")) - (byte-opt-arg (concat (update-elc-chop-extension - (locate-library "byte-optimize")) ".el")) - (autoload-arg (concat (update-elc-chop-extension - (locate-library "autoload")) ".el")) - ) - (setq inhibit-autoloads t) - (setq command-line-args - (append - '("-l" "loadup-el.el" "run-temacs" "-batch" "-q" "-no-site-file") +(let ((do-autoload-commands + (append + (if (or need-to-rebuild-autoloads + need-to-rebuild-mule-autoloads) + '("-l" "autoload")) + (if need-to-rebuild-autoloads + '("-f" "autoload-update-directory-autoloads" + "auto" "../lisp")) + (if need-to-rebuild-mule-autoloads + '("-f" "autoload-update-directory-autoloads" + "mule" "../lisp/mule")) + (if need-to-recompile-autoloads + '("-f" "batch-byte-compile-one-file" + "../lisp/auto-autoloads.el")) + (if need-to-recompile-mule-autoloads + '("-f" "batch-byte-compile-one-file" + "../lisp/mule/auto-autoloads.el"))))) + (condition-case nil + (delete-file "../src/REBUILD_AUTOLOADS") + (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))) + ((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 + ;; update-elc-2 to do it. This is much faster than loading + ;; all the .el's and doing it here. (We only need to rebuild + ;; 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") + (file-error nil)) + (condition-case nil + (delete-file "../src/BYTECOMPILE_CHANGE") + (file-error nil))) + (t + (let ((bc-bootstrap + (mapcar #'(lambda (arg) + (concat (update-elc-chop-extension + (locate-library arg)) ".el")) + lisp-files-needed-for-byte-compilation)) + (bootstrap-other + (mapcar #'(lambda (arg) + (concat (update-elc-chop-extension + (locate-library arg)) ".el")) + lisp-files-needing-early-byte-compilation))) + (setq inhibit-autoloads t) ;; if bytecomp or byte-optimize need recompiling, then load ;; the .el version of them first, recompile them, and reload ;; the .elc versions to recompile everything else (so we won't ;; be waiting until the cows come home). we need to set ;; load-ignore-elc-files because byte-optimize gets autoloaded ;; from bytecomp. - (if (or (member bytecomp-arg update-elc-files-to-compile) - (member byte-opt-arg update-elc-files-to-compile)) - (append - '("-eval" "(setq load-ignore-elc-files t)" "-l" "bytecomp") - (if (member bytecomp-arg update-elc-files-to-compile) - (append '("-f" "batch-byte-compile-one-file") - (list bytecomp-arg))) - (if (member byte-opt-arg update-elc-files-to-compile) - (append '("-f" "batch-byte-compile-one-file") - (list byte-opt-arg))) - '("-eval" "(setq load-ignore-elc-files nil)"))) - '("-l" "bytecomp") - ;; likewise, recompile autoload.el if out-of-date. - (if (member autoload-arg update-elc-files-to-compile) - (append '("-f" "batch-byte-compile-one-file") - (list autoload-arg))) - ;; then generate autoloads for lisp and maybe lisp/mule. - (if (or need-to-rebuild-autoloads - need-to-rebuild-mule-autoloads) - '("-l" "autoload")) - (if need-to-rebuild-autoloads - '("-f" "batch-force-update-one-directory" "../lisp")) - (if need-to-rebuild-mule-autoloads - '("-f" "batch-force-update-one-directory" "../lisp/mule")) - (if need-to-recompile-autoloads - '("-f" "batch-byte-compile-one-file" - "../lisp/auto-autoloads.el")) - (if need-to-recompile-mule-autoloads - '("-f" "batch-byte-compile-one-file" - "../lisp/mule/auto-autoloads.el")) - ;; now load the autoloads and compile alles anderes. - '("-eval" "(setq inhibit-autoloads nil)" - "-f" "startup-load-autoloads" - "-f" "batch-byte-compile") - (delete autoload-arg - (delete byte-opt-arg - (delete bytecomp-arg - update-elc-files-to-compile)))))) - (load "loadup-el.el")) + (let ((recompile-bc-bootstrap + (apply #'nconc + (mapcar + #'(lambda (arg) + (when (member arg update-elc-files-to-compile) + (append '("-f" "batch-byte-compile-one-file") + (list arg)))) + bc-bootstrap))) + (recompile-bootstrap-other + (apply #'nconc + (mapcar + #'(lambda (arg) + (when (member arg update-elc-files-to-compile) + (append '("-f" "batch-byte-compile-one-file") + (list arg)))) + bootstrap-other)))) + (mapc-internal + #'(lambda (arg) + (setq update-elc-files-to-compile + (delete arg update-elc-files-to-compile))) + (append bc-bootstrap bootstrap-other)) + (setq command-line-args + (append + '("-l" "loadup-el.el" "run-temacs" + "-batch" "-no-packages" "-no-autoloads" + "-eval" "(setq stack-trace-on-error t)" + "-eval" "(setq load-always-display-messages t)") + (when recompile-bc-bootstrap + (append + '("-eval" "(setq load-ignore-elc-files t)" + "-l" "bytecomp") + recompile-bc-bootstrap + '("-eval" "(setq load-ignore-elc-files nil)"))) + '("-l" "bytecomp") + ;; likewise, recompile autoload.el etc. if out-of-date. + recompile-bootstrap-other + ;; then generate autoloads for lisp and maybe lisp/mule. + do-autoload-commands + ;; now load the autoloads and compile alles anderes. + '("-eval" "(setq inhibit-autoloads nil)" + "-f" "startup-load-autoloads" + "-f" "batch-byte-compile") + update-elc-files-to-compile + )))) + + ;;(print command-line-args) + (load "loadup-el.el")))) (kill-emacs) Index: lisp/window-xemacs.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/window-xemacs.el,v retrieving revision 1.13 retrieving revision 1.16 diff -u -r1.13 -r1.16 --- lisp/window-xemacs.el 16 Dec 2002 02:32:48 -0000 1.13 +++ lisp/window-xemacs.el 6 Feb 2003 06:35:48 -0000 1.16 @@ -74,8 +74,8 @@ Optional second arg MINIBUF t means count the minibuffer window even if not active. If MINIBUF is neither t nor nil it means not to count the minibuffer even if it is active." - (setq window (or window (selected-window)) - frame (or frame (selected-frame))) + (setq frame (or frame (selected-frame)) + window (or window (selected-window frame))) (if (not (eq (window-frame window) frame)) (error "Window must be on frame.")) (let ((current-frame (selected-frame)) @@ -298,6 +298,7 @@ (select-window (minibuffer-window frame)) (let ((window-configuration-current-window nil)) + (declare (special window-configuration-current-window)) (restore-saved-window configuration root-window (window-configuration-saved-root-window configuration) @@ -325,6 +326,9 @@ (if combination-start (window-reduce-to-one combination-start)))) +;; Note that simply using `delete-other-windows' causes obscure +;; breakage. --Mike + (defun window-reduce-to-one (window) "Make sure only one subwindow of WINDOW is left." (let ((window (window-next-child window))) @@ -370,6 +374,7 @@ (defun restore-saved-window-parameters (configuration window saved-window) "Restore the window parameters stored in SAVED-WINDOW on WINDOW." + (declare (special window-configuration-current-window)) (let ((buffer (saved-window-buffer saved-window))) (if (and buffer (buffer-live-p buffer)) (progn Index: lisp/window.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/window.el,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- lisp/window.el 2 Dec 2002 12:27:20 -0000 1.9 +++ lisp/window.el 9 Feb 2003 09:33:42 -0000 1.10 @@ -96,19 +96,23 @@ If `window-system', search all devices on window-system consoles. Any other non-nil value means search all devices." ;; If we start from the minibuffer window, don't fail to come back to it. - (if (window-minibuffer-p (selected-window)) - (setq minibuf t)) - ;; Note that, like next-window & previous-window, this behaves a little - ;; strangely if the selected window is on an invisible frame: it hits - ;; some of the windows on that frame, and all windows on visible frames. - (let* ((walk-windows-start (selected-window)) - (walk-windows-current walk-windows-start)) - (while (progn - (setq walk-windows-current - (next-window walk-windows-current minibuf which-frames - which-devices)) - (funcall function walk-windows-current) - (not (eq walk-windows-current walk-windows-start)))))) + (let ((arg (cond + ((framep which-frames) which-frames) + ((devicep which-devices) which-devices) + (t nil)))) + (if (window-minibuffer-p (selected-window arg)) + (setq minibuf t)) + ;; Note that, like next-window & previous-window, this behaves a little + ;; strangely if the selected window is on an invisible frame: it hits + ;; some of the windows on that frame, and all windows on visible frames. + (let* ((walk-windows-start (selected-window arg)) + (walk-windows-current walk-windows-start)) + (while (progn + (setq walk-windows-current + (next-window walk-windows-current minibuf which-frames + which-devices)) + (funcall function walk-windows-current) + (not (eq walk-windows-current walk-windows-start))))))) ;; The old XEmacs definition of the above clause. It's more correct in ;; that it will never hit a window that's already been hit even if you ;; do something odd like `delete-other-windows', but has the problem Index: lisp/mule/cyril-util.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/cyril-util.el,v retrieving revision 1.4 retrieving revision 1.6 diff -u -r1.4 -r1.6 --- lisp/mule/cyril-util.el 21 Mar 2002 07:30:21 -0000 1.4 +++ lisp/mule/cyril-util.el 6 Feb 2003 06:35:52 -0000 1.6 @@ -45,8 +45,10 @@ (defvar cyrillic-language-alist (list '("Belorussian") '("Bulgarian") '("Macedonian") - '("Russian") '("Serbo-Croatian") '("Ukrainian")) + '("Russian") '("Serbian") '("Ukrainian")) "*List of known cyrillic languages") + +(defvar standard-display-table) ;;;###autoload (defun standard-display-cyrillic-translit (&optional cyrillic-language) Index: lisp/mule/ethio-util.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/ethio-util.el,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- lisp/mule/ethio-util.el 29 Mar 2002 04:46:42 -0000 1.5 +++ lisp/mule/ethio-util.el 9 Jan 2003 13:09:04 -0000 1.6 @@ -1991,7 +1991,7 @@ (defun ethio-gemination nil "Compose the character before the point with the Ethiopic gemination mark. -If the characater is already composed, decompose it and remove the gemination +If the character is already composed, decompose it and remove the gemination mark." (interactive "*") (cond Index: lisp/mule/japan-util.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/japan-util.el,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- lisp/mule/japan-util.el 2 Aug 2002 16:54:24 -0000 1.5 +++ lisp/mule/japan-util.el 9 Jan 2003 13:09:05 -0000 1.6 @@ -36,7 +36,7 @@ (defun setup-japanese-environment-internal () (cond ((eq system-type 'ms-dos) (prefer-coding-system 'shift_jis)) - ((eq system-type 'usg-unix-v) + (t (prefer-coding-system 'euc-jp))) (setq sentence-end-save sentence-end) (setq sentence-end (concat sentence-end "\\|[$B!#!)!*(B]"))) Index: lisp/mule/mule-cmds.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/mule-cmds.el,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- lisp/mule/mule-cmds.el 2 Aug 2002 16:54:25 -0000 1.21 +++ lisp/mule/mule-cmds.el 10 Feb 2003 17:47:44 -0000 1.22 @@ -756,7 +756,8 @@ ;; Fit the charsets preferences in unicode conversions for the ;; language environment. - (set-language-unicode-precedence-list (charset-list)) + (set-language-unicode-precedence-list + (get-language-info language-name 'charset)) (run-hooks 'set-language-environment-hook) (force-mode-line-update t)) Index: lisp/mule/viet-util.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/viet-util.el,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- lisp/mule/viet-util.el 21 Mar 2002 07:30:23 -0000 1.4 +++ lisp/mule/viet-util.el 9 Jan 2003 13:09:04 -0000 1.5 @@ -223,7 +223,7 @@ ;;;###autoload (defun viet-decode-viqr-region (from to) - "Convert `VIQR' mnemonics of the current region to Vietnamese characaters. + "Convert `VIQR' mnemonics of the current region to Vietnamese characters. When called from a program, expects two arguments, positions (integers or markers) specifying the stretch of the region." (interactive "r") @@ -240,13 +240,13 @@ ;;;###autoload (defun viet-decode-viqr-buffer () - "Convert `VIQR' mnemonics of the current buffer to Vietnamese characaters." + "Convert `VIQR' mnemonics of the current buffer to Vietnamese characters." (interactive) (viet-decode-viqr-region (point-min) (point-max))) ;;;###autoload (defun viet-encode-viqr-region (from to) - "Convert Vietnamese characaters of the current region to `VIQR' mnemonics. + "Convert Vietnamese characters of the current region to `VIQR' mnemonics. When called from a program, expects two arguments, positions (integers or markers) specifying the stretch of the region." (interactive "r") @@ -263,7 +263,7 @@ ;;;###autoload (defun viet-encode-viqr-buffer () - "Convert Vietnamese characaters of the current buffer to `VIQR' mnemonics." + "Convert Vietnamese characters of the current buffer to `VIQR' mnemonics." (interactive) (viet-encode-viqr-region (point-min) (point-max))) Index: lwlib/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/ChangeLog,v retrieving revision 1.43 retrieving revision 1.48 diff -u -r1.43 -r1.48 --- lwlib/ChangeLog 5 Jan 2003 05:13:35 -0000 1.43 +++ lwlib/ChangeLog 16 Feb 2003 06:13:27 -0000 1.48 @@ -1,3 +1,41 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-02-13 Martin Buchholz + + * xlwmenu.c (xlwMenuClassRec): + Use symbolic name `XtExposeCompressMaximal' instead of `TRUE'. + +2003-01-31 Martin Buchholz + + * lwlib-Xm.c (xm_update_progress): + Don't define unless LWLIB_WIDGETS_MOTIF. + +2003-02-05 Ben Wing + + * lwlib-Xm.c: + * lwlib-Xm.c (xm_pop_down_callback): + * lwlib-Xm.c (xm_pull_down_callback): + Fix compile warning. + +2002-12-16 Ben Wing + + * lwlib-Xlw.c (xlw_update_one_widget): + * lwlib-Xm.c (xm_update_one_widget): + * lwlib-Xm.c (xm_update_one_value): + * lwlib.c: + * lwlib.c (merge_scrollbar_values): + * xlwmenu.c: + * xlwmenu.c (display_menu): + * xlwmenu.c (XlwMenuInitialize): + * xlwmenu.c (XlwMenuSetValues): + * xlwradio.c: + * xlwradio.c (RadioClassPartInit): + * xlwradio.c (RadioSet): + * xlwradio.c (RadioUnset): + class -> class_, new -> new_. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: lwlib/lwlib-Xlw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/lwlib-Xlw.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- lwlib/lwlib-Xlw.c 13 Mar 2002 08:52:22 -0000 1.11 +++ lwlib/lwlib-Xlw.c 12 Jan 2003 10:45:53 -0000 1.12 @@ -535,12 +535,12 @@ xlw_update_one_widget (widget_instance* instance, Widget widget, widget_value* val, Boolean deep_p) { - WidgetClass class = XtClass (widget); + WidgetClass class_ = XtClass (widget); if (0) ; #ifdef LWLIB_MENUBARS_LUCID - else if (class == xlwMenuWidgetClass) + else if (class_ == xlwMenuWidgetClass) { XlwMenuWidget mw; Arg al [1]; @@ -553,13 +553,13 @@ } #endif #ifdef LWLIB_SCROLLBARS_LUCID - else if (class == xlwScrollBarWidgetClass) + else if (class_ == xlwScrollBarWidgetClass) { xlw_update_scrollbar (instance, widget, val); } #endif #ifdef LWLIB_TABS_LUCID - else if (class == tabsWidgetClass) + else if (class_ == tabsWidgetClass) { xlw_update_tab_control (instance, widget, val); } Index: lwlib/lwlib-Xm.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/lwlib-Xm.c,v retrieving revision 1.16 retrieving revision 1.19 diff -u -r1.16 -r1.19 --- lwlib/lwlib-Xm.c 6 Jul 2002 05:48:18 -0000 1.16 +++ lwlib/lwlib-Xm.c 9 Feb 2003 15:30:44 -0000 1.19 @@ -72,7 +72,7 @@ #endif static void xm_internal_update_other_instances (Widget, XtPointer, XtPointer); -static void xm_pop_down_callback (Widget, XtPointer, XtPointer); +/* static void xm_pop_down_callback (Widget, XtPointer, XtPointer); */ static void xm_generic_callback (Widget, XtPointer, XtPointer); static void mark_dead_instance_destroyed (Widget widget, XtPointer closure, XtPointer call_data); @@ -344,6 +344,7 @@ XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); } +#ifdef LWLIB_WIDGETS_MOTIF static void xm_update_progress (widget_instance* instance, Widget scale, widget_value* val) @@ -373,6 +374,7 @@ XtSetValues (scale, al, 1); } +#endif /* LWLIB_WIDGETS_MOTIF */ #ifdef LWLIB_MENUBARS_MOTIF @@ -824,7 +826,7 @@ xm_update_one_widget (widget_instance* instance, Widget widget, widget_value* val, Boolean deep_p) { - WidgetClass class; + WidgetClass class_; Arg al [20]; int ac = 0; @@ -840,25 +842,25 @@ /* Common to all label like widgets */ xm_safe_update_label (instance, widget, val); #endif - class = XtClass (widget); + class_ = XtClass (widget); /* Class specific things */ - if (class == xmPushButtonWidgetClass || - class == xmArrowButtonWidgetClass) + if (class_ == xmPushButtonWidgetClass || + class_ == xmArrowButtonWidgetClass) { xm_update_pushbutton (instance, widget, val); } #ifdef LWLIB_MENUBARS_MOTIF - else if (class == xmCascadeButtonWidgetClass) + else if (class_ == xmCascadeButtonWidgetClass) { xm_update_cascadebutton (instance, widget, val); } #endif - else if (class == xmToggleButtonWidgetClass - || class == xmToggleButtonGadgetClass) + else if (class_ == xmToggleButtonWidgetClass + || class_ == xmToggleButtonGadgetClass) { xm_update_toggle (instance, widget, val); } - else if (class == xmRowColumnWidgetClass) + else if (class_ == xmRowColumnWidgetClass) { Boolean radiobox = 0; @@ -872,31 +874,31 @@ xm_update_menu (instance, widget, val, deep_p); #endif } - else if (class == xmTextWidgetClass) + else if (class_ == xmTextWidgetClass) { xm_update_text (instance, widget, val); } - else if (class == xmTextFieldWidgetClass) + else if (class_ == xmTextFieldWidgetClass) { xm_update_text_field (instance, widget, val); } - else if (class == xmListWidgetClass) + else if (class_ == xmListWidgetClass) { xm_update_list (instance, widget, val); } #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 - else if (class == xmComboBoxWidgetClass) + else if (class_ == xmComboBoxWidgetClass) { xm_update_combo_box (instance, widget, val); } #endif #ifdef LWLIB_SCROLLBARS_MOTIF - else if (class == xmScrollBarWidgetClass) + else if (class_ == xmScrollBarWidgetClass) { xm_update_scrollbar (instance, widget, val); } #endif - else if (class == xmScaleWidgetClass) + else if (class_ == xmScaleWidgetClass) { xm_update_progress (instance, widget, val); } @@ -910,7 +912,7 @@ xm_update_one_value (widget_instance* instance, Widget widget, widget_value* val) { - WidgetClass class = XtClass (widget); + WidgetClass class_ = XtClass (widget); widget_value *old_wv; /* copy the call_data slot into the "return" widget_value */ @@ -921,28 +923,28 @@ break; } - if (class == xmToggleButtonWidgetClass || class == xmToggleButtonGadgetClass) + if (class_ == xmToggleButtonWidgetClass || class_ == xmToggleButtonGadgetClass) { Arg al [1]; XtSetArg (al [0], XmNset, &val->selected); XtGetValues (widget, al, 1); val->edited = True; } - else if (class == xmTextWidgetClass) + else if (class_ == xmTextWidgetClass) { if (val->value) XtFree (val->value); val->value = XmTextGetString (widget); val->edited = True; } - else if (class == xmTextFieldWidgetClass) + else if (class_ == xmTextFieldWidgetClass) { if (val->value) XtFree (val->value); val->value = XmTextFieldGetString (widget); val->edited = True; } - else if (class == xmRowColumnWidgetClass) + else if (class_ == xmRowColumnWidgetClass) { Boolean radiobox = 0; { @@ -973,9 +975,9 @@ val->edited = True; } } - else if (class == xmListWidgetClass + else if (class_ == xmListWidgetClass #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 - || class == xmComboBoxWidgetClass + || class_ == xmComboBoxWidgetClass #endif ) { @@ -983,7 +985,7 @@ int* pos_list; Widget list = widget; #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 - if (class == xmComboBoxWidgetClass) + if (class_ == xmComboBoxWidgetClass) list = CB_List (widget); #endif if (XmListGetSelectedPos (list, &pos_list, &pos_cnt)) @@ -1008,7 +1010,7 @@ } } #ifdef LWLIB_SCROLLBARS_MOTIF - else if (class == xmScrollBarWidgetClass) + else if (class_ == xmScrollBarWidgetClass) { /* This function is not used by the scrollbar. */ return; @@ -2071,11 +2073,13 @@ do_call (widget, closure, selection); } +#if 0 /* Caller above is commented out */ static void xm_pop_down_callback (Widget widget, XtPointer closure, XtPointer call_data) { do_call (widget, closure, post_activate); } +#endif /* 0 */ #ifdef LWLIB_MENUBARS_MOTIF Index: lwlib/lwlib.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/lwlib.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- lwlib/lwlib.c 20 Jun 2002 21:18:13 -0000 1.17 +++ lwlib/lwlib.c 12 Jan 2003 10:45:53 -0000 1.18 @@ -196,24 +196,24 @@ * to new->scrollbar_data. */ static Boolean -merge_scrollbar_values (widget_value *old, widget_value *new) +merge_scrollbar_values (widget_value *old, widget_value *new_) { Boolean changed = False; - if (new->scrollbar_data && !old->scrollbar_data) + if (new_->scrollbar_data && !old->scrollbar_data) { - copy_scrollbar_values (new, old); + copy_scrollbar_values (new_, old); changed = True; } - else if (!new->scrollbar_data && old->scrollbar_data) + else if (!new_->scrollbar_data && old->scrollbar_data) { free (old->scrollbar_data); old->scrollbar_data = NULL; } - else if (new->scrollbar_data && old->scrollbar_data) + else if (new_->scrollbar_data && old->scrollbar_data) { scrollbar_values *old_sb = old->scrollbar_data; - scrollbar_values *new_sb = new->scrollbar_data; + scrollbar_values *new_sb = new_->scrollbar_data; if ((old_sb->line_increment != new_sb->line_increment) || (old_sb->page_increment != new_sb->page_increment) || @@ -836,6 +836,8 @@ } } +#if defined (NEED_LUCID) || defined (NEED_ATHENA) || defined (NEED_MOTIF) + /* strcasecmp() is not sufficiently portable or standard, and it's easier just to write our own. */ static int @@ -851,8 +853,6 @@ if (c1 == '\0') return 0; } } - -#if defined (NEED_LUCID) || defined (NEED_ATHENA) || defined (NEED_MOTIF) static widget_creation_function find_in_table (const char *type, const widget_creation_entry table[]) Index: lwlib/xlwmenu.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwmenu.c,v retrieving revision 1.34 retrieving revision 1.36 diff -u -r1.34 -r1.36 --- lwlib/xlwmenu.c 13 Aug 2001 04:45:58 -0000 1.34 +++ lwlib/xlwmenu.c 14 Feb 2003 07:38:27 -0000 1.36 @@ -151,13 +151,13 @@ }; #undef offset -static Boolean XlwMenuSetValues (Widget current, Widget request, Widget new, +static Boolean XlwMenuSetValues (Widget current, Widget request, Widget new_, ArgList args, Cardinal *num_args); static void XlwMenuRealize (Widget w, Mask *valueMask, XSetWindowAttributes *attributes); static void XlwMenuRedisplay (Widget w, XEvent *ev, Region region); static void XlwMenuResize (Widget w); -static void XlwMenuInitialize (Widget request, Widget new, ArgList args, +static void XlwMenuInitialize (Widget request, Widget new_, ArgList args, Cardinal *num_args); static void XlwMenuDestroy (Widget w); static void XlwMenuClassInitialize (void); @@ -197,7 +197,7 @@ XtNumber(xlwMenuResources), /* resource_count */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ - TRUE, /* compress_exposure */ + XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ XlwMenuDestroy, /* destroy */ @@ -2200,7 +2200,7 @@ static void display_menu (XlwMenuWidget mw, int level, Boolean just_compute_p, XPoint *highlighted_pos, XPoint *hit, widget_value **hit_return, - widget_value *this, widget_value *that) + widget_value *this_, widget_value *that) { widget_value *val; widget_value *following_item; @@ -2272,7 +2272,7 @@ } just_compute_this_one_p = - just_compute_p || ((this || that) && val != this && val != that); + just_compute_p || ((this_ || that) && val != this_ && val != that); start.x = where.x; start.y = where.y; @@ -3000,11 +3000,11 @@ #endif /* NEED_MOTIF */ static void -XlwMenuInitialize (Widget request, Widget new, ArgList args, +XlwMenuInitialize (Widget request, Widget new_, ArgList args, Cardinal *num_args) { /* Get the GCs and the widget size */ - XlwMenuWidget mw = (XlwMenuWidget)new; + XlwMenuWidget mw = (XlwMenuWidget)new_; Window window = RootWindowOfScreen (DefaultScreenOfDisplay (XtDisplay (mw))); Display *display = XtDisplay (mw); @@ -3163,11 +3163,11 @@ } static Boolean -XlwMenuSetValues (Widget current, Widget request, Widget new, ArgList args, +XlwMenuSetValues (Widget current, Widget request, Widget new_, ArgList args, Cardinal *num_args) { XlwMenuWidget oldmw = (XlwMenuWidget)current; - XlwMenuWidget newmw = (XlwMenuWidget)new; + XlwMenuWidget newmw = (XlwMenuWidget)new_; Boolean redisplay = False; int i; Index: lwlib/xlwradio.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwradio.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- lwlib/xlwradio.c 12 Apr 2001 18:21:55 -0000 1.2 +++ lwlib/xlwradio.c 12 Jan 2003 10:45:53 -0000 1.3 @@ -200,9 +200,9 @@ } static void -RadioClassPartInit (WidgetClass class) +RadioClassPartInit (WidgetClass class_) { - RadioWidgetClass c = (RadioWidgetClass) class ; + RadioWidgetClass c = (RadioWidgetClass) class_ ; RadioWidgetClass super = (RadioWidgetClass)c->core_class.superclass ; if( c->radio_class.drawDiamond == NULL || @@ -480,14 +480,14 @@ Cardinal *num_params) /* unused */ { RadioWidget rw = (RadioWidget)w; - RadioWidgetClass class = (RadioWidgetClass) w->core.widget_class ; + RadioWidgetClass class_ = (RadioWidgetClass) w->core.widget_class ; if( rw->command.set ) return ; rw->command.set = TRUE ; if( XtIsRealized(w) ) - class->radio_class.drawDiamond(w) ; + class_->radio_class.drawDiamond(w) ; } @@ -499,14 +499,14 @@ Cardinal *num_params) /* unused */ { RadioWidget rw = (RadioWidget)w; - RadioWidgetClass class = (RadioWidgetClass) w->core.widget_class ; + RadioWidgetClass class_ = (RadioWidgetClass) w->core.widget_class ; if( ! rw->command.set ) return ; rw->command.set = FALSE ; if( XtIsRealized(w) ) - class->radio_class.drawDiamond(w) ; + class_->radio_class.drawDiamond(w) ; } Index: man/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/ChangeLog,v retrieving revision 1.202 retrieving revision 1.208 diff -u -r1.202 -r1.208 --- man/ChangeLog 5 Jan 2003 10:53:58 -0000 1.202 +++ man/ChangeLog 16 Feb 2003 06:13:29 -0000 1.208 @@ -1,3 +1,62 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-02-11 Adrian Aichner + + * lispref/backups.texi (Auto-Saving): Fix auto-save xref to user + manual. + +2003-02-06 Stephen J. Turnbull + + * internals/internals.texi (Top): + (Buffers and Textual Representation): + Fix up white space in menu. + (Character-Related Data Types): + (Conversion to and from External Data): + (Format of the Extent Info): + Pedantic grammatical nits. + +2003-02-05 Ben Wing + + * lispref/mule.texi (Internationalization Terminology): + Lots of Mule rewriting. + +2003-02-05 Ben Wing + + * internals/internals.texi (Top): + * internals/internals.texi (Coding for Mule): + * internals/internals.texi (Character-Related Data Types): + * internals/internals.texi (Working With Character and Byte Positions): + * internals/internals.texi (Conversion to and from External Data): + * internals/internals.texi (General Guidelines for Writing Mule-Aware Code): + * internals/internals.texi (An Example of Mule-Aware Code): + * internals/internals.texi (Mule-izing Code): + * internals/internals.texi (help): New. + * internals/internals.texi (Buffers and Textual Representation): + * internals/internals.texi (The Text in a Buffer): + * internals/internals.texi (Markers and Extents): + * internals/internals.texi (MULE Character Sets and Encodings): + * internals/internals.texi (Lstream Functions): + * internals/internals.texi (Lstream Methods): + * internals/internals.texi (Format of the Extent Info): + * internals/internals.texi (Mathematics of Extent Ordering): + Major fixup. Correct for new names of Bytebpos, Ichar, etc. and + lots of Mule rewriting. + +2003-02-05 Stephen J. Turnbull + + * xemacs/startup.texi (Startup Paths): Clarification of package + hierarchy structure. + + * xemacs-faq.texi (Q2.0.13, Q2.0.14, Q2.1.24, Q2.1.25): Not NEW. + (Q2.1.15): Stylistic changes for clarity. + +2003-02-03 Steve Youngs + + * xemacs/packages.texi (Local.rules File): Update to reflect Ben's + recent dabble into the packages. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: man/xemacs-faq.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs-faq.texi,v retrieving revision 1.66 retrieving revision 1.67 diff -u -r1.66 -r1.67 --- man/xemacs-faq.texi 3 Jan 2003 12:12:30 -0000 1.66 +++ man/xemacs-faq.texi 5 Feb 2003 08:18:55 -0000 1.67 @@ -7,7 +7,7 @@ @finalout @titlepage @title XEmacs FAQ -@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2003/01/03 12:12:30 $ +@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2003/02/05 08:18:55 $ @sp 1 @author Tony Rossini @author Ben Wing @@ -149,8 +149,8 @@ * Q2.0.10:: After I run configure I find a coredump, is something wrong? * Q2.0.11:: XEmacs can't resolve host names. * Q2.0.12:: Why can't I strip XEmacs? -* Q2.0.13:: I don't need no steenkin' packages. Do I? (NEW) -* Q2.0.14:: How do I figure out which packages to install? (NEW) +* Q2.0.13:: I don't need no steenkin' packages. Do I? +* Q2.0.14:: How do I figure out which packages to install? * Q2.0.15:: EFS fails with "500 AUTH not understood" (NEW) * Q2.0.16:: Cygwin XEmacs won't start: cygXpm-noX4.dll was not found (NEW) @@ -178,8 +178,8 @@ * Q2.1.21:: [This question intentionally left blank] * Q2.1.22:: XEmacs seems to take a really long time to do some things. * Q2.1.23:: Movemail on Linux does not work for XEmacs 19.15 and later. -* Q2.1.24:: XEmacs won't start without network. (NEW) -* Q2.1.25:: After upgrading, XEmacs won't do `foo' any more! (NEW) +* Q2.1.24:: XEmacs won't start without network. +* Q2.1.25:: After upgrading, XEmacs won't do `foo' any more! Customization and Options @@ -1344,8 +1344,8 @@ * Q2.0.10:: After I run configure I find a coredump, is something wrong? * Q2.0.11:: XEmacs can't resolve host names. * Q2.0.12:: Why can't I strip XEmacs? -* Q2.0.13:: I don't need no steenkin' packages. Do I? (NEW) -* Q2.0.14:: I don't want to install a million .els one at a time! (NEW) +* Q2.0.13:: I don't need no steenkin' packages. Do I? +* Q2.0.14:: I don't want to install a million .els one at a time! * Q2.0.15:: EFS fails with "500 AUTH not understood" (NEW) * Q2.0.16:: Cygwin XEmacs won't start: cygXpm-noX4.dll was not found (NEW) @@ -1373,8 +1373,8 @@ * Q2.1.21:: [This question intentionally left blank] * Q2.1.22:: XEmacs seems to take a really long time to do some things. * Q2.1.23:: Movemail on Linux does not work for XEmacs 19.15 and later. -* Q2.1.24:: XEmacs won't start without network. (NEW) -* Q2.1.25:: After upgrading, XEmacs won't do `foo' any more! (NEW) +* Q2.1.24:: XEmacs won't start without network. +* Q2.1.25:: After upgrading, XEmacs won't do `foo' any more! @end menu @node Q2.0.1, Q2.0.2, Installation, Installation @@ -1501,9 +1501,9 @@ XEmacs to read what it says about your platform. If you compiled XEmacs using @samp{--use-union-type} (or the option -@samp{USE_UNION_TYPE} in @file{config.inc} under Windows), recompile -again without this. This has been known to trigger compiler errors in a -number of cases. +@samp{USE_UNION_TYPE} in @file{config.inc} under Windows), try +recompiling again without it. The union type has been known to trigger +compiler errors in a number of cases. @node Q2.0.7, Q2.0.8, Q2.0.6, Installation @unnumberedsubsec Q2.0.7: Libraries in non-standard locations @@ -1721,7 +1721,7 @@ @end quotation @node Q2.0.13, Q2.0.14, Q2.0.12, Installation -@unnumberedsubsec Q2.0.13: I don't need no steenkin' packages. Do I? (NEW) +@unnumberedsubsec Q2.0.13: I don't need no steenkin' packages. Do I? Strictly speaking, no. XEmacs will build and install just fine without any packages installed. However, only the most basic editing functions @@ -1729,7 +1729,7 @@ an essential part of making your installed XEmacs _useful_. @node Q2.0.14, Q2.0.15, Q2.0.13, Installation -@unnumberedsubsec Q2.0.14: How do I figure out which packages to install? (NEW) +@unnumberedsubsec Q2.0.14: How do I figure out which packages to install? Many people really liked the old way that packages were bundled and do not want to mess with packages at all. You can grab all the packages at @@ -2213,7 +2213,7 @@ @end quotation @node Q2.1.15, Q2.1.16, Q2.1.14, Installation -@unnumberedsubsec Q2.1.15: How to Debug an XEmacs problem with a debugger +@unnumberedsubsec Q2.1.15: How to debug an XEmacs problem with a debugger If XEmacs does crash on you, one of the most productive things you can do to help get the bug fixed is to poke around a bit with the debugger. @@ -2226,18 +2226,22 @@ optimization (e.g. with GCC use the compiler flags @samp{-g -O0} -- that's an "oh" followed by a zero), and with the configure options @samp{--debug=yes} and @samp{--error-checking=all}. This will make your -XEmacs run somewhat slower but make it a lot more likely to catch the -problem earlier (closer to its source), and a lot easier to determine -what's going on with a debugger. +XEmacs run somewhat slower, but you are a lot more likely to catch the +problem earlier (closer to its source). It makes it a lot easier to +determine what's going on with a debugger. + +@item +If it's not a true crash (@emph{i.e.}, XEmacs is hung, or a zombie +process), or it's inconvenient to run XEmacs again because XEmacs is +already running or is running in batch mode as part of a bunch of +scripts, you may be able to attach to the existing process with your +debugger. Most debuggers let you do this by substituting the process ID +for the core file when you invoke the debugger from the command line, or +by using the @code{attach} command or something similar. @item -If you're able to run XEmacs under a debugger and reproduce the crash -(if it's inconvenient to do this because XEmacs is already running or is -running in batch mode as part of a bunch of scripts, consider attaching -to the existing process with your debugger; most debuggers let you do -this by substituting the process ID for the core file when you invoke -the debugger from the command line, or by using the @code{attach} -command or something similar), here are some things you can do: +If you're able to run XEmacs under a debugger and reproduce the crash, +here are some things you can do: @item If XEmacs is hitting an assertion failure, put a breakpoint on @@ -2254,18 +2258,18 @@ @item Internally, you will probably see lots of variables that hold objects of -type @code{Lisp_Object}. These are exactly what they appear to be, -i.e. references to Lisp objects. Printing them out with the debugger -probably won't be too useful---you'll likely just see a number. To -decode them, do this: +type @code{Lisp_Object}. These are references to Lisp objects. +Printing them out with the debugger probably won't be too +useful---you'll likely just see a number. To decode them, do this: @example call dp (OBJECT) @end example where @var{OBJECT} is whatever you want to decode (it can be a variable, -a function call, etc.). This will print out a readable representation -on the TTY from which the xemacs process was invoked. +a function call, etc.). This uses the Lisp printing routines to out a +readable representation on the TTY from which the xemacs process was +invoked. @item If you want to get a Lisp backtrace showing the Lisp call @@ -2276,10 +2280,10 @@ @end example @item -Using @code{dp} and @code{db} has two disadvantages - it can only be -used with a running xemacs process, and it cannot display the internal C -structure of a Lisp Object. Even if all you've got is a core dump, all -is not lost. +Using @code{dp} and @code{db} has two disadvantages - they can only be +used with a running (including hung or zombie) xemacs process, and they +do not display the internal C structure of a Lisp Object. Even if all +you've got is a core dump, all is not lost. If you're using GDB, there are some macros in the file @file{src/.gdbinit} in the XEmacs source distribution that should make @@ -2299,12 +2303,14 @@ @item lbt Usage: lbt @* Print the current Lisp stack trace. -Requires a running xemacs process. +Requires a running xemacs process. (It works by calling the db +routine described above.) @item ldp Usage: ldp lisp_object @* Print a Lisp Object value using the Lisp printer. -Requires a running xemacs process. +Requires a running xemacs process. (It works by calling the dp +routine described above.) @item run-temacs Usage: run-temacs @* @@ -2360,7 +2366,11 @@ Your stack is getting trashed. Debugging this is hard; you have to do a binary-search type of narrowing down where the crash occurs, until you figure out exactly which line is causing the problem. Of course, this -only works if the bug is highly reproducible. +only works if the bug is highly reproducible. Also, in many cases if +you run XEmacs from the debugger, the debugger can protect the stack +somewhat. However, if the stack is being smashed, it is typically the +case that there is a wild pointer somewhere in the program, often quite +far from where the crash occurs. @item If your stack trace has exactly one frame in it, with address 0x0, this @@ -2525,7 +2535,7 @@ @end quotation @node Q2.1.24, Q2.1.25, Q2.1.23, Installation -@unnumberedsubsec Q2.1.24: XEmacs won't start without network. (NEW) +@unnumberedsubsec Q2.1.24: XEmacs won't start without network. If XEmacs starts when you're on the network, but fails when you're not on the network, you may be missing a "localhost" entry in your @@ -2538,7 +2548,7 @@ Add that line, and XEmacs will be happy. @node Q2.1.25, , Q2.1.24, Installation -@unnumberedsubsec Q2.1.25:: After upgrading, XEmacs won't do `foo' any more! (NEW) +@unnumberedsubsec Q2.1.25:: After upgrading, XEmacs won't do `foo' any more! You have been used to doing `foo', but now when you invoke it (or click the toolbar button or select the menu item), nothing (or an error) Index: man/internals/internals.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/internals/internals.texi,v retrieving revision 1.38 retrieving revision 1.40 diff -u -r1.38 -r1.40 --- man/internals/internals.texi 3 Jan 2003 12:12:36 -0000 1.38 +++ man/internals/internals.texi 6 Feb 2003 14:37:56 -0000 1.40 @@ -267,7 +267,7 @@ * The Text in a Buffer:: Representation of the text in a buffer. * Buffer Lists:: Keeping track of all buffers. * Markers and Extents:: Tagging locations within a buffer. -* Bufbytes and Emchars:: Representation of individual characters. +* Ibytes and Ichars:: Representation of individual characters. * The Buffer Object:: The Lisp object corresponding to a buffer. MULE Character Sets and Encodings @@ -2748,6 +2748,7 @@ * Conversion to and from External Data:: * General Guidelines for Writing Mule-Aware Code:: * An Example of Mule-Aware Code:: +* Mule-izing Code:: @end menu @node Character-Related Data Types @@ -2756,77 +2757,90 @@ @cindex data types, character-related First, let's review the basic character-related datatypes used by -XEmacs. Note that the separate @code{typedef}s are not mandatory in the -current implementation (all of them boil down to @code{unsigned char} or -@code{int}), but they improve clarity of code a great deal, because one +XEmacs. Note that some of the separate @code{typedef}s are not +mandatory, but they improve clarity of code a great deal, because one glance at the declaration can tell the intended use of the variable. @table @code -@item Emchar -@cindex Emchar -An @code{Emchar} holds a single Emacs character. +@item Ichar +@cindex Ichar +An @code{Ichar} holds a single Emacs character. Obviously, the equality between characters and bytes is lost in the Mule world. Characters can be represented by one or more bytes in the -buffer, and @code{Emchar} is the C type large enough to hold any +buffer, and @code{Ichar} is a C type large enough to hold any character. -Without Mule support, an @code{Emchar} is equivalent to an +Without Mule support, an @code{Ichar} is equivalent to an @code{unsigned char}. -@item Bufbyte -@cindex Bufbyte +@item Ibyte +@cindex Ibyte The data representing the text in a buffer or string is logically a set -of @code{Bufbyte}s. +of @code{Ibyte}s. XEmacs does not work with the same character formats all the time; when reading characters from the outside, it decodes them to an internal -format, and likewise encodes them when writing. @code{Bufbyte} (in fact +format, and likewise encodes them when writing. @code{Ibyte} (in fact @code{unsigned char}) is the basic unit of XEmacs internal buffers and -strings format. A @code{Bufbyte *} is the type that points at text +strings format. An @code{Ibyte *} is the type that points at text encoded in the variable-width internal encoding. -One character can correspond to one or more @code{Bufbyte}s. In the +One character can correspond to one or more @code{Ibyte}s. In the current Mule implementation, an ASCII character is represented by the -same @code{Bufbyte}, and other characters are represented by a sequence -of two or more @code{Bufbyte}s. +same @code{Ibyte}, and other characters are represented by a sequence +of two or more @code{Ibyte}s. Without Mule support, there are exactly 256 characters, implicitly -Latin-1, and each character is represented using one @code{Bufbyte}, and -there is a one-to-one correspondence between @code{Bufbyte}s and -@code{Emchar}s. +Latin-1, and each character is represented using one @code{Ibyte}, and +there is a one-to-one correspondence between @code{Ibyte}s and +@code{Ichar}s. -@item Bufpos +@item Charxpos +@item Charbpos @itemx Charcount -@cindex Bufpos +@cindex Charxpos +@cindex Charbpos @cindex Charcount -A @code{Bufpos} represents a character position in a buffer or string. -A @code{Charcount} represents a number (count) of characters. -Logically, subtracting two @code{Bufpos} values yields a -@code{Charcount} value. Although all of these are @code{typedef}ed to +A @code{Charbpos} represents a character position in a buffer. A +@code{Charcount} represents a number (count) of characters. Logically, +subtracting two @code{Charbpos} values yields a @code{Charcount} value. +When representing a character position in a string, we just use +@code{Charcount} directly. The reason for having a separate typedef for +buffer positions is that they are 1-based, whereas string positions are +0-based and hence string counts and positions can be freely intermixed (a +string position is equivalent to the count of characters from the +beginning). When representing a character position that could be either +in a buffer or string (for example, in the extent code), @code{Charxpos} +is used. Although all of these are @code{typedef}ed to @code{EMACS_INT}, we use them in preference to @code{EMACS_INT} to make it clear what sort of position is being used. -@code{Bufpos} and @code{Charcount} values are the only ones that are -ever visible to Lisp. +@code{Charxpos}, @code{Charbpos} and @code{Charcount} values are the +only ones that are ever visible to Lisp. -@item Bytind +@item Bytexpos @itemx Bytecount -@cindex Bytind +@cindex Bytebpos @cindex Bytecount -A @code{Bytind} represents a byte position in a buffer or string. A -@code{Bytecount} represents the distance between two positions, in bytes. -The relationship between @code{Bytind} and @code{Bytecount} is the same -as the relationship between @code{Bufpos} and @code{Charcount}. +A @code{Bytebpos} represents a byte position in a buffer. A +@code{Bytecount} represents the distance between two positions, in +bytes. Byte positions in strings use @code{Bytecount}, and for byte +positions that can be either in a buffer or string, @code{Bytexpos} is +used. The relationship between @code{Bytexpos}, @code{Bytebpos} and +@code{Bytecount} is the same as the relationship between +@code{Charxpos}, @code{Charbpos} and @code{Charcount}. @item Extbyte -@itemx Extcount @cindex Extbyte -@cindex Extcount When dealing with the outside world, XEmacs works with @code{Extbyte}s, -which are equivalent to @code{unsigned char}. Obviously, an -@code{Extcount} is the distance between two @code{Extbyte}s. Extbytes -and Extcounts are not all that frequent in XEmacs code. +which are equivalent to @code{char}. The distance between two +@code{Extbyte}s is a @code{Bytecount}, since external text is a +byte-by-byte encoding. Extbytes occur mainly at the transition point +between internal text and external functions. XEmacs code should not, +if it can possibly avoid it, do any actual manipulation using external +text, since its format is completely unpredictable (it might not even be +ASCII-compatible). @end table @node Working With Character and Byte Positions @@ -2843,8 +2857,8 @@ learn about them. @table @code -@item MAX_EMCHAR_LEN -@cindex MAX_EMCHAR_LEN +@item MAX_ICHAR_LEN +@cindex MAX_ICHAR_LEN This preprocessor constant is the maximum number of buffer bytes to represent an Emacs character in the variable width internal encoding. It is useful when allocating temporary strings to keep a known number of @@ -2857,75 +2871,75 @@ ... @{ /* Allocate place for @var{cclen} characters. */ - Bufbyte *buf = (Bufbyte *)alloca (cclen * MAX_EMCHAR_LEN); + Ibyte *buf = (Ibyte *) alloca (cclen * MAX_ICHAR_LEN); ... @end group @end example If you followed the previous section, you can guess that, logically, -multiplying a @code{Charcount} value with @code{MAX_EMCHAR_LEN} produces +multiplying a @code{Charcount} value with @code{MAX_ICHAR_LEN} produces a @code{Bytecount} value. -In the current Mule implementation, @code{MAX_EMCHAR_LEN} equals 4. +In the current Mule implementation, @code{MAX_ICHAR_LEN} equals 4. Without Mule, it is 1. -@item charptr_emchar -@itemx set_charptr_emchar -@cindex charptr_emchar -@cindex set_charptr_emchar -The @code{charptr_emchar} macro takes a @code{Bufbyte} pointer and -returns the @code{Emchar} stored at that position. If it were a +@item itext_ichar +@itemx set_itext_ichar +@cindex itext_ichar +@cindex set_itext_ichar +The @code{itext_ichar} macro takes a @code{Ibyte} pointer and +returns the @code{Ichar} stored at that position. If it were a function, its prototype would be: @example -Emchar charptr_emchar (Bufbyte *p); +Ichar itext_ichar (Ibyte *p); @end example -@code{set_charptr_emchar} stores an @code{Emchar} to the specified byte +@code{set_itext_ichar} stores an @code{Ichar} to the specified byte position. It returns the number of bytes stored: @example -Bytecount set_charptr_emchar (Bufbyte *p, Emchar c); +Bytecount set_itext_ichar (Ibyte *p, Ichar c); @end example -It is important to note that @code{set_charptr_emchar} is safe only for +It is important to note that @code{set_itext_ichar} is safe only for appending a character at the end of a buffer, not for overwriting a character in the middle. This is because the width of characters -varies, and @code{set_charptr_emchar} cannot resize the string if it +varies, and @code{set_itext_ichar} cannot resize the string if it writes, say, a two-byte character where a single-byte character used to reside. -A typical use of @code{set_charptr_emchar} can be demonstrated by this +A typical use of @code{set_itext_ichar} can be demonstrated by this example, which copies characters from buffer @var{buf} to a temporary -string of Bufbytes. +string of Ibytes. @example @group @{ - Bufpos pos; + Charbpos pos; for (pos = beg; pos < end; pos++) @{ - Emchar c = BUF_FETCH_CHAR (buf, pos); - p += set_charptr_emchar (buf, c); + Ichar c = BUF_FETCH_CHAR (buf, pos); + p += set_itext_ichar (buf, c); @} @} @end group @end example -Note how @code{set_charptr_emchar} is used to store the @code{Emchar} +Note how @code{set_itext_ichar} is used to store the @code{Ichar} and increment the counter, at the same time. -@item INC_CHARPTR -@itemx DEC_CHARPTR -@cindex INC_CHARPTR -@cindex DEC_CHARPTR -These two macros increment and decrement a @code{Bufbyte} pointer, +@item INC_IBYTEPTR +@itemx DEC_IBYTEPTR +@cindex INC_IBYTEPTR +@cindex DEC_IBYTEPTR +These two macros increment and decrement an @code{Ibyte} pointer, respectively. They will adjust the pointer by the appropriate number of bytes according to the byte length of the character stored there. Both macros assume that the memory address is located at the beginning of a valid character. -Without Mule support, @code{INC_CHARPTR (p)} and @code{DEC_CHARPTR (p)} +Without Mule support, @code{INC_IBYTEPTR (p)} and @code{DEC_IBYTEPTR (p)} simply expand to @code{p++} and @code{p--}, respectively. @item bytecount_to_charcount @@ -2934,7 +2948,7 @@ equivalent length in characters. @example -Charcount bytecount_to_charcount (Bufbyte *p, Bytecount bc); +Charcount bytecount_to_charcount (Ibyte *p, Bytecount bc); @end example @item charcount_to_bytecount @@ -2943,16 +2957,16 @@ equivalent length in bytes. @example -Bytecount charcount_to_bytecount (Bufbyte *p, Charcount cc); +Bytecount charcount_to_bytecount (Ibyte *p, Charcount cc); @end example -@item charptr_n_addr -@cindex charptr_n_addr +@item itext_n_addr +@cindex itext_n_addr Return a pointer to the beginning of the character offset @var{cc} (in characters) from @var{p}. @example -Bufbyte *charptr_n_addr (Bufbyte *p, Charcount cc); +Ibyte *itext_n_addr (Ibyte *p, Charcount cc); @end example @end table @@ -2962,7 +2976,7 @@ @cindex external data, conversion to and from When an external function, such as a C library function, returns a -@code{char} pointer, you should almost never treat it as @code{Bufbyte}. +@code{char} pointer, you should almost never treat it as @code{Ibyte}. This is because these returned strings may contain 8bit characters which can be misinterpreted by XEmacs, and cause a crash. Likewise, when exporting a piece of internal text to the outside world, you should @@ -2973,11 +2987,12 @@ representations of text are the numerous conversion macros defined in @file{buffer.h}. There used to be a fixed set of external formats supported by these macros, but now any coding system can be used with -these macros. The coding system alias mechanism is used to create the +them. The coding system alias mechanism is used to create the following logical coding systems, which replace the fixed external formats. The (dontusethis-set-symbol-value-handler) mechanism was -enhanced to make this possible (more work on that is needed - like -remove the @code{dontusethis-} prefix). +enhanced to make this possible (more work on that is needed). + +Often useful coding systems: @table @code @item Qbinary @@ -3000,26 +3015,37 @@ characters are converted into `~'. @end enumerate -@item Qfile_name -Format used for filenames. This is user-definable via either the -@code{file-name-coding-system} or @code{pathname-coding-system} (now -obsolete) variables. - @item Qnative Format used for the external Unix environment---@code{argv[]}, stuff from @code{getenv()}, stuff from the @file{/etc/passwd} file, etc. -Currently this is the same as Qfile_name. The two should be -distinguished for clarity and possible future separation. +This is encoded according to the encoding specified by the current locale. + +@item Qfile_name +Format used for filenames. This is normally the same as @code{Qnative}, +but the two should be distinguished for clarity and possible future +separation -- and also because @code{Qfile_name} can be changed using either +the @code{file-name-coding-system} or @code{pathname-coding-system} (now +obsolete) variables. @item Qctext -Compound--text format. This is the standard X11 format used for data +Compound-text format. This is the standard X11 format used for data stored in properties, selections, and the like. This is an 8-bit no-lock-shift ISO2022 coding system. This is a real coding system, -unlike Qfile_name, which is user-definable. +unlike @code{Qfile_name}, which is user-definable. + +@item Qmswindows_tstr +Used for external data in all MS Windows functions that are declared to +accept data of type @code{LPTSTR} or @code{LPCSTR}. This maps to either +@code{Qmswindows_multibyte} (a locale-specific encoding, same as +@code{Qnative}) or @code{Qmswindows_unicode}, depending on whether +XEmacs is being run under Windows 9X or Windows NT/2000/XP. @end table +Many other coding systems are provided by default. + There are two fundamental macros to convert between external and -internal format. +internal format, as well as various convenience macros to simplify the +most common operations. @code{TO_INTERNAL_FORMAT} converts external data to internal format, and @code{TO_EXTERNAL_FORMAT} converts the other way around. The arguments @@ -3067,7 +3093,7 @@ @item @code{C_STRING_MALLOC, ptr,} equivalent to @code{MALLOC (ptr, len_ignored)} on output @item @code{C_STRING, ptr,} -equivalent to @code{DATA, (ptr, strlen (ptr) + 1)} on input +equivalent to @code{DATA, (ptr, strlen/wcslen (ptr))} on input @item @code{LISP_STRING, string,} input or output is a Lisp_Object of type string @item @code{LISP_BUFFER, buffer,} @@ -3078,16 +3104,20 @@ input or output is a Lisp_Object of type opaque @end table -Often, the data is being converted to a '\0'-byte-terminated string, -which is the format required by many external system C APIs. For these -purposes, a source type of @code{C_STRING} or a sink type of -@code{C_STRING_ALLOCA} or @code{C_STRING_MALLOC} is appropriate. -Otherwise, we should try to keep XEmacs '\0'-byte-clean, which means -using (ptr, len) pairs. +A source type of @code{C_STRING} or a sink type of +@code{C_STRING_ALLOCA} or @code{C_STRING_MALLOC} is appropriate where +the external API is not '\0'-byte-clean -- i.e. it expects strings to be +terminated with a null byte. For external API's that are in fact +'\0'-byte-clean, we should of course not use these. The sinks to be specified must be lvalues, unless they are the lisp object types @code{LISP_LSTREAM} or @code{LISP_BUFFER}. +There is no problem using the same lvalue for source and sink. + +Garbage collection is inhibited during these conversion operations, so +it is OK to pass in data from Lisp strings using @code{XSTRING_DATA}. + For the sink types @code{ALLOCA} and @code{C_STRING_ALLOCA}, the resulting text is stored in a stack-allocated buffer, which is automatically freed on returning from the function. However, the sink @@ -3099,6 +3129,42 @@ for @code{TO_INTERNAL_FORMAT} or a sink for @code{TO_EXTERNAL_FORMAT}. You'll get an assertion failure if you try. +99% of conversions involve raw data or Lisp strings as both source and +sink, and usually data is output as @code{alloca()}, or sometimes +@code{xmalloc()}. 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 @code{alloca()}ed string. (When the +destination is a Lisp string, there are other functions that should be +used instead -- @code{build_ext_string()} and @code{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 +@code{TO_EXTERNAL_FORMAT} and @code{TO_INTERNAL_FORMAT}. Thus, any +comments above about the workings of these macros also apply to all +convenience macros. + +A typical old-style convenience macro is + +@example + C_STRING_TO_EXTERNAL (in, out, codesys); +@end example + +This is equivalent to + +@example + TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, codesys); +@end example + +but is easier to write and somewhat clearer, since it clearly identifies +the arguments without the clutter of having the preprocessor types mixed +in. + +The new-style equivalent is @code{NEW_C_STRING_TO_EXTERNAL (src, +codesys)}, which @emph{returns} the converted data (still in +@code{alloca()} space). This is far more convenient for most +operations. @node General Guidelines for Writing Mule-Aware Code @subsection General Guidelines for Writing Mule-Aware Code @@ -3113,46 +3179,54 @@ @item Never use @code{char} and @code{char *}. In XEmacs, the use of @code{char} and @code{char *} is almost always a mistake. If you want to manipulate an Emacs character from ``C'', use -@code{Emchar}. If you want to examine a specific octet in the internal -format, use @code{Bufbyte}. If you want a Lisp-visible character, use a +@code{Ichar}. If you want to examine a specific octet in the internal +format, use @code{Ibyte}. If you want a Lisp-visible character, use a @code{Lisp_Object} and @code{make_char}. If you want a pointer to move -through the internal text, use @code{Bufbyte *}. Also note that you -almost certainly do not need @code{Emchar *}. +through the internal text, use @code{Ibyte *}. Also note that you +almost certainly do not need @code{Ichar *}. Other typedefs to clarify +the use of @code{char} are @code{Char_ASCII}, @code{Char_Binary}, +@code{UChar_Binary}, and @code{CIbyte}. -@item Be careful not to confuse @code{Charcount}, @code{Bytecount}, and @code{Bufpos}. +@item Be careful not to confuse @code{Charcount}, @code{Bytecount}, @code{Charbpos} and @code{Bytebpos}. The whole point of using different types is to avoid confusion about the use of certain variables. Lest this effect be nullified, you need to be careful about using the right types. @item Always convert external data It is extremely important to always convert external data, because -XEmacs can crash if unexpected 8bit sequences are copied to its internal +XEmacs can crash if unexpected 8-bit sequences are copied to its internal buffers literally. This means that when a system function, such as @code{readdir}, returns -a string, you may need to convert it using one of the conversion macros +a string, you normally need to convert it using one of the conversion macros described in the previous chapter, before passing it further to Lisp. Actually, most of the basic system functions that accept '\0'-terminated -string arguments, like @code{stat()} and @code{open()}, have been -@strong{encapsulated} so that they are they @code{always} do internal to -external conversion themselves. This means you must pass internally -encoded data, typically the @code{XSTRING_DATA} of a Lisp_String to -these functions. This is actually a design bug, since it unexpectedly -changes the semantics of the system functions. A better design would be -to provide separate versions of these system functions that accepted -Lisp_Objects which were lisp strings in place of their current -@code{char *} arguments. - -@example -int stat_lisp (Lisp_Object path, struct stat *buf); /* Implement me */ -@end example +string arguments, like @code{stat()} and @code{open()}, have +@strong{encapsulated} equivalents that do the internal to external +conversion themselves. The encapsulated equivalents have a @code{qxe_} +prefix and have string arguments of type @code{Ibyte *}, and you can +pass internally encoded data to them, often from a Lisp string using +@code{XSTRING_DATA}. (A better design might be to provide versions that +accept Lisp strings directly.) Also note that many internal functions, such as @code{make_string}, -accept Bufbytes, which removes the need for them to convert the data -they receive. This increases efficiency because that way external data -needs to be decoded only once, when it is read. After that, it is -passed around in internal format. +accept Ibytes, which removes the need for them to convert the data they +receive. This increases efficiency because that way external data needs +to be decoded only once, when it is read. After that, it is passed +around in internal format. + +@item Do all work in internal format +External-formatted data is completely unpredictable in its format. It +may be fixed-width Unicode (not even ASCII compatible); it may be a +modal encoding, in +which case some occurrences of (e.g.) the slash character may be part of +two-byte Asian-language characters, and a naive attempt to split apart a +pathname by slashes will fail; etc. Internal-format text should be +converted to external format only at the point where an external API is +actually called, and the first thing done after receiving +external-format text from an external API should be to convert it to +internal text. @end table @node An Example of Mule-Aware Code @@ -3171,14 +3245,14 @@ */ (int nargs, Lisp_Object *args)) @{ - Bufbyte *storage = alloca_array (Bufbyte, nargs * MAX_EMCHAR_LEN); - Bufbyte *p = storage; + Ibyte *storage = alloca_array (Ibyte, nargs * MAX_ICHAR_LEN); + Ibyte *p = storage; for (; nargs; nargs--, args++) @{ Lisp_Object lisp_char = *args; CHECK_CHAR_COERCE_INT (lisp_char); - p += set_charptr_emchar (p, XCHAR (lisp_char)); + p += set_itext_ichar (p, XCHAR (lisp_char)); @} return make_string (storage, p - storage); @} @@ -3188,17 +3262,17 @@ Now we can analyze the source line by line. Obviously, string will be as long as there are arguments to the -function. This is why we allocate @code{MAX_EMCHAR_LEN} * @var{nargs} +function. This is why we allocate @code{MAX_ICHAR_LEN} * @var{nargs} bytes on the stack, i.e. the worst-case number of bytes for @var{nargs} -@code{Emchar}s to fit in the string. +@code{Ichar}s to fit in the string. Then, the loop checks that each element is a character, converting integers in the process. Like many other functions in XEmacs, this function silently accepts integers where characters are expected, for historical and compatibility reasons. Unless you know what you are doing, @code{CHECK_CHAR} will also suffice. @code{XCHAR (lisp_char)} -extracts the @code{Emchar} from the @code{Lisp_Object}, and -@code{set_charptr_emchar} stores it to storage, increasing @code{p} in +extracts the @code{Ichar} from the @code{Lisp_Object}, and +@code{set_itext_ichar} stores it to storage, increasing @code{p} in the process. Other instructive examples of correct coding under Mule can be found all @@ -3207,6 +3281,37 @@ understood this section of the manual and studied the examples, you can proceed writing new Mule-aware code. +@node Mule-izing Code +@subsection Mule-izing Code + +A lot of code is written without Mule in mind, and needs to be made +Mule-correct or "Mule-ized". There is really no substitute for +line-by-line analysis when doing this, but the following checklist can +help: + +@itemize @bullet +@item +Check all uses of @code{XSTRING_DATA}. +@item +Check all uses of @code{build_string} and @code{make_string}. +@item +Check all uses of @code{tolower} and @code{toupper}. +@item +Check object print methods. +@item +Check for use of functions such as @code{write_c_string}, +@code{write_fmt_string}, @code{stderr_out}, @code{stdout_out}. +@item +Check all occurrences of @code{char} and correct to one of the other +typedefs described above. +@item +Check all existing uses of @code{TO_EXTERNAL_FORMAT}, +@code{TO_INTERNAL_FORMAT}, and any convenience macros (grep for +@samp{EXTERNAL_TO}, @samp{TO_EXTERNAL}, and @samp{TO_SIZED_EXTERNAL}). +@item +In Windows code, string literals may need to be encapsulated with @code{XETEXT}. +@end itemize + @node Techniques for XEmacs Developers @section Techniques for XEmacs Developers @cindex techniques for XEmacs developers @@ -8011,7 +8116,7 @@ * The Text in a Buffer:: Representation of the text in a buffer. * Buffer Lists:: Keeping track of all buffers. * Markers and Extents:: Tagging locations within a buffer. -* Bufbytes and Emchars:: Representation of individual characters. +* Ibytes and Ichars:: Representation of individual characters. * The Buffer Object:: The Lisp object corresponding to a buffer. @end menu @@ -8087,7 +8192,7 @@ has some shape that defines how it typically appears (e.g. as an uppercase A). (The exact way in which a character appears depends on the font used to display the character.) The internal type of characters in -the C code is an @code{Emchar}; this is just an @code{int}, but using a +the C code is an @code{Ichar}; this is just an @code{int}, but using a symbolic type makes the code clearer. Between every character in a buffer is a @dfn{buffer position} or @@ -8096,7 +8201,7 @@ particular position, all characters after that position end up at new positions. When we speak of the character @dfn{at} a position, we really mean the character after the position. (This schizophrenia -between a buffer position being ``between'' a character and ``on'' a +between a buffer position being ``between'' two characters and ``on'' a character is rampant in Emacs.) Buffer positions are numbered starting at 1. This means that @@ -8104,12 +8209,12 @@ valid. If there are N characters in a buffer, then buffer position N+1 is after the last one, and position N+2 is not valid. - The internal makeup of the Emchar integer varies depending on whether -we have compiled with MULE support. If not, the Emchar integer is an + The internal makeup of the Ichar integer varies depending on whether +we have compiled with MULE support. If not, the Ichar integer is an 8-bit integer with possible values from 0 - 255. 0 - 127 are the standard ASCII characters, while 128 - 255 are the characters from the ISO-8859-1 character set. If we have compiled with MULE support, an -Emchar is a 19-bit integer, with the various bits having meanings +Ichar is a 19-bit integer, with the various bits having meanings according to a complex scheme that will be detailed later. The characters numbered 0 - 255 still have the same meanings as for the non-MULE case, though. @@ -8148,14 +8253,14 @@ noticeable speed penalty.) Astute readers may notice that the text in a buffer is represented as -an array of @emph{bytes}, while (at least in the MULE case) an Emchar is +an array of @emph{bytes}, while (at least in the MULE case) an Ichar is a 19-bit integer, which clearly cannot fit in a byte. This means (of course) that the text in a buffer uses a different representation from -an Emchar: specifically, the 19-bit Emchar becomes a series of one to +an Ichar: specifically, the 19-bit Ichar becomes a series of one to four bytes. The conversion between these two representations is complex and will be described later. - In the non-MULE case, everything is very simple: An Emchar + In the non-MULE case, everything is very simple: An Ichar is an 8-bit value, which fits neatly into one byte. If we are given a buffer position and want to retrieve the @@ -8180,7 +8285,7 @@ @item Fetch the appropriate bytes at the determined memory position. @item -Convert these bytes into an Emchar. +Convert these bytes into an Ichar. @end enumerate In the non-Mule case, (3) and (4) boil down to a simple one-byte @@ -8190,11 +8295,11 @@ @enumerate @item -@dfn{buffer positions} or @dfn{character positions}, typedef @code{Bufpos} +@dfn{buffer positions} or @dfn{character positions}, typedef @code{Charbpos} @item -@dfn{byte indices}, typedef @code{Bytind} +@dfn{byte indices}, typedef @code{Bytebpos} @item -@dfn{memory indices}, typedef @code{Memind} +@dfn{memory indices}, typedef @code{Membpos} @end enumerate All three typedefs are just @code{int}s, but defining them this way makes @@ -8205,8 +8310,8 @@ not know that byte indices or memory indices exist. Finally, we have a typedef for the bytes in a buffer. This is a -@code{Bufbyte}, which is an unsigned char. Referring to them as -Bufbytes underscores the fact that we are working with a string of bytes +@code{Ibyte}, which is an unsigned char. Referring to them as +Ibytes underscores the fact that we are working with a string of bytes in the internal Emacs buffer representation rather than in one of a number of possible alternative representations (e.g. EUC-encoded text, etc.). @@ -8276,7 +8381,7 @@ buffer positions in them as integers, and every time text is inserted or deleted, these positions must be updated. In order to minimize the amount of shuffling that needs to be done, the positions in markers and -extents (there's one per marker, two per extent) are stored in Meminds. +extents (there's one per marker, two per extent) are stored in Membpos's. This means that they only need to be moved when the text is physically moved in memory; since the gap structure tries to minimize this, it also minimizes the number of marker and extent indices that need to be @@ -8290,10 +8395,10 @@ (which could happen as a result of text being deleted) or the buffer is deleted, and primitives do exist to enumerate the extents in a buffer. -@node Bufbytes and Emchars -@section Bufbytes and Emchars -@cindex Bufbytes and Emchars -@cindex Emchars, Bufbytes and +@node Ibytes and Ichars +@section Ibytes and Ichars +@cindex Ibytes and Ichars +@cindex Ichars, Ibytes and Not yet documented. @@ -8404,9 +8509,9 @@ Recall that there are two primary ways that text is represented in XEmacs. The @dfn{buffer} representation sees the text as a series of -bytes (Bufbytes), with a variable number of bytes used per character. +bytes (Ibytes), with a variable number of bytes used per character. The @dfn{character} representation sees the text as a series of integers -(Emchars), one per character. The character representation is a cleaner +(Ichars), one per character. The character representation is a cleaner representation from a theoretical standpoint, and is thus used in many cases when lots of manipulations on a string need to be done. However, the buffer representation is the standard representation used in both @@ -9039,18 +9144,18 @@ Function equivalents of the above macros. @end deftypefun -@deftypefun ssize_t Lstream_read (Lstream *@var{stream}, void *@var{data}, size_t @var{size}) +@deftypefun Bytecount Lstream_read (Lstream *@var{stream}, void *@var{data}, Bytecount @var{size}) Read @var{size} bytes of @var{data} from the stream. Return the number of bytes read. 0 means EOF. -1 means an error occurred and no bytes were read. @end deftypefun -@deftypefun ssize_t Lstream_write (Lstream *@var{stream}, void *@var{data}, size_t @var{size}) +@deftypefun Bytecount Lstream_write (Lstream *@var{stream}, void *@var{data}, Bytecount @var{size}) Write @var{size} bytes of @var{data} to the stream. Return the number of bytes written. -1 means an error occurred and no bytes were written. @end deftypefun -@deftypefun void Lstream_unread (Lstream *@var{stream}, void *@var{data}, size_t @var{size}) +@deftypefun void Lstream_unread (Lstream *@var{stream}, void *@var{data}, Bytecount @var{size}) Push back @var{size} bytes of @var{data} onto the input queue. The next call to @code{Lstream_read()} with the same size will read the same bytes back. Note that this will be the case even if there is other @@ -9076,7 +9181,7 @@ @section Lstream Methods @cindex lstream methods -@deftypefn {Lstream Method} ssize_t reader (Lstream *@var{stream}, unsigned char *@var{data}, size_t @var{size}) +@deftypefn {Lstream Method} Bytecount reader (Lstream *@var{stream}, unsigned char *@var{data}, Bytecount @var{size}) Read some data from the stream's end and store it into @var{data}, which can hold @var{size} bytes. Return the number of bytes read. A return value of 0 means no bytes can be read at this time. This may be because @@ -9093,7 +9198,7 @@ This function can be @code{NULL} if the stream is output-only. @end deftypefn -@deftypefn {Lstream Method} ssize_t writer (Lstream *@var{stream}, const unsigned char *@var{data}, size_t @var{size}) +@deftypefn {Lstream Method} Bytecount writer (Lstream *@var{stream}, const unsigned char *@var{data}, Bytecount @var{size}) Send some data to the stream's end. Data to be sent is in @var{data} and is @var{size} bytes. Return the number of bytes sent. This function can send and return fewer bytes than is passed in; in that @@ -9694,7 +9799,7 @@ string.) So use the @code{_force} version if you need the extent_info structure to be there. - A list of extents is maintained as a double gap array: one gap array + A list of extents is maintained as a double gap array. One gap array is ordered by start index (the @dfn{display order}) and the other is ordered by end index (the @dfn{e-order}). Note that positions in an extent list should logically be conceived of as referring @emph{to} a @@ -9704,6 +9809,34 @@ array, except for the fact that positions are integers (this should be generalized to handle integers and linked list equally well). +A gap array is the same structure used by buffer text: an array of +elements with a "gap" somewhere in the middle. Insertion and deletion +happens by moving the gap to the insertion/deletion point, and then +expanding/contracting as necessary. Gap arrays have a number of +useful properties: + +@enumerate +@item +They are space efficient, as there is no need for next/previous pointers. + +@item +If the items in them are sorted, locating an item is fast -- @math{O(log N)}. + +@item +Insertion and deletion is very fast (constant time, essentially) if the +gap is near (which favors localized operations, as will usually be the +case). Even if not, it requires only a block move of memory, which is +generally a highly optimized operation on modern processors. + +@item +Code to manipulate them is relatively simple to write. +@end enumerate + +An alternative would be balanced binary trees, which have guaranteed +@math{O(log N)} time for all operations (although the constant factors +are not as good, and repeated localized operations will be slower than +for a gap array). Such code is quite tricky to write, however. + @node Zero-Length Extents @section Zero-Length Extents @cindex zero-length extents @@ -9831,24 +9964,17 @@ Therefore, @math{F} can be found in the same amount of time as operation (1), i.e. the time that it takes to locate where an extent -would go if inserted into the e-order list. - - If the lists were stored as balanced binary trees, then operation (1) -would take logarithmic time, which is usually quite fast. However, -currently they're stored as simple doubly-linked lists, and instead we -do some caching to try to speed things up. +would go if inserted into the e-order list. This is @math{O(log N)}, +since we are using gap arrays to manage extents. Define a @dfn{stack of extents} (or @dfn{SOE}) as the set of extents -(ordered in the display order) that overlap an index @math{I}, together -with the SOE's @dfn{previous} extent, which is an extent that precedes -@math{I} in the e-order. (Hopefully there will not be very many extents -between @math{I} and the previous extent.) +(ordered in display order and e-order, just like for normal extent +lists) that overlap an index @math{I}. Now: Let @math{I} be an index, let @math{S} be the stack of extents on -@math{I}, let @math{F} be the first extent in @math{S}, and let @math{P} -be @math{S}'s previous extent. +@math{I} and let @math{F} be the first extent in @math{S}. Theorem 3: The first extent in @math{S} is the first extent that overlaps any range @math{[I, J]}. Index: man/lispref/backups.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/lispref/backups.texi,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- man/lispref/backups.texi 12 Apr 2001 18:22:10 -0000 1.4 +++ man/lispref/backups.texi 11 Feb 2003 19:13:55 -0000 1.5 @@ -357,8 +357,8 @@ called @dfn{auto-saving}. Auto-saving prevents you from losing more than a limited amount of work if the system crashes. By default, auto-saves happen every 300 keystrokes, or after around 30 seconds of -idle time. @xref{Auto-Save, Auto-Save, Auto-Saving: Protection Against -Disasters, xemacs, The XEmacs Lisp Reference Manual}, for information on +idle time. @xref{Auto Save, Auto-Save, Auto-Saving: Protection Against +Disasters, xemacs, The XEmacs User's Manual}, for information on auto-save for users. Here we describe the functions used to implement auto-saving and the variables that control them. Index: man/lispref/mule.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/lispref/mule.texi,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- man/lispref/mule.texi 5 Jan 2003 10:54:04 -0000 1.8 +++ man/lispref/mule.texi 6 Feb 2003 06:35:59 -0000 1.9 @@ -39,7 +39,8 @@ used in Japanese Kanji, Chinese Hanzi, and Korean Hanja; typically there are thousands of such ideographs in each language), etc. The basic property of a character is that it is the smallest unit of text with -semantic significance in text processing. +semantic significance in text processing---i.e., characters are abstract +units defined by their meaning, not by their exact appearance. Human beings normally process text visually, so to a first approximation a character may be identified with its shape. Note that the same @@ -98,62 +99,100 @@ but the difference in ordering can cause great headaches when the same thousands of characters are used by different cultures as in the Hanzi.) - A code point may be broken into a number of @dfn{position codes}. The -number of position codes required to index a particular character in a -character set is called the @dfn{dimension} of the character set. For -practical purposes, a position code may be thought of as a byte-sized -index. The printing characters of ASCII, being a relatively small -character set, is of dimension one, and each character in the set is -indexed using a single position code, in the range 1 through 94. Use of -this unusual range, rather than the familiar 33 through 126, is an -intentional abstraction; to understand the programming issues you must -break the equation between character sets and encodings. - - JIS X 0208, i.e. Japanese Kanji, has thousands of characters, and is -of dimension two -- every character is indexed by two position codes, -each in the range 1 through 94. (This number ``94'' is not a -coincidence; we shall see that the JIS position codes were chosen so -that JIS kanji could be encoded without using codes that in ASCII are -associated with device control functions.) Note that the choice of the -range here is somewhat arbitrary. You could just as easily index the -printing characters in ASCII using numbers in the range 0 through 93, 2 -through 95, 3 through 96, etc. In fact, the standardized -@emph{encoding} for the ASCII @emph{character set} uses the range 33 -through 126. + It's important to understand that a character is defined not by any +number attached to it, but by its meaning. For example, ASCII and +EBCDIC are two charsets containing exactly the same characters +(lowercase and uppercase letters, numbers 0 through 9, particular +punctuation marks) but with different numberings. The @samp{comma} +character in ASCII and EBCDIC, for instance, is the same character +despite having a different numbering. Conversely, when comparing ASCII +and JIS-Roman, which look the same except that the latter has a yen sign +substituted for the backslash, we would say that the backslash and yen +sign are @emph{not} the same characters, despite having the same number +(95) and despite the fact that all other characters are present in both +charsets, with the same numbering. ASCII and JIS-Roman, then, do +@emph{not} have exactly the same characters in them (ASCII has a +backslash character but no yen-sign character, and vice-versa for +JIS-Roman), unlike ASCII and EBCDIC, even though the numberings in ASCII +and JIS-Roman are closer. + + Sometimes, a code point is not a single number, but instead a group of +numbers, called @dfn{position codes}. In such cases, the number of +position codes required to index a particular character in a character +set is called the @dfn{dimension} of the character set. Character sets +indexed by more than one position code typically use byte-sized position +codes. Small character sets, e.g. ASCII, invariably use a single +position code, but for larger character sets, the choice of whether to +use multiple position codes or a single large (16-bit or 32-bit) number +is arbitrary. Unicode typically uses a single large number, but +language-specific or "national" character sets often use multiple +(usually two) position codes. For example, JIS X 0208, i.e. Japanese +Kanji, has thousands of characters, and is of dimension two -- every +character is indexed by two position codes, each in the range 1 through +94. (This number ``94'' is not a coincidence; it is the same as the +number of printable characters in ASCII, and was chosen so that JIS +characters could be directly encoded using two printable ASCII +characters.) Note that the choice of the range here is somewhat +arbitrary -- it could just as easily be 0 through 93, 2 through 95, etc. +In fact, the range for JIS position codes (and for other character sets +modeled after it) is often given as range 33 through 126, so as to +directly match ASCII printing characters. An @dfn{encoding} is a way of numerically representing characters from one or more character sets into a stream of like-sized numerical values -called @dfn{words}; typically these are 8-bit, 16-bit, or 32-bit -quantities. If an encoding encompasses only one character set, then the -position codes for the characters in that character set could be used -directly. (This is the case with the trivial cipher used by children, -assigning 1 to `A', 2 to `B', and so on.) However, even with ASCII, -other considerations intrude. For example, why are the upper- and -lowercase alphabets separated by 8 characters? Why do the digits start -with `0' being assigned the code 48? In both cases because semantically -interesting operations (case conversion and numerical value extraction) -become convenient masking operations. Other artificial aspects (the -control characters being assigned to codes 0--31 and 127) are historical -accidents. (The use of 127 for @samp{DEL} is an artifact of the "punch -once" nature of paper tape, for example.) +called @dfn{words} -- typically 8-bit bytes, but sometimes 16-bit or +32-bit quantities. It's very important to clearly distinguish between +charsets and encodings. For a simple charset like ASCII, there is only +one encoding normally used -- each character is represented by a single +byte, with the same value as its code point. For more complicated +charsets, however, or when a single encoding needs to represent more +than charset, things are not so obvious. Unicode version 2, for +example, is a large charset with thousands of characters, each indexed +by a 16-bit number, often represented in hex, e.g. 0x05D0 for the Hebrew +letter "aleph". One obvious encoding (actually two encodings, depending +on which of the two possible byte orderings is chosen) simply uses two +bytes per character. This encoding is convenient for internal +processing of Unicode text; however, it's incompatible with ASCII, and +thus external text (files, e-mail, etc.) that is encoded this way is +completely uninterpretable by programs lacking Unicode support. For +this reason, a different, ASCII-compatible encoding, e.g. UTF-8, is +usually used for external text. UTF-8 represents Unicode characters +with one to three bytes (often extended to six bytes to handle +characters with up to 31-bit indices). Unicode characters 00 to 7F +(identical with ASCII) are directly represented with one byte, and other +characters with two or more bytes, each in the range 80 to FF. +Applications that don't understand Unicode will still be able to process +ASCII characters represented in UTF-8-encoded text, and will typically +ignore (and hopefully preserve) the high-bit characters. - Naive use of the position code is not possible, however, if more than -one character set is to be used in the encoding. For example, printed + Naive use of code points is also not possible if more than one +character set is to be used in the encoding. For example, printed Japanese text typically requires characters from multiple character sets -- ASCII, JIS X 0208, and JIS X 0212, to be specific. Each of these is -indexed using one or more position codes in the range 1 through 94, so -the position codes could not be used directly or there would be no way -to tell which character was meant. Different Japanese encodings handle -this differently -- JIS uses special escape characters to denote -different character sets; EUC sets the high bit of the position codes -for JIS X 0208 and JIS X 0212, and puts a special extra byte before each -JIS X 0212 character; etc. (JIS, EUC, and most of the other encodings -you will encounter in files are 7-bit or 8-bit encodings. There is one -common 16-bit encoding, which is Unicode; this strives to represent all -the world's characters in a single large character set. 32-bit -encodings are often used internally in programs, such as XEmacs with -MULE support, to simplify the code that manipulates them; however, they -are not used externally because they are not very space-efficient.) +indexed using one or more position codes in the range 1 through 94 (or +33 through 126), so the position codes could not be used directly or +there would be no way to tell which character was meant. Different +Japanese encodings handle this differently -- JIS uses special escape +characters to denote different character sets; EUC sets the high bit of +the position codes for JIS X 0208 and JIS X 0212, and puts a special +extra byte before each JIS X 0212 character; etc. + + The encodings described above are all 7-bit or 8-bit encodings. The +fixed-width Unicode encoding previous described, however, is sometimes +considered to be a 16-bit encoding, in which case the issue of byte +ordering does not come up. (Imagine, for example, that the text is +represented as an array of shorts.) Similarly, Unicode version 3 (which +has characters with indices above 0xFFFF), and other very large +character sets, may be represented internally as 32-bit encodings, +i.e. arrays of ints. However, it does not make too much sense to talk +about 16-bit or 32-bit encodings for external data, since nowadays 8-bit +data is a universal standard -- the closest you can get is fixed-width +encodings using two or four bytes to encode 16-bit or 32-bit values. (A +"7-bit" encoding is used when it cannot be guaranteed that the high bit +of 8-bit data will be correctly preserved. Some e-mail gateways, for +example, strip the high bit of text passing through them. These same +gateways often handle non-printable characters incorrectly, and so 7-bit +encodings usually avoid using bytes with such values.) A general method of handling text using multiple character sets (whether for multilingual text, or simply text in an extremely Index: man/xemacs/packages.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs/packages.texi,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- man/xemacs/packages.texi 4 Oct 2002 18:09:50 -0000 1.19 +++ man/xemacs/packages.texi 3 Feb 2003 02:42:56 -0000 1.20 @@ -468,53 +468,63 @@ @cindex local.rules @heading The Local.rules File: This file is used when building and installing packages from source. In -the top level of the CVS module, @file{xemacs-packages}, contains the +the top level of the CVS module, @file{packages}, contains the file, @file{Local.rules.template}. Simply copy that to @file{Local.rules} and edit it to suit your needs. These are the variables in 'Local.rules' that you will need to -address. +address. Items that have default settings have those defaults shown. @table @var +@item XEMACS = xemacs +If your XEmacs isn't in your path, change this. Native MS Windows users +should double quote this if the path has embedded spaces. + +@item BUILD_WITHOUT_MULE = +Building from CVS defaults to building the Mule +packages. Set this to 't' if you don't want/have Mule + +@item XEMACS_NATIVE_NT = +Set this to 't' if you are building on WinNT. NT users should note that +you still need the Cygwin environment to build the packages. + +@item XEMACS_INSTALLED_PACKAGES_ROOT = /usr/local/lib/xemacs +This is the directory tree under which the installed packages go. Under +this directory there would normally be @file{xemacs-packages/} for +standard (non-Mule) packages, @file{mule-packages/} for Mule packages +(if you built XEmacs with Mule), and possibly @file{site-packages/} for +3rd party packages that aren't distributed by XEmacs.org. + @item symlink = Set this to 't' if you want to do a "run in place". Setting this doesn't work well with 'make bindist' -@item XEMACS_PACKAGES = -This is where you set the normal packages that you -want to install. eg: +@item NONMULE_INSTALLED_PACKAGES_ROOT = $@{XEMACS_INSTALLED_PACKAGES_ROOT@}/xemacs-packages +This is where the non-Mule packages are installed to. You probably +don't want to change this. + +@item MULE_INSTALLED_PACKAGES_ROOT = $@{XEMACS_INSTALLED_PACKAGES_ROOT@}/mule-packages +This is where the Mule packages are installed to. You probably don't +want to change this. Please note that @code{make bindist} does +@emph{not} use this variable. When doing a @code{make bindist} +@emph{everything} goes into @var{NONMULE_INSTALLED_PACKAGES_ROOT}. + +@item NONMULE_PACKAGES = xemacs-packages +This is where you set the non-Mule packages that you want to install. eg: @example XEMACS_PACKAGES = xemacs-packages/xemacs-base xemacs-packages/bbdb @end example -@item XEMACS_STAGING = $@{XEMACS_PACKAGES_BASE@}/../Packages -Set this to where you want normal packages to be -installed to. - -@item PACKAGE_INDEX = package-index -If you want the package-index file to have a different -name, change this. - -@item BUILD_WITHOUT_MULE = -Building from CVS defaults to building the Mule -packages. Set this to 't' if you don't want/have Mule - -@item MULE_PACKAGES = +@item MULE_PACKAGES = mule-packages Same as for 'XEMACS_PACKAGES' except you list the Mule packages you want to install here. eg: @example MULE_PACKAGES = mule-packages/mule-base mule-packages/skk @end example -@item MULE_STAGING = $@{XEMACS_PACKAGES_BASE@}/../Mule-Packages -Set this to where you want Mule packages installed -to. Note: 'make bindist' does not use this variable. - -@item XEMACS = xemacs -If your XEmacs isn't in your path, change this. - -@item XEMACS_NATIVE_NT = -Set this to 't' if you are building on WinNT. +@item PACKAGE_INDEX = package-index +If you want the package-index file to have a different +name, change this. @item INSTALL = install -c The path to your BSD compatible install program. Index: man/xemacs/startup.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs/startup.texi,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- man/xemacs/startup.texi 3 Jan 2003 12:12:40 -0000 1.9 +++ man/xemacs/startup.texi 5 Feb 2003 08:18:58 -0000 1.10 @@ -93,9 +93,13 @@ the @code{EMACSPACKAGEPATH} environment variable. An XEmacs package hierarchy is laid out just like a normal installed -XEmacs lisp directory. It may have @file{lisp}, @file{etc}, -@file{info}, and @file{lib-src} subdirectories. XEmacs adds these at -appropriate places within the various system-wide paths. +XEmacs directory. It may have @file{lisp}, @file{etc}, @file{info}, and +@file{lib-src} subdirectories. (The @file{lib-src} subdirectory +contains architecture-independent general-purpose scripts interpreted by +the shell or Perl. Java is also being widely used, but Java programs +are generally found under @file{etc}, because they are specific to +particular packages such as @file{JDE} and @file{xslt}.) XEmacs adds +these at appropriate places within the various system-wide paths. There may be any number of package hierarchy directories. Index: modules/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/modules/ChangeLog,v retrieving revision 1.11 retrieving revision 1.16 diff -u -r1.11 -r1.16 --- modules/ChangeLog 5 Jan 2003 05:13:38 -0000 1.11 +++ modules/ChangeLog 16 Feb 2003 06:13:30 -0000 1.16 @@ -1,3 +1,26 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-02-07 Jerry James + + * ldap/eldap.c: Add unload_eldap prototype to fix warning. + +2003-01-30 Robert Pluim + + * Makefile.common: FreeBSD make compatability fixes: expand + SRC_SRCS immediately, use MODCC rather than CC to prevent + overriding by top-level makefile. + +2003-01-15 Jerry James + + * ldap/eldap.c: Apply Ben's postgresql change to LDAP also. + +2002-12-16 Ben Wing + + * postgresql/postgresql.c: + remove ifdef USE_KKCC. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: modules/common/Makefile.common =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/modules/common/Makefile.common,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- modules/common/Makefile.common 18 Nov 2002 06:52:30 -0000 1.2 +++ modules/common/Makefile.common 3 Feb 2003 17:46:58 -0000 1.3 @@ -27,7 +27,7 @@ ## Note: This will be appended to the individual module Makefiles by configure. -SRC_SRCS=$(SRCS:%=$(srcdir)/%) +SRC_SRCS:=$(SRCS:%=$(srcdir)/%) OBJS=$(SRCS:.c=.o) SHELL=/bin/sh @@ -47,7 +47,7 @@ srcdir=@srcdir@ VPATH=@srcdir@ -CC=@MOD_CC@ +MODCC=@MOD_CC@ MODARCHDIR=@MODARCHDIR@ MAKE_DOCFILE=@MAKE_DOCFILE@ MODCFLAGS=@MODCFLAGS@ @@ -59,13 +59,13 @@ all: $(OBJECT_TO_BUILD) .c.o: - $(CC) $(MODCFLAGS) -c $< + $(MODCC) $(MODCFLAGS) -c $< $(MODNAME).ell: $(OBJS) $(MODNAME)_i.o - $(CC) --mode=link --mode=verbose --mod-output=$@ $^ $(LDFLAGS) + $(MODCC) --mode=link --mode=verbose --mod-output=$@ $^ $(LDFLAGS) $(MODNAME)_i.c: $(SRCS) - ELLMAKEDOC=$(MAKE_DOCFILE) $(CC) --mode=init --mod-output=$@ \ + ELLMAKEDOC=$(MAKE_DOCFILE) $(MODCC) --mode=init --mod-output=$@ \ --mod-name=$(MODNAME) --mod-version=$(MODVER) \ --mod-title=$(MODTITLE) $(SRC_SRCS) Index: modules/ldap/eldap.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/modules/ldap/eldap.c,v retrieving revision 1.3 retrieving revision 1.5 diff -u -r1.3 -r1.5 --- modules/ldap/eldap.c 10 Sep 2002 15:27:14 -0000 1.3 +++ modules/ldap/eldap.c 7 Feb 2003 20:46:02 -0000 1.5 @@ -100,12 +100,10 @@ return wrap_ldap (ldap); } -#ifdef USE_KKCC -static const struct lrecord_description ldap_description [] = { +static const struct memory_description ldap_description [] = { { XD_LISP_OBJECT, offsetof (struct Lisp_LDAP, host) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_ldap (Lisp_Object obj) @@ -151,17 +149,9 @@ ldap->ld = NULL; } -#ifdef USE_KKCC -DEFINE_LRECORD_IMPLEMENTATION ("ldap", ldap, - 0, /*dumpable-flag*/ +DEFINE_LRECORD_IMPLEMENTATION ("ldap", ldap, 0, mark_ldap, print_ldap, finalize_ldap, NULL, NULL, ldap_description, Lisp_LDAP); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("ldap", ldap, - mark_ldap, print_ldap, finalize_ldap, - NULL, NULL, 0, Lisp_LDAP); -#endif /* not USE_KKCC */ - /************************************************************************/ @@ -863,6 +853,7 @@ } #ifdef HAVE_SHLIB +void unload_eldap (void); void unload_eldap (void) { Index: modules/postgresql/postgresql.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/modules/postgresql/postgresql.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- modules/postgresql/postgresql.c 18 Nov 2002 06:52:33 -0000 1.2 +++ modules/postgresql/postgresql.c 12 Jan 2003 11:08:02 -0000 1.3 @@ -178,11 +178,9 @@ return wrap_pgconn (pgconn); } -#ifdef USE_KKCC -static const struct lrecord_description pgconn_description [] = { +static const struct memory_description pgconn_description [] = { { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object #ifdef RUNNING_XEMACS_21_1 @@ -267,20 +265,12 @@ NULL, NULL, Lisp_PGconn); #else -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, 0, /*dumpable-flag*/ mark_pgconn, print_pgconn, finalize_pgconn, NULL, NULL, pgconn_description, Lisp_PGconn); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, - mark_pgconn, print_pgconn, finalize_pgconn, - NULL, NULL, - 0, - Lisp_PGconn); -#endif /* not USE_KKCC */ #endif /****/ @@ -295,11 +285,9 @@ return wrap_pgresult (pgresult); } -#ifdef USE_KKCC -static const struct lrecord_description pgresult_description [] = { +static const struct memory_description pgresult_description [] = { { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object @@ -400,20 +388,12 @@ NULL, NULL, Lisp_PGresult); #else -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, 0, /*dumpable-flag*/ mark_pgresult, print_pgresult, finalize_pgresult, NULL, NULL, pgresult_description, Lisp_PGresult); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, - mark_pgresult, print_pgresult, finalize_pgresult, - NULL, NULL, - 0, - Lisp_PGresult); -#endif /* not USE_KKCC */ #endif /***********************/ Index: netinstall/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/netinstall/ChangeLog,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- netinstall/ChangeLog 5 Jan 2003 05:13:39 -0000 1.23 +++ netinstall/ChangeLog 16 Feb 2003 06:13:32 -0000 1.24 @@ -1,3 +1,7 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. @@ -467,6 +471,6 @@ * all: port from cygwin setup. -%%% $Id: ChangeLog,v 1.23 2003/01/05 05:13:39 youngs Exp $ -$Revision: 1.23 $ +%%% $Id: ChangeLog,v 1.24 2003/02/16 06:13:32 youngs Exp $ +$Revision: 1.24 $ Index: nt/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/ChangeLog,v retrieving revision 1.145 retrieving revision 1.149 diff -u -r1.145 -r1.149 --- nt/ChangeLog 5 Jan 2003 05:13:40 -0000 1.145 +++ nt/ChangeLog 16 Feb 2003 06:13:33 -0000 1.149 @@ -1,3 +1,77 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-02-15 Ben Wing + + * xemacs.mak: + * xemacs.mak (PROGNAME): + * xemacs.mak (docfile): + * xemacs.mak (make-docargs): Removed. + * xemacs.mak (update-elc): + * xemacs.mak (update-elc-2): New. + * xemacs.mak (OS): + Delete old unused code that checks SATISFIED. + Move update-elc-2 up to be near update-elc. + Run update-elc-2 with -no-autoloads to avoid multiple + autoload-loading problem. + + Don't compute make-docfile args ourselves. Pass the raw objects + to make-docfile.el, which does the computation (much faster than + we could). Don't delete the DOC file, split the invocation into + two calls to make-docfile.exe (one direct, one through + make-docfile.el), etc. In general, all we do is call make-docfile. + Add proper dependencies for DOC-file rebuilding so it doesn't get + done when not necessary. Implement quick-building here: not + building the DOC file unless it doesn't exist, as the quick-build + docs say. + +2003-02-05 Ben Wing + + * config.inc.samp (GTK_DIR): + * config.inc.samp (XPM_DIR): + * config.inc.samp (HAVE_GIF): + * config.inc.samp (ZLIB_DIR): + * config.inc.samp (TIFF_DIR): + * config.inc.samp (JPEG_DIR): + * config.inc.samp (COMPFACE_DIR): + * config.inc.samp (USE_PORTABLE_DUMPER): + * config.inc.samp (USE_KKCC): + Various fixups. + +2002-12-16 Ben Wing + + * README (NOTE): + * config.inc.samp: + * config.inc.samp (PACKAGE_PREFIX): + * config.inc.samp (GTK_DIR): + * config.inc.samp (COMPFACE_DIR): + * config.inc.samp (USE_FASTCALL): + * config.inc.samp (HAVE_VC6): New. + * config.inc.samp (PROFILE_SUPPORT): + * config.inc.samp (DEBUG_XEMACS): + * config.inc.samp (USE_PORTABLE_DUMPER): + * config.inc.samp (USE_KKCC): New. + * config.inc.samp (USE_UNION_TYPE): New. + * xemacs.dsp (CFG): + * xemacs.mak (HAVE_VC6): + * xemacs.mak (ERROR_CHECK_ALL): New. + * xemacs.mak (CPLUSPLUS_COMPILE): New. + * xemacs.mak (USE_KKCC): New. + * xemacs.mak (USE_UNION_TYPE): New. + * xemacs.mak (USE_PORTABLE_DUMPER): + * xemacs.mak (PROFILE_FLAGS): + * xemacs.mak (CPLUSPLUS_COMPILE_FLAGS): New. + * xemacs.mak (DUMPER_DEFINES): + * xemacs.mak (KKCC_DEFINES): New. + * xemacs.mak (DEFINES): + * xemacs.mak (LASTFILE_FLAGS): + * xemacs.mak (TEMACS_CPP_FLAGS_NO_CFLAGS): + * xemacs.mak (OS): + + Support C++ compilation, KKCC compilation. See src/ChangeLog. + Add stuff about the evilness of USE_UNION_TYPE. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: nt/README =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/README,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- nt/README 10 Jul 2002 06:27:42 -0000 1.23 +++ nt/README 12 Jan 2003 11:04:30 -0000 1.24 @@ -281,13 +281,19 @@ MS Developer Studio. Build and debug your XEmacs this way. 3. To display the contents of a lisp variable, type Shift-F9 (or use the - menu) to bring up the QuickWatch window, type debug_print(variable) and - click Recalculate. The output will appear in a console window, as well - as in the Debug window in MS Developer Studio. + menu) to bring up the QuickWatch window, type dp(variable) and click + Recalculate. The output will appear in a console window, as well as in + the Debug window in MS Developer Studio. -4. To view Lisp variables in the "Watch" window wrap the variable in one of +4. To display a current Lisp backtrace, type db() in the QuickWatch window, + as in the previous item. + +5. To view Lisp variables in the "Watch" window wrap the variable in one of the helper functions from the file src\console-msw.c, for example type DSTRING(variable) in the "Watch" window to inspect a Lisp string. + +6. For further information on debugging XEmacs, see the item + `How to Debug an XEmacs problem with a debugger' in the XEmacs FAQ. * Known Problems Index: nt/config.inc.samp =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/config.inc.samp,v retrieving revision 1.10 retrieving revision 1.12 diff -u -r1.10 -r1.12 --- nt/config.inc.samp 20 Jun 2002 21:18:16 -0000 1.10 +++ nt/config.inc.samp 6 Feb 2003 06:36:00 -0000 1.12 @@ -1,12 +1,16 @@ # -*- mode: makefile -*- ############################################################################ +# Install options # +############################################################################ INSTALL_DIR=c:\Program Files\XEmacs\XEmacs-$(XEMACS_VERSION_STRING) PACKAGE_PREFIX=c:\Program Files\XEmacs ############################################################################ +# Compiled-in features: basic # +############################################################################ # Multilingual support. MULE=0 @@ -27,41 +31,56 @@ GTK_DIR= ############################################################################ +# Compiled-in features: graphics formats # +############################################################################ # Set this to enable XPM support (virtually mandatory), and specify -# the directory containing xpm. +# the directory containing xpm. Get the library from +# http://ftp.xemacs.org/aux/xpm-3.4k.tar.gz. HAVE_XPM=1 XPM_DIR=c:\src\xpm-3.4k -# Set this to enable GIF support. +# Set this to enable GIF support (built-in). HAVE_GIF=1 # Set this to enable PNG support (virtually mandatory), and specify -# the directories containing png and zlib. +# the directories containing png and zlib. Get the latest version from +# ftp://ftp.uu.net/graphics/png/. You will have to rename the zlib directory +# from zlib-1.1.3 or whatever to just `zlib' for the build to work. HAVE_PNG=1 -PNG_DIR=c:\src\libpng-1.0.9 +PNG_DIR=c:\src\libpng-1.0.12 ZLIB_DIR=c:\src\zlib # Set this to enable TIFF support, and specify the directory containing tiff. +# Get the latest version from ftp://ftp.uu.net/graphics/tiff/. Not on by +# default since TIFF isn't really very important and those TIFF wankers +# couldn't be bothered to incorporate minimal MS-Windows patches they've +# had sitting around for years, so getting it to build is a major pain in +# the ass. HAVE_TIFF=0 -TIFF_DIR= +TIFF_DIR=c:\src\tiff-v3.4 # Set this to enable JPEG support, and specify the directory containing jpeg. +# Get the latest version from ftp://ftp.uu.net/graphics/jpeg/. HAVE_JPEG=1 JPEG_DIR=c:\src\jpeg-6b # Set this to enable XFace support, and specify the directory containing -# compface. +# compface. Get the library from http://ftp.xemacs.org/aux/compface.tar.gz. HAVE_XFACE=0 COMPFACE_DIR= ############################################################################ +# Build settings # +############################################################################ # Set this to specify the location of makeinfo. (If not set, XEmacs will -# attempt to use its built-in texinfo support when building info files.) -MAKEINFO=c:\src\texinfo-4.0\makeinfo\makeinfo.exe - -############################################################################ +# attempt to use its built-in, much slower texinfo support when building +# info files.) If you are building XEmacs yourself, you probably have +# Cygwin sitting around already. If not, you should. Cygwin provides a +# `makeinfo.exe' in /usr/bin/makeinfo (/usr/bin is virtual, it's /bin in +# the actual file system). +MAKEINFO=c:\cygwin\bin\makeinfo.exe # Set this to turn on optimization when compiling. OPTIMIZED_BUILD=0 @@ -71,14 +90,17 @@ # #### Change to 1 when I check in the ws with support for fastcall USE_FASTCALL=0 -# Set this to compile in support for profiling. If you want line-by-line -# profiling under VC++, you also need debugging turned on. -PROFILE_SUPPORT=0 +# True if running VC++ 6 or later. +HAVE_VC6=1 ############################################################################ # Development options # ############################################################################ +# Set this to compile in support for profiling. If you want line-by-line +# profiling under VC++, you also need debugging turned on. +PROFILE_SUPPORT=0 + # Set this to enable debug code in XEmacs that doesn't slow things down, # and to add debugging information to the executable. (The code that's # enabled in XEmacs is primarily extra commands that aid in debugging @@ -87,15 +109,17 @@ # variable, below.) DEBUG_XEMACS=1 -# True if running VC++ 6 or later. -HAVE_VC6=1 - # 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 # builds. # ERROR_CHECK_ALL=0 +# Uncomment this to turn on or off whether we compile source files as C++ +# files. This turns on additional error checking of various sorts. Normally, +# leave it alone -- it will be on when ERROR_CHECK_ALL is on. +# CPLUSPLUS_COMPILE=0 + # Set this to speed up building, for development purposes. QUICK_BUILD=0 @@ -111,17 +135,32 @@ # routines, instead of the older "unexec" routines in unexnt.c. USE_PORTABLE_DUMPER=1 -# Set this to get improved type checking of Lisp_Objects -- with this -# setting, they're declared as unions instead of ints, and so places where -# a Lisp_Object is mistakenly passed to a routine expecting an int (or -# vice-versa), or a check is written `if (foo)' instead of `if (!NILP -# (foo))', will be flagged as errors. (All of these do NOT lead to the -# expected results! Qnil is not represented as 0 (so if (foo) will -# *ALWAYS* be true for a Lisp_Object), the representation of an integer as -# a Lisp_Object is not just the integer's numeric value (but usually 2x the -# integer +/- 1). - -# Some also claim it simplifies debugging, but I don't really believe them. -# Definitely don't do your normal builds this way, because you may well get -# less efficiency, and could conceivably trigger compiler bugs (has definitely happened, many times, with gcc). -# USE_UNION_TYPE=1 +# Set this to use the new experimental garbage-collection routines instead +# of the traditional XEmacs garbage-collection routines. +USE_KKCC=0 + +# Set this to turn on the use of the union type, which gets you improved +# type checking of Lisp_Objects -- they're declared as unions instead of +# ints, and so places where a Lisp_Object is mistakenly passed to a routine +# expecting an int (or vice-versa), or a check is written `if (foo)' +# instead of `if (!NILP (foo))', will be flagged as errors. (All of these +# do NOT lead to the expected results! Qnil is not represented as 0 [so if +# (foo) will *ALWAYS* be true for a Lisp_Object], and the representation of +# an integer as a Lisp_Object is not just the integer's numeric value, but +# usually 2x the integer +/- 1.) + +# There used to be a claim that it simplified debugging. There may have +# been a grain of truth to this pre-19.8, when there was no lrecord type +# and all objects had a separate type appearing in the tag. Nowadays, +# however, there is no debugging gain, and in fact frequent debugging *LOSS*, +# since many debuggers don't handle unions very well, and usually there is +# no way to directly specify a union from a debugging prompt. + +# Furthermore, release builds should *NOT* be done this way because (a) you +# may get less efficiency, with compilers that can't figure out how to +# optimize the union into a machine word; (b) even worse, the union type +# often triggers compiler bugs, especially when combined with Mule and +# error-checking. This has been the case with various times using GCC, +# *AND CURRENTLY HAPPENS WITH VC++*, at least when using pdump. Therefore, +# be warned! +USE_UNION_TYPE=0 Index: nt/xemacs.dsp =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/xemacs.dsp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- nt/xemacs.dsp 20 Jun 2002 21:18:16 -0000 1.3 +++ nt/xemacs.dsp 12 Jan 2003 11:04:30 -0000 1.4 @@ -58,7 +58,7 @@ # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\src" # PROP Intermediate_Dir "obj" -# PROP Cmd_Line "NMAKE /k /f xemacs.mak" +# PROP Cmd_Line "NMAKE /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.95 retrieving revision 1.97 diff -u -r1.95 -r1.97 --- nt/xemacs.mak 14 Oct 2002 19:20:17 -0000 1.95 +++ nt/xemacs.mak 15 Feb 2003 10:15:58 -0000 1.97 @@ -1,7 +1,7 @@ # Makefile for Microsoft NMAKE -*- Makefile -*- # # 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) 1997, 1998, 2000 Jonathan Harris. # Copyright (C) 1995 Sun Microsystems, Inc. # Copyright (C) 1998 Free Software Foundation, Inc. @@ -188,9 +188,28 @@ !if !defined(HAVE_VC6) HAVE_VC6=1 !endif + !if !defined(ERROR_CHECK_ALL) -# Turn off when not a beta XEmacs. +!if "$(emacs_is_beta)" != "" ERROR_CHECK_ALL=1 +!else +ERROR_CHECK_ALL=0 +!endif +!endif + +!if !defined(CPLUSPLUS_COMPILE) +!if $(ERROR_CHECK_ALL) +CPLUSPLUS_COMPILE=1 +!else +CPLUSPLUS_COMPILE=0 +!endif +!endif + +!if !defined(USE_KKCC) +USE_KKCC=0 +!endif +!if !defined(USE_UNION_TYPE) +USE_UNION_TYPE=0 !endif !if !defined(QUICK_BUILD) QUICK_BUILD=0 @@ -204,15 +223,9 @@ !if !defined(USE_PORTABLE_DUMPER) USE_PORTABLE_DUMPER=1 !endif -!if !defined(USE_UNION_TYPE) -USE_UNION_TYPE=0 -!endif !if !defined(USE_MINITAR) USE_MINITAR=$(HAVE_ZLIB) !endif -!if !defined(USE_KKCC) -USE_KKCC=1 -!endif # A little bit of adhockery. Default to use system malloc and # DLL version of the C runtime library when using portable @@ -430,6 +443,12 @@ PROFILE_FLAGS= !endif +!if $(CPLUSPLUS_COMPILE) +CPLUSPLUS_COMPILE_FLAGS=-TP +!else +CPLUSPLUS_COMPILE_FLAGS= +!endif + CFLAGS_NO_OPT=-nologo -W3 -DSTRICT $(DEBUG_FLAGS_COMPILE) CFLAGS_NO_LIB=$(CFLAGS_NO_OPT) $(OPTFLAGS) @@ -527,6 +546,10 @@ DUMPER_DEFINES=-DPDUMP !endif +!if $(USE_KKCC) +KKCC_DEFINES=-DUSE_KKCC +!endif + !if $(USE_SYSTEM_MALLOC) MALLOC_DEFINES=-DSYSTEM_MALLOC !else @@ -548,8 +571,8 @@ INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(NT)\inc -I$(SRC) -I$(LWLIB_SRCDIR) DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) $(UNION_DEFINES) \ - $(DUMPER_DEFINES) $(MALLOC_DEFINES) $(QUICK_DEFINES) \ - $(ERROR_CHECK_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) @@ -664,7 +687,7 @@ LASTFILE=$(OUTDIR)\lastfile.lib LASTFILE_SRC=$(SRC) -LASTFILE_FLAGS=$(CFLAGS) $(INCLUDES) -Fo$@ -Fd$* -c +LASTFILE_FLAGS=$(CFLAGS) $(CPLUSPLUS_COMPILE_FLAGS) $(INCLUDES) -Fo$@ -Fd$* -c LASTFILE_OBJS= \ $(OUTDIR)\lastfile.obj @@ -749,7 +772,8 @@ -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 $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \ +TEMACS_CPP_FLAGS_NO_CFLAGS=-c $(CPLUSPLUS_COMPILE_FLAGS) \ + $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \ -DEMACS_MAJOR_VERSION=$(emacs_major_version) \ -DEMACS_MINOR_VERSION=$(emacs_minor_version) \ $(EMACS_BETA_VERSION) \ @@ -1021,7 +1045,7 @@ rc -Fo$@ xemacs.rc -PROGNAME=$(TEMACS_DIR)\xemacs.exe +PROGNAME = $(TEMACS_DIR)\xemacs.exe BATCH = -no-packages -batch BATCH_PACKAGES = -vanilla -batch TEMACS_BATCH = "$(LIB_SRC)\i" "$(TEMACS)" $(BATCH) @@ -1283,25 +1307,26 @@ if exist $(DOC) $(DEL) $(DOC) docfile :: $(DOC) -# This takes 5 seconds on my Pentium 233. If you are running on a -# much slower machine and are bothered by the time, modify make-docfile.c -# to contain special code to frob $(OUTDIR)\foo.obj into the right file. -make-docargs: $(TEMACS_OBJS) - @echo Creating make-docfile argument file ... - -$(DEL) $(OUTDIR)\make-docfile.tmp - @!echo $(SRC)\$(**B).c >> $(OUTDIR)\make-docfile.tmp - @echo Done. - -$(DOC): $(LIB_SRC)\make-docfile.exe make-docargs - if exist $(DOC) $(DEL) $(DOC) +$(DOC): $(LIB_SRC)\make-docfile.exe $(TEMACS_DIR)\NEEDTODUMP $(TEMACS_OBJS) cd $(TEMACS_DIR) - $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages - $(LIB_SRC)\make-docfile.exe -a $(DOC) @$(OUTDIR)\make-docfile.tmp +!if $(QUICK_BUILD) + if not exist $(DOC) $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages @<< +$(**) +<< +!else + $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages @<< +$(**) +<< +!endif update-elc: cd $(TEMACS_DIR) $(TEMACS_BATCH) -l $(LISP)\update-elc.el +# 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 @@ -1309,10 +1334,7 @@ # This rule dumps xemacs and then possibly spawns sub-make if PURESPACE # requirements have changed. -$(TEMACS_DIR)\SATISFIED: $(PROGNAME) - $(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP - @echo >$(TEMACS_DIR)\SATISFIED cd $(TEMACS_DIR) $(TEMACS_BATCH) -l $(LISP)\loadup.el dump !if $(USE_PORTABLE_DUMPER) @@ -1324,8 +1346,6 @@ << -$(DEL) $(TEMACS_DIR)\xemacs.dmp !endif - cd $(NT) - @if not exist $(TEMACS_DIR)\SATISFIED $(MAKE) /$(MAKEFLAGS) -nologo -f xemacs.mak $@ #------------------------------------------------------------------------------ # use this rule to build the complete system @@ -1460,6 +1480,9 @@ !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) @@ -1477,8 +1500,8 @@ !if $(HAVE_GTK) -------------------------------------------------------------------- WARNING: You specified HAVE_GTK=1, but we are compiling WITHOUT GTK support. - WARNING: gtk-xemacs is not currently supported on MSWindows (mingw or msvc). - WARNING: Yes, we know that gtk has been ported to native MSWindows, but + 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 @@ -1531,6 +1554,12 @@ !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. @@ -1542,7 +1571,12 @@ Using DLL version of C runtime library. !endif !if $(ERROR_CHECK_ALL) - Compiling in extra internal error-checking. XEmacs will be slow! + 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). @@ -1560,10 +1594,6 @@ @echo -------------------------------------------------------------------- @type $(XEMACS)\Installation @echo -------------------------------------------------------------------- - -# Update out-of-date .elcs, other than needed for dumping. -update-elc-2: - $(XEMACS_BATCH) -l update-elc-2.el -f batch-update-elc-2 $(LISP) # DO NOT DELETE THIS LINE -- make depend depends on it. Index: nt/installer/Wise/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/installer/Wise/ChangeLog,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- nt/installer/Wise/ChangeLog 5 Jan 2003 05:13:41 -0000 1.12 +++ nt/installer/Wise/ChangeLog 16 Feb 2003 06:13:35 -0000 1.13 @@ -1,3 +1,7 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: src/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v retrieving revision 1.528 retrieving revision 1.560 diff -u -r1.528 -r1.560 --- src/ChangeLog 5 Jan 2003 05:13:42 -0000 1.528 +++ src/ChangeLog 16 Feb 2003 06:13:37 -0000 1.560 @@ -1,3 +1,1484 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-02-15 Ben Wing + + * Makefile.in.in (dynodump_deps): + Don't delete the DOC file. Implement quick-building here: not + building the DOC file unless it doesn't exist, as the quick-build + docs say. + + * config.h.in: Style changes. Add HAVE_XLIKE. + * emacs.c (main_1): + * emacs.c (main): + * emacs.c (Fdump_emacs): + * emacs.c (voodoo_free_hook): + * emacs.c (Fkill_emacs): + * emacs.c (assert_failed): + * emacs.c (vars_of_emacs): + * emacs.c (__sti__iflPNGFile_c___): + Nothing but niggly spacing changes -- one space before a paren + starting a function-call arglist, please. + + * make-src-depend: + When QUICK_BUILD, don't put lisp.h, config.h, and related as + dependencies of all source files, so that changes to these files + don't trigger total rebuilding of the src directory. + Update info on what's a GTK-only and X-only file and use HAVE_XLIKE + for files shared between GTK and X. + +2003-02-14 Ben Wing + + * buffer.c: + * syntax.c: + Move syntax table description from buffer.c to syntax.c. + + * chartab.c: + * chartab.c (set_char_table_dirty): + * chartab.c (fill_char_table): + * chartab.c (Fmake_char_table): + * chartab.c (Fcopy_char_table): + * chartab.c (get_range_char_table_1): + * chartab.c (get_range_char_table): + * chartab.c (put_char_table): + * chartab.h: + * chartab.h (struct Lisp_Char_Table): + Free extra char table entries to avoid excessive garbage. + Add flags for dirty and mirror_table_p to char tables. + Add a back pointer from mirror tables to the original syntax table. + When modifying a syntax table, don't update the mirror table right + away, just mark as dirty. + Add various asserts to make sure we are dealing with the right type + of table (mirror or non-mirror). + + * font-lock.c: + * font-lock.c (find_context): + * syntax.c (init_syntax_cache): + * syntax.c (setup_syntax_cache): + * syntax.c (mark_buffer_syntax_cache): + * syntax.c (init_buffer_syntax_cache): + * syntax.c (syntax_cache_table_was_changed): + * syntax.c (update_syntax_cache): + * syntax.c (scan_lists): + * syntax.c (scan_sexps_forward): + * syntax.c (copy_if_not_already_present): + * syntax.c (update_just_this_syntax_table): + * syntax.c (update_syntax_table): + * syntax.c (vars_of_syntax): + * syntax.h: + * syntax.h (struct syntax_cache): + Add entry to syntax caches for the non-mirror table. Set it + appropriately when initializing the syntax table. Use it, not + the mirror table, for calls to syntax_match(). + Don't create a bogus float each time, just once at startup. + Add some asserts, as in chartab.c. + + * syntax.h (SYNTAX_CODE_FROM_CACHE): + When retrieving the syntax code, check the dirty flag and update + the mirror tables as appropriate. + Add some asserts, as above. + +2003-02-14 Ben Wing + + * scrollbar.c (specifier_vars_of_scrollbar): + Don't generate fallbacks for TTY's when not HAVE_TTY. + +2003-02-13 Martin Buchholz + + Make XEmacs redisplay 10 times faster. + If, that is, you're using a slow X connection and MoveOpaque. + Use compress_exposure = XtExposeCompressMaximal | XtExposeNoRegion. + Use compress_motion = TRUE. + * EmacsFrame.c (emacsFrameClassRec): + * EmacsShell-sub.c (EMACS_SHELL_CLASS_REC): + * EmacsManager.c (emacsManagerClassRec): + * xintrinsicp.h: Make sure XtExposeNoRegion is defined. + +2003-02-13 Ben Wing + + * unicode.c (utf_16_detect): + Don't get snafued w/division-by-zero. + +2003-02-12 Ben Wing + + * profile.c: + * profile.c (create_profile_tables): + * profile.c (current_profile_function): + * profile.c (profile_record_consing): + * profile.c (profile_record_about_to_call): + * profile.c (profile_record_just_called): + * profile.c (sigprof_handler): + * profile.c (Fstart_profiling): + * profile.c (Fstop_profiling): + * profile.c (Fclear_profiling_info): + * profile.c (copy_hash_table_or_blank): + * profile.c (Fget_profiling_info): + * profile.c (set_profiling_info_timing_maphash): + * profile.c (Fset_profiling_info): + * profile.c (mark_profiling_info_maphash): + * profile.c (mark_profiling_info): + * profile.c (vars_of_profile): + Major reworking. Keep track of new information -- total + function timing (includes descendants), GC usage, total GC usage + (includes descendants). New functions to be called appropriately + from eval.c, alloc.c to keep track of this information. Keep track + of when we're actually in a function vs. in its profile, for more + accurate timing counts. Track profile overhead separately. Create + new mechanism for specifying "internal sections" that are tracked + just like regular Lisp functions and even appear in the backtrace + if `backtrace-with-internal-sections' is non-nil (t by default + for error-checking builds). Add some KKCC information for the + straight (non-Elisp) hash table used by profile, which contains + Lisp objects in its keys -- but not used yet. Remove old ad-hoc + methods for tracking garbage collection, redisplay (which was + incorrect anyway when Lisp was called within these sections). + Don't record any tick info when blocking under MS Windows, since + the timer there is in real time rather than in process time. + Make `start-profiling', `stop-profiling' interactive. Be consistent + wrt. recursive functions and functions currently on the stack when + starting or stopping -- together these make implementing the + `total' values extremely difficult. When we start profiling, we + act as if we just entered all the functions currently on the stack. + Likewise when exiting. Create vars in_profile for tracking + time spent inside of profiling, and profiling_lock for setting + exclusive access to the main hash table when reading from it or + modifying it. (protects against getting screwed up by the signal + handle going off at the same time. + + * profile.h: New file. + Create macros for declaring internal profiling sections. + + * lisp.h: + Move profile-related stuff to profile.h. + + * alloc.c: + * alloc.c (INCREMENT_CONS_COUNTER_1): + * alloc.c (DECREMENT_CONS_COUNTER): + * alloc.c (garbage_collect_1): + * alloc.c (vars_of_alloc): + Keep track of total consing, for profile. + Tell profile when we are consing. + Use new profile-section method for noting garbage-collection. + + * alloc.c (xmalloc): + * alloc.c (xcalloc): + * alloc.c (xrealloc): + * alloc.c (endif): + Abort if we attempt to call the allocator reentrantly. + + * backtrace.h: + * backtrace.h (FSET_FAST_UNSAFE): + * eval.c: + Add info for use by profile in the backtrace frame and transfer + PUSH_BACKTRACE/POP_BACKTRACE from eval.c, for use with profile. + + * elhash.c: Author comment. + + * eval.c (vars_of_eval): + * lisp.h: + New Lisp var `backtrace-with-internal-sections'. Set to t when + error-checking is on. + + * eval.c: + * eval.c (unwind_to_catch): + When unwinding, + + * eval.c (Fcommand_execute): + * eval.c (Feval): + * eval.c (Ffuncall): + Report to profile when we are about-to-call and just-called wrt. a + function. + + * alloc.c (garbage_collect_1): + * eval.c (backtrace_unevalled_args): + * eval.c (Fbacktrace): + * eval.c (Fbacktrace_frame): + Allow for "fake" backtrace frames, for internal sections (used by + profile and `backtrace-with-internal-sections'. + + * event-Xt.c: + * event-Xt.c (emacs_Xt_next_event): + * event-gtk.c: + * event-gtk.c (emacs_gtk_next_event): + * event-msw.c: + * event-msw.c (mswindows_need_event): + * event-tty.c: + * event-tty.c (emacs_tty_next_event): + Record when we are actually blocking on an event, for profile's sake. + + * event-stream.c: + * event-stream.c (next_event_internal): + * event-stream.c (Fnext_event): + * event-stream.c (execute_internal_event): + * event-stream.c (Fdispatch_event): + * event-stream.c (syms_of_event_stream): + * event-stream.c (vars_of_event_stream): + Record internal profiling sections for getting, dispatching events. + + * extents.c: + * extents.c (map_extents): + * extents.c (vars_of_extents): + Record internal profiling sections for map_extents. + + * hash.c: Author comment. + * hash.c (grow_hash_table): + * hash.h: + Add pregrow_hash_table_if_necessary(). (Used in profile code + since the signal handler is the main grower but can't allow + a realloc(). We make sure, at critical points, that the table + is large enough.) + + * lread.c: + * lread.c (Fload_internal): + * lread.c (done): New. + * lread.c (syms_of_lread): + * lread.c (vars_of_lread): + Create internal profiling sections for `load' (which may be triggered + internally by autoload, etc.). + + * redisplay.c: + * redisplay.c (redisplay_without_hooks): + * redisplay.c (vars_of_redisplay): + Remove old profile_redisplay_flag. Use new macros to declare + internal profiling section for redisplay. + + * text.c (charbpos_to_bytebpos_func): + * text.c (bytebpos_to_charbpos_func): + * text.c (dfc_convert_to_external_format): + * text.c (dfc_convert_to_internal_format): + * text.c (vars_of_text): + Use new macros to declare internal profiling sections for + char-byte conversion and internal-external conversion. + + SEMI-UNRELATED CHANGES: + ----------------------- + + * text.c: + Update the long comments. + +2003-02-07 Mike Sperber + + * scrollbar.c (specifier_vars_of_scrollbar): + (specifier_vars_of_scrollbar): TTY devices don't have scrollbars. + +2003-01-28 Martin Buchholz + + * config.h.in (_ALL_SOURCE): Guard against multiple definition. + +2003-02-09 Ben Wing + + * console-stream.c: + * console-stream.c (stream_clear_region): + * console-stream.c (console_type_create_stream): + Abort when any attempts to output a stream console are made. + Should be caught sooner. + + * event-msw.c (mswindows_wnd_proc): + Don't redisplay() during sizing when the frame has not yet been + initialized completely. + + * event-stream.c (Fnext_event): + * menubar-msw.c (mswindows_handle_wm_initmenupopup): + * menubar-x.c (protected_menu_item_descriptor_to_widget_value): + * menubar.c: + * menubar.h: + Restore in_menu_callback. Bind it in menubar-{msw,x}.c when + calling filter functions and the like. Conditionalize on it, not + in_modal_loop, when issuing error in `next-event', otherwise we + bite the dust immediately -- event-msw.c purposely calls + Fnext_event() in a modal loop, and knows what it's doing. + + * redisplay-output.c (redisplay_unmap_subwindows_maybe): + * redisplay-output.c (redisplay_unmap_subwindows_except_us): + Formatting fixes. + + * redisplay.c: + * redisplay.c (redisplay_frame): + * redisplay.c (Fredisplay_echo_area): + * redisplay.c (redisplay_no_pre_idle_hook): + * redisplay.c (syms_of_redisplay): + * redisplay.c (vars_of_redisplay): + * window.c (Fwindow_pixel_edges): + * window.c (syms_of_window): + * winslots.h: + Delete lots of carcasses of attempts to add redisplay support for + font-lock -- `pre/post-redisplay-hook', unimplemented junk from + FSF (redisplay-end-trigger, `window-scroll-functions', + `window-size-change-functions'). If we want to port some + redisplay support from FSF, port the `fontified' property. + + * redisplay.c (redisplay_frame): + Put in a check here (as well as redisplay_device()) for a stream + frame. We can get here directly through Lisp fun + `redisplay-frame'. Abort if frame not initialized. + + * redisplay.c (Fredisplay_echo_area): + * redisplay.c (Fforce_cursor_redisplay): + Check for stream frames/devices. + +2003-02-07 Mike Sperber + + * alloc.c (GC_CHECK_NOT_FREE): Pull this out of USE_KKCC. + +2003-02-07 Ben Wing + + * lread.c (Fload_internal): + Eliminate printing `done' messages noninteractively since it's now + obvious which files are loaded by which others. + +2003-02-06 Andrew Begel + + * sysdll.c: Included lisp.h to define needed alloca_array. + +2003-02-07 Jerry James + + * sysdep.c (strlwr): Return the parameter. + * sysdep.c (strupr): Ditto. Depend on !HAVE_STRUPR. + +2003-02-07 Ben Wing + + This contains two related changes: + + (1) Fix problems with reentrant calling of lwlib and associated + crashes when selecting menu items. + (2) Improve redisplay handling of preemption. Turn on lazy lock + and hold down page-down or page-up and you'll see what I mean. + + They are related because they both touch on the code that retrieves + events and handles the internal queues. + + * console-msw.h: + * event-msw.c: + * event-msw.c (mswindows_unmodalize_signal_maybe): + * event-msw.c (mswindows_unsafe_pump_events): + * event-msw.c (mswindows_pump_outstanding_events): + * event-msw.c (mswindows_need_event_in_modal_loop): + * event-msw.c (mswindows_drain_windows_queue): + * event-msw.c (mswindows_need_event): + * event-msw.c (reinit_vars_of_event_mswindows): + * event-stream.c (event_stream_protect_modal_loop): + * events.h: + * events.h (struct event_stream): + * menubar-msw.c (struct handle_wm_initmenu): + * menubar-msw.c (unsafe_handle_wm_initmenupopup): + * menubar-msw.c (unsafe_handle_wm_initmenu): + * menubar-msw.c (mswindows_handle_wm_initmenupopup): + * menubar-msw.c (mswindows_handle_wm_initmenu): + * menubar-x.c: + * menubar-x.c (protected_menu_item_descriptor_to_widget_value): + * menubar-x.c (pre_activate_callback): + * menubar.h: + + mswindows_protect_modal_loop() has been generalized to + event_stream_protect_modal_loop(), and moved to event-stream.c. + mswindows_in_modal_loop ->in_modal_loop likewise. Changes in + event-msw.c and menubar-msw.c for the new names and calling format + (use structures instead of static variables in menubar-msw.c). + Delete former in_menu_callback and use in_modal_loop in its place. + Remove emacs_mswindows_quit_check_disallowed_p(), superseded by + in_modal_loop. Use event_stream_protect_modal_loop() in + pre_activate_callback() so that we get no lwlib reentrancy. + + Rearrange some of the code in event-msw.c to be grouped better. + Make mswindows_drain_windows_queue() respect in_modal_loop and + do nothing if so. + + * cmdloop.c (command_loop_3): + * event-stream.c (Fnext_event): + Don't conditionalize on LWLIB_MENUBARS_LUCID when giving error when + in_modal_loop, and give better error. + + * event-Xt.c (emacs_Xt_next_event): + * event-Xt.c (emacs_Xt_drain_queue): + * event-gtk.c (emacs_gtk_drain_queue): + If in_modal_loop, only retrieve process and timeout events. + Don't retrieve any X events because processing them can lead + to reentrancy in lwlib -> death. + + * event-stream.c: + * event-stream.c (check_event_stream_ok): + * event-stream.c (event_stream_handle_magic_event): + * event-stream.c (event_stream_format_magic_event): + * event-stream.c (event_stream_compare_magic_event): + * event-stream.c (event_stream_hash_magic_event): + * event-stream.c (event_stream_add_timeout): + * event-stream.c (event_stream_remove_timeout): + * event-stream.c (event_stream_select_console): + * event-stream.c (event_stream_unselect_console): + * event-stream.c (event_stream_select_process): + * event-stream.c (event_stream_unselect_process): + * event-stream.c (event_stream_create_io_streams): + * event-stream.c (event_stream_delete_io_streams): + * event-stream.c (event_stream_current_event_timestamp): + * event-stream.c (event_stream_next_event): + Remove unused parameter to check_event_stream_ok() and change + all callers. + + * lisp.h: + * event-stream.c (maybe_do_auto_save): + * event-stream.c (emacs_handle_focus_change_preliminary): + * event-stream.c (emacs_handle_focus_change_final): + * event-stream.c (detect_input_pending): + * event-stream.c (maybe_read_quit_event): + * event-stream.c (remove_quit_p_event): + * event-stream.c (event_stream_quit_p): + * event-stream.c (event_stream_next_event): + * event-stream.c (sit_for_unwind): + * event-stream.c (Faccept_process_output): + * event-stream.c (Fsleep_for): + * event-stream.c (Fsit_for): + * event-stream.c (maybe_kbd_translate): + * event-stream.c (command_builder_find_leaf_no_mule_processing): + * event-stream.c (reinit_vars_of_event_stream): + Rearrange some functions for increased clarity -- in particular, + group all the input-pending/QUIT-related stuff together, and + put right next to next-event stuff, to which it's related. + Add the concept of "HOW_MANY" -- when asking whether user input + is pending, you can ask if at least HOW_MANY events are pending, + not just if any are. Add parameter to detect_input_pending() + for this. Change recursive_sit_for from a Lisp_Object (which + could only be Qt or Qnil) to an int, like it should be. + + * event-Xt.c: + * event-Xt.c (THIS_IS_X): + * event-gtk.c: + * event-gtk.c (THIS_IS_GTK): + * event-xlike-inc.c: New file. + Abstract out similar code in event_{Xt/gtk}_pending_p() and write + only once, using include-file tricks. Rewrite this function to + implement HOW_MANY and only process events when not in_modal_loop. + + * event-msw.c (emacs_mswindows_event_pending_p): + Implement HOW_MANY and only process events when not in_modal_loop. + + * event-tty.c: + * event-tty.c (tty_timeout_to_emacs_event): + * event-tty.c (emacs_tty_event_pending_p): + Implement HOW_MANY. + + * redisplay.c: + * redisplay.c (QUEUED_EVENTS_REQUIRED_FOR_PREEMPTION): + * redisplay.c (init_redisplay): + * redisplay.c (vars_of_redisplay): + Add var `max-preempts' to control maximum number of preempts. + (#### perhaps not useful) Rewrite preemption check so that, + rather than preempting when any user events are available, only + preempt when a certain number (currently 4) of them are backed up. + This effectively allows redisplay to proceed to completion in the + presence of a fast auto-repeat (usually the auto-repeating is + generated dynamically as necessary), and you get much better + display behavior with lazy-lock active. + + * event-unixoid.c: + Comment changes. + + * event-stream.c (command_event_p_cb): + * event-stream.c (Fdiscard_input): + Rewrite discard-input much more simply and safely using the + drain-queue functions. I think the old version might loop + forever if called when in_modal_loop. + + SEMI-UNRELATED CHANGES: + ----------------------- + + * event-stream.c (run_pre_idle_hook): + Turn QUIT-checking back on when running the pre-idle hook so it + can be quit out of. + + * indent.c: + Document exact functioning of `vertical-motion' better, and its + differences from GNU Emacs. + +2003-02-06 Ben Wing + + * unicode.c: + * unicode.c (struct utf_16_detector): + * unicode.c (utf_16_detect): + * unicode.c (struct utf_8_detector): + * unicode.c (utf_8_detect): + UTF-8 detector was totally bogus and detected almost anything as UTF-8. + UTF-16 detector got overly happy with 0x2028's (line separator, + also space+paren). + +2003-02-06 Ben Wing + + * lread.c (Fload_internal): + Oops. Plain C can't handle declarations intermixed with statements. + +2003-02-06 Ben Wing + + * alloc.c: + * alloc.c (GC_CHECK_NOT_FREE): + * alloc.c (mark_object_maybe_checking_free): + * alloc.c (mark_with_description): + * alloc.c (mark_object): + Implement tail-recursion in KKCC when the last-marked object is + a Lisp object, to avoid stack-overflow errors when marking long + lists. Factor out some duplicated error-checking into macros. + +2003-02-05 Ben Wing + + * Makefile.in.in (update-elc.stamp): + NOBYTECOMPILE -> BYTECOMPILE_CHANGE. + + * esd.c (esd_play_sound_data): + Warning fixes. + + * fns.c: + * fns.c (mark_bit_vector): + * fns.c (Frequire): + * fns.c (vars_of_fns): + Eliminate bogus require-prints-loading-message; use already + existent load-always-display-messages instead. Make sure `load' + knows we are coming from `require'. + + * lread.c: + * lread.c (READCHARFUN_MAYBE): + * lread.c (Fload_internal): + * lread.c (PRINT_LOADING_MESSAGE_1): + * lread.c (PRINT_LOADING_MESSAGE): + * lread.c (vars_of_lread): + Turn on `load-warn-when-source-newer' by default. Change loading + message to indicate when we are `require'ing. Eliminate + purify_flag hacks to display more messages; instead, loadup and + friends specify this explicitly with + `load-always-display-messages'. Add spaces when batch to clearly + indicate recursive loading. Fassoc() does not GC so no need to + gcpro. + + * gui-x.c: + * gui-x.c (snarf_widget_values_for_gcpro): + * gui-x.c (gcpro_popup_callbacks): + * gui-x.h: + * menubar-x.c: + * menubar-x.c (pre_activate_callback): + * menubar-x.c (set_frame_menubar): + Fix up crashes when selecting menubar items due to lack of GCPROing + of callbacks in lwlib structures. + + * eval.c (Fbacktrace): + * lisp.h: + * print.c: + * print.c (canonicalize_printcharfun): + Don't canonicalize to selected-frame when noninteractive, or + backtraces get all screwed up as some values are printed through + the stream console and some aren't. Export + canonicalize_printcharfun() and use in Fbacktrace(). + +2003-02-05 Stephen J. Turnbull + + * config.h.in: New symbol: DLSYM_NEEDS_UNDERSCORE. + +2003-01-09 Stephen J. Turnbull + + * config.h.in: Restore USE_XFONTSET. + +2003-02-04 Ben Wing + + * s/windowsnt.h: + * s/windowsnt.h (HAVE_STRLWR): + Windows has strupr(), strlwr(). Comment fixes. + +2003-02-04 Ben Wing + + * text.h: Style fixes. + +2003-01-31 Stephen J. Turnbull + + * alloc.c (mark_object_maybe_checking_free): C macro syntax + requires paren to immediately follow definiendum. + +2003-01-30 Stephen J. Turnbull + + * file-coding.c (vars_of_file_coding): Fprovide here ... + (syms_of_file_coding): ... not here. Dem's da rules. + +2003-01-23 Stephen J. Turnbull + + * toolbar-msw.c: + * menubar-gtk.c (menu_descriptor_to_widget_1): + * nt.c (mswindows_link): + * event-msw.c (output_alt_keyboard_state): + Change C++ style comments to C style. + +2003-01-22 Vin Shelton + + * events.h: Change illegal (for C) // comment to /* */ + +2003-01-15 Jerry James + + * emodules.h: #undef everything we redefine for module code. + +2003-01-14 Sergey Okhapkin + + * Makefile.in.in (ldflags): re-order sections for gcc 3.2. + * s/cygwin.sc: new linker file. + +2003-01-11 Mike Sperber + + * window.c (Fdelete_window): Make sure that + f->last_nonminibuf_window is set to a live window once we're done. + (contains_window): Abstract this code out of Fdelete_window. + +2003-01-10 Mike Sperber + + * window.c (Fdelete_other_windows): Prevent crash for combination + windows. + +2003-01-08 Mike Sperber + + * console.h (CDFW_CONSOLE): Don't lead to a crash if we're dealing + with a dead window/frame/device/console. + +2002-12-20 Mike Sperber + + * ui-gtk.c: Fix typo from Ben's patch: emacs_ffi_data is a + typedef, not a struct. emacs_gtk_object_data is a typedef, not a + struct. + + + * gtk-glue.c (gdk_event_to_emacs_event): Fix typos from Ben's + patch: le -> emacs_event + rearrange the code. + + * event-gtk.c (gtk_event_to_emacs_event): Fix typos from Ben's + patch: ..._UNDERLYING_GDK_EVENT -> ..._GDK_EVENT, ev -> key_event. + + * device-gtk.c: Fix typo from Ben's patch: x_keysym_map_hash_table + -> x_keysym_map_hashtable. + +2002-12-19 Mike Sperber + + * menubar-x.c (set_frame_menubar): Initialize protect_me field of + popup_data. + +2002-12-16 Ben Wing + Major cleanup of KKCC, etc. + + KKCC, pdump-related: + + -- descriptions are written for all objects. this required some + changes in the format of some objects, e.g. extents, popup-data, + coding system, lstream, lcrecord-list. + -- KKCC now handles weakness in markers, hash tables, elsewhere + correctly (formerly, you'd eventually get a stack overflow due + to endlessly expanding markers). + -- textual changes: lrecord_description -> memory_description, + struct_description -> sized_memory_description. + -- extensive comment describing descriptions and pdump. + -- redo XD_UNION so it works inline and change its format to provide + sufficient info for pdump. implement XD_UNION in pdump. also add + XD_UNION_DYNAMIC_SIZE, which works like XD_UNION except for when + auto-computing structure sizes. + -- add support for XD_INDIRECT in description offsets (used by + extents). + -- add support for "description maps", allowing for indirect + descriptions that are retrieved from an object at run-time. this + generalizes XD_CODING_SYSTEM_END, XD_SPECIFIER_END, etc., which + have now been eliminated. + -- add a fifth field "flags" to memory_description, to support flags + that can be specified for this particular line. Currently defined + flags are XD_FLAG_NO_KKCC (KKCC should ignore this entry; useful + for the weakness above in markers, etc.), XD_FLAG_NO_PDUMP (pdump + should ignore this entry), XD_FLAG_UNION_DEFAULT_ENTRY (in + union maps, this specifies a "default" entry for all remaining + values), and XD_FLAG_FREE_LISP_OBJECT (for use with lcrecord-lists). + -- clean up the kkcc-itis in events, so that the differences + between event data as separate objects and as a union are now + minimized to a small number of places. with the new XD_UNION, we + no longer need event data as separate objects, so this code is no + longer ifdef USE_KKCC, but instead ifdef EVENT_DATA_AS_OBJECTS, + not used by default. make sure that we explicitly free the + separate event data objects when no longer in use, to maintain the + invariant the event processing causes no consing. + -- also remove other USE_KKCC ifdefs when not necessary. + -- allow for KKCC compilation under MS Windows. + -- fix README.kkcc. + -- dump_add_root_object -> dump_add_root_lisp_object. + -- implement dump_add_root_block and use this to handle + dump_add_opaque. + -- factor out some code duplicated in kkcc and pdump. + + Other allocation/object-related: + + -- change various *slots.h so MARKED_SLOT() call no longer + includes semicolon. + -- free_marker() takes a Lisp_Object not a direct pointer. + -- make bit vectors lcrecords, like vectors, and eliminate code + that essentially duplicated the lcrecord handling. + -- additional asserts in FREE_FIXED_TYPE, formerly duplicated in + the various callers of this. + -- all lcrecord allocation functions now zero out the returned + lcrecords. unnecessary calls to zero_lcrecord removed. add long + comment describing these functions. + -- extract out process and coding system slots, like for buffers, + frames, etc. + -- lcrecords now set the type of items sitting on the free list to + lcrecord_type_free. + -- changes to the way that gap arrays are allocated, for kkcc's + benefit -- now, one single memory block with a stretchy array on + the end, instead of a separate block holding the array. + + Error-checking-related: + + -- now can compile with C++ under MS Windows. clean up compile errors + discovered that way. (a few were real problems) + -- add C++ error-checking code to verify problems with mismatched + GCPRO/UNGCPRO. (there were a few in the kkcc code.) add long + comment about how to catch insufficient GCPRO (yes, it's possible + using C++). + -- add debug_p4(), a simple object printer, when debug_print() + doesn't work. + -- add dp() and db() as short synonyms of debug_print(), + debug_backtrace(). + -- `print' tries EXTREMELY hard to avoid core dumping when printing + when crashing or from debug_print(), and tries as hard as it + reasonably can in other situations. + -- Correct the message output upon crashing to be more up-to-date. + + Event-related: + + -- document event-matches-key-specifier-p better. + -- generalize the dispatch queues formerly duplicated in the + various event implementations. add event methods to drain pending + events. generalize and clean up QUIT handling, removing + event-specific quit processing. allow arbitrary keystrokes, not + just ASCII, to be the QUIT char. among other things, this should + fix some longstanding bugs in X quit handling. long comment + describing the various event queues. + -- implement delaying of XFlush() if there are pending expose events. + SOMEONE PLEASE TRY THIS OUT. + -- Fix `xemacs -batch -l dunnet' under Cygwin. Try to fix under + MS Windows but not quite there yet. + + Other: + + -- class -> class_ and no more C++ games with this item. + new -> new_ in the lwlib code, so far not elsewhere. + -- use `struct htentry' not `struct hentry' in elhash.c to avoid + debugger confusion with hash.c. + -- new macros ALIST_LOOP_3, ALIST_LOOP_4. + + * README.kkcc: + * alloc.c: + * alloc.c (deadbeef_memory): + * alloc.c (allocate_lisp_storage): + * alloc.c (copy_lisp_object): + * alloc.c (ALLOCATE_FIXED_TYPE_1): + * alloc.c (FREE_FIXED_TYPE): + * alloc.c (make_vector_internal): + * alloc.c (make_bit_vector_internal): + * alloc.c (make_key_data): + * alloc.c (make_button_data): + * alloc.c (make_motion_data): + * alloc.c (make_process_data): + * alloc.c (make_timeout_data): + * alloc.c (make_magic_data): + * alloc.c (make_magic_eval_data): + * alloc.c (make_eval_data): + * alloc.c (make_misc_user_data): + * alloc.c (struct string_chars_block): + * alloc.c (mark_lcrecord_list): + * alloc.c (make_lcrecord_list): + * alloc.c (alloc_managed_lcrecord): + * alloc.c (free_managed_lcrecord): + * alloc.c (alloc_automanaged_lcrecord): + * alloc.c (staticpro_1): + * alloc.c (staticpro): + * alloc.c (lispdesc_indirect_count_1): + * alloc.c (lispdesc_indirect_description_1): + * alloc.c (lispdesc_one_description_line_size): + * alloc.c (lispdesc_structure_size): + * alloc.c (mark_object_maybe_checking_free): + * alloc.c (mark_with_description): + * alloc.c (mark_struct_contents): + * alloc.c (mark_object): + * alloc.c (tick_lcrecord_stats): + * alloc.c (free_cons): + * alloc.c (free_key_data): + * alloc.c (free_button_data): + * alloc.c (free_motion_data): + * alloc.c (free_process_data): + * alloc.c (free_timeout_data): + * alloc.c (free_magic_data): + * alloc.c (free_magic_eval_data): + * alloc.c (free_eval_data): + * alloc.c (free_misc_user_data): + * alloc.c (free_marker): + * alloc.c (compact_string_chars): + * alloc.c (gc_sweep): + * alloc.c (garbage_collect_1): + * alloc.c (Fgarbage_collect): + * alloc.c (common_init_alloc_early): + * alloc.c (init_alloc_early): + * alloc.c (init_alloc_once_early): + * buffer.c: + * buffer.c (mark_buffer): + * buffer.c (MARKED_SLOT): + * buffer.c (cleanup_buffer_undo_lists): + * buffer.c (Fget_file_buffer): + * buffer.h (MARKED_SLOT): + * bufslots.h: + * bytecode.c: + * callint.c: + * casetab.c: + * chartab.c: + * chartab.c (symbol_to_char_table_type): + * cmdloop.c: + * cmdloop.c (Fcommand_loop_1): + * config.h.in (new): + * conslots.h: + * console-gtk-impl.h (struct gtk_frame): + * console-impl.h: + * console-impl.h (struct console): + * console-impl.h (MARKED_SLOT): + * console-impl.h (CONSOLE_QUIT_EVENT): + * console-msw-impl.h (XM_BUMPQUEUE): + * console-msw.c (write_string_to_mswindows_debugging_output): + * console-msw.h: + * console-stream-impl.h: + * console-stream-impl.h (struct stream_console): + * console-stream.c: + * console-stream.c (stream_init_console): + * console-stream.h: + * console-tty.c: + * console-tty.h: + * console-x.h: + * console.c: + * console.c (mark_console): + * console.c (MARKED_SLOT): + * console.c (allocate_console): + * console.c (get_console_variant): + * console.c (create_console): + * console.c (delete_console_internal): + * console.c (Fset_input_mode): + * console.c (Fcurrent_input_mode): + * console.c (common_init_complex_vars_of_console): + * console.h: + * console.h (console_variant): + * console.h (device_metrics): + * data.c: + * data.c (Faref): + * data.c (Faset): + * data.c (decode_weak_list_type): + * database.c: + * debug.c (xemacs_debug_loop): + * debug.c (FROB): + * debug.c (Fadd_debug_class_to_check): + * debug.c (Fdelete_debug_class_to_check): + * debug.c (Fset_debug_classes_to_check): + * debug.c (Fset_debug_class_types_to_check): + * debug.c (Fdebug_types_being_checked): + * debug.h (DASSERT): + * device-gtk.c: + * device-impl.h (struct device): + * device-impl.h (MARKED_SLOT): + * device-msw.c: + * device-x.c: + * device-x.c (x_init_device_class): + * device-x.c (x_comp_visual_info): + * device-x.c (x_try_best_visual_class): + * device-x.c (x_init_device): + * device-x.c (construct_name_list): + * device-x.c (x_get_resource_prefix): + * device-x.c (Fx_get_resource): + * device-x.c (Fx_display_visual_class): + * device.c: + * device.c (MARKED_SLOT): + * device.c (allocate_device): + * device.c (Fmake_device): + * device.c (delete_device_internal): + * device.c (Fset_device_class): + * device.h: + * devslots.h: + * devslots.h (MARKED_SLOT): + * dialog-msw.c: + * dired-msw.c (mswindows_ls_sort_fcn): + * dired-msw.c (mswindows_get_files): + * dired-msw.c (mswindows_format_file): + * doprnt.c (parse_doprnt_spec): + * dumper.c: + * dumper.c (struct): + * dumper.c (dump_add_root_block): + * dumper.c (dump_add_root_struct_ptr): + * dumper.c (dump_add_root_lisp_object): + * dumper.c (pdump_struct_list_elt): + * dumper.c (pdump_get_entry_list): + * dumper.c (pdump_backtrace): + * dumper.c (pdump_bump_depth): + * dumper.c (pdump_register_sub): + * dumper.c (pdump_register_object): + * dumper.c (pdump_register_struct_contents): + * dumper.c (pdump_register_struct): + * dumper.c (pdump_store_new_pointer_offsets): + * dumper.c (pdump_dump_data): + * dumper.c (pdump_reloc_one): + * dumper.c (pdump_allocate_offset): + * dumper.c (pdump_scan_by_alignment): + * dumper.c (pdump_dump_root_blocks): + * dumper.c (pdump_dump_rtables): + * dumper.c (pdump_dump_root_lisp_objects): + * dumper.c (pdump): + * dumper.c (pdump_load_finish): + * dumper.c (pdump_file_get): + * dumper.c (pdump_resource_get): + * dumper.c (pdump_load): + * editfns.c (save_excursion_restore): + * editfns.c (user_login_name): + * editfns.c (save_restriction_restore): + * elhash.c: + * elhash.c (htentry): + * elhash.c (struct Lisp_Hash_Table): + * elhash.c (HTENTRY_CLEAR_P): + * elhash.c (LINEAR_PROBING_LOOP): + * elhash.c (check_hash_table_invariants): + * elhash.c (mark_hash_table): + * elhash.c (hash_table_equal): + * elhash.c (print_hash_table_data): + * elhash.c (free_hentries): + * elhash.c (make_general_lisp_hash_table): + * elhash.c (decode_hash_table_weakness): + * elhash.c (decode_hash_table_test): + * elhash.c (Fcopy_hash_table): + * elhash.c (resize_hash_table): + * elhash.c (pdump_reorganize_hash_table): + * elhash.c (find_htentry): + * elhash.c (Fgethash): + * elhash.c (Fputhash): + * elhash.c (remhash_1): + * elhash.c (Fremhash): + * elhash.c (Fclrhash): + * elhash.c (copy_compress_hentries): + * elhash.c (elisp_maphash_unsafe): + * elhash.c (finish_marking_weak_hash_tables): + * elhash.c (prune_weak_hash_tables): + * elhash.h: + * emacs.c: + * emacs.c (main_1): + * emacs.c (main): + * emacs.c (shut_down_emacs): + * emodules.h (dump_add_root_lisp_object): + * eval.c: + * eval.c (unwind_to_catch): + * eval.c (maybe_signal_error_1): + * eval.c (maybe_signal_continuable_error_1): + * eval.c (maybe_signal_error): + * eval.c (maybe_signal_continuable_error): + * eval.c (maybe_signal_error_2): + * eval.c (maybe_signal_continuable_error_2): + * eval.c (maybe_signal_ferror): + * eval.c (maybe_signal_continuable_ferror): + * eval.c (maybe_signal_ferror_with_frob): + * eval.c (maybe_signal_continuable_ferror_with_frob): + * eval.c (maybe_syntax_error): + * eval.c (maybe_sferror): + * eval.c (maybe_invalid_argument): + * eval.c (maybe_invalid_constant): + * eval.c (maybe_invalid_operation): + * eval.c (maybe_invalid_change): + * eval.c (maybe_invalid_state): + * eval.c (Feval): + * eval.c (call_trapping_problems): + * eval.c (call_with_suspended_errors): + * eval.c (warn_when_safe_lispobj): + * eval.c (warn_when_safe): + * eval.c (vars_of_eval): + * event-Xt.c: + * event-Xt.c (maybe_define_x_key_as_self_inserting_character): + * event-Xt.c (x_to_emacs_keysym): + * event-Xt.c (x_event_to_emacs_event): + * event-Xt.c (emacs_Xt_enqueue_focus_event): + * event-Xt.c (emacs_Xt_format_magic_event): + * event-Xt.c (emacs_Xt_compare_magic_event): + * event-Xt.c (emacs_Xt_hash_magic_event): + * event-Xt.c (emacs_Xt_handle_magic_event): + * event-Xt.c (Xt_timeout_to_emacs_event): + * event-Xt.c (Xt_process_to_emacs_event): + * event-Xt.c (signal_special_Xt_user_event): + * event-Xt.c (emacs_Xt_next_event): + * event-Xt.c (emacs_Xt_event_handler): + * event-Xt.c (emacs_Xt_drain_queue): + * event-Xt.c (emacs_Xt_event_pending_p): + * event-Xt.c (check_if_pending_expose_event): + * event-Xt.c (reinit_vars_of_event_Xt): + * event-Xt.c (vars_of_event_Xt): + * event-gtk.c: + * event-gtk.c (IS_MODIFIER_KEY): + * event-gtk.c (emacs_gtk_format_magic_event): + * event-gtk.c (emacs_gtk_compare_magic_event): + * event-gtk.c (emacs_gtk_hash_magic_event): + * event-gtk.c (emacs_gtk_handle_magic_event): + * event-gtk.c (gtk_to_emacs_keysym): + * event-gtk.c (gtk_timeout_to_emacs_event): + * event-gtk.c (gtk_process_to_emacs_event): + * event-gtk.c (dragndrop_data_received): + * event-gtk.c (signal_special_gtk_user_event): + * event-gtk.c (emacs_gtk_next_event): + * event-gtk.c (gtk_event_to_emacs_event): + * event-gtk.c (generic_event_handler): + * event-gtk.c (emacs_shell_event_handler): + * event-gtk.c (emacs_gtk_drain_queue): + * event-gtk.c (emacs_gtk_event_pending_p): + * event-gtk.c (reinit_vars_of_event_gtk): + * event-gtk.c (vars_of_event_gtk): + * event-msw.c: + * event-msw.c (struct winsock_stream): + * event-msw.c (winsock_reader): + * event-msw.c (winsock_writer): + * event-msw.c (mswindows_enqueue_dispatch_event): + * event-msw.c (mswindows_enqueue_misc_user_event): + * event-msw.c (mswindows_enqueue_magic_event): + * event-msw.c (mswindows_enqueue_process_event): + * event-msw.c (mswindows_enqueue_mouse_button_event): + * event-msw.c (mswindows_enqueue_keypress_event): + * event-msw.c (mswindows_dequeue_dispatch_event): + * event-msw.c (emacs_mswindows_drain_queue): + * event-msw.c (mswindows_need_event_in_modal_loop): + * event-msw.c (mswindows_need_event): + * event-msw.c (mswindows_wm_timer_callback): + * event-msw.c (dde_eval_string): + * event-msw.c (Fdde_alloc_advise_item): + * event-msw.c (mswindows_dde_callback): + * event-msw.c (mswindows_wnd_proc): + * event-msw.c (remove_timeout_mapper): + * event-msw.c (emacs_mswindows_remove_timeout): + * event-msw.c (emacs_mswindows_event_pending_p): + * event-msw.c (emacs_mswindows_format_magic_event): + * event-msw.c (emacs_mswindows_compare_magic_event): + * event-msw.c (emacs_mswindows_hash_magic_event): + * event-msw.c (emacs_mswindows_handle_magic_event): + * event-msw.c (emacs_mswindows_select_console): + * event-msw.c (emacs_mswindows_unselect_console): + * event-msw.c (reinit_vars_of_event_mswindows): + * event-msw.c (vars_of_event_mswindows): + * event-stream.c: + * event-stream.c (mark_command_builder): + * event-stream.c (reset_command_builder_event_chain): + * event-stream.c (allocate_command_builder): + * event-stream.c (copy_command_builder): + * event-stream.c (command_builder_append_event): + * event-stream.c (event_stream_event_pending_p): + * event-stream.c (event_stream_force_event_pending): + * event-stream.c (maybe_read_quit_event): + * event-stream.c (event_stream_drain_queue): + * event-stream.c (remove_quit_p_event): + * event-stream.c (event_stream_quit_p): + * event-stream.c (echo_key_event): + * event-stream.c (maybe_kbd_translate): + * event-stream.c (execute_help_form): + * event-stream.c (event_stream_generate_wakeup): + * event-stream.c (enqueue_dispatch_event): + * event-stream.c (enqueue_magic_eval_event): + * event-stream.c (Fenqueue_eval_event): + * event-stream.c (enqueue_misc_user_event): + * event-stream.c (enqueue_misc_user_event_pos): + * event-stream.c (next_event_internal): + * event-stream.c (Fnext_event): + * event-stream.c (Faccept_process_output): + * event-stream.c (execute_internal_event): + * event-stream.c (munge_keymap_translate): + * event-stream.c (command_builder_find_leaf_no_mule_processing): + * event-stream.c (command_builder_find_leaf): + * event-stream.c (lookup_command_event): + * event-stream.c (is_scrollbar_event): + * event-stream.c (execute_command_event): + * event-stream.c (Fdispatch_event): + * event-stream.c (Fread_key_sequence): + * event-stream.c (dribble_out_event): + * event-stream.c (vars_of_event_stream): + * event-tty.c (tty_timeout_to_emacs_event): + * event-tty.c (emacs_tty_next_event): + * event-tty.c (emacs_tty_drain_queue): + * event-tty.c (reinit_vars_of_event_tty): + * event-unixoid.c: + * event-unixoid.c (find_tty_or_stream_console_from_fd): + * event-unixoid.c (read_event_from_tty_or_stream_desc): + * event-unixoid.c (drain_tty_devices): + * event-unixoid.c (poll_fds_for_input): + * events.c: + * events.c (deinitialize_event): + * events.c (zero_event): + * events.c (mark_event): + * events.c (print_event_1): + * events.c (print_event): + * events.c (event_equal): + * events.c (event_hash): + * events.c (Fmake_event): + * events.c (Fdeallocate_event): + * events.c (Fcopy_event): + * events.c (map_event_chain_remove): + * events.c (character_to_event): + * events.c (event_to_character): + * events.c (Fevent_to_character): + * events.c (format_event_object): + * events.c (upshift_event): + * events.c (downshift_event): + * events.c (event_upshifted_p): + * events.c (Fevent_live_p): + * events.c (Fevent_type): + * events.c (Fevent_timestamp): + * events.c (CHECK_EVENT_TYPE): + * events.c (CHECK_EVENT_TYPE2): + * events.c (CHECK_EVENT_TYPE3): + * events.c (Fevent_key): + * events.c (Fevent_button): + * events.c (Fevent_modifier_bits): + * events.c (event_x_y_pixel_internal): + * events.c (event_pixel_translation): + * events.c (Fevent_process): + * events.c (Fevent_function): + * events.c (Fevent_object): + * events.c (Fevent_properties): + * events.c (syms_of_events): + * events.c (vars_of_events): + * events.h: + * events.h (struct event_stream): + * events.h (struct Lisp_Key_Data): + * events.h (KEY_DATA_KEYSYM): + * events.h (EVENT_KEY_KEYSYM): + * events.h (struct Lisp_Button_Data): + * events.h (EVENT_BUTTON_BUTTON): + * events.h (struct Lisp_Motion_Data): + * events.h (EVENT_MOTION_X): + * events.h (struct Lisp_Process_Data): + * events.h (EVENT_PROCESS_PROCESS): + * events.h (struct Lisp_Timeout_Data): + * events.h (EVENT_TIMEOUT_INTERVAL_ID): + * events.h (struct Lisp_Eval_Data): + * events.h (EVENT_EVAL_FUNCTION): + * events.h (struct Lisp_Misc_User_Data): + * events.h (EVENT_MISC_USER_FUNCTION): + * events.h (struct Lisp_Magic_Eval_Data): + * events.h (EVENT_MAGIC_EVAL_INTERNAL_FUNCTION): + * events.h (struct Lisp_Magic_Data): + * events.h (EVENT_MAGIC_UNDERLYING): + * events.h (EVENT_MAGIC_GDK_EVENT): + * events.h (struct Lisp_Event): + * events.h (XEVENT_CHANNEL): + * events.h (SET_EVENT_TIMESTAMP_ZERO): + * events.h (SET_EVENT_CHANNEL): + * events.h (SET_EVENT_NEXT): + * events.h (XSET_EVENT_TYPE): + * events.h (struct command_builder): + * extents.c: + * extents.c (gap_array_adjust_markers): + * extents.c (gap_array_recompute_derived_values): + * extents.c (gap_array_move_gap): + * extents.c (gap_array_make_gap): + * extents.c (gap_array_insert_els): + * extents.c (gap_array_delete_els): + * extents.c (gap_array_make_marker): + * extents.c (gap_array_delete_marker): + * extents.c (gap_array_move_marker): + * extents.c (make_gap_array): + * extents.c (free_gap_array): + * extents.c (extent_list_num_els): + * extents.c (extent_list_insert): + * extents.c (mark_extent_auxiliary): + * extents.c (allocate_extent_auxiliary): + * extents.c (decode_extent_at_flag): + * extents.c (verify_extent_mapper): + * extents.c (symbol_to_glyph_layout): + * extents.c (syms_of_extents): + * faces.c: + * file-coding.c: + * file-coding.c (struct_detector_category_description =): + * file-coding.c (detector_category_dynarr_description_1): + * file-coding.c (struct_detector_description =): + * file-coding.c (detector_dynarr_description_1): + * file-coding.c (MARKED_SLOT): + * file-coding.c (mark_coding_system): + * file-coding.c (coding_system_extra_description_map): + * file-coding.c (coding_system_description): + * file-coding.c (allocate_coding_system): + * file-coding.c (symbol_to_eol_type): + * file-coding.c (Fcoding_system_aliasee): + * file-coding.c (set_coding_stream_coding_system): + * file-coding.c (struct convert_eol_coding_system): + * file-coding.c (struct undecided_coding_system): + * file-coding.c (undecided_mark_coding_stream): + * file-coding.c (coding_category_symbol_to_id): + * file-coding.c (struct gzip_coding_system): + * file-coding.c (coding_system_type_create): + * file-coding.h: + * file-coding.h (struct Lisp_Coding_System): + * file-coding.h (CODING_SYSTEM_SLOT_DECLARATION): + * file-coding.h (coding_system_variant): + * file-coding.h (struct coding_system_methods): + * file-coding.h (DEFINE_CODING_SYSTEM_TYPE_WITH_DATA): + * file-coding.h (INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA): + * file-coding.h (struct coding_stream): + * fileio.c (Fsubstitute_in_file_name): + * floatfns.c: + * fns.c: + * fns.c (base64_encode_1): + * frame-gtk.c: + * frame-gtk.c (Fgtk_start_drag_internal): + * frame-impl.h (struct frame): + * frame-impl.h (MARKED_SLOT): + * frame-msw.c: + * frame-x.c: + * frame-x.c (Fcde_start_drag_internal): + * frame-x.c (Foffix_start_drag_internal): + * frame.c: + * frame.c (MARKED_SLOT): + * frame.c (allocate_frame_core): + * frame.c (delete_frame_internal): + * frame.c (Fmouse_position_as_motion_event): + * frameslots.h: + * frameslots.h (MARKED_SLOT_ARRAY): + * free-hook.c: + * glyphs-msw.c (mswindows_widget_instantiate): + * glyphs-x.c: + * glyphs-x.c (convert_EImage_to_XImage): + * glyphs.c: + * glyphs.c (process_image_string_instantiator): + * glyphs.c (mark_image_instance): + * glyphs.c (allocate_image_instance): + * glyphs.c (unmap_subwindow): + * glyphs.c (map_subwindow): + * glyphs.c (syms_of_glyphs): + * glyphs.c (specifier_type_create_image): + * glyphs.h: + * glyphs.h (struct text_image_instance): + * glyphs.h (struct Lisp_Image_Instance): + * gmalloc.c: + * gmalloc.c ("C"): + * gpmevent.c (Freceive_gpm_event): + * gpmevent.c (gpm_next_event_cb): + * gpmevent.c (vars_of_gpmevent): + * gtk-glue.c (gdk_event_to_emacs_event): + * gtk-xemacs.c (gtk_xemacs_class_init): + * gui-msw.c: + * gui-msw.c (mswindows_handle_gui_wm_command): + * gui-msw.c (mswindows_translate_menu_or_dialog_item): + * gui-x.c: + * gui-x.c (mark_popup_data): + * gui-x.c (snarf_widget_value_mapper): + * gui-x.c (gcpro_popup_callbacks): + * gui-x.c (ungcpro_popup_callbacks): + * gui-x.c (free_popup_widget_value_tree): + * gui-x.c (popup_selection_callback): + * gui-x.h: + * gui-x.h (struct popup_data): + * gui.c: + * gui.c (allocate_gui_item): + * gutter.c (decode_gutter_position): + * hash.c (NULL_ENTRY): + * indent.c (vmotion_1): + * indent.c (vmotion_pixels): + * input-method-motif.c (res): + * input-method-xlib.c (IMInstantiateCallback): + * input-method-xlib.c (XIM_init_device): + * input-method-xlib.c (res): + * intl-encap-win32.c: + * intl-encap-win32.c (qxeSHGetDataFromIDList): + * intl-win32.c: + * intl-win32.c (mswindows_multibyte_cp_type): + * intl-win32.c (struct mswindows_multibyte_coding_system): + * keymap.c: + * keymap.c (make_key_description): + * keymap.c (keymap_store): + * keymap.c (get_keyelt): + * keymap.c (keymap_lookup_1): + * keymap.c (define_key_parser): + * keymap.c (key_desc_list_to_event): + * keymap.c (event_matches_key_specifier_p): + * keymap.c (meta_prefix_char_p): + * keymap.c (ensure_meta_prefix_char_keymapp): + * keymap.c (Fdefine_key): + * keymap.c (struct raw_lookup_key_mapper_closure): + * keymap.c (raw_lookup_key): + * keymap.c (raw_lookup_key_mapper): + * keymap.c (lookup_keys): + * keymap.c (lookup_events): + * keymap.c (Flookup_key): + * keymap.c (struct map_keymap_unsorted_closure): + * keymap.c (map_keymap_unsorted_mapper): + * keymap.c (map_keymap_sorted): + * keymap.c (map_keymap_mapper): + * keymap.c (map_keymap): + * keymap.c (accessible_keymaps_mapper_1): + * keymap.c (Faccessible_keymaps): + * keymap.c (Fsingle_key_description): + * keymap.c (raw_keys_to_keys): + * keymap.c (format_raw_keys): + * keymap.c (where_is_recursive_mapper): + * keymap.c (where_is_internal): + * keymap.c (describe_map_mapper_shadow_search): + * keymap.c (keymap_lookup_inherited_mapper): + * keymap.c (describe_map_mapper): + * keymap.h (event_matches_key_specifier_p): + * lisp.h: + * lisp.h (this): + * lisp.h (RETURN_NOT_REACHED): + * lisp.h (struct Lisp_Vector): + * lisp.h (struct Lisp_Bit_Vector): + * lisp.h (UNGCPRO_1): + * lisp.h (NUNGCPRO): + * lisp.h (NNUNGCPRO): + * lisp.h (DECLARE_INLINE_HEADER): + * lrecord.h: + * lrecord.h (struct lrecord_header): + * lrecord.h (struct lcrecord_header): + * lrecord.h (lrecord_type): + * lrecord.h (struct lrecord_implementation): + * lrecord.h (RECORD_DUMPABLE): + * lrecord.h (memory_description_type): + * lrecord.h (data_description_entry_flags): + * lrecord.h (struct memory_description): + * lrecord.h (struct sized_memory_description): + * lrecord.h (XD_INDIRECT): + * lrecord.h (XD_IS_INDIRECT): + * lrecord.h (XD_DYNARR_DESC): + * lrecord.h (DEFINE_BASIC_LRECORD_IMPLEMENTATION): + * lrecord.h (MAKE_LRECORD_IMPLEMENTATION): + * lrecord.h (MAKE_EXTERNAL_LRECORD_IMPLEMENTATION): + * lrecord.h (alloc_lcrecord_type): + * lstream.c: + * lstream.c (Lstream_new): + * lstream.c (lisp_buffer_marker): + * lstream.h: + * lstream.h (lstream_implementation): + * lstream.h (DEFINE_LSTREAM_IMPLEMENTATION): + * lstream.h (DEFINE_LSTREAM_IMPLEMENTATION_WITH_DATA): + * marker.c: + * marker.c (copy_marker_1): + * mem-limits.h: + * menubar-gtk.c: + * menubar-gtk.c (gtk_popup_menu): + * menubar-msw.c: + * menubar-msw.c (mswindows_popup_menu): + * menubar-x.c (make_dummy_xbutton_event): + * menubar-x.c (command_builder_operate_menu_accelerator): + * menubar-x.c (menu_accelerator_safe_compare): + * menubar-x.c (menu_accelerator_safe_mod_compare): + * mule-charset.c: + * mule-charset.c (make_charset): + * mule-charset.c (Fcharset_property): + * mule-coding.c: + * mule-coding.c (ccs_description_1): + * mule-coding.c (ccs_description =): + * mule-coding.c (ccsd_description_1): + * mule-coding.c (ccsd_description =): + * nt.c (getpwnam): + * nt.c (init_mswindows_environment): + * nt.c (get_cached_volume_information): + * nt.c (mswindows_is_executable): + * nt.c (read_unc_volume): + * nt.c (mswindows_access): + * nt.c (mswindows_link): + * nt.c (mswindows_fstat): + * nt.c (mswindows_stat): + * nt.c (mswindows_executable_type): + * nt.c (Fmswindows_short_file_name): + * nt.c (Fmswindows_long_file_name): + * objects-impl.h (struct Lisp_Color_Instance): + * objects-impl.h (struct Lisp_Font_Instance): + * objects-tty.c: + * objects-x.c (allocate_nearest_color): + * objects.c: + * objects.c (Fmake_color_instance): + * objects.c (Fmake_font_instance): + * objects.c (font_instantiate): + * opaque.c: + * opaque.c (make_opaque): + * opaque.c (make_opaque_ptr): + * opaque.c (reinit_opaque_early): + * opaque.c (init_opaque_once_early): + * print.c: + * print.c (printing_badness): + * print.c (printing_major_badness): + * print.c (print_internal): + * print.c (debug_p4): + * print.c (dp): + * print.c (debug_backtrace): + * process-nt.c (nt_create_process): + * process-nt.c (get_internet_address): + * process-unix.c: + * process-unix.c (struct unix_process_data): + * process-unix.c (get_internet_address): + * process-unix.c (unix_alloc_process_data): + * process-unix.c (unix_create_process): + * process-unix.c (try_to_initialize_subtty): + * process-unix.c (unix_kill_child_process): + * process-unix.c (process_type_create_unix): + * process.c: + * process.c (mark_process): + * process.c (MARKED_SLOT): + * process.c (make_process_internal): + * process.c (Fprocess_tty_name): + * process.c (decode_signal): + * process.h: + * procimpl.h: + * procimpl.h (struct process_methods): + * procimpl.h (struct Lisp_Process): + * rangetab.c: + * realpath.c (readlink_and_correct_case): + * redisplay-x.c (x_window_output_end): + * redisplay-x.c (x_redraw_exposed_area): + * redisplay-x.c (x_clear_frame): + * redisplay.c: + * redisplay.h: + * redisplay.h (struct rune_dglyph): + * redisplay.h (struct rune): + * scrollbar.c: + * scrollbar.c (create_scrollbar_instance): + * specifier.c: + * specifier.c (specifier_empty_extra_description_1): + * specifier.c (make_specifier_internal): + * specifier.c (decode_locale_type): + * specifier.c (decode_how_to_add_specification): + * specifier.h: + * specifier.h (struct specifier_methods): + * specifier.h (DEFINE_SPECIFIER_TYPE_WITH_DATA): + * specifier.h (INITIALIZE_SPECIFIER_TYPE_WITH_DATA): + * symbols.c: + * symbols.c (Fsetplist): + * symbols.c (default_value): + * symbols.c (decode_magic_handler_type): + * symbols.c (handler_type_from_function_symbol): + * symbols.c (Fdefvaralias): + * symbols.c (init_symbols_once_early): + * symbols.c (reinit_symbols_early): + * symsinit.h: + * sysdep.c (sys_subshell): + * sysdep.c (tty_init_sys_modes_on_device): + * syswindows.h: + * text.c (dfc_convert_to_external_format): + * text.c (dfc_convert_to_internal_format): + * text.c (reinit_eistring_early): + * text.c (init_eistring_once_early): + * text.c (reinit_vars_of_text): + * text.h: + * text.h (INC_IBYTEPTR_FMT): + * text.h (DEC_IBYTEPTR_FMT): + * toolbar.c: + * toolbar.c (decode_toolbar_position): + * tooltalk.c: + * ui-gtk.c: + * unexnt.c: + * unexnt.c (_start): + * unexnt.c (unexec): + * unexnt.c (get_section_info): + * unicode.c: + * unicode.c (vars_of_unicode): + * window.c: + * window.c (allocate_window): + * window.c (new_window_mirror): + * window.c (update_mirror_internal): + * winslots.h: + +2003-01-08 Andy Piper + + * unexcw.c (copy_executable_and_dump_data_section): Set the stack + reserve size during unexec(). + +2002-12-17 Daiki Ueno + + * process-unix.c (unix_create_process): Set pipe write descriptor + non-blocking. + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: src/EmacsManager.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/EmacsManager.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/EmacsManager.c 12 Apr 2001 18:23:22 -0000 1.3 +++ src/EmacsManager.c 14 Feb 2003 07:38:30 -0000 1.4 @@ -87,7 +87,7 @@ /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, - /* compress_exposure */ TRUE, + /* compress_exposure */ XtExposeCompressMaximal | XtExposeNoRegion, /* compress_enterleave*/ TRUE, /* visible_interest */ FALSE, /* destroy */ NULL, Index: src/EmacsShell-sub.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/EmacsShell-sub.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/EmacsShell-sub.c 12 Apr 2001 18:23:22 -0000 1.5 +++ src/EmacsShell-sub.c 14 Feb 2003 07:38:30 -0000 1.6 @@ -192,9 +192,9 @@ /* resources */ resources, /* resource_count */ XtNumber (resources), /* xrm_class */ NULLQUARK, - /* compress_motion */ FALSE, - /* compress_exposure */ TRUE, - /* compress_enterleave*/ FALSE, + /* compress_motion */ TRUE, + /* compress_exposure */ XtExposeCompressMaximal | XtExposeNoRegion, + /* compress_enterleave*/ TRUE, /* visible_interest */ TRUE, /* destroy */ NULL, /* resize */ XtInheritResize, Index: src/Makefile.in.in =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Makefile.in.in,v retrieving revision 1.95 retrieving revision 1.98 diff -u -r1.95 -r1.98 --- src/Makefile.in.in 10 Sep 2002 15:27:33 -0000 1.95 +++ src/Makefile.in.in 15 Feb 2003 10:16:03 -0000 1.98 @@ -273,6 +273,9 @@ 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 @@ -500,10 +503,10 @@ FRC.update-elc.stamp : update-elc.stamp : ${EXE_TARGET} FRC.update-elc.stamp - @touch NOBYTECOMPILE + @touch BYTECOMPILE_CHANGE ./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/update-elc.el - @if test ! -f $@ -o -f NOBYTECOMPILE; then touch $@; fi; \ - $(RM) NOBYTECOMPILE + @if test ! -f $@ -o -f BYTECOMPILE_CHANGE; then touch $@; fi; \ + $(RM) BYTECOMPILE_CHANGE obj_src = $(objs:.o=.c) @@ -521,10 +524,15 @@ #endif /* DYNODUMP */ ${libsrc}DOC: ${EXE_TARGET} update-elc.stamp - $(RM) ${libsrc}DOC; \ +#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} + ${obj_src} ${mallocdocsrc} ${rallocdocsrc} \ + ${extra_doc_files} ; fi dump_elcs: dump-elcs Index: src/README.kkcc =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/README.kkcc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/README.kkcc 3 Sep 2002 10:51:55 -0000 1.1 +++ src/README.kkcc 12 Jan 2003 11:08:07 -0000 1.2 @@ -28,137 +28,41 @@ the Object, if it is set to 0, the dumper does not care about it. - XD_UNION - -------- - We implemented XD_UNION support in (mark_with_description), so - we can describe exspecially console/device specific data with XD_UNION. - To describe with XD_UNION, we added a field to these objects, which - holds the variant type of the object. This field is initialized in - the appendant constructor. The variant is an integer, it has also to - be described in an description, if XD_UNION is used. - - Here is a pattern of a XD_UNION usage: - - First, the existing variants are listed. - enum example_variant - { - first_choice, - second_choice - }; - - Then a field which holds the variant is added to the Lisp_Object. - This field determines, where pointer points to. - struct Lisp_... - { - enum example_variant which_variant; - ... - void *pointer; - } - The variant field must be initialized in the constructor(s). - - In the description, the first entry should be the which_variant field, - on which XD_UNION refers. - static const struct lrecord_description ..._description [] = { - { XD_INT, offsetof (struct Lisp_..., which_variant) }, - ... - { XD_UNION, offsetof (struct Lisp_..., which_variant), - XD_INDIRECT (0, 0), variant_description }, - ... - }; - - The variant_description looks like this: - static const struct struct_description variant_description []= { - { first_choice, first_choice_description}, - { second_choice, second_choice__description}, - { XD_END } - }; - - first- and second_choice_description are common lrecord_descriptions: - static const struct lrecord_description first_choice_description [] = { - ... - { XD_END } - } - - - TODO ---- - - The following objects have currently no description: - * alloc.c: lcrecord_list - mark_object is never called, marking is done per mane. - - * buffer.c: mark_buffer - mark_conses_in_list implements weakness??? - - * extents.c: extent_info - loop to mark elements in list. - - * frame.c: frame - calls mark_gutters, that calls mark_redisplay_structs - - * glyphs.c: image_instance - XD_UNION or convert the union members to Lisp_Objects (see Lisp_Event) - - * gui-x.c: popup_data - calls lw_map_widget_values - - * window.c: window - calls mark_face_cachels and mark_glyph_cachels - - window_configuration - loop to mark saved_windows - - window_mirror - calls mark_redisplay_structs - - * lstream.c: lstream - - - After all Lisp_Objects have pdump descriptions, + After all Lisp_Objects have pdump descriptions (THEY DO NOW!!), (mark_with_description) can get rid of the mark_object calls. - There are a few Lisp_Objects, where there occured differences and - inexactness between the mark-method and the pdump description. - All these Lisp_Objects get dumped, so their descriptions have been - written, before we started our work: + There are a few Lisp_Objects, where there occured differences and + inexactness between the mark-method and the pdump description. All + these Lisp_Objects get dumped (except image instances), so their + descriptions have been written, before we started our work: + + * alloc.c: lcrecord_list + description: + mark: performs extra gc_checking_assert() for various checks. * alloc.c: cons description: car and cdr mark: cdr is marked, only if its != Qnil * alloc.c: string - description: - mark: + description: ??? + mark: ??? - * elhash.c: hash_table - description: the weakness receives no consideration - mark: weakness == HASH_TABLE_NON_WEAK + * buffer.c: buffer + description: XD_LISP_OBJECT indirect_children + mark: indirect_children not marked if Qnull_pointer * eval.c: subr description: XD_DOC_STRING doc mark: empty, nothing is marked * file-coding.c: coding_system - description: - mark: - - * frame.c: bit_vektor - description: XD_LISP_OBJECT next - mark: empty, nothing is marked + description: ??? + mark: ??? - * marker.c: marker - description: prev & next (marker's chain) - mark: do not mark through marker's chain! - - * specifier.c: specifier - description: XD_STRUCT_PTR caching - mark: caching is not marked - - * symbols.c: symbol-value-lisp-magic - description: only handler[] is described - mark: even harg[] and shadowed are marked - - * data.c: ephemeron - description: everything is marked, there is no weakness! + * glyphs.c: image_instance + description: + mark: mark method sets device to nil if dead Index: src/alloc.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/alloc.c,v retrieving revision 1.79 retrieving revision 1.84 diff -u -r1.79 -r1.84 --- src/alloc.c 12 Dec 2002 03:20:43 -0000 1.79 +++ src/alloc.c 13 Feb 2003 09:57:05 -0000 1.84 @@ -1,7 +1,7 @@ /* Storage allocation and gc for XEmacs Lisp interpreter. Copyright (C) 1985-1998 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. @@ -50,10 +50,13 @@ #include "elhash.h" #include "events.h" #include "extents-impl.h" +#include "file-coding.h" #include "frame-impl.h" #include "glyphs.h" #include "opaque.h" +#include "lstream.h" #include "process.h" +#include "profile.h" #include "redisplay.h" #include "specifier.h" #include "sysfile.h" @@ -61,18 +64,10 @@ #include "window.h" #include "console-stream.h" -#ifdef USE_KKCC -#include "file-coding.h" -#endif /* USE_KKCC */ - #ifdef DOUG_LEA_MALLOC #include #endif -#ifdef PDUMP -#include "dumper.h" -#endif - EXFUN (Fgarbage_collect, 0); static void recompute_need_to_garbage_collect (void); @@ -98,6 +93,8 @@ /* Number of bytes of consing done since the last gc */ static EMACS_INT consing_since_gc; +EMACS_UINT total_consing; + int need_to_garbage_collect; int need_to_check_c_alloca; int need_to_signal_post_gc; @@ -111,6 +108,9 @@ do \ { \ consing_since_gc += (size); \ + total_consing += (size); \ + if (profiling_active) \ + profile_record_consing (size); \ recompute_need_to_garbage_collect (); \ } while (0) @@ -149,6 +149,9 @@ #define DECREMENT_CONS_COUNTER(size) do { \ consing_since_gc -= (size); \ + total_consing -= (size); \ + if (profiling_active) \ + profile_record_unconsing (size); \ if (consing_since_gc < 0) \ consing_since_gc = 0; \ recompute_need_to_garbage_collect (); \ @@ -196,9 +199,16 @@ static const Char_ASCII gc_default_message[] = "Garbage collecting"; Lisp_Object Qgarbage_collecting; +static Lisp_Object QSin_garbage_collection; + /* Non-zero means we're in the process of doing the dump */ int purify_flag; +/* Non-zero means we're pdumping out or in */ +#ifdef PDUMP +int in_pdump; +#endif + #ifdef ERROR_CHECK_TYPES Error_Behavior ERROR_ME, ERROR_ME_NOT, ERROR_ME_WARN, ERROR_ME_DEBUG_WARN; @@ -303,11 +313,21 @@ /* like malloc and realloc but check for no memory left. */ +static int in_malloc; + #undef xmalloc void * xmalloc (Bytecount size) { - void *val = malloc (size); + void *val; +#ifdef ERROR_CHECK_MALLOC + assert (!in_malloc); + in_malloc = 1; +#endif + val = malloc (size); +#ifdef ERROR_CHECK_MALLOC + in_malloc = 0; +#endif if (!val && (size != 0)) memory_full (); set_alloc_mins_and_maxes (val, size); return val; @@ -317,7 +337,15 @@ static void * xcalloc (Elemcount nelem, Bytecount elsize) { - void *val = calloc (nelem, elsize); + void *val; +#ifdef ERROR_CHECK_MALLOC + assert (!in_malloc); + in_malloc = 1; +#endif + val= calloc (nelem, elsize); +#ifdef ERROR_CHECK_MALLOC + in_malloc = 0; +#endif if (!val && (nelem != 0)) memory_full (); set_alloc_mins_and_maxes (val, nelem * elsize); @@ -334,7 +362,14 @@ void * xrealloc (void *block, Bytecount size) { +#ifdef ERROR_CHECK_MALLOC + assert (!in_malloc); + in_malloc = 1; +#endif block = realloc (block, size); +#ifdef ERROR_CHECK_MALLOC + in_malloc = 0; +#endif if (!block && (size != 0)) memory_full (); set_alloc_mins_and_maxes (block, size); @@ -354,8 +389,13 @@ the one that comes with Solaris 2.3. FMH!! */ assert (block != (void *) 0xDEADBEEF); assert (block); + assert (!in_malloc); + in_malloc = 1; #endif /* ERROR_CHECK_MALLOC */ free (block); +#ifdef ERROR_CHECK_MALLOC + in_malloc = 0; +#endif } #ifdef ERROR_CHECK_GC @@ -368,7 +408,7 @@ /* In practice, size will always be a multiple of four. */ while (beefs--) - (*ptr4++) = 0xDEADBEEF; + (*ptr4++) = 0xDEADBEEF; /* -559038737 base 10 */ } #else /* !ERROR_CHECK_GC */ @@ -412,9 +452,9 @@ /* But we do now (as of 3-27-02) go and zero out the memory. This is a good thing, as it will guarantee we won't get any intermittent bugs - coming from an uninitiated field. The speed loss if unnoticeable, - esp. as the object are not large -- large stuff like buffer text and - redisplay structures and allocated separately. */ + coming from an uninitiated field. The speed loss is unnoticeable, + esp. as the objects are not large -- large stuff like buffer text and + redisplay structures are allocated separately. */ memset (val, 0, size); if (need_to_check_c_alloca) @@ -429,9 +469,13 @@ and free any lcrecord which hasn't been marked. */ static struct lcrecord_header *all_lcrecords; +/* The most basic of the lcrecord allocation functions. Not usually called + directly. Allocates an lrecord not managed by any lcrecord-list, of a + specified size. See lrecord.h. */ + void * -alloc_lcrecord (Bytecount size, - const struct lrecord_implementation *implementation) +basic_alloc_lcrecord (Bytecount size, + const struct lrecord_implementation *implementation) { struct lcrecord_header *lcheader; @@ -510,6 +554,28 @@ } } +/* Bitwise copy all parts of a Lisp object other than the header */ + +void +copy_lisp_object (Lisp_Object dst, Lisp_Object src) +{ + const struct lrecord_implementation *imp = + XRECORD_LHEADER_IMPLEMENTATION (src); + Bytecount size = lisp_object_size (src); + + assert (imp == XRECORD_LHEADER_IMPLEMENTATION (dst)); + assert (size == lisp_object_size (dst)); + + if (imp->basic_p) + memcpy ((char *) XRECORD_LHEADER (dst) + sizeof (struct lrecord_header), + (char *) XRECORD_LHEADER (src) + sizeof (struct lrecord_header), + size - sizeof (struct lrecord_header)); + else + memcpy ((char *) XRECORD_LHEADER (dst) + sizeof (struct lcrecord_header), + (char *) XRECORD_LHEADER (src) + sizeof (struct lcrecord_header), + size - sizeof (struct lcrecord_header)); +} + /************************************************************************/ /* Debugger support */ @@ -597,7 +663,7 @@ string_chars_blocks. Furthermore, no one string stretches across two string_chars_blocks. - Vectors are each malloc()ed separately, similar to lcrecords. + Vectors are each malloc()ed separately as lcrecords. In the following discussion, we use conses, but it applies equally well to the other fixed-size types. @@ -786,8 +852,9 @@ MINIMUM_ALLOWED_FIXED_TYPE_CELLS_##type) \ { \ result = (structtype *) type##_free_list; \ - /* Before actually using the chain pointer, \ - we complement all its bits; see FREE_FIXED_TYPE(). */ \ + assert (LRECORD_FREE_P (result)); \ + /* Before actually using the chain pointer, we complement \ + all its bits; see PUT_FIXED_TYPE_ON_FREE_LIST(). */ \ type##_free_list = (Lisp_Free *) \ (~ (EMACS_UINT) (type##_free_list->chain)); \ gc_count_num_##type##_freelist--; \ @@ -882,6 +949,7 @@ #define FREE_FIXED_TYPE(type, structtype, ptr) do { \ structtype *FFT_ptr = (ptr); \ + gc_checking_assert (!LRECORD_FREE_P (FFT_ptr)); \ ADDITIONAL_FREE_##type (FFT_ptr); \ deadbeef_memory (FFT_ptr, sizeof (structtype)); \ PUT_FIXED_TYPE_ON_FREE_LIST (type, structtype, FFT_ptr); \ @@ -896,13 +964,20 @@ completely necessary but helps keep things saner: e.g. this way, repeatedly allocating and freeing a cons will not result in the consing-since-gc counter advancing, which would cause a GC - and somewhat defeat the purpose of explicitly freeing. */ + and somewhat defeat the purpose of explicitly freeing. + We also disable this mechanism entirely when ALLOC_NO_POOLS is + set, which is used for Purify and the like. */ + +#ifndef ALLOC_NO_POOLS #define FREE_FIXED_TYPE_WHEN_NOT_IN_GC(type, structtype, ptr) \ do { FREE_FIXED_TYPE (type, structtype, ptr); \ DECREMENT_CONS_COUNTER (sizeof (structtype)); \ gc_count_num_##type##_freelist++; \ } while (0) +#else +#define FREE_FIXED_TYPE_WHEN_NOT_IN_GC(type, structtype, ptr) +#endif @@ -939,13 +1014,12 @@ return 0; } -static const struct lrecord_description cons_description[] = { +static const struct memory_description cons_description[] = { { XD_LISP_OBJECT, offsetof (Lisp_Cons, car_) }, { XD_LISP_OBJECT, offsetof (Lisp_Cons, cdr_) }, { XD_END } }; -#ifdef USE_KKCC DEFINE_BASIC_LRECORD_IMPLEMENTATION ("cons", cons, 1, /*dumpable-flag*/ mark_cons, print_cons, 0, @@ -958,19 +1032,6 @@ 0, cons_description, Lisp_Cons); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("cons", cons, - mark_cons, print_cons, 0, - cons_equal, - /* - * No `hash' method needed. - * internal_hash knows how to - * handle conses. - */ - 0, - cons_description, - Lisp_Cons); -#endif /* not USE_KKCC */ DEFUN ("cons", Fcons, 2, 2, 0, /* Create a new cons, give it CAR and CDR as components, and return it. @@ -1168,36 +1229,28 @@ depth + 1)); } -static const struct lrecord_description vector_description[] = { +static const struct memory_description vector_description[] = { { XD_LONG, offsetof (Lisp_Vector, size) }, { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Vector, contents), XD_INDIRECT(0, 0) }, { XD_END } }; -#ifdef USE_KKCC -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION("vector", vector, - 1, /*dumpable-flag*/ - mark_vector, print_vector, 0, - vector_equal, - vector_hash, - vector_description, - size_vector, Lisp_Vector); -#else /* not USE_KKCC */ -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION("vector", vector, - mark_vector, print_vector, 0, - vector_equal, - vector_hash, - vector_description, - size_vector, Lisp_Vector); -#endif /* not USE_KKCC */ +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("vector", vector, + 1, /*dumpable-flag*/ + mark_vector, print_vector, 0, + vector_equal, + vector_hash, + vector_description, + size_vector, Lisp_Vector); /* #### should allocate `small' vectors from a frob-block */ static Lisp_Vector * make_vector_internal (Elemcount sizei) { - /* no vector_next */ + /* no `next' field; we use lcrecords */ Bytecount sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, Lisp_Object, - contents, sizei); - Lisp_Vector *p = (Lisp_Vector *) alloc_lcrecord (sizem, &lrecord_vector); + contents, sizei); + Lisp_Vector *p = + (Lisp_Vector *) basic_alloc_lcrecord (sizem, &lrecord_vector); p->size = sizei; return p; @@ -1344,27 +1397,19 @@ /* Bit Vector allocation */ /************************************************************************/ -static Lisp_Object all_bit_vectors; - /* #### should allocate `small' bit vectors from a frob-block */ static Lisp_Bit_Vector * make_bit_vector_internal (Elemcount sizei) { + /* no `next' field; we use lcrecords */ Elemcount num_longs = BIT_VECTOR_LONG_STORAGE (sizei); Bytecount sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, - unsigned long, - bits, num_longs); - Lisp_Bit_Vector *p = (Lisp_Bit_Vector *) allocate_lisp_storage (sizem); - set_lheader_implementation (&p->lheader, &lrecord_bit_vector); - - INCREMENT_CONS_COUNTER (sizem, "bit-vector"); + unsigned long, + bits, num_longs); + Lisp_Bit_Vector *p = (Lisp_Bit_Vector *) + basic_alloc_lcrecord (sizem, &lrecord_bit_vector); bit_vector_length (p) = sizei; - bit_vector_next (p) = all_bit_vectors; - /* make sure the extra bits in the last long are 0; the calling - functions might not set them. */ - p->bits[num_longs - 1] = 0; - all_bit_vectors = wrap_bit_vector (p); return p; } @@ -1690,133 +1735,152 @@ return wrap_event (e); } -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_FIXED_TYPE_ALLOC (key_data, Lisp_Key_Data); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_key_data 1000 Lisp_Object -allocate_key_data (void) +make_key_data (void) { Lisp_Key_Data *d; ALLOCATE_FIXED_TYPE (key_data, Lisp_Key_Data, d); + xzero (*d); set_lheader_implementation (&d->lheader, &lrecord_key_data); + d->keysym = Qnil; - return wrap_key_data(d); + return wrap_key_data (d); } DECLARE_FIXED_TYPE_ALLOC (button_data, Lisp_Button_Data); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_button_data 1000 Lisp_Object -allocate_button_data (void) +make_button_data (void) { Lisp_Button_Data *d; ALLOCATE_FIXED_TYPE (button_data, Lisp_Button_Data, d); + xzero (*d); set_lheader_implementation (&d->lheader, &lrecord_button_data); - return wrap_button_data(d); + return wrap_button_data (d); } DECLARE_FIXED_TYPE_ALLOC (motion_data, Lisp_Motion_Data); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_motion_data 1000 Lisp_Object -allocate_motion_data (void) +make_motion_data (void) { Lisp_Motion_Data *d; ALLOCATE_FIXED_TYPE (motion_data, Lisp_Motion_Data, d); + xzero (*d); set_lheader_implementation (&d->lheader, &lrecord_motion_data); - return wrap_motion_data(d); + return wrap_motion_data (d); } DECLARE_FIXED_TYPE_ALLOC (process_data, Lisp_Process_Data); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_process_data 1000 Lisp_Object -allocate_process_data (void) +make_process_data (void) { Lisp_Process_Data *d; ALLOCATE_FIXED_TYPE (process_data, Lisp_Process_Data, d); + xzero (*d); set_lheader_implementation (&d->lheader, &lrecord_process_data); + d->process = Qnil; - return wrap_process_data(d); + return wrap_process_data (d); } DECLARE_FIXED_TYPE_ALLOC (timeout_data, Lisp_Timeout_Data); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_timeout_data 1000 Lisp_Object -allocate_timeout_data (void) +make_timeout_data (void) { Lisp_Timeout_Data *d; ALLOCATE_FIXED_TYPE (timeout_data, Lisp_Timeout_Data, d); + xzero (*d); set_lheader_implementation (&d->lheader, &lrecord_timeout_data); + d->function = Qnil; + d->object = Qnil; - return wrap_timeout_data(d); + return wrap_timeout_data (d); } DECLARE_FIXED_TYPE_ALLOC (magic_data, Lisp_Magic_Data); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_magic_data 1000 Lisp_Object -allocate_magic_data (void) +make_magic_data (void) { Lisp_Magic_Data *d; ALLOCATE_FIXED_TYPE (magic_data, Lisp_Magic_Data, d); + xzero (*d); set_lheader_implementation (&d->lheader, &lrecord_magic_data); - return wrap_magic_data(d); + return wrap_magic_data (d); } DECLARE_FIXED_TYPE_ALLOC (magic_eval_data, Lisp_Magic_Eval_Data); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_magic_eval_data 1000 Lisp_Object -allocate_magic_eval_data (void) +make_magic_eval_data (void) { Lisp_Magic_Eval_Data *d; ALLOCATE_FIXED_TYPE (magic_eval_data, Lisp_Magic_Eval_Data, d); + xzero (*d); set_lheader_implementation (&d->lheader, &lrecord_magic_eval_data); + d->object = Qnil; - return wrap_magic_eval_data(d); + return wrap_magic_eval_data (d); } DECLARE_FIXED_TYPE_ALLOC (eval_data, Lisp_Eval_Data); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_eval_data 1000 Lisp_Object -allocate_eval_data (void) +make_eval_data (void) { Lisp_Eval_Data *d; ALLOCATE_FIXED_TYPE (eval_data, Lisp_Eval_Data, d); + xzero (*d); set_lheader_implementation (&d->lheader, &lrecord_eval_data); + d->function = Qnil; + d->object = Qnil; - return wrap_eval_data(d); + return wrap_eval_data (d); } DECLARE_FIXED_TYPE_ALLOC (misc_user_data, Lisp_Misc_User_Data); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_misc_user_data 1000 Lisp_Object -allocate_misc_user_data (void) +make_misc_user_data (void) { Lisp_Misc_User_Data *d; ALLOCATE_FIXED_TYPE (misc_user_data, Lisp_Misc_User_Data, d); + xzero (*d); set_lheader_implementation (&d->lheader, &lrecord_misc_user_data); + d->function = Qnil; + d->object = Qnil; - return wrap_misc_user_data(d); + return wrap_misc_user_data (d); } -#endif /* USE_KKCC */ + +#endif /* EVENT_DATA_AS_OBJECTS */ /************************************************************************/ /* Marker allocation */ @@ -1864,9 +1928,9 @@ /* The data for "short" strings generally resides inside of structs of type string_chars_block. The Lisp_String structure is allocated just like any - other Lisp object (except for vectors), and these are freelisted when - they get garbage collected. The data for short strings get compacted, - but the data for large strings do not. + other basic lrecord, and these are freelisted when they get garbage + collected. The data for short strings get compacted, but the data for + large strings do not. Previously Lisp_String structures were relocated, but this caused a lot of bus-errors because the C code didn't include enough GCPRO's for @@ -1896,7 +1960,7 @@ !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len)); } -static const struct lrecord_description string_description[] = { +static const struct memory_description string_description[] = { { XD_BYTECOUNT, offsetof (Lisp_String, size_) }, { XD_OPAQUE_DATA_PTR, offsetof (Lisp_String, data_), XD_INDIRECT(0, 1) }, { XD_LISP_OBJECT, offsetof (Lisp_String, plist) }, @@ -1955,7 +2019,6 @@ is done with the ADDITIONAL_FREE_string macro, which is the standard way to do finalization when using SWEEP_FIXED_TYPE_BLOCK(). */ -#ifdef USE_KKCC DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("string", string, 1, /*dumpable-flag*/ mark_string, print_string, @@ -1966,17 +2029,6 @@ string_remprop, string_plist, Lisp_String); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("string", string, - mark_string, print_string, - 0, string_equal, 0, - string_description, - string_getprop, - string_putprop, - string_remprop, - string_plist, - Lisp_String); -#endif /* not USE_KKCC */ /* String blocks contain this many useful bytes. */ #define STRING_CHARS_BLOCK_SIZE \ ((Bytecount) (8192 - MALLOC_OVERHEAD - \ @@ -2484,32 +2536,30 @@ /************************************************************************/ /* Lcrecord lists are used to manage the allocation of particular - sorts of lcrecords, to avoid calling alloc_lcrecord() (and thus + sorts of lcrecords, to avoid calling basic_alloc_lcrecord() (and thus malloc() and garbage-collection junk) as much as possible. It is similar to the Blocktype class. - It works like this: + See detailed comment in lcrecord.h. +*/ - 1) Create an lcrecord-list object using make_lcrecord_list(). - This is often done at initialization. Remember to staticpro_nodump - this object! The arguments to make_lcrecord_list() are the - same as would be passed to alloc_lcrecord(). - 2) Instead of calling alloc_lcrecord(), call allocate_managed_lcrecord() - and pass the lcrecord-list earlier created. - 3) When done with the lcrecord, call free_managed_lcrecord(). - The standard freeing caveats apply: ** make sure there are no - pointers to the object anywhere! ** - 4) Calling free_managed_lcrecord() is just like kissing the - lcrecord goodbye as if it were garbage-collected. This means: - -- the contents of the freed lcrecord are undefined, and the - contents of something produced by allocate_managed_lcrecord() - are undefined, just like for alloc_lcrecord(). - -- the mark method for the lcrecord's type will *NEVER* be called - on freed lcrecords. - -- the finalize method for the lcrecord's type will be called - at the time that free_managed_lcrecord() is called. +const struct memory_description free_description[] = { + { XD_LISP_OBJECT, offsetof (struct free_lcrecord_header, chain), 0, 0, + XD_FLAG_FREE_LISP_OBJECT }, + { XD_END } +}; - */ +DEFINE_LRECORD_IMPLEMENTATION ("free", free, + 0, /*dumpable-flag*/ + 0, internal_object_printer, + 0, 0, 0, free_description, + struct free_lcrecord_header); + +const struct memory_description lcrecord_list_description[] = { + { XD_LISP_OBJECT, offsetof (struct lcrecord_list, free), 0, 0, + XD_FLAG_FREE_LISP_OBJECT }, + { XD_END } +}; static Lisp_Object mark_lcrecord_list (Lisp_Object obj) @@ -2528,17 +2578,17 @@ ! MARKED_RECORD_HEADER_P (lheader) && /* Only lcrecords should be here. */ - ! LHEADER_IMPLEMENTATION (lheader)->basic_p + ! list->implementation->basic_p && /* Only free lcrecords should be here. */ free_header->lcheader.free && /* The type of the lcrecord must be right. */ - LHEADER_IMPLEMENTATION (lheader) == list->implementation + lheader->type == lrecord_type_free && /* So must the size. */ - (LHEADER_IMPLEMENTATION (lheader)->static_size == 0 || - LHEADER_IMPLEMENTATION (lheader)->static_size == list->size) + (list->implementation->static_size == 0 || + list->implementation->static_size == list->size) ); MARK_RECORD_HEADER (lheader); @@ -2548,25 +2598,21 @@ return Qnil; } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("lcrecord-list", lcrecord_list, 0, /*dumpable-flag*/ mark_lcrecord_list, internal_object_printer, - 0, 0, 0, 0, struct lcrecord_list); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("lcrecord-list", lcrecord_list, - mark_lcrecord_list, internal_object_printer, - 0, 0, 0, 0, struct lcrecord_list); -#endif /* not USE_KKCC */ + 0, 0, 0, lcrecord_list_description, + struct lcrecord_list); Lisp_Object make_lcrecord_list (Elemcount size, const struct lrecord_implementation *implementation) { - struct lcrecord_list *p = - /* Avoid infinite recursion allocating this */ - alloc_unmanaged_lcrecord_type (struct lcrecord_list, - &lrecord_lcrecord_list); + /* Don't use alloc_lcrecord_type() avoid infinite recursion + allocating this, */ + struct lcrecord_list *p = (struct lcrecord_list *) + basic_alloc_lcrecord (sizeof (struct lcrecord_list), + &lrecord_lcrecord_list); p->implementation = implementation; p->size = size; @@ -2575,7 +2621,7 @@ } Lisp_Object -allocate_managed_lcrecord (Lisp_Object lcrecord_list) +alloc_managed_lcrecord (Lisp_Object lcrecord_list) { struct lcrecord_list *list = XLCRECORD_LIST (lcrecord_list); if (!NILP (list->free)) @@ -2583,33 +2629,41 @@ Lisp_Object val = list->free; struct free_lcrecord_header *free_header = (struct free_lcrecord_header *) XPNTR (val); - -#ifdef ERROR_CHECK_GC struct lrecord_header *lheader = &free_header->lcheader.lheader; +#ifdef ERROR_CHECK_GC + /* Major overkill here. */ /* There should be no other pointers to the free list. */ assert (! MARKED_RECORD_HEADER_P (lheader)); - /* Only lcrecords should be here. */ - assert (! LHEADER_IMPLEMENTATION (lheader)->basic_p); /* Only free lcrecords should be here. */ assert (free_header->lcheader.free); + assert (lheader->type == lrecord_type_free); + /* Only lcrecords should be here. */ + assert (! (list->implementation->basic_p)); +#if 0 /* Not used anymore, now that we set the type of the header to + lrecord_type_free. */ /* The type of the lcrecord must be right. */ assert (LHEADER_IMPLEMENTATION (lheader) == list->implementation); +#endif /* 0 */ /* So must the size. */ - assert (LHEADER_IMPLEMENTATION (lheader)->static_size == 0 || - LHEADER_IMPLEMENTATION (lheader)->static_size == list->size); + assert (list->implementation->static_size == 0 || + list->implementation->static_size == list->size); #endif /* ERROR_CHECK_GC */ list->free = free_header->chain; free_header->lcheader.free = 0; + /* Put back the correct type, as we set it to lrecord_type_free. */ + lheader->type = list->implementation->lrecord_type_index; + zero_sized_lcrecord (free_header, list->size); return val; } else - return wrap_pointer_1 (alloc_lcrecord (list->size, list->implementation)); + return wrap_pointer_1 (basic_alloc_lcrecord (list->size, + list->implementation)); } /* "Free" a Lisp object LCRECORD by placing it on its associated free list - LCRECORD_LIST; next time allocate_managed_lcrecord() is called with the + LCRECORD_LIST; next time alloc_managed_lcrecord() is called with the same LCRECORD_LIST as its parameter, it will return an object from the free list, which may be this one. Be VERY VERY SURE there are no pointers to this object hanging around anywhere where they might be @@ -2641,15 +2695,18 @@ /* Make sure the size is correct. This will catch, for example, putting a window configuration on the wrong free list. */ - gc_checking_assert ((implementation->size_in_bytes_method ? - implementation->size_in_bytes_method (lheader) : - implementation->static_size) - == list->size); + gc_checking_assert (detagged_lisp_object_size (lheader) == list->size); /* Make sure the object isn't already freed. */ gc_checking_assert (!free_header->lcheader.free); if (implementation->finalizer) implementation->finalizer (lheader, 0); + /* Yes, there are two ways to indicate freeness -- the type is + lrecord_type_free or the ->free flag is set. We used to do only the + latter; now we do the former as well for KKCC purposes. Probably + safer in any case, as we will lose quicker this way than keeping + around an lrecord of apparently correct type but bogus junk in it. */ + MARK_LRECORD_AS_FREE (lheader); free_header->chain = list->free; free_header->lcheader.free = 1; list->free = lcrecord; @@ -2665,7 +2722,7 @@ all_lcrecord_lists[imp->lrecord_type_index] = make_lcrecord_list (size, imp); - return XPNTR (allocate_managed_lcrecord + return XPNTR (alloc_managed_lcrecord (all_lcrecord_lists[imp->lrecord_type_index])); } @@ -2716,43 +2773,46 @@ objects, which are global variables like Qfoo or Vbar, themselves are pointers to heap objects. Each needs to be described to pdump as a "root pointer"; this happens in the call to staticpro(). */ -static const struct lrecord_description staticpro_description_1[] = { +static const struct memory_description staticpro_description_1[] = { { XD_END } }; -static const struct struct_description staticpro_description = { +static const struct sized_memory_description staticpro_description = { sizeof (Lisp_Object *), staticpro_description_1 }; -static const struct lrecord_description staticpros_description_1[] = { +static const struct memory_description staticpros_description_1[] = { XD_DYNARR_DESC (Lisp_Object_ptr_dynarr, &staticpro_description), { XD_END } }; -static const struct struct_description staticpros_description = { +static const struct sized_memory_description staticpros_description = { sizeof (Lisp_Object_ptr_dynarr), staticpros_description_1 }; #ifdef DEBUG_XEMACS -static const struct lrecord_description staticpro_one_name_description_1[] = { +static const struct memory_description staticpro_one_name_description_1[] = { { XD_C_STRING, 0 }, { XD_END } }; -static const struct struct_description staticpro_one_name_description = { +static const struct sized_memory_description staticpro_one_name_description = { sizeof (char *), staticpro_one_name_description_1 }; -static const struct lrecord_description staticpro_names_description_1[] = { +static const struct memory_description staticpro_names_description_1[] = { XD_DYNARR_DESC (char_ptr_dynarr, &staticpro_one_name_description), { XD_END } }; -static const struct struct_description staticpro_names_description = { + +extern const struct sized_memory_description staticpro_names_description; + +const struct sized_memory_description staticpro_names_description = { sizeof (char_ptr_dynarr), staticpro_names_description_1 }; @@ -2769,7 +2829,7 @@ { Dynarr_add (staticpros, varaddress); Dynarr_add (staticpro_names, varname); - dump_add_root_object (varaddress); + dump_add_root_lisp_object (varaddress); } @@ -2806,7 +2866,7 @@ staticpro (Lisp_Object *varaddress) { Dynarr_add (staticpros, varaddress); - dump_add_root_object (varaddress); + dump_add_root_lisp_object (varaddress); } @@ -2861,23 +2921,24 @@ #endif +static const struct memory_description lisp_object_description_1[] = { + { XD_LISP_OBJECT, 0 }, + { XD_END } +}; -#ifdef USE_KKCC -/* The following functions implement the new mark algorithm. - They mark objects according to their descriptions. They - are modeled on the corresponding pdumper procedures. */ +const struct sized_memory_description lisp_object_description = { + sizeof (Lisp_Object), + lisp_object_description_1 +}; -static void mark_struct_contents (const void *data, - const struct struct_description * - sdesc, - int count); +#if defined (USE_KKCC) || defined (PDUMP) /* This function extracts the value of a count variable described somewhere else in the description. It is converted corresponding to the type */ -static EMACS_INT -get_indirect_count (EMACS_INT code, - const struct lrecord_description *idesc, - const void *idata) +EMACS_INT +lispdesc_indirect_count_1 (EMACS_INT code, + const struct memory_description *idesc, + const void *idata) { EMACS_INT count; const void *irdata; @@ -2885,27 +2946,32 @@ int line = XD_INDIRECT_VAL (code); int delta = XD_INDIRECT_DELTA (code); - irdata = ((char *)idata) + idesc[line].offset; + irdata = ((char *) idata) + + lispdesc_indirect_count (idesc[line].offset, idesc, idata); switch (idesc[line].type) { case XD_BYTECOUNT: - count = *(Bytecount *)irdata; + count = * (Bytecount *) irdata; break; case XD_ELEMCOUNT: - count = *(Elemcount *)irdata; + count = * (Elemcount *) irdata; break; case XD_HASHCODE: - count = *(Hashcode *)irdata; + count = * (Hashcode *) irdata; break; case XD_INT: - count = *(int *)irdata; + count = * (int *) irdata; break; case XD_LONG: - count = *(long *)irdata; + count = * (long *) irdata; break; default: stderr_out ("Unsupported count type : %d (line = %d, code = %ld)\n", - idesc[line].type, line, (long)code); + idesc[line].type, line, (long) code); +#ifdef PDUMP + if (in_pdump) + pdump_backtrace (); +#endif count = 0; /* warning suppression */ abort (); } @@ -2913,159 +2979,155 @@ return count; } -/* This function is called to mark the elements of an object. It processes - the description of the object and calls mark object with every described - object. */ -static void -mark_with_description (const void *lheader, const struct lrecord_description *desc) +/* SDESC is a "description map" (basically, a list of offsets used for + successive indirections) and OBJ is the first object to indirect off of. + Return the description ultimately found. */ + +const struct sized_memory_description * +lispdesc_indirect_description_1 (const void *obj, + const struct sized_memory_description *sdesc) { int pos; - static const Lisp_Object *last_occured_object = (Lisp_Object *) 0; - static int mark_last_occured_object = 0; + for (pos = 0; sdesc[pos].size >= 0; pos++) + obj = * (const void **) ((const char *) obj + sdesc[pos].size); - reprocess_desc: - for (pos=0; desc[pos].type != XD_END; pos++) - { - const void *rdata = (const char *)lheader + desc[pos].offset; - switch (desc[pos].type) { - case XD_LISP_OBJECT: - { - const Lisp_Object *stored_obj = (const Lisp_Object *)rdata; + return (const struct sized_memory_description *) obj; +} - if (EQ (*stored_obj, Qnull_pointer)) - break; +/* Compute the size of the data at RDATA, described by a single entry + DESC1 in a description array. OBJ and DESC are used for + XD_INDIRECT references. */ - if (desc[pos+1].type == XD_END) - { - mark_last_occured_object = 1; - last_occured_object = stored_obj; - break; - } - else - { - mark_object (*stored_obj); - } - - - break; - } - case XD_LISP_OBJECT_ARRAY: - { - int i; - EMACS_INT count = desc[pos].data1; - if (XD_IS_INDIRECT (count)) - count = get_indirect_count (count, desc, lheader); - - for (i = 0; i < count; i++) - { - const Lisp_Object *stored_obj = ((const Lisp_Object *)rdata) + i; +static Bytecount +lispdesc_one_description_line_size (void *rdata, + const struct memory_description *desc1, + const void *obj, + const struct memory_description *desc) +{ + union_switcheroo: + switch (desc1->type) + { + case XD_LISP_OBJECT_ARRAY: + { + EMACS_INT val = lispdesc_indirect_count (desc1->data1, desc, obj); + return (val * sizeof (Lisp_Object)); + } + case XD_LISP_OBJECT: + case XD_LO_LINK: + return sizeof (Lisp_Object); + case XD_OPAQUE_PTR: + return sizeof (void *); + case XD_STRUCT_PTR: + { + EMACS_INT val = lispdesc_indirect_count (desc1->data1, desc, obj); + return val * sizeof (void *); + } + case XD_STRUCT_ARRAY: + { + EMACS_INT val = lispdesc_indirect_count (desc1->data1, desc, obj); + + return (val * + lispdesc_structure_size + (rdata, lispdesc_indirect_description (obj, desc1->data2))); + } + case XD_OPAQUE_DATA_PTR: + return sizeof (void *); + case XD_UNION_DYNAMIC_SIZE: + { + /* If an explicit size was given in the first-level structure + description, use it; else compute size based on current union + constant. */ + const struct sized_memory_description *sdesc = + lispdesc_indirect_description (obj, desc1->data2); + if (sdesc->size) + return sdesc->size; + else + { + desc1 = lispdesc_process_xd_union (desc1, desc, obj); + if (desc1) + goto union_switcheroo; + break; + } + } + case XD_UNION: + { + /* If an explicit size was given in the first-level structure + description, use it; else compute size based on maximum of all + possible structures. */ + const struct sized_memory_description *sdesc = + lispdesc_indirect_description (obj, desc1->data2); + if (sdesc->size) + return sdesc->size; + else + { + int count; + Bytecount max_size = -1, size; - if (EQ (*stored_obj, Qnull_pointer)) - break; + desc1 = sdesc->description; - mark_object (*stored_obj); - } - break; - } - case XD_SPECIFIER_END: - desc = ((const Lisp_Specifier *)lheader)->methods->extra_description; - goto reprocess_desc; - break; - case XD_CODING_SYSTEM_END: - desc = ((const Lisp_Coding_System *)lheader)->methods->extra_description; - goto reprocess_desc; - break; - case XD_BYTECOUNT: - break; - case XD_ELEMCOUNT: - break; - case XD_HASHCODE: - break; - case XD_INT: - break; - case XD_LONG: - break; - case XD_INT_RESET: - break; - case XD_LO_LINK: - break; - case XD_OPAQUE_PTR: - break; - case XD_OPAQUE_DATA_PTR: - break; - case XD_C_STRING: - break; - case XD_DOC_STRING: - break; - case XD_STRUCT_PTR: - { - EMACS_INT count = desc[pos].data1; - const struct struct_description *sdesc = desc[pos].data2; - const char *dobj = *(const char **)rdata; - if (dobj) - { - if (XD_IS_INDIRECT (count)) - count = get_indirect_count (count, desc, lheader); - mark_struct_contents (dobj, sdesc, count); - } - break; - } - case XD_STRUCT_ARRAY: - { - EMACS_INT count = desc[pos].data1; - const struct struct_description *sdesc = desc[pos].data2; - - if (XD_IS_INDIRECT (count)) - count = get_indirect_count (count, desc, lheader); - - mark_struct_contents (rdata, sdesc, count); - break; - } - case XD_UNION: - { - int count = 0; - int variant = desc[pos].data1; - const struct struct_description *sdesc = desc[pos].data2; - const char *dobj = *(const char **)rdata; - if (XD_IS_INDIRECT (variant)) - variant = get_indirect_count (variant, desc, lheader); - - for (count=0; sdesc[count].size != XD_END; count++) - { - if (sdesc[count].size == variant) - { - mark_with_description(dobj, sdesc[count].description); - break; - } - } - break; - } - - default: - stderr_out ("Unsupported description type : %d\n", desc[pos].type); - abort (); + for (count = 0; desc1[count].type != XD_END; count++) + { + size = lispdesc_one_description_line_size (rdata, + &desc1[count], + obj, desc); + if (size > max_size) + max_size = size; + } + return max_size; + } } + case XD_C_STRING: + return sizeof (void *); + case XD_DOC_STRING: + return sizeof (void *); + case XD_INT_RESET: + return sizeof (int); + case XD_BYTECOUNT: + return sizeof (Bytecount); + case XD_ELEMCOUNT: + return sizeof (Elemcount); + case XD_HASHCODE: + return sizeof (Hashcode); + case XD_INT: + return sizeof (int); + case XD_LONG: + return sizeof (long); + default: + stderr_out ("Unsupported dump type : %d\n", desc1->type); + abort (); } - if (mark_last_occured_object) - { - mark_object(*last_occured_object); - mark_last_occured_object = 0; - } + return 0; } -/* This function calculates the size of a described struct. */ -static Bytecount -structure_size (const void *obj, const struct struct_description *sdesc) +/* Return the size of the memory block (NOT necessarily a structure!) + described by SDESC and pointed to by OBJ. If SDESC records an + explicit size (i.e. non-zero), it is simply returned; otherwise, + the size is calculated by the maximum offset and the size of the + object at that offset, rounded up to the maximum alignment. In + this case, we may need the object, for example when retrieving an + "indirect count" of an inlined array (the count is not constant, + but is specified by one of the elements of the memory block). (It + is generally not a problem if we return an overly large size -- we + will simply end up reserving more space than necessary; but if the + size is too small we could be in serious trouble, in particular + with nested inlined structures, where there may be alignment + padding in the middle of a block. #### In fact there is an (at + least theoretical) problem with an overly large size -- we may + trigger a protection fault when reading from invalid memory. We + need to handle this -- perhaps in a stupid but dependable way, + i.e. by trapping SIGSEGV and SIGBUS.) */ + +Bytecount +lispdesc_structure_size (const void *obj, + const struct sized_memory_description *sdesc) { - int max_offset = -1; + EMACS_INT max_offset = -1; int max_offset_pos = -1; - int size_at_max = 0; int pos; - const struct lrecord_description *desc; - void *rdata; + const struct memory_description *desc; if (sdesc->size) return sdesc->size; @@ -3074,14 +3136,15 @@ for (pos = 0; desc[pos].type != XD_END; pos++) { - if (desc[pos].offset == max_offset) + EMACS_INT offset = lispdesc_indirect_count (desc[pos].offset, desc, obj); + if (offset == max_offset) { stderr_out ("Two relocatable elements at same offset?\n"); abort (); } - else if (desc[pos].offset > max_offset) + else if (offset > max_offset) { - max_offset = desc[pos].offset; + max_offset = offset; max_offset_pos = pos; } } @@ -3089,102 +3152,236 @@ if (max_offset_pos < 0) return 0; - pos = max_offset_pos; - rdata = (char *) obj + desc[pos].offset; + { + Bytecount size_at_max; + size_at_max = + lispdesc_one_description_line_size ((char *) obj + max_offset, + &desc[max_offset_pos], obj, desc); + + /* We have no way of knowing the required alignment for this structure, + so just make it maximally aligned. */ + return MAX_ALIGN_SIZE (max_offset + size_at_max); + } +} + +#endif /* defined (USE_KKCC) || defined (PDUMP) */ + +#define GC_CHECK_NOT_FREE(lheader) \ + gc_checking_assert (LHEADER_IMPLEMENTATION (lheader)->basic_p || \ + ! ((struct lcrecord_header *) lheader)->free) + +#ifdef USE_KKCC +/* The following functions implement the new mark algorithm. + They mark objects according to their descriptions. They + are modeled on the corresponding pdumper procedures. */ + +static void mark_struct_contents (const void *data, + const struct sized_memory_description *sdesc, + int count); + +#ifdef ERROR_CHECK_GC +#define KKCC_DO_CHECK_FREE(obj, allow_free) \ +do \ +{ \ + if (!allow_free && XTYPE (obj) == Lisp_Type_Record) \ + { \ + struct lrecord_header *lheader = XRECORD_LHEADER (obj); \ + GC_CHECK_NOT_FREE (lheader); \ + } \ +} while (0) +#else +#define KKCC_DO_CHECK_FREE(obj, allow_free) +#endif + +#ifdef ERROR_CHECK_GC +void +mark_object_maybe_checking_free (Lisp_Object obj, int allow_free) +{ + KKCC_DO_CHECK_FREE (obj, allow_free); + mark_object (obj); +} +#else +#define mark_object_maybe_checking_free(obj, allow_free) mark_object (obj) +#endif /* ERROR_CHECK_GC */ + +/* This function is called to mark the elements of an object. It processes + the description of the object and calls mark object with every described + object. */ +static void +mark_with_description (const void *data, + const struct memory_description *desc) +{ + int pos; + static const Lisp_Object *last_occurred_object = (Lisp_Object *) 0; + static int mark_last_occurred_object = 0; +#ifdef ERROR_CHECK_GC + static int last_occurred_flags; +#endif + + tail_recurse: - switch (desc[pos].type) + for (pos = 0; desc[pos].type != XD_END; pos++) { - case XD_LISP_OBJECT_ARRAY: - { - EMACS_INT val = desc[pos].data1; - if (XD_IS_INDIRECT (val)) - val = get_indirect_count (val, desc, obj); - size_at_max = val * sizeof (Lisp_Object); - break; - } - case XD_LISP_OBJECT: - case XD_LO_LINK: - size_at_max = sizeof (Lisp_Object); - break; - case XD_OPAQUE_PTR: - size_at_max = sizeof (void *); - break; - case XD_STRUCT_PTR: - { - EMACS_INT val = desc[pos].data1; - if (XD_IS_INDIRECT (val)) - val = get_indirect_count (val, desc, obj); - size_at_max = val * sizeof (void *); - break; - } - break; - case XD_STRUCT_ARRAY: - { - EMACS_INT val = desc[pos].data1; + const struct memory_description *desc1 = &desc[pos]; + const void *rdata = + (const char *) data + lispdesc_indirect_count (desc1->offset, + desc, data); + union_switcheroo: + + /* If the flag says don't mark, then don't mark. */ + if ((desc1->flags) & XD_FLAG_NO_KKCC) + continue; - if (XD_IS_INDIRECT (val)) - val = get_indirect_count (val, desc, obj); - - size_at_max = val * structure_size (rdata, desc[pos].data2); - break; - } - break; - case XD_OPAQUE_DATA_PTR: - size_at_max = sizeof (void *); - break; - case XD_UNION: - abort (); - break; - case XD_C_STRING: - size_at_max = sizeof (void *); - break; - case XD_DOC_STRING: - size_at_max = sizeof (void *); - break; - case XD_INT_RESET: - size_at_max = sizeof (int); - break; - case XD_BYTECOUNT: - size_at_max = sizeof (Bytecount); - break; - case XD_ELEMCOUNT: - size_at_max = sizeof (Elemcount); - break; - case XD_HASHCODE: - size_at_max = sizeof (Hashcode); - break; - case XD_INT: - size_at_max = sizeof (int); - break; - case XD_LONG: - size_at_max = sizeof (long); - break; - case XD_SPECIFIER_END: - case XD_CODING_SYSTEM_END: - stderr_out - ("Should not be seeing XD_SPECIFIER_END or\n" - "XD_CODING_SYSTEM_END outside of struct Lisp_Specifier\n" - "and struct Lisp_Coding_System.\n"); - abort (); - default: - stderr_out ("Unsupported dump type : %d\n", desc[pos].type); - abort (); + switch (desc1->type) + { + case XD_BYTECOUNT: + case XD_ELEMCOUNT: + case XD_HASHCODE: + case XD_INT: + case XD_LONG: + case XD_INT_RESET: + case XD_LO_LINK: + case XD_OPAQUE_PTR: + case XD_OPAQUE_DATA_PTR: + case XD_C_STRING: + case XD_DOC_STRING: + break; + case XD_LISP_OBJECT: + { + const Lisp_Object *stored_obj = (const Lisp_Object *) rdata; + + /* Because of the way that tagged objects work (pointers and + Lisp_Objects have the same representation), XD_LISP_OBJECT + can be used for untagged pointers. They might be NULL, + though. */ + if (EQ (*stored_obj, Qnull_pointer)) + break; + + if (desc[pos+1].type == XD_END) + { + mark_last_occurred_object = 1; + last_occurred_object = stored_obj; +#ifdef ERROR_CHECK_GC + last_occurred_flags = desc1->flags; +#endif + break; + } + else + mark_object_maybe_checking_free + (*stored_obj, (desc1->flags) & XD_FLAG_FREE_LISP_OBJECT); + + break; + } + case XD_LISP_OBJECT_ARRAY: + { + int i; + EMACS_INT count = + lispdesc_indirect_count (desc1->data1, desc, data); + + for (i = 0; i < count; i++) + { + const Lisp_Object *stored_obj = + (const Lisp_Object *) rdata + i; + + if (EQ (*stored_obj, Qnull_pointer)) + break; + + mark_object_maybe_checking_free + (*stored_obj, (desc1->flags) & XD_FLAG_FREE_LISP_OBJECT); + } + break; + } + case XD_STRUCT_PTR: + { + EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, + data); + const struct sized_memory_description *sdesc = + lispdesc_indirect_description (data, desc1->data2); + const char *dobj = * (const char **) rdata; + if (dobj) + mark_struct_contents (dobj, sdesc, count); + break; + } + case XD_STRUCT_ARRAY: + { + EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, + data); + const struct sized_memory_description *sdesc = + lispdesc_indirect_description (data, desc1->data2); + + mark_struct_contents (rdata, sdesc, count); + break; + } + case XD_UNION: + case XD_UNION_DYNAMIC_SIZE: + desc1 = lispdesc_process_xd_union (desc1, desc, data); + if (desc1) + goto union_switcheroo; + break; + + default: + stderr_out ("Unsupported description type : %d\n", desc1->type); + abort (); + } } - return ALIGN_SIZE (max_offset + size_at_max, ALIGNOF (max_align_t)); -} + if (mark_last_occurred_object) + { + Lisp_Object obj = *last_occurred_object; + old_tail_recurse: + /* NOTE: The second parameter isn't even evaluated + non-ERROR_CHECK_GC, so it's OK for the variable not to exist. + */ + KKCC_DO_CHECK_FREE + (obj, (last_occurred_flags & XD_FLAG_FREE_LISP_OBJECT) != 0); + + if (XTYPE (obj) == Lisp_Type_Record) + { + struct lrecord_header *lheader = XRECORD_LHEADER (obj); + + GC_CHECK_LHEADER_INVARIANTS (lheader); + + /* All c_readonly objects have their mark bit set, + so that we only need to check the mark bit here. */ + if (! MARKED_RECORD_HEADER_P (lheader)) + { + MARK_RECORD_HEADER (lheader); + + { + desc = LHEADER_IMPLEMENTATION (lheader)->description; + if (desc) /* && !CONSP(obj))*/ /* KKCC cons special case */ + { + data = lheader; + mark_last_occurred_object = 0; + goto tail_recurse; + } + else + { + if (RECORD_MARKER (lheader)) + { + obj = RECORD_MARKER (lheader) (obj); + if (!NILP (obj)) goto old_tail_recurse; + } + } + } + } + } + + mark_last_occurred_object = 0; + } +} /* This function loops all elements of a struct pointer and calls mark_with_description with each element. */ static void mark_struct_contents (const void *data, - const struct struct_description *sdesc, - int count) + const struct sized_memory_description *sdesc, + int count) { int i; Bytecount elsize; - elsize = structure_size (data, sdesc); + elsize = lispdesc_structure_size (data, sdesc); for (i = 0; i < count; i++) { @@ -3211,15 +3408,13 @@ if (XTYPE (obj) == Lisp_Type_Record) { struct lrecord_header *lheader = XRECORD_LHEADER (obj); -#ifdef USE_KKCC - const struct lrecord_implementation *imp; - const struct lrecord_description *desc; -#endif /* USE_KKCC */ GC_CHECK_LHEADER_INVARIANTS (lheader); - gc_checking_assert (LHEADER_IMPLEMENTATION (lheader)->basic_p || - ! ((struct lcrecord_header *) lheader)->free); +#ifndef USE_KKCC + /* We handle this separately, above, so we can mark free objects */ + GC_CHECK_NOT_FREE (lheader); +#endif /* not USE_KKCC */ /* All c_readonly objects have their mark bit set, so that we only need to check the mark bit here. */ @@ -3227,60 +3422,29 @@ { MARK_RECORD_HEADER (lheader); + { #ifdef USE_KKCC - imp = LHEADER_IMPLEMENTATION (lheader); - desc = imp->description; - - if (desc) /* && !CONSP(obj))*/ /* KKCC cons special case */ - { + const struct memory_description *desc; + desc = LHEADER_IMPLEMENTATION (lheader)->description; + if (desc) /* && !CONSP(obj))*/ /* KKCC cons special case */ mark_with_description (lheader, desc); - } - - else - { - -#endif /* USE_KKCC */ - - - if (RECORD_MARKER (lheader)) - { - obj = RECORD_MARKER (lheader) (obj); - if (!NILP (obj)) goto tail_recurse; - } - -#ifdef USE_KKCC - } + else #endif /* USE_KKCC */ + { + if (RECORD_MARKER (lheader)) + { + obj = RECORD_MARKER (lheader) (obj); + if (!NILP (obj)) goto tail_recurse; + } + } + } } } } -/* mark all of the conses in a list and mark the final cdr; but - DO NOT mark the cars. - - Use only for internal lists! There should never be other pointers - to the cons cells, because if so, the cars will remain unmarked - even when they maybe should be marked. */ -void -mark_conses_in_list (Lisp_Object obj) -{ - Lisp_Object rest; - - for (rest = obj; CONSP (rest); rest = XCDR (rest)) - { - if (CONS_MARKED_P (XCONS (rest))) - return; - MARK_CONS (XCONS (rest)); - } - - mark_object (rest); -} - /* Find all structures not marked, and free them. */ -static int gc_count_num_bit_vector_used, gc_count_bit_vector_total_size; -static int gc_count_bit_vector_storage; static int gc_count_num_short_string_in_use; static Bytecount gc_count_string_total_size; static Bytecount gc_count_short_string_total_size; @@ -3312,12 +3476,8 @@ } else { - const struct lrecord_implementation *implementation = - LHEADER_IMPLEMENTATION (h); + Bytecount sz = detagged_lisp_object_size (h); - Bytecount sz = (implementation->size_in_bytes_method ? - implementation->size_in_bytes_method (h) : - implementation->static_size); if (free_p) { lcrecord_stats[type_index].instances_freed++; @@ -3393,49 +3553,6 @@ /* *total = total_size; */ } - -static void -sweep_bit_vectors_1 (Lisp_Object *prev, - int *used, int *total, int *storage) -{ - Lisp_Object bit_vector; - int num_used = 0; - int total_size = 0; - int total_storage = 0; - - /* BIT_VECTORP fails because the objects are marked, which changes - their implementation */ - for (bit_vector = *prev; !EQ (bit_vector, Qzero); ) - { - Lisp_Bit_Vector *v = XBIT_VECTOR (bit_vector); - int len = v->size; - if (MARKED_RECORD_P (bit_vector)) - { - if (! C_READONLY_RECORD_HEADER_P(&(v->lheader))) - UNMARK_RECORD_HEADER (&(v->lheader)); - total_size += len; - total_storage += - MALLOC_OVERHEAD + - FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, unsigned long, - bits, BIT_VECTOR_LONG_STORAGE (len)); - num_used++; - /* #### May modify next on a C_READONLY bitvector */ - prev = &(bit_vector_next (v)); - bit_vector = *prev; - } - else - { - Lisp_Object next = bit_vector_next (v); - *prev = next; - xfree (v); - bit_vector = next; - } - } - *used = num_used; - *total = total_size; - *storage = total_storage; -} - /* And the Lord said: Thou shalt use the `c-backslash-region' command to make macros prettier. */ @@ -3594,14 +3711,16 @@ placed on the free list, however, its car will probably contain a chain pointer to the next cons on the list, which has cleverly had all its 0's and 1's inverted. This allows for a quick - check to make sure we're not freeing something already freed. */ + check to make sure we're not freeing something already freed. + + NOTE: This check may not be necessary. Freeing an object sets its + type to lrecord_type_free, which will trip up the XCONS() above -- as + well as a check in FREE_FIXED_TYPE(). */ if (POINTER_TYPE_P (XTYPE (cons_car (ptr)))) ASSERT_VALID_POINTER (XPNTR (cons_car (ptr))); #endif /* ERROR_CHECK_GC */ -#ifndef ALLOC_NO_POOLS FREE_FIXED_TYPE_WHEN_NOT_IN_GC (cons, Lisp_Cons, ptr); -#endif /* ALLOC_NO_POOLS */ } /* explicitly free a list. You **must make sure** that you have @@ -3685,7 +3804,7 @@ SWEEP_FIXED_TYPE_BLOCK (event, Lisp_Event); } -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS static void sweep_key_data (void) @@ -3696,6 +3815,12 @@ SWEEP_FIXED_TYPE_BLOCK (key_data, Lisp_Key_Data); } +void +free_key_data (Lisp_Object ptr) +{ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (key_data, Lisp_Key_Data, XKEY_DATA (ptr)); +} + static void sweep_button_data (void) { @@ -3705,6 +3830,12 @@ SWEEP_FIXED_TYPE_BLOCK (button_data, Lisp_Button_Data); } +void +free_button_data (Lisp_Object ptr) +{ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (button_data, Lisp_Button_Data, XBUTTON_DATA (ptr)); +} + static void sweep_motion_data (void) { @@ -3714,6 +3845,12 @@ SWEEP_FIXED_TYPE_BLOCK (motion_data, Lisp_Motion_Data); } +void +free_motion_data (Lisp_Object ptr) +{ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (motion_data, Lisp_Motion_Data, XMOTION_DATA (ptr)); +} + static void sweep_process_data (void) { @@ -3723,6 +3860,12 @@ SWEEP_FIXED_TYPE_BLOCK (process_data, Lisp_Process_Data); } +void +free_process_data (Lisp_Object ptr) +{ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (process_data, Lisp_Process_Data, XPROCESS_DATA (ptr)); +} + static void sweep_timeout_data (void) { @@ -3732,6 +3875,12 @@ SWEEP_FIXED_TYPE_BLOCK (timeout_data, Lisp_Timeout_Data); } +void +free_timeout_data (Lisp_Object ptr) +{ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (timeout_data, Lisp_Timeout_Data, XTIMEOUT_DATA (ptr)); +} + static void sweep_magic_data (void) { @@ -3741,6 +3890,12 @@ SWEEP_FIXED_TYPE_BLOCK (magic_data, Lisp_Magic_Data); } +void +free_magic_data (Lisp_Object ptr) +{ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (magic_data, Lisp_Magic_Data, XMAGIC_DATA (ptr)); +} + static void sweep_magic_eval_data (void) { @@ -3750,6 +3905,12 @@ SWEEP_FIXED_TYPE_BLOCK (magic_eval_data, Lisp_Magic_Eval_Data); } +void +free_magic_eval_data (Lisp_Object ptr) +{ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (magic_eval_data, Lisp_Magic_Eval_Data, XMAGIC_EVAL_DATA (ptr)); +} + static void sweep_eval_data (void) { @@ -3759,6 +3920,12 @@ SWEEP_FIXED_TYPE_BLOCK (eval_data, Lisp_Eval_Data); } +void +free_eval_data (Lisp_Object ptr) +{ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (eval_data, Lisp_Eval_Data, XEVAL_DATA (ptr)); +} + static void sweep_misc_user_data (void) { @@ -3768,7 +3935,13 @@ SWEEP_FIXED_TYPE_BLOCK (misc_user_data, Lisp_Misc_User_Data); } -#endif /* USE_KKCC */ +void +free_misc_user_data (Lisp_Object ptr) +{ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (misc_user_data, Lisp_Misc_User_Data, XMISC_USER_DATA (ptr)); +} + +#endif /* EVENT_DATA_AS_OBJECTS */ static void sweep_markers (void) @@ -3785,14 +3958,9 @@ /* Explicitly free a marker. */ void -free_marker (Lisp_Marker *ptr) +free_marker (Lisp_Object ptr) { - /* Perhaps this will catch freeing an already-freed marker. */ - gc_checking_assert (ptr->lheader.type == lrecord_type_marker); - -#ifndef ALLOC_NO_POOLS - FREE_FIXED_TYPE_WHEN_NOT_IN_GC (marker, Lisp_Marker, ptr); -#endif /* ALLOC_NO_POOLS */ + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (marker, Lisp_Marker, XMARKER (ptr)); } @@ -3842,7 +4010,7 @@ } } -#endif /* MULE && ERROR_CHECK_GC */ +#endif /* defined (MULE) && defined (VERIFY_STRING_CHARS_INTEGRITY) */ /* Compactify string chars, relocating the reference to each -- free any empty string_chars_block we see. */ @@ -3884,7 +4052,7 @@ } string = from_s_chars->string; - assert (!(LRECORD_FREE_P (string))); + gc_checking_assert (!(LRECORD_FREE_P (string))); size = string->size_; fullsize = STRING_FULLSIZE (size); @@ -4054,12 +4222,6 @@ /* Put all unmarked conses on free list */ sweep_conses (); - /* Free all unmarked bit vectors */ - sweep_bit_vectors_1 (&all_bit_vectors, - &gc_count_num_bit_vector_used, - &gc_count_bit_vector_total_size, - &gc_count_bit_vector_storage); - /* Free all unmarked compiled-function objects */ sweep_compiled_functions (); @@ -4078,7 +4240,7 @@ sweep_events (); -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS sweep_key_data (); sweep_button_data (); sweep_motion_data (); @@ -4088,7 +4250,7 @@ sweep_magic_eval_data (); sweep_eval_data (); sweep_misc_user_data (); -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ #ifdef PDUMP pdump_objects_unmark (); @@ -4242,6 +4404,7 @@ int cursor_changed; Lisp_Object pre_gc_cursor; struct gcpro gcpro1; + PROFILE_DECLARE (); assert (!in_display || gc_currently_forbidden); @@ -4251,6 +4414,8 @@ || preparing_for_armageddon) return; + PROFILE_RECORD_ENTERING_SECTION (QSin_garbage_collection); + /* We used to call selected_frame() here. The following functions cannot be called inside GC @@ -4356,6 +4521,7 @@ /* #### generalize this? */ clear_event_resource (); cleanup_specifiers (); + cleanup_buffer_undo_lists (); /* Mark all the special slots that serve as the roots of accessibility. */ @@ -4408,7 +4574,9 @@ int i; mark_object (*backlist->function); - if (nargs < 0 /* nargs == UNEVALLED || nargs == MANY */) + if (nargs < 0 /* nargs == UNEVALLED || nargs == MANY */ + /* might be fake (internal profiling entry) */ + && backlist->args) mark_object (backlist->args[0]); else for (i = 0; i < nargs; i++) @@ -4498,6 +4666,8 @@ need_to_signal_post_gc = 1; funcall_allocation_flag = 1; + PROFILE_RECORD_EXITING_SECTION (QSin_garbage_collection); + return; } @@ -4607,11 +4777,6 @@ pl = gc_plist_hack ("compiled-functions-used", gc_count_num_compiled_function_in_use, pl); - pl = gc_plist_hack ("bit-vector-storage", gc_count_bit_vector_storage, pl); - pl = gc_plist_hack ("bit-vectors-total-length", - gc_count_bit_vector_total_size, pl); - pl = gc_plist_hack ("bit-vectors-used", gc_count_num_bit_vector_used, pl); - HACK_O_MATIC (symbol, "symbol-storage", pl); pl = gc_plist_hack ("symbols-free", gc_count_num_symbol_freelist, pl); pl = gc_plist_hack ("symbols-used", gc_count_num_symbol_in_use, pl); @@ -4845,7 +5010,7 @@ /* Initialization */ static void -common_init_alloc_once_early (void) +common_init_alloc_early (void) { #ifndef Qzero Qzero = make_int (0); /* Only used if Lisp_Object is a union type */ @@ -4859,7 +5024,6 @@ gc_generation_number[0] = 0; breathing_space = 0; - all_bit_vectors = Qzero; Vgc_message = Qzero; all_lcrecords = 0; ignore_malloc_warnings = 1; @@ -4879,7 +5043,7 @@ init_marker_alloc (); init_extent_alloc (); init_event_alloc (); -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS init_key_data_alloc (); init_button_data_alloc (); init_motion_data_alloc (); @@ -4889,7 +5053,7 @@ init_magic_eval_data_alloc (); init_eval_data_alloc (); init_misc_user_data_alloc (); -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ ignore_malloc_warnings = 0; @@ -4920,7 +5084,6 @@ systems */ lrecord_uid_counter = 259; debug_string_purity = 0; - gcprolist = 0; gc_currently_forbidden = 0; gc_hooks_inhibited = 0; @@ -4952,16 +5115,31 @@ } void -reinit_alloc_once_early (void) +init_alloc_early (void) { - common_init_alloc_once_early (); +#if defined (__cplusplus) && defined (ERROR_CHECK_GC) + static struct gcpro initial_gcpro; + + initial_gcpro.next = 0; + initial_gcpro.var = &Qnil; + initial_gcpro.nvars = 1; + gcprolist = &initial_gcpro; +#else + gcprolist = 0; +#endif /* defined (__cplusplus) && defined (ERROR_CHECK_GC) */ +} + +void +reinit_alloc_early (void) +{ + common_init_alloc_early (); init_lcrecord_lists (); } void init_alloc_once_early (void) { - common_init_alloc_once_early (); + common_init_alloc_early (); { int i; @@ -4973,6 +5151,7 @@ INIT_LRECORD_IMPLEMENTATION (vector); INIT_LRECORD_IMPLEMENTATION (string); INIT_LRECORD_IMPLEMENTATION (lcrecord_list); + INIT_LRECORD_IMPLEMENTATION (free); staticpros = Dynarr_new2 (Lisp_Object_ptr_dynarr, Lisp_Object *); Dynarr_resize (staticpros, 1410); /* merely a small optimization */ @@ -4987,12 +5166,6 @@ } void -init_alloc_early (void) -{ - gcprolist = 0; -} - -void syms_of_alloc (void) { DEFSYMBOL (Qpre_gc_hook); @@ -5023,6 +5196,9 @@ void vars_of_alloc (void) { + QSin_garbage_collection = build_msg_string ("(in garbage collection)"); + staticpro (&QSin_garbage_collection); + DEFVAR_INT ("gc-cons-threshold", &gc_cons_threshold /* *Number of bytes of consing between garbage collections. \"Consing\" is a misnomer in that this actually counts allocation Index: src/backtrace.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/backtrace.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/backtrace.h 28 May 2002 08:44:44 -0000 1.9 +++ src/backtrace.h 13 Feb 2003 09:57:05 -0000 1.10 @@ -1,6 +1,6 @@ /* The lisp stack. Copyright (C) 1985, 1986, 1987, 1992, 1993 Free Software Foundation, Inc. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -63,6 +63,51 @@ char evalargs; /* Nonzero means call value of debugger when done with this operation. */ char debug_on_exit; + + /* All the rest is information for the use of the profiler. The only + thing that eval.c does is set the first value to 0 so that it can + be relied upon. */ + + /* ----------------------------------------------------------------- */ + + /* 0 = profiling not turned on when function called. + Since profiling can be turned on and off dynamically, we can't + always count on having info recorded when a function was called + and need to take evasive action if necessary. + 1 = profiling turned on but function not yet actually called. Lots of + stuff can happen between when a function is pushed onto the + backtrace list and when it's actually called (e.g. evalling its + arguments, autoloading, etc.). For greater accuracy we don't + treat the preamble stuff as part of the function itself. + 2 = profiling turned on, function called. + */ + char function_being_called; + /* The trick here is handling recursive functions and dealing with the + dynamicity of in-profile/not-in-profile. I used to just use a bunch + of hash tables for all info but that fails in the presence of + recursive functions because they can modify values out from under + you. The algorithm here is that we record the total_ticks and + total_consing, as well as the current values of `total-timing' and + `total-gc-usage' for the OBJ -- that's because recursive functions, + which get called later and exit early, will go ahead and modify the + `total-timing' and `total-gc-usage' for the fun, even though it's + not "correct" because the outer function is still running. However, + if we ask for profiling info at this point, at least we're getting + SOME info. + + So ... On entry, we record these four values. On exit, we compute + an offset from the recorded value to the current value and then + store it into the appropriate hash table entry, using the recorded + value in the entry rather than the actual one. (Inner recursive + functions may have added their own values to the total-counts, and + we want to subsume them, not add to them.) + + #### Also we need to go through the backtrace list during + stop-profiling and record values, just like for unwind_to. */ + EMACS_INT current_total_timing_val; + EMACS_INT current_total_gc_usage_val; + EMACS_UINT total_ticks_at_start; + EMACS_UINT total_consing_at_start; }; /* This structure helps implement the `catch' and `throw' control @@ -347,6 +392,19 @@ FFU_symbol->value = FFU_newval; \ else \ Fset (FFU_sym, FFU_newval); \ +} while (0) + +/* Note: you must always fill in all of the fields in a backtrace structure + before pushing them on the backtrace_list. The profiling code depends + on this. */ + +#define PUSH_BACKTRACE(bt) do { \ + (bt).next = backtrace_list; \ + backtrace_list = &(bt); \ +} while (0) + +#define POP_BACKTRACE(bt) do { \ + backtrace_list = (bt).next; \ } while (0) #endif /* INCLUDED_backtrace_h_ */ Index: src/buffer.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/buffer.c,v retrieving revision 1.61 retrieving revision 1.63 diff -u -r1.61 -r1.63 --- src/buffer.c 29 Jul 2002 09:21:14 -0000 1.61 +++ src/buffer.c 14 Feb 2003 09:50:16 -0000 1.63 @@ -228,17 +228,38 @@ static void reset_buffer_local_variables (struct buffer *, int first_time); static void nuke_all_buffer_slots (struct buffer *b, Lisp_Object zap); +static const struct memory_description buffer_text_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct buffer_text, line_number_cache) }, + { XD_END } +}; + +static const struct sized_memory_description buffer_text_description = { + sizeof (struct buffer_text), + buffer_text_description_1 +}; + +static const struct memory_description buffer_description [] = { +#define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (struct buffer, x) }, +#include "bufslots.h" + + { XD_LISP_OBJECT, offsetof (struct buffer, extent_info) }, + + { XD_STRUCT_PTR, offsetof (struct buffer, text), + 1, &buffer_text_description }, + { XD_STRUCT_PTR, offsetof (struct buffer, syntax_cache), + 1, &syntax_cache_description }, + + { XD_LISP_OBJECT, offsetof (struct buffer, indirect_children) }, + { XD_LISP_OBJECT, offsetof (struct buffer, base_buffer) }, + { XD_END } +}; + static Lisp_Object mark_buffer (Lisp_Object obj) { struct buffer *buf = XBUFFER (obj); - /* Truncate undo information. */ - buf->undo_list = truncate_undo_list (buf->undo_list, - undo_threshold, - undo_high_threshold); - -#define MARKED_SLOT(x) mark_object (buf->x) +#define MARKED_SLOT(x) mark_object (buf->x); #include "bufslots.h" mark_object (buf->extent_info); @@ -246,10 +267,17 @@ mark_object (buf->text->line_number_cache); mark_buffer_syntax_cache (buf); - /* Don't mark normally through the children slot. - (Actually, in this case, it doesn't matter.) */ + /* [[ Don't mark normally through the children slot. Actually, in this + case, it doesn't matter. ]] + + Indirect buffers, like all buffers, are permanent objects and stay + around by themselves, so it doesn't matter whether we mark their + children. This used to contain a call to mark_conses_in_list(), to + mark only the conses. I deleted that function, since it's not used + any more and causes problems with KKCC. If we really needed such a + weak list, just use a weak list object, like extents do. --ben */ if (! EQ (buf->indirect_children, Qnull_pointer)) - mark_conses_in_list (buf->indirect_children); + mark_object (buf->indirect_children); return buf->base_buffer ? wrap_buffer (buf->base_buffer) : Qnil; } @@ -274,19 +302,28 @@ print_internal (b->name, printcharfun, 0); } +void +cleanup_buffer_undo_lists (void) +{ + /* Truncate undo information at GC time. Used to be in mark_object() but + moved here for KKCC purposes. */ + + ALIST_LOOP_3 (name, buf, Vbuffer_alist) + { + XBUFFER (buf)->undo_list = truncate_undo_list (XBUFFER (buf)->undo_list, + undo_threshold, + undo_high_threshold); + } +} + /* We do not need a finalize method to handle a buffer's children list because all buffers have `kill-buffer' applied to them before they disappear, and the children removal happens then. */ -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("buffer", buffer, 0, /*dumpable-flag*/ - mark_buffer, print_buffer, 0, 0, 0, 0, - struct buffer); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("buffer", buffer, - mark_buffer, print_buffer, 0, 0, 0, 0, + mark_buffer, print_buffer, 0, 0, 0, + buffer_description, struct buffer); -#endif /* not USE_KKCC */ DEFUN ("bufferp", Fbufferp, 1, 1, 0, /* Return t if OBJECT is an editor buffer. @@ -441,7 +478,6 @@ (filename)) { /* This function can GC. GC checked and fixed 7-11-2000 ben. */ - REGISTER Lisp_Object buf; struct gcpro gcpro1; #ifdef I18N3 @@ -486,10 +522,8 @@ } { - LIST_LOOP_2 (elt, Vbuffer_alist) + ALIST_LOOP_3 (name, buf, Vbuffer_alist) { - buf = Fcdr (elt); - if (!BUFFERP (buf)) continue; if (!STRINGP (XBUFFER (buf)->filename)) continue; if (!NILP (Fstring_equal (filename, (find_file_compare_truenames @@ -2106,7 +2140,7 @@ b->indirect_children = Qnil; b->own_text.line_number_cache = Qnil; -#define MARKED_SLOT(x) b->x = zap +#define MARKED_SLOT(x) b->x = zap; #include "bufslots.h" } @@ -2252,12 +2286,12 @@ } -static const struct lrecord_description buffer_slots_description_1[] = { +static const struct memory_description buffer_slots_description_1[] = { { XD_LISP_OBJECT_ARRAY, 0, BUFFER_SLOTS_COUNT }, { XD_END } }; -static const struct struct_description buffer_slots_description = { +static const struct sized_memory_description buffer_slots_description = { BUFFER_SLOTS_SIZE, buffer_slots_description_1 }; @@ -2754,7 +2788,7 @@ if ((XINT (buffer_local_flags.slot) != -2 && \ XINT (buffer_local_flags.slot) != -3) \ != !(NILP (XBUFFER (Vbuffer_local_symbols)->slot))) \ - abort () + abort (); #include "bufslots.h" { Index: src/buffer.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/buffer.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- src/buffer.h 5 Jun 2002 09:54:56 -0000 1.27 +++ src/buffer.h 12 Jan 2003 11:08:08 -0000 1.28 @@ -235,7 +235,7 @@ /* Everything from here down must be a Lisp_Object */ -#define MARKED_SLOT(x) Lisp_Object x +#define MARKED_SLOT(x) Lisp_Object x; #include "bufslots.h" #undef MARKED_SLOT }; Index: src/bufslots.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/bufslots.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/bufslots.h 13 Mar 2002 08:52:33 -0000 1.9 +++ src/bufslots.h 12 Jan 2003 11:08:08 -0000 1.10 @@ -1,6 +1,6 @@ /* Definitions of marked slots in buffers Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc. - Copyright (C) 2001 Ben Wing. + Copyright (C) 2001, 2002 Ben Wing. This file is part of XEmacs. @@ -41,36 +41,36 @@ #endif /* The name of this buffer. */ - MARKED_SLOT (name); + MARKED_SLOT (name) /* The name of the file visited in this buffer, or nil. */ - MARKED_SLOT (filename); + MARKED_SLOT (filename) /* Dir for expanding relative file names. */ - MARKED_SLOT (directory); + MARKED_SLOT (directory) /* True iff this buffer has been backed up (if you write to the visited file and it hasn't been backed up, then a backup will be made). */ /* #### This isn't really used by the C code, so could be deleted. */ - MARKED_SLOT (backed_up); + MARKED_SLOT (backed_up) /* Length of file when last read or saved. This is not in the struct buffer_text because it's not used in indirect buffers at all. */ - MARKED_SLOT (saved_size); + MARKED_SLOT (saved_size) /* File name used for auto-saving this buffer. This is not in the struct buffer_text because it's not used in indirect buffers at all. */ - MARKED_SLOT (auto_save_file_name); + MARKED_SLOT (auto_save_file_name) /* Non-nil if buffer read-only. */ - MARKED_SLOT (read_only); + MARKED_SLOT (read_only) /* "The mark". This is a marker which may point into this buffer or may point nowhere. */ - MARKED_SLOT (mark); + MARKED_SLOT (mark) /* Alist of elements (SYMBOL . VALUE-IN-THIS-BUFFER) for all per-buffer variables of this buffer. @@ -84,48 +84,48 @@ Variables declared in C with DEFVAR_BUFFER_LOCAL() (i.e. those stored in the struct buffer) are not listed here. */ - MARKED_SLOT (local_var_alist); + MARKED_SLOT (local_var_alist) /* Symbol naming major mode (eg, lisp-mode). */ - MARKED_SLOT (major_mode); + MARKED_SLOT (major_mode) /* Pretty name of major mode (eg, "Lisp"). */ - MARKED_SLOT (mode_name); + MARKED_SLOT (mode_name) /* Modeline element that controls format of modeline. */ - MARKED_SLOT (modeline_format); + MARKED_SLOT (modeline_format) /* Keys that are bound local to this buffer. */ - MARKED_SLOT (keymap); + MARKED_SLOT (keymap) /* This buffer's local abbrev table. */ - MARKED_SLOT (abbrev_table); + MARKED_SLOT (abbrev_table) /* This buffer's syntax table. */ - MARKED_SLOT (syntax_table); + MARKED_SLOT (syntax_table) /* Massaged values from the syntax table, for faster lookup. */ - MARKED_SLOT (mirror_syntax_table); + MARKED_SLOT (mirror_syntax_table) #ifdef MULE /* This buffer's category table. */ - MARKED_SLOT (category_table); + MARKED_SLOT (category_table) #endif /* MULE */ /* This buffer's coding system. */ - MARKED_SLOT (buffer_file_coding_system); + MARKED_SLOT (buffer_file_coding_system) /* Values of several buffer-local variables. tab-width is buffer-local so that redisplay can find it in buffers that are not current */ - MARKED_SLOT (case_fold_search); - MARKED_SLOT (tab_width); - MARKED_SLOT (fill_column); - MARKED_SLOT (left_margin); + MARKED_SLOT (case_fold_search) + MARKED_SLOT (tab_width) + MARKED_SLOT (fill_column) + MARKED_SLOT (left_margin) /* Function to call when insert space past fill column. */ - MARKED_SLOT (auto_fill_function); + MARKED_SLOT (auto_fill_function) /* Case table for case-conversion in this buffer. */ - MARKED_SLOT (case_table); - /* It contais following char-tables: */ + MARKED_SLOT (case_table) + /* It contanis following char-tables: */ /* Char-table maps each char into its lower-case version. */ /* Char-table mapping each char to its upper-case version. */ /* Char-table for conversion for case-folding search. */ @@ -133,31 +133,31 @@ /* #### This ought to be a specifier: */ /* Non-nil means do not display continuation lines. */ - MARKED_SLOT (truncate_lines); + MARKED_SLOT (truncate_lines) /* #### This ought to be a specifier: */ /* #### Better yet, it ought to be junked. It really sucks. */ /* Non-nil means display ctl chars with uparrow. */ - MARKED_SLOT (ctl_arrow); + MARKED_SLOT (ctl_arrow) /* #### This ought to be a specifier: */ /* #### Better yet, it ought to be junked. It really sucks. */ /* Non-nil means do selective display; see doc string in syms_of_buffer (buffer.c) for details. */ - MARKED_SLOT (selective_display); + MARKED_SLOT (selective_display) /* #### This ought to be a specifier: */ /* #### Better yet, it ought to be junked. It really sucks. */ /* Non-nil means show ... at end of line followed by invisible lines. */ - MARKED_SLOT (selective_display_ellipses); + MARKED_SLOT (selective_display_ellipses) /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ - /* Unused: MARKED_SLOT (minor_modes); */ + /* Unused: MARKED_SLOT (minor_modes) */ /* t if "self-insertion" should overwrite */ - MARKED_SLOT (overwrite_mode); + MARKED_SLOT (overwrite_mode) /* non-nil means abbrev mode is on. Expand abbrevs automatically. */ - MARKED_SLOT (abbrev_mode); + MARKED_SLOT (abbrev_mode) /* No display table here. It's a specifier. */ #if 0 /* FSFmacs */ /* t means the mark and region are currently active. */ - MARKED_SLOT (mark_active); + MARKED_SLOT (mark_active) #endif /* Changes in the buffer are recorded here for undo. @@ -166,7 +166,7 @@ But we can't store it in the struct buffer_text because local variables have to be right in the struct buffer. So we copy it around in set_buffer_internal. */ - MARKED_SLOT (undo_list); + MARKED_SLOT (undo_list) /* FSFmacs has overlay stuff here. We have extent info elsewhere in the struct buffer. */ @@ -174,12 +174,12 @@ /* dedicated_frame in lisp */ /* Lisp of symbols naming the file format used for visited file. */ - MARKED_SLOT (file_format); + MARKED_SLOT (file_format) #ifdef REGION_CACHE_NEEDS_WORK /* True if the newline position cache and width run cache are enabled. See search.c and indent.c. */ - MARKED_SLOT (cache_long_line_scans); + MARKED_SLOT (cache_long_line_scans) /* If the width run cache is enabled, this table contains the character widths width_run_cache (see above) assumes. When we @@ -187,13 +187,13 @@ current display table to see whether the display table has affected the widths of any characters. If it has, we invalidate the width run cache, and re-initialize width_table. */ - MARKED_SLOT (width_table); + MARKED_SLOT (width_table) #endif /* REGION_CACHE_NEEDS_WORK */ /* A redundant copy of text.pt, in the form of a marker. Every time one is updated, so is the other. */ - MARKED_SLOT (point_marker); + MARKED_SLOT (point_marker) /* FSFmacs has pt_marker, begv_marker, zv_marker here, used for indirect buffers. We don't need them because we handle these @@ -201,24 +201,24 @@ /* This holds the point value before the last scroll operation. Explicitly setting point sets this to nil. */ - MARKED_SLOT (point_before_scroll); + MARKED_SLOT (point_before_scroll) /* Truename of the visited file (via qxe_realpath()), or nil. */ - MARKED_SLOT (file_truename); + MARKED_SLOT (file_truename) /* Invisibility spec of this buffer. t => any non-nil `invisible' property means invisible. A list => `invisible' property means invisible if it is memq in that list. */ - MARKED_SLOT (invisibility_spec); + MARKED_SLOT (invisibility_spec) /* The string generated by formatting the modeline in this buffer. */ - MARKED_SLOT (generated_modeline_string); + MARKED_SLOT (generated_modeline_string) /* A hash table that maps from a "generic extent" (an extent in `modeline-format') into a buffer-specific extent. */ - MARKED_SLOT (modeline_extent_table); + MARKED_SLOT (modeline_extent_table) #ifndef BUFFER_SLOTS_LAST_NAME #define BUFFER_SLOTS_LAST_NAME modeline_extent_table Index: src/bytecode.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/bytecode.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- src/bytecode.c 8 Dec 2002 10:25:06 -0000 1.31 +++ src/bytecode.c 12 Jan 2003 11:08:08 -0000 1.32 @@ -1869,20 +1869,10 @@ internal_hash (f->constants, depth + 1)); } -static const struct lrecord_description lo_description_1[] = { - { XD_LISP_OBJECT, 0 }, - { XD_END } -}; - -static const struct struct_description lo_description = { - sizeof (Lisp_Object), - lo_description_1 -}; - -static const struct lrecord_description compiled_function_description[] = { +static const struct memory_description compiled_function_description[] = { { XD_INT, offsetof (Lisp_Compiled_Function, args_in_array) }, { XD_STRUCT_PTR, offsetof (Lisp_Compiled_Function, args), - XD_INDIRECT (0, 0), &lo_description }, + XD_INDIRECT (0, 0), &lisp_object_description }, { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, instructions) }, { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, constants) }, { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, arglist) }, @@ -1893,7 +1883,6 @@ { XD_END } }; -#ifdef USE_KKCC DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function, 1, /*dumpable_flag*/ mark_compiled_function, @@ -1902,15 +1891,6 @@ compiled_function_hash, compiled_function_description, Lisp_Compiled_Function); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function, - mark_compiled_function, - print_compiled_function, 0, - compiled_function_equal, - compiled_function_hash, - compiled_function_description, - Lisp_Compiled_Function); -#endif /* not USE_KKCC */ DEFUN ("compiled-function-p", Fcompiled_function_p, 1, 1, 0, /* Return t if OBJECT is a byte-compiled function object. Index: src/callint.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/callint.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- src/callint.c 22 Aug 2002 11:31:41 -0000 1.26 +++ src/callint.c 12 Jan 2003 11:08:08 -0000 1.27 @@ -37,7 +37,7 @@ #include "insdel.h" #include "window-impl.h" /* WINDOW_MINI_P */ -extern int num_input_chars; +extern Charcount num_input_chars; Lisp_Object Vcurrent_prefix_arg; Lisp_Object Qcall_interactively; Index: src/casetab.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/casetab.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/casetab.c 29 Jul 2002 09:21:15 -0000 1.13 +++ src/casetab.c 12 Jan 2003 11:08:08 -0000 1.14 @@ -97,7 +97,7 @@ write_fmt_string (printcharfun, "0x%x>", ct->header.uid); } -static const struct lrecord_description case_table_description [] = { +static const struct memory_description case_table_description [] = { { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, downcase_table) }, { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, upcase_table) }, { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, case_canon_table) }, @@ -106,16 +106,10 @@ }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION("case-table", case_table, 1, /*dumpable-flag*/ mark_case_table, print_case_table, 0, 0, 0, case_table_description, Lisp_Case_Table); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("case-table", case_table, - mark_case_table, print_case_table, 0, - 0, 0, case_table_description, Lisp_Case_Table); -#endif /* not USE_KKCC */ static Lisp_Object allocate_case_table (int init_tables) Index: src/chartab.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/chartab.c,v retrieving revision 1.27 retrieving revision 1.29 diff -u -r1.27 -r1.29 --- src/chartab.c 29 Jul 2002 09:21:15 -0000 1.27 +++ src/chartab.c 14 Feb 2003 09:50:16 -0000 1.29 @@ -1,7 +1,7 @@ /* XEmacs routines to deal with char tables. Copyright (C) 1992, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. Copyright (C) 1995, 1997, 1999 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. @@ -133,12 +133,11 @@ return internal_array_hash (cte->level2, 96, depth + 1); } -static const struct lrecord_description char_table_entry_description[] = { +static const struct memory_description char_table_entry_description[] = { { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table_Entry, level2), 96 }, { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("char-table-entry", char_table_entry, 1, /* dumpable flag */ mark_char_table_entry, internal_object_printer, @@ -146,14 +145,6 @@ char_table_entry_hash, char_table_entry_description, Lisp_Char_Table_Entry); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("char-table-entry", char_table_entry, - mark_char_table_entry, internal_object_printer, - 0, char_table_entry_equal, - char_table_entry_hash, - char_table_entry_description, - Lisp_Char_Table_Entry); -#endif /* not USE_KKCC */ #endif /* MULE */ @@ -229,7 +220,7 @@ #endif invalid_constant ("Unrecognized char table type", symbol); - RETURN_NOT_REACHED (CHAR_TABLE_TYPE_GENERIC) + RETURN_NOT_REACHED (CHAR_TABLE_TYPE_GENERIC); } static void @@ -388,7 +379,7 @@ return HASH2 (hashval, internal_hash (ct->default_, depth + 1)); } -static const struct lrecord_description char_table_description[] = { +static const struct memory_description char_table_description[] = { { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table, ascii), NUM_ASCII_CHARS }, #ifdef MULE { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table, level1), NUM_LEADING_BYTES }, @@ -400,20 +391,12 @@ { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("char-table", char_table, 1, /*dumpable-flag*/ mark_char_table, print_char_table, 0, char_table_equal, char_table_hash, char_table_description, Lisp_Char_Table); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("char-table", char_table, - mark_char_table, print_char_table, 0, - char_table_equal, char_table_hash, - char_table_description, - Lisp_Char_Table); -#endif /* not USE_KKCC */ DEFUN ("char-table-p", Fchar_table_p, 1, 1, 0, /* Return non-nil if OBJECT is a char table. @@ -461,13 +444,20 @@ return char_table_type_to_symbol (XCHAR_TABLE (char_table)->type); } +static void +set_char_table_dirty (Lisp_Object table) +{ + assert (!XCHAR_TABLE (table)->mirror_table_p); + XCHAR_TABLE (XCHAR_TABLE (table)->mirror_table)->dirty = 1; +} + void set_char_table_default (Lisp_Object table, Lisp_Object value) { Lisp_Char_Table *ct = XCHAR_TABLE (table); ct->default_ = value; if (ct->type == CHAR_TABLE_TYPE_SYNTAX) - update_syntax_table (table); + set_char_table_dirty (table); } static void @@ -479,11 +469,17 @@ ct->ascii[i] = value; #ifdef MULE for (i = 0; i < NUM_LEADING_BYTES; i++) - ct->level1[i] = value; + { + /* Don't get stymied when initting the table */ + if (!EQ (ct->level1[i], Qnull_pointer) && + CHAR_TABLE_ENTRYP (ct->level1[i])) + free_lcrecord (ct->level1[i]); + ct->level1[i] = value; + } #endif /* MULE */ if (ct->type == CHAR_TABLE_TYPE_SYNTAX) - update_syntax_table (wrap_char_table (ct)); + set_char_table_dirty (wrap_char_table (ct)); } DEFUN ("reset-char-table", Freset_char_table, 1, 1, 0, /* @@ -593,19 +589,21 @@ ct = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table); ct->type = ty; + obj = wrap_char_table (ct); if (ty == CHAR_TABLE_TYPE_SYNTAX) { /* Qgeneric not Qsyntax because a syntax table has a mirror table and we don't want infinite recursion */ ct->mirror_table = Fmake_char_table (Qgeneric); set_char_table_default (ct->mirror_table, make_int (Spunct)); + XCHAR_TABLE (ct->mirror_table)->mirror_table_p = 1; + XCHAR_TABLE (ct->mirror_table)->mirror_table = obj; } else ct->mirror_table = Qnil; ct->next_table = Qnil; ct->parent = Qnil; ct->default_ = Qnil; - obj = wrap_char_table (ct); if (ty == CHAR_TABLE_TYPE_SYNTAX) { ct->next_table = Vall_syntax_tables; @@ -669,6 +667,8 @@ ctnew->type = ct->type; ctnew->parent = ct->parent; ctnew->default_ = ct->default_; + ctnew->mirror_table_p = ct->mirror_table_p; + obj = wrap_char_table (ctnew); for (i = 0; i < NUM_ASCII_CHARS; i++) { @@ -692,12 +692,14 @@ #endif /* MULE */ - if (CHAR_TABLEP (ct->mirror_table)) - ctnew->mirror_table = Fcopy_char_table (ct->mirror_table); + if (!ct->mirror_table_p && CHAR_TABLEP (ct->mirror_table)) + { + ctnew->mirror_table = Fcopy_char_table (ct->mirror_table); + XCHAR_TABLE (ctnew->mirror_table)->mirror_table = obj; + } else ctnew->mirror_table = ct->mirror_table; ctnew->next_table = Qnil; - obj = wrap_char_table (ctnew); if (ctnew->type == CHAR_TABLE_TYPE_SYNTAX) { ctnew->next_table = Vall_syntax_tables; @@ -789,9 +791,9 @@ map_char_table (from, range, copy_mapper, LISP_TO_VOID (to)); } -Lisp_Object -get_range_char_table (struct chartab_range *range, Lisp_Object table, - Lisp_Object multi) +static Lisp_Object +get_range_char_table_1 (struct chartab_range *range, Lisp_Object table, + Lisp_Object multi) { Lisp_Char_Table *ct = XCHAR_TABLE (table); Lisp_Object retval = Qnil; @@ -880,6 +882,32 @@ return retval; } +Lisp_Object +get_range_char_table (struct chartab_range *range, Lisp_Object table, + Lisp_Object multi) +{ + if (range->type == CHARTAB_RANGE_CHAR) + return get_char_table (range->ch, table); + else + return get_range_char_table_1 (range, table, multi); +} + +#ifdef ERROR_CHECK_TYPES + +/* Only exists so as not to trip an assert in get_char_table(). */ +Lisp_Object +updating_mirror_get_range_char_table (struct chartab_range *range, + Lisp_Object table, + Lisp_Object multi) +{ + if (range->type == CHARTAB_RANGE_CHAR) + return get_char_table_1 (range->ch, table); + else + return get_range_char_table_1 (range, table, multi); +} + +#endif /* ERROR_CHECK_TYPES */ + DEFUN ("get-range-char-table", Fget_range_char_table, 2, 3, 0, /* Find value for a range in CHAR-TABLE. If there is more than one value, return MULTI (defaults to nil). @@ -1003,8 +1031,7 @@ { case CHARTAB_RANGE_ALL: fill_char_table (ct, val); - return; /* avoid the duplicate call to update_syntax_table() below, - since fill_char_table() also did that. */ + return; /* fill_char_table() recorded the table as dirty. */ #ifdef MULE case CHARTAB_RANGE_CHARSET: @@ -1023,6 +1050,8 @@ else { int lb = XCHARSET_LEADING_BYTE (range->charset) - MIN_LEADING_BYTE; + if (CHAR_TABLE_ENTRYP (ct->level1[lb])) + free_lcrecord (ct->level1[lb]); ct->level1[lb] = val; } break; @@ -1084,7 +1113,7 @@ } if (ct->type == CHAR_TABLE_TYPE_SYNTAX) - update_syntax_table (wrap_char_table (ct)); + set_char_table_dirty (wrap_char_table (ct)); } DEFUN ("put-char-table", Fput_char_table, 3, 3, 0, /* Index: src/chartab.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/chartab.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/chartab.h 5 Jun 2002 09:55:02 -0000 1.13 +++ src/chartab.h 14 Feb 2003 09:50:17 -0000 1.14 @@ -1,7 +1,7 @@ /* Declarations having to do with Mule char tables. Copyright (C) 1992 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -119,8 +119,12 @@ enum char_table_type type; /* stuff used for syntax tables */ - Lisp_Object mirror_table; + Lisp_Object mirror_table; /* points to mirror table for this table + (a cache for quicker access), or a back + pointer if MIRROR_TABLE_P. */ Lisp_Object next_table; /* DO NOT mark through this. */ + char dirty; /* nonzero if mirror dirty and needs updating. */ + char mirror_table_p; /* nonzero if this is a mirror table. */ }; typedef struct Lisp_Char_Table Lisp_Char_Table; @@ -140,7 +144,7 @@ DECLARE_INLINE_HEADER ( Lisp_Object -get_char_table (Ichar ch, Lisp_Object table) +get_char_table_1 (Ichar ch, Lisp_Object table) ) { Lisp_Object retval; @@ -165,6 +169,19 @@ return ct->default_; } +#ifdef ERROR_CHECK_TYPES +DECLARE_INLINE_HEADER ( +Lisp_Object +get_char_table (Ichar ch, Lisp_Object table) +) +{ + assert (!XCHAR_TABLE (table)->mirror_table_p); + return get_char_table_1 (ch, table); +} +#else +#define get_char_table(ch, table) get_char_table_1 (ch, table) +#endif + enum chartab_range_type { CHARTAB_RANGE_ALL, @@ -195,6 +212,13 @@ void prune_syntax_tables (void); Lisp_Object get_range_char_table (struct chartab_range *range, Lisp_Object table, Lisp_Object multi); +#ifdef ERROR_CHECK_TYPES +Lisp_Object updating_mirror_get_range_char_table (struct chartab_range *range, + Lisp_Object table, + Lisp_Object multi); +#else +#define updating_mirror_get_range_char_table get_range_char_table +#endif void copy_char_table_range (Lisp_Object from, Lisp_Object to, struct chartab_range *range); int word_boundary_p (Ichar c1, Ichar c2); Index: src/cmdloop.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/cmdloop.c,v retrieving revision 1.17 retrieving revision 1.19 diff -u -r1.17 -r1.19 --- src/cmdloop.c 20 Jun 2002 21:18:22 -0000 1.17 +++ src/cmdloop.c 7 Feb 2003 11:50:52 -0000 1.19 @@ -238,26 +238,13 @@ static DOESNT_RETURN command_loop_3 (void) { -#ifdef LWLIB_MENUBARS_LUCID - extern int in_menu_callback; /* defined in menubar-x.c */ -#endif /* LWLIB_MENUBARS_LUCID */ - -#ifdef LWLIB_MENUBARS_LUCID /* - * #### Fix the menu code so this isn't necessary. - * - * We cannot allow the lwmenu code to be reentered, because the - * code is not written to be reentrant and will crash. Therefore - * paths from the menu callbacks back into the menu code have to - * be blocked. Fnext_event is the normal path into the menu code, - * but waiting to signal an error there is too late in case where - * a new command loop has been started. The error will be caught - * and Fnext_event will be called again, looping forever. So we - * signal an error here to avoid the loop. + * If we are inside of a menu callback we cannot reenter the command loop + * because we will deadlock, as no input is allowed. */ - if (in_menu_callback) - invalid_operation ("Attempt to enter command_loop_3 inside menu callback", Qunbound); -#endif /* LWLIB_MENUBARS_LUCID */ + if (in_modal_loop) + invalid_operation ("Attempt to enter command loop inside menu callback", + Qunbound); /* This function can GC */ for (;;) { @@ -583,17 +570,14 @@ if (!was_locked) any_console_state (); -#if (defined (_MSC_VER) \ - || defined (__SUNPRO_C) \ - || defined (__SUNPRO_CC) \ - || (defined (DEC_ALPHA) \ - && defined (OSF1))) - if (0) return Qnil; /* Shut up compiler */ -#endif + + DO_NOTHING_DISABLING_NO_RETURN_WARNINGS; } #ifdef LISP_COMMAND_LOOP UNGCPRO; return Qnil; +#else + RETURN_NOT_REACHED (Qnil); #endif } Index: src/coding-system-slots.h =================================================================== RCS file: src/coding-system-slots.h diff -N src/coding-system-slots.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/coding-system-slots.h 12 Jan 2003 11:08:09 -0000 1.1 @@ -0,0 +1,110 @@ +/* Definitions of marked slots in coding systems + Copyright (C) 1991, 1995 Free Software Foundation, Inc. + Copyright (C) 1995 Sun Microsystems, Inc. + Copyright (C) 2000, 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. */ + +/* Synched up with: ????. Split out of file-coding.h. */ + +/* We define the Lisp_Objects in the coding system structure in a separate + file because there are numerous places we want to iterate over them, + such as when defining them in the structure, initializing them, or + marking them. + + To use, define MARKED_SLOT before including this file. In the structure + definition, you also need to define CODING_SYSTEM_SLOT_DECLARATION. No + need to undefine either value; that happens automatically. */ + +#ifndef MARKED_SLOT_ARRAY +#ifdef CODING_SYSTEM_SLOT_DECLARATION +#define MARKED_SLOT_ARRAY(slot, size) MARKED_SLOT(slot[size]) +#else +#define MARKED_SLOT_ARRAY(slot, size) do { \ + int mslotidx; \ + for (mslotidx = 0; mslotidx < size; mslotidx++) \ + { \ + MARKED_SLOT (slot[mslotidx]) \ + } \ + } while (0); +#endif +#endif /* not MARKED_SLOT_ARRAY */ + + /* Name and description of this coding system. The description + should be suitable for a menu entry. */ + MARKED_SLOT (name) + MARKED_SLOT (description) + + /* Mnemonic string displayed in the modeline when this coding + system is active for a particular buffer. */ + MARKED_SLOT (mnemonic) + + /* Long documentation on the coding system. */ + MARKED_SLOT (documentation) + /* Functions to handle additional conversion after reading or before + writing. #### This mechanism should be replaced by the ability to + simply create new coding system types. */ + MARKED_SLOT (post_read_conversion) + MARKED_SLOT (pre_write_conversion) + + /* If this coding system is not of the correct type for text file + conversion (i.e. decodes byte->char), we wrap it with appropriate + char<->byte converters. This is created dynamically, when it's + needed, and cached here. */ + MARKED_SLOT (text_file_wrapper) + + /* ------------------------ junk to handle EOL ------------------------- + I had hoped that we could handle this without lots of special-case + code, but it appears not to be the case if we want to maintain + compatibility with the existing way. However, at least with the way + we do things now, we avoid EOL junk in most of the coding system + methods themselves, or in the decode/encode functions. The EOL + special-case code is limited to coding-system creation and to the + convert-eol and undecided coding system types. */ + + /* If this coding system wants autodetection of the EOL type, then at the + appropriate time we wrap this coding system with + convert-eol-autodetect. (We do NOT do this at creation time because + then we end up with multiple convert-eols wrapped into the final + result -- esp. with autodetection using `undecided' -- leading to a + big mess.) We cache the wrapped coding system here. */ + MARKED_SLOT (auto_eol_wrapper) + + /* Subsidiary coding systems that specify a particular type of EOL + marking, rather than autodetecting it. These will only be non-nil + if (eol_type == EOL_AUTODETECT). These are chains. */ + MARKED_SLOT_ARRAY (eol, 3) + /* If this coding system is a subsidiary, this element points back to its + parent. */ + MARKED_SLOT (subsidiary_parent) + + /* At decoding or encoding time, we use the following coding system, if + it exists, in place of the coding system object. This is how we + handle coding systems with EOL types of CRLF or CR. Formerly, we did + the canonicalization at creation time, returning a chain in place of + the original coding system; but that interferes with + `coding-system-property' and causes other complications. CANONICAL is + used when determining the end types of a coding system. + canonicalize-after-coding also consults CANONICAL (it has to, because + the data in the lstream is based on CANONICAL, not on the original + coding system). */ + MARKED_SLOT (canonical) + +#undef MARKED_SLOT +#undef MARKED_SLOT_ARRAY +#undef CODING_SYSTEM_SLOT_DECLARATION Index: src/config.h.in =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/config.h.in,v retrieving revision 1.78 retrieving revision 1.83 diff -u -r1.78 -r1.83 --- src/config.h.in 12 Nov 2002 18:58:27 -0000 1.78 +++ src/config.h.in 15 Feb 2003 10:16:04 -0000 1.83 @@ -110,7 +110,10 @@ #undef _XOPEN_SOURCE_EXTENDED /* Make all functions available on AIX. See AC_AIX. */ +/* Some AIX compilers (cc) pre-define _ALL_SOURCE, some (xlc) don't. */ +#ifndef _ALL_SOURCE #undef _ALL_SOURCE +#endif /* Make all functions available on GNU libc systems. See features.h. */ #undef _GNU_SOURCE @@ -200,12 +203,16 @@ #undef LIBGLADE_XML_TXTDOMAIN /* Define HAVE_WINDOW_SYSTEM if any windowing system is available. */ -#if defined (HAVE_GTK) || defined (HAVE_X_WINDOWS) || defined(HAVE_MS_WINDOWS) /* || defined (HAVE_NEXTSTEP) */ +#if defined (HAVE_GTK) || defined (HAVE_X_WINDOWS) || defined (HAVE_MS_WINDOWS) /* || defined (HAVE_NEXTSTEP) */ #define HAVE_WINDOW_SYSTEM #endif +#if defined (HAVE_GTK) || defined (HAVE_X_WINDOWS) +#define HAVE_XLIKE +#endif + /* Define HAVE_UNIXOID_EVENT_LOOP if we use select() to wait for events. */ -#if defined (HAVE_X_WINDOWS) || defined (HAVE_TTY) || defined(HAVE_MSG_SELECT) +#if defined (HAVE_X_WINDOWS) || defined (HAVE_TTY) || defined (HAVE_MSG_SELECT) #define HAVE_UNIXOID_EVENT_LOOP #endif @@ -297,6 +304,7 @@ #undef HAVE_SHL_LOAD #undef HAVE_DLD_INIT #undef HAVE_SHLIB +#undef DLSYM_NEEDS_UNDERSCORE #undef HAVE_LIBINTL #undef HAVE_LIBDNET @@ -377,6 +385,8 @@ #undef HAVE_SNPRINTF #undef HAVE_STPCPY #undef HAVE_STRERROR +#undef HAVE_STRLWR +#undef HAVE_STRUPR #undef HAVE_SYMLINK #undef HAVE_TZSET #undef HAVE_ULIMIT @@ -592,6 +602,10 @@ files are read in as binary. Doesn't apply to Cygwin or MinGW. */ #undef HAVE_DEFAULT_EOL_DETECTION +/* Support X FontSets. Evil, yes, but if we're going to make it go away + by using faces in the menubar we should do so. */ +#undef USE_XFONTSET + /* Do we want to use X window input methods for use with Mule? (requires X11R5) If so, use raw Xlib or higher level Motif interface? */ #undef HAVE_XIM @@ -920,7 +934,6 @@ #ifndef NOT_C_CODE /* Actually means C or C++ */ # if defined (__cplusplus) /* Avoid C++ keywords used as ordinary C identifiers */ -# define class c_class # define new c_new # define this c_this # define catch c_catch Index: src/conslots.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/conslots.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/conslots.h 18 Jun 2001 07:10:11 -0000 1.5 +++ src/conslots.h 12 Jan 2003 11:08:09 -0000 1.6 @@ -1,5 +1,6 @@ /* Definitions of marked slots in consoles Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc. + Copyright (C) 2002 Ben Wing. This file is part of XEmacs. @@ -35,25 +36,25 @@ /* Name of this console, for resourcing and printing purposes. If not explicitly given, it's initialized in a console-specific manner. */ - MARKED_SLOT (name); + MARKED_SLOT (name) /* What this console is connected to */ - MARKED_SLOT (connection); + MARKED_SLOT (connection) /* A canonical name for the connection that is used to determine whether create_console() is being called on an existing console. */ - MARKED_SLOT (canon_connection); + MARKED_SLOT (canon_connection) /* List of devices on this console. */ - MARKED_SLOT (device_list); + MARKED_SLOT (device_list) /* Currently selected device. */ - MARKED_SLOT (selected_device); + MARKED_SLOT (selected_device) /* Most-recently-selected non-minibuffer-only frame. Always the same as the selected frame, unless that's a minibuffer-only frame. */ - MARKED_SLOT (last_nonminibuf_frame); + MARKED_SLOT (last_nonminibuf_frame) /* If non-nil, a keymap that overrides all others but applies only to this console. Lisp code that uses this instead of calling next-event @@ -64,41 +65,50 @@ #### This comes from FSF Emacs; but there's probably a better solution that involves making next-event itself work over all consoles. */ - MARKED_SLOT (overriding_terminal_local_map); + MARKED_SLOT (overriding_terminal_local_map) /* Last command executed by the editor command loop, not counting commands that set the prefix argument. */ - MARKED_SLOT (last_command); + MARKED_SLOT (last_command) /* The prefix argument for the next command, in raw form. */ - MARKED_SLOT (prefix_arg); + MARKED_SLOT (prefix_arg) /* Where information about a partially completed key sequence is kept. */ - MARKED_SLOT (command_builder); + MARKED_SLOT (command_builder) /* Non-nil while a kbd macro is being defined. */ - MARKED_SLOT (defining_kbd_macro); + MARKED_SLOT (defining_kbd_macro) /* This is a lisp vector, which contains the events of the keyboard macro currently being read. It is reallocated when the macro gets too large. */ - MARKED_SLOT (kbd_macro_builder); + MARKED_SLOT (kbd_macro_builder) /* Last anonymous kbd macro defined. */ - MARKED_SLOT (last_kbd_macro); + MARKED_SLOT (last_kbd_macro) #ifdef HAVE_TTY /* ERASE character from stty settings. */ - MARKED_SLOT (tty_erase_char); + MARKED_SLOT (tty_erase_char) #endif + /* Key that invokes QUIT. */ + MARKED_SLOT (quit_char) + + /* Event version of quit-char. */ + MARKED_SLOT (quit_event) + + /* Event version of critical QUIT (upshifted quit-char). */ + MARKED_SLOT (critical_quit_event) + /* Minibufferless frames on this console use this frame's minibuffer. */ - MARKED_SLOT (default_minibuffer_frame); + MARKED_SLOT (default_minibuffer_frame) /* Keymap mapping ASCII function key sequences onto their preferred forms. Initialized by the terminal-specific lisp files. */ - MARKED_SLOT (function_key_map); + MARKED_SLOT (function_key_map) #ifndef CONSOLE_SLOTS_LAST_NAME #define CONSOLE_SLOTS_LAST_NAME function_key_map Index: src/console-gtk-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-gtk-impl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/console-gtk-impl.h 20 Jun 2002 21:18:22 -0000 1.1 +++ src/console-gtk-impl.h 12 Jan 2003 11:08:09 -0000 1.2 @@ -144,7 +144,7 @@ int num_top_widgets; /* Our container widget as a Lisp_Object */ - Lisp_Object lisp_visible_widgets[10]; + Lisp_Object lisp_visible_widgets[3]; /*************************** Miscellaneous **************************/ Index: src/console-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-impl.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/console-impl.h 29 Jul 2002 09:21:15 -0000 1.3 +++ src/console-impl.h 12 Jan 2003 11:08:09 -0000 1.4 @@ -27,8 +27,8 @@ #include "console.h" -extern const struct struct_description cted_description; -extern const struct struct_description console_methods_description; +extern const struct sized_memory_description cted_description; +extern const struct sized_memory_description console_methods_description; /* @@ -407,26 +407,24 @@ /* Description of this console's methods. */ struct console_methods *conmeths; -#ifdef USE_KKCC + /* Enumerated constant listing which type of console this is (TTY, X, + MS-Windows, etc.). This duplicates the symbol in conmeths->symbol, + which formerly was the only way to determine the console type. + We need this constant now for KKCC, so that it can be used in + an XD_UNION clause to determine the Lisp objects in console_data. */ enum console_variant contype; -#endif /* USE_KKCC */ /* A structure of auxiliary data specific to the console type. struct x_console is used for X window frames; defined in console-x.h struct tty_console is used to TTY's; defined in console-tty.h */ void *console_data; - /* Character that causes a quit. Normally C-g. - #### Should be possible for this not to be ASCII. (Currently works - under Windows.) */ - Ichar quit_char; - /* ----- begin partially-completed console localization of event loop ---- */ int local_var_flags; -#define MARKED_SLOT(x) Lisp_Object x +#define MARKED_SLOT(x) Lisp_Object x; #include "conslots.h" /* Where to store the next keystroke of the macro. @@ -561,6 +559,8 @@ DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device)) #define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->last_nonminibuf_frame) #define CONSOLE_QUIT_CHAR(con) ((con)->quit_char) +#define CONSOLE_QUIT_EVENT(con) ((con)->quit_event) +#define CONSOLE_CRITICAL_QUIT_EVENT(con) ((con)->critical_quit_event) DECLARE_CONSOLE_TYPE (dead); Index: src/console-msw-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-msw-impl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/console-msw-impl.h 6 Jul 2002 05:48:20 -0000 1.2 +++ src/console-msw-impl.h 12 Jan 2003 11:08:09 -0000 1.3 @@ -269,8 +269,6 @@ */ /* win32 messages / magic event types */ -#define EVENT_MSWINDOWS_MAGIC_TYPE(e) \ - ((e)->event.magic.underlying_mswindows_event) #define XM_BUMPQUEUE (WM_USER + 101) #define XM_MAPFRAME (WM_USER + 102) #define XM_UNMAPFRAME (WM_USER + 103) Index: src/console-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-msw.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- src/console-msw.c 20 Jun 2002 21:18:23 -0000 1.14 +++ src/console-msw.c 12 Jan 2003 11:08:09 -0000 1.15 @@ -293,7 +293,13 @@ qxeOutputDebugString (extptr); } else - OutputDebugStringA ((char *) str); + { + /* STR may not be null-terminated so make it that way. */ + Extbyte *ext = alloca_extbytes (len + 1); + memcpy (ext, str, len); + ext[len] = '\0'; + OutputDebugStringA (ext); + } } #ifdef DEBUG_XEMACS Index: src/console-msw.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-msw.h,v retrieving revision 1.41 retrieving revision 1.43 diff -u -r1.41 -r1.43 --- src/console-msw.h 6 Jul 2002 05:48:21 -0000 1.41 +++ src/console-msw.h 7 Feb 2003 11:50:52 -0000 1.43 @@ -124,10 +124,6 @@ Lisp_Object object); Lisp_Object mswindows_cancel_dispatch_event (Lisp_Event *event); Lisp_Object mswindows_pump_outstanding_events (void); -Lisp_Object mswindows_protect_modal_loop (const char *error_string, - Lisp_Object (*bfun) - (Lisp_Object barg), - Lisp_Object barg, int flags); void mswindows_unmodalize_signal_maybe (void); COLORREF mswindows_string_to_color (const Ibyte *name); @@ -148,8 +144,6 @@ #ifdef HAVE_MENUBARS int mswindows_char_is_accelerator (struct frame *f, Ichar ch); -Lisp_Object mswindows_translate_menu_or_dialog_item (Lisp_Object item, - Ichar *accel); #endif #ifdef HAVE_TOOLBARS @@ -160,7 +154,8 @@ #endif Lisp_Object mswindows_handle_gui_wm_command (struct frame *f, HWND ctrl, LPARAM id); - +Lisp_Object mswindows_translate_menu_or_dialog_item (Lisp_Object item, + Ichar *accel); void mswindows_handle_destroyclipboard (void); Lisp_Object mswindows_handle_print_dialog_box (struct frame *f, Index: src/console-stream-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-stream-impl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/console-stream-impl.h 20 Jun 2002 21:18:23 -0000 1.1 +++ src/console-stream-impl.h 12 Jan 2003 11:08:09 -0000 1.2 @@ -1,6 +1,7 @@ /* Define stream specific console, device, and frame object for XEmacs. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 2002 Ben Wing. This file is part of XEmacs. @@ -37,6 +38,7 @@ FILE *out; FILE *err; int needs_newline; + Lisp_Object instream; }; #define CONSOLE_STREAM_DATA(con) CONSOLE_TYPE_DATA (con, stream) Index: src/console-stream.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-stream.c,v retrieving revision 1.19 retrieving revision 1.21 diff -u -r1.19 -r1.21 --- src/console-stream.c 20 Jun 2002 21:18:23 -0000 1.19 +++ src/console-stream.c 9 Feb 2003 09:33:47 -0000 1.21 @@ -1,6 +1,6 @@ /* Stream device functions. Copyright (C) 1995 Free Software Foundation, Inc. - Copyright (C) 1996, 2001 Ben Wing. + Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -48,6 +48,15 @@ Lisp_Object Vstdio_str; +static const struct memory_description stream_console_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct stream_console, instream) }, + { XD_END } +}; + +const struct sized_memory_description stream_console_data_description = { + sizeof (struct stream_console), stream_console_data_description_1 +}; + static void stream_init_console (struct console *con, Lisp_Object params) { @@ -55,11 +64,11 @@ struct stream_console *stream_con; if (CONSOLE_STREAM_DATA (con) == NULL) - CONSOLE_STREAM_DATA (con) = xnew (struct stream_console); + CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console); stream_con = CONSOLE_STREAM_DATA (con); - stream_con->needs_newline = 0; + stream_con->instream = Qnil; /* Open the specified console */ if (NILP (tty) || internal_equal (tty, Vstdio_str, 0)) @@ -207,12 +216,44 @@ return 1; } +/* We used to try and check for redisplaying on stream devices (e.g. in + redisplay_device(), and beg out if so. However, we didn't always manage + completely. Now we do manage completely, and to verify this we abort if + we try to display a stream device. This might fix some crashes I've + been getting in pdump -- the only difference between crash and non-crash + is a few changes to the redisplay critical-section handling. */ + +static void +stream_window_output_begin (struct window *w) +{ + abort (); +} + +static void +stream_window_output_end (struct window *w) +{ + abort (); +} + +static void +stream_frame_output_begin (struct frame *f) +{ + abort (); +} + +static void +stream_frame_output_end (struct frame *f) +{ + abort (); +} + static void stream_output_display_block (struct window *w, struct display_line *dl, int block, int start, int end, int start_pixpos, int cursor_start, int cursor_width, int cursor_height) { + abort (); } static void @@ -221,6 +262,7 @@ int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, Lisp_Object background_pixmap) { + abort (); } static int @@ -269,12 +311,16 @@ CONSOLE_HAS_METHOD (stream, init_frame_1); /* redisplay methods */ + CONSOLE_HAS_METHOD (stream, text_width); CONSOLE_HAS_METHOD (stream, left_margin_width); CONSOLE_HAS_METHOD (stream, right_margin_width); - CONSOLE_HAS_METHOD (stream, text_width); - CONSOLE_HAS_METHOD (stream, output_display_block); CONSOLE_HAS_METHOD (stream, divider_height); CONSOLE_HAS_METHOD (stream, eol_cursor_width); + CONSOLE_HAS_METHOD (stream, window_output_begin); + CONSOLE_HAS_METHOD (stream, window_output_end); + CONSOLE_HAS_METHOD (stream, frame_output_begin); + CONSOLE_HAS_METHOD (stream, frame_output_end); + CONSOLE_HAS_METHOD (stream, output_display_block); CONSOLE_HAS_METHOD (stream, clear_region); CONSOLE_HAS_METHOD (stream, flash); CONSOLE_HAS_METHOD (stream, ring_bell); Index: src/console-stream.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-stream.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/console-stream.h 20 Jun 2002 21:18:24 -0000 1.6 +++ src/console-stream.h 12 Jan 2003 11:08:09 -0000 1.7 @@ -1,6 +1,7 @@ /* Define stream specific console, device, and frame object for XEmacs. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 2002 Ben Wing. This file is part of XEmacs. @@ -27,6 +28,8 @@ #define INCLUDED_console_stream_h_ #include "console.h" + +extern const struct sized_memory_description stream_console_data_description; extern Lisp_Object Vterminal_console, Vterminal_frame, Vterminal_device; Index: src/console-tty.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-tty.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- src/console-tty.c 20 Jun 2002 21:18:24 -0000 1.28 +++ src/console-tty.c 12 Jan 2003 11:08:09 -0000 1.29 @@ -49,6 +49,17 @@ Lisp_Object Qterminal_type; Lisp_Object Qcontrolling_process; +static const struct memory_description tty_console_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct tty_console, terminal_type) }, + { XD_LISP_OBJECT, offsetof (struct tty_console, instream) }, + { XD_LISP_OBJECT, offsetof (struct tty_console, outstream) }, + { XD_END } +}; + +const struct sized_memory_description tty_console_data_description = { + sizeof (struct tty_console), tty_console_data_description_1 +}; + static void allocate_tty_console_struct (struct console *con) Index: src/console-tty.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-tty.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/console-tty.h 20 Jun 2002 21:18:24 -0000 1.12 +++ src/console-tty.h 12 Jan 2003 11:08:10 -0000 1.13 @@ -1,6 +1,6 @@ /* Define TTY specific console, device, and frame object for XEmacs. Copyright (C) 1995 Board of Trustees, University of Illinois. - Copyright (C) 1996 Ben Wing. + Copyright (C) 1996, 2002 Ben Wing. This file is part of XEmacs. @@ -50,6 +50,16 @@ void send_string_to_tty_console (struct console *c, unsigned char *str, int len); +/*************** Prototypes from console-tty.c ****************/ + +extern const struct sized_memory_description tty_console_data_description; + + +/*************** Prototypes from objects-tty.c ****************/ + +extern const struct sized_memory_description tty_color_instance_data_description; +extern const struct sized_memory_description tty_font_instance_data_description; + /*************** Prototypes from redisplay-tty.c ****************/ @@ -79,6 +89,5 @@ Error_Behavior errb); Lisp_Object tty_canonicalize_device_connection (Lisp_Object connection, Error_Behavior errb); -struct console * tty_find_console_from_fd (int fd); #endif /* INCLUDED_console_tty_h_ */ Index: src/console-x.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-x.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/console-x.h 20 Jun 2002 21:18:24 -0000 1.17 +++ src/console-x.h 12 Jan 2003 11:08:10 -0000 1.18 @@ -65,6 +65,12 @@ XtGetValues (widget, &al, 1); \ } while (0) +#ifdef __cplusplus +#define X_CLASSFIELD c_class +#else +#define X_CLASSFIELD class +#endif + /* Variables associated with the X display frame this emacs is using. */ extern XtAppContext Xt_app_con; @@ -98,6 +104,7 @@ void x_wm_set_variable_size (Widget wmshell, int width, int height); const char *x_event_name (int event_type); +int check_if_pending_expose_event (struct device *d); int x_error_handler (Display *disp, XErrorEvent *event); void expect_x_error (Display *dpy); int x_error_occurred_p (Display *dpy); @@ -130,7 +137,6 @@ void x_init_modifier_mapping (struct device *d); int x_frame_window_state (struct frame *f); - #define X_ERROR_OCCURRED(dpy, body) \ (expect_x_error (dpy), body, x_error_occurred_p (dpy)) Index: src/console.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- src/console.c 29 Jul 2002 09:21:15 -0000 1.31 +++ src/console.c 12 Jan 2003 11:08:10 -0000 1.32 @@ -38,6 +38,7 @@ #include "sysdep.h" #include "window.h" +#include "console-stream-impl.h" #ifdef HAVE_TTY #include "console-tty-impl.h" #endif @@ -106,75 +107,35 @@ -#ifdef USE_KKCC - -static const struct lrecord_description empty_condata_description [] = { - { XD_END } -}; - -static const struct lrecord_description tty_condata_description [] = { - { XD_LISP_OBJECT, offsetof (struct tty_console, terminal_type) }, - { XD_LISP_OBJECT, offsetof (struct tty_console, instream) }, - { XD_LISP_OBJECT, offsetof (struct tty_console, outstream) }, - { XD_END } -}; - -static const struct struct_description condata_description []= { - { dead_console, empty_condata_description }, - { tty_console, tty_condata_description }, - { gtk_console, empty_condata_description }, - { x_console, empty_condata_description }, - { mswindows_console, empty_condata_description }, - { stream_console, empty_condata_description }, - { XD_END } -}; - -static const struct lrecord_description conmeths_description_1 [] = { - { XD_LISP_OBJECT, offsetof (struct console_methods, symbol) }, - /*{ XD_LISP_OBJECT, offsetof (struct console_methods, predicate_symbol) }, - { XD_LISP_OBJECT, offsetof (struct console_methods, image_conversion_list) },*/ +static const struct memory_description console_data_description_1 []= { +#ifdef HAVE_TTY + { XD_STRUCT_PTR, tty_console, 1, &tty_console_data_description}, +#endif + { XD_STRUCT_PTR, stream_console, 1, &stream_console_data_description}, { XD_END } }; -static const struct struct_description conmeths_description = { - sizeof (struct console_methods), - conmeths_description_1 +static const struct sized_memory_description console_data_description = { + sizeof (void *), console_data_description_1 }; -static const struct lrecord_description console_description [] = { +static const struct memory_description console_description [] = { { XD_INT, offsetof (struct console, contype) }, - { XD_LISP_OBJECT, offsetof (struct console, name) }, - { XD_LISP_OBJECT, offsetof (struct console, connection) }, - { XD_LISP_OBJECT, offsetof (struct console, canon_connection) }, - { XD_LISP_OBJECT, offsetof (struct console, device_list) }, - { XD_LISP_OBJECT, offsetof (struct console, selected_device) }, - { XD_LISP_OBJECT, offsetof (struct console, last_nonminibuf_frame) }, - { XD_LISP_OBJECT, offsetof (struct console, overriding_terminal_local_map) }, - { XD_LISP_OBJECT, offsetof (struct console, last_command) }, - { XD_LISP_OBJECT, offsetof (struct console, prefix_arg) }, - { XD_LISP_OBJECT, offsetof (struct console, command_builder) }, - { XD_LISP_OBJECT, offsetof (struct console, defining_kbd_macro) }, - { XD_LISP_OBJECT, offsetof (struct console, kbd_macro_builder) }, - { XD_LISP_OBJECT, offsetof (struct console, last_kbd_macro) }, -#ifdef HAVE_TTY - { XD_LISP_OBJECT, offsetof (struct console, tty_erase_char) }, -#endif - { XD_LISP_OBJECT, offsetof (struct console, default_minibuffer_frame) }, - { XD_LISP_OBJECT, offsetof (struct console, function_key_map) }, - { XD_STRUCT_PTR, offsetof (struct console, conmeths), 1, &conmeths_description }, +#define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (struct console, x) }, +#include "conslots.h" + { XD_STRUCT_PTR, offsetof (struct console, conmeths), 1, + &console_methods_description }, { XD_UNION, offsetof (struct console, console_data), - XD_INDIRECT (0, 0), condata_description }, + XD_INDIRECT (0, 0), &console_data_description }, { XD_END } }; -#endif /* USE_KKCC */ - static Lisp_Object mark_console (Lisp_Object obj) { struct console *con = XCONSOLE (obj); -#define MARKED_SLOT(x) mark_object (con->x) +#define MARKED_SLOT(x) mark_object (con->x); #include "conslots.h" /* Can be zero for Vconsole_defaults, Vconsole_local_symbols */ @@ -204,20 +165,26 @@ write_fmt_string (printcharfun, " 0x%x>", con->header.uid); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("console", console, 0, /*dumpable-flag*/ mark_console, print_console, 0, 0, 0, console_description, struct console); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("console", console, - mark_console, print_console, 0, 0, 0, 0, - struct console); -#endif /* not USE_KKCC */ + +static void +set_quit_events (struct console *con, Lisp_Object key) +{ + /* Make sure to run Fcharacter_to_event() *BEFORE* setting QUIT_CHAR, + so that nothing is changed when invalid values trigger an error! */ + con->quit_event = Fcharacter_to_event (key, Qnil, wrap_console (con), Qnil); + con->quit_char = key; + con->critical_quit_event = Fcopy_event (con->quit_event, Qnil); + upshift_event (con->critical_quit_event); +} + static struct console * -allocate_console (void) +allocate_console (Lisp_Object type) { Lisp_Object console; struct console *con = alloc_lcrecord_type (struct console, &lrecord_console); @@ -228,9 +195,11 @@ console = wrap_console (con); GCPRO1 (console); - con->quit_char = 7; /* C-g */ + con->conmeths = decode_console_type (type, ERROR_ME); + con->contype = get_console_variant (type); con->command_builder = allocate_command_builder (console, 1); con->function_key_map = Fmake_sparse_keymap (Qnil); + set_quit_events (con, make_char (7)); /* C-g */ UNGCPRO; return con; @@ -263,39 +232,27 @@ return 0; } -#ifdef USE_KKCC enum console_variant get_console_variant (Lisp_Object type) { if (EQ (type, Qtty)) - { - return tty_console; - } + return tty_console; if (EQ (type, Qgtk)) - { - return gtk_console; - } + return gtk_console; if (EQ (type, Qx)) - { - return x_console; - } + return x_console; if (EQ (type, Qmswindows)) - { - return mswindows_console; - } + return mswindows_console; if (EQ (type, Qstream)) - { - return stream_console; - } + return stream_console; abort (); /* should never happen */ return dead_console; } -#endif /* USE_KKCC */ int valid_console_type_p (Lisp_Object type) @@ -593,16 +550,11 @@ if (!NILP (console)) return console; - con = allocate_console (); + con = allocate_console (type); console = wrap_console (con); GCPRO1 (console); - con->conmeths = decode_console_type (type, ERROR_ME); -#ifdef USE_KKCC - con->contype = get_console_variant (type); -#endif /* USE_KKCC */ - CONSOLE_NAME (con) = name; CONSOLE_CONNECTION (con) = semi_canonicalize_console_connection (con->conmeths, connection, @@ -701,7 +653,7 @@ { zero_lcrecord (con); -#define MARKED_SLOT(x) con->x = zap +#define MARKED_SLOT(x) con->x = zap; #include "conslots.h" } @@ -858,6 +810,7 @@ them. */ nuke_all_console_slots (con, Qnil); con->conmeths = dead_console_methods; + con->contype = dead_console; note_object_deleted (console); UNGCPRO; @@ -1133,7 +1086,7 @@ DEFUN ("set-input-mode", Fset_input_mode, 3, 5, 0, /* Set mode of reading keyboard input. -First arg is ignored, for backward compatibility. +First arg (formerly INTERRUPT-INPUT) is ignored, for backward compatibility. Second arg FLOW non-nil means use ^S/^Q flow control for output to terminal (no effect except in CBREAK mode). Third arg META t means accept 8-bit input (for a Meta key). @@ -1155,9 +1108,10 @@ if (!NILP (quit)) { - CHECK_CHAR_COERCE_INT (quit); - CONSOLE_QUIT_CHAR (con) = - ((unsigned int) XCHAR (quit)) & (meta_key ? 0377 : 0177); + if (CHAR_OR_CHAR_INTP (quit) && !meta_key) + set_quit_events (con, make_char (XCHAR_OR_CHAR_INT (quit) & 0177)); + else + set_quit_events (con, quit); } #ifdef HAVE_TTY @@ -1193,7 +1147,7 @@ (console)) { struct console *con = decode_console (console); - Lisp_Object flow, meta, quit; + Lisp_Object flow, meta; #ifdef HAVE_TTY flow = CONSOLE_TTY_P (con) && TTY_FLAGS (con).flow_control ? Qt : Qnil; @@ -1205,9 +1159,8 @@ flow = Qnil; meta = Qt; #endif - quit = make_char (CONSOLE_QUIT_CHAR (con)); - return list4 (Qnil, flow, meta, quit); + return list4 (Qnil, flow, meta, CONSOLE_QUIT_CHAR (con)); } @@ -1255,35 +1208,35 @@ DEFSYMBOL (Qsuspend_resume_hook); } -static const struct lrecord_description cte_description_1[] = { +static const struct memory_description cte_description_1[] = { { XD_LISP_OBJECT, offsetof (console_type_entry, symbol) }, { XD_STRUCT_PTR, offsetof (console_type_entry, meths), 1, &console_methods_description }, { XD_END } }; -static const struct struct_description cte_description = { +static const struct sized_memory_description cte_description = { sizeof (console_type_entry), cte_description_1 }; -static const struct lrecord_description cted_description_1[] = { +static const struct memory_description cted_description_1[] = { XD_DYNARR_DESC (console_type_entry_dynarr, &cte_description), { XD_END } }; -const struct struct_description cted_description = { +const struct sized_memory_description cted_description = { sizeof (console_type_entry_dynarr), cted_description_1 }; -static const struct lrecord_description console_methods_description_1[] = { +static const struct memory_description console_methods_description_1[] = { { XD_LISP_OBJECT, offsetof (struct console_methods, symbol) }, { XD_LISP_OBJECT, offsetof (struct console_methods, predicate_symbol) }, { XD_LISP_OBJECT, offsetof (struct console_methods, image_conversion_list) }, { XD_END } }; -const struct struct_description console_methods_description = { +const struct sized_memory_description console_methods_description = { sizeof (struct console_methods), console_methods_description_1 }; @@ -1412,7 +1365,9 @@ /* Set up the non-nil default values of various console slots. Must do these before making the first console. */ - /* #### Anything needed here? */ + + /* ... Nothing here for the moment. + #### Console-local variables should probably be eliminated.*/ { /* 0 means var is always local. Default used only at creation. @@ -1481,12 +1436,12 @@ } -static const struct lrecord_description console_slots_description_1[] = { +static const struct memory_description console_slots_description_1[] = { { XD_LISP_OBJECT_ARRAY, 0, CONSOLE_SLOTS_COUNT }, { XD_END } }; -static const struct struct_description console_slots_description = { +static const struct sized_memory_description console_slots_description = { CONSOLE_SLOTS_SIZE, console_slots_description_1 }; @@ -1594,6 +1549,6 @@ if ((XINT (console_local_flags.slot) != -2 && \ XINT (console_local_flags.slot) != -3) \ != !(NILP (XCONSOLE (Vconsole_local_symbols)->slot))) \ - abort () + abort (); #include "conslots.h" } Index: src/console.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- src/console.h 29 Jul 2002 09:21:15 -0000 1.39 +++ src/console.h 12 Jan 2003 11:08:10 -0000 1.40 @@ -46,7 +46,6 @@ /* GCC does not like forward enum declaration. This needs to be defined here. What a disgust! */ -#ifdef USE_KKCC enum console_variant { dead_console, @@ -57,8 +56,6 @@ stream_console }; -#endif /* USE_KKCC */ - enum device_metrics { DM_color_default, DM_color_select, DM_color_balloon, DM_color_3d_face, @@ -105,10 +102,10 @@ } while (0) #define CDFW_CONSOLE(obj) \ - (WINDOWP (obj) ? WINDOW_CONSOLE (XWINDOW (obj)) \ - : (FRAMEP (obj) ? FRAME_CONSOLE (XFRAME (obj)) \ - : (DEVICEP (obj) ? DEVICE_CONSOLE (XDEVICE (obj)) \ - : (CONSOLEP (obj) ? obj \ + ((WINDOWP (obj) && WINDOW_LIVE_P (XWINDOW(obj))) ? WINDOW_CONSOLE (XWINDOW (obj)) \ + : ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj))) ? FRAME_CONSOLE (XFRAME (obj)) \ + : ((DEVICEP (obj) && DEVICE_LIVE_P (XDEVICE (obj))) ? DEVICE_CONSOLE (XDEVICE (obj)) \ + : ((CONSOLEP (obj) && CONSOLE_LIVE_P (XCONSOLE (obj))) ? obj \ : Qnil)))) #define CONSOLE_LOOP(concons) LIST_LOOP (concons, Vconsole_list) @@ -134,9 +131,7 @@ struct console_methods *decode_console_type (Lisp_Object type, Error_Behavior errb); -#ifdef USE_KKCC enum console_variant get_console_variant (Lisp_Object type); -#endif /* USE_KKCC */ void delete_console_internal (struct console *con, int force, int from_kill_emacs, int from_io_error); Index: src/data.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/data.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- src/data.c 12 Nov 2002 18:58:27 -0000 1.44 +++ src/data.c 12 Jan 2003 11:08:10 -0000 1.45 @@ -739,7 +739,7 @@ range_error: args_out_of_range (array, index_); - RETURN_NOT_REACHED (Qnil) + RETURN_NOT_REACHED (Qnil); } DEFUN ("aset", Faset, 3, 3, 0, /* @@ -792,7 +792,7 @@ range_error: args_out_of_range (array, index_); - RETURN_NOT_REACHED (Qnil) + RETURN_NOT_REACHED (Qnil); } @@ -1612,26 +1612,18 @@ return result; } -static const struct lrecord_description weak_list_description[] = { +static const struct memory_description weak_list_description[] = { { XD_LISP_OBJECT, offsetof (struct weak_list, list) }, { XD_LO_LINK, offsetof (struct weak_list, next_weak) }, { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, 1, /*dumpable-flag*/ mark_weak_list, print_weak_list, 0, weak_list_equal, weak_list_hash, weak_list_description, struct weak_list); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, - mark_weak_list, print_weak_list, - 0, weak_list_equal, weak_list_hash, - weak_list_description, - struct weak_list); -#endif /* not USE_KKCC */ /* -- we do not mark the list elements (either the elements themselves or the cons cells that hold them) in the normal marking phase. @@ -1906,7 +1898,7 @@ if (EQ (symbol, Qfull_assoc)) return WEAK_LIST_FULL_ASSOC; invalid_constant ("Invalid weak list type", symbol); - RETURN_NOT_REACHED (WEAK_LIST_SIMPLE) + RETURN_NOT_REACHED (WEAK_LIST_SIMPLE); } static Lisp_Object @@ -2083,25 +2075,17 @@ return result; } -static const struct lrecord_description weak_box_description[] = { +static const struct memory_description weak_box_description[] = { { XD_LO_LINK, offsetof (struct weak_box, value) }, { XD_END} }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("weak_box", weak_box, 0, /*dumpable-flag*/ mark_weak_box, print_weak_box, 0, weak_box_equal, weak_box_hash, weak_box_description, struct weak_box); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("weak_box", weak_box, - mark_weak_box, print_weak_box, - 0, weak_box_equal, weak_box_hash, - weak_box_description, - struct weak_box); -#endif /* not USE_KKCC */ DEFUN ("make-weak-box", Fmake_weak_box, 1, 1, 0, /* Return a new weak box from value CONTENTS. @@ -2280,27 +2264,22 @@ return result; } -static const struct lrecord_description ephemeron_description[] = { - { XD_LISP_OBJECT, offsetof(struct ephemeron, key)}, - { XD_LISP_OBJECT, offsetof(struct ephemeron, cons_chain)}, - { XD_LISP_OBJECT, offsetof(struct ephemeron, value)}, +static const struct memory_description ephemeron_description[] = { + { XD_LISP_OBJECT, offsetof(struct ephemeron, key), + 0, 0, XD_FLAG_NO_KKCC }, + { XD_LISP_OBJECT, offsetof(struct ephemeron, cons_chain), + 0, 0, XD_FLAG_NO_KKCC }, + { XD_LISP_OBJECT, offsetof(struct ephemeron, value), + 0, 0, XD_FLAG_NO_KKCC }, { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("ephemeron", ephemeron, 0, /*dumpable-flag*/ mark_ephemeron, print_ephemeron, 0, ephemeron_equal, ephemeron_hash, ephemeron_description, struct ephemeron); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("ephemeron", ephemeron, - mark_ephemeron, print_ephemeron, - 0, ephemeron_equal, ephemeron_hash, - ephemeron_description, - struct ephemeron); -#endif /* not USE_KKCC */ DEFUN ("make-ephemeron", Fmake_ephemeron, 2, 3, 0, /* Return a new ephemeron with key KEY, value CONTENTS, and finalizer FINALIZER. Index: src/database.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/database.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- src/database.c 4 Dec 2002 13:54:45 -0000 1.24 +++ src/database.c 12 Jan 2003 11:08:10 -0000 1.25 @@ -142,12 +142,10 @@ return db; } -#ifdef USE_KKCC -static const struct lrecord_description database_description[] = { +static const struct memory_description database_description[] = { { XD_LISP_OBJECT, offsetof (struct Lisp_Database, fname) }, { XD_END} }; -#endif /* USE_KKCC */ static Lisp_Object mark_database (Lisp_Object object) @@ -189,19 +187,12 @@ db->funcs->close (db); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("database", database, 0, /*dumpable-flag*/ mark_database, print_database, finalize_database, 0, 0, database_description, Lisp_Database); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("database", database, - mark_database, print_database, - finalize_database, 0, 0, 0, - Lisp_Database); -#endif /* not USE_KKCC */ DEFUN ("close-database", Fclose_database, 1, 1, 0, /* Close database DATABASE. Index: src/debug.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/debug.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/debug.c 24 May 2001 07:51:05 -0000 1.7 +++ src/debug.c 12 Jan 2003 11:08:10 -0000 1.8 @@ -56,13 +56,13 @@ }; static Lisp_Object -xemacs_debug_loop (enum debug_loop op, Lisp_Object class, Lisp_Object type) +xemacs_debug_loop (enum debug_loop op, Lisp_Object class_, Lisp_Object type) { 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_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; \ @@ -94,12 +94,12 @@ DEFUN ("add-debug-class-to-check", Fadd_debug_class_to_check, 1, 1, 0, /* Add a debug class to the list of active classes. */ - (class)) + (class_)) { - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (X_VALIDATE, class_, Qnil))) invalid_argument ("No such debug class exists", Qunbound); else - xemacs_debug_loop (X_ADD, class, Qnil); + xemacs_debug_loop (X_ADD, class_, Qnil); return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); } @@ -107,12 +107,12 @@ DEFUN ("delete-debug-class-to-check", Fdelete_debug_class_to_check, 1, 1, 0, /* Delete a debug class from the list of active classes. */ - (class)) + (class_)) { - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (X_VALIDATE, class_, Qnil))) invalid_argument ("No such debug class exists", Qunbound); else - xemacs_debug_loop (X_DELETE, class, Qnil); + xemacs_debug_loop (X_DELETE, class_, Qnil); return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); } @@ -145,7 +145,7 @@ /* Make sure all objects in the list are valid. If anyone is not valid, reject the entire list without doing anything. */ - LIST_LOOP (rest, classes ) + LIST_LOOP (rest, classes) { if (NILP (xemacs_debug_loop (X_VALIDATE, XCAR (rest), Qnil))) sferror ("Invalid object in class list", Qunbound); @@ -162,26 +162,26 @@ TYPES should be an integer representing the or'd value of all desired types. Lists of defined types and their values are located in the source code. */ - (class, type)) + (class_, type)) { CHECK_INT (type); - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (X_VALIDATE, class_, Qnil))) invalid_argument ("Invalid debug class", Qunbound); - xemacs_debug_loop (X_SETTYPE, class, type); + xemacs_debug_loop (X_SETTYPE, class_, type); - return (xemacs_debug_loop (X_TYPE, class, Qnil)); + return (xemacs_debug_loop (X_TYPE, class_, Qnil)); } DEFUN ("debug-types-being-checked", Fdebug_types_being_checked, 1, 1, 0, /* For the given CLASS, return the associated type value. */ - (class)) + (class_)) { - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (X_VALIDATE, class_, Qnil))) invalid_argument ("Invalid debug class", Qunbound); - return (xemacs_debug_loop (X_TYPE, class, Qnil)); + return (xemacs_debug_loop (X_TYPE, class_, Qnil)); } void Index: src/debug.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/debug.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/debug.h 23 May 2001 09:59:43 -0000 1.4 +++ src/debug.h 12 Jan 2003 11:08:10 -0000 1.5 @@ -53,10 +53,10 @@ extern struct debug_classes active_debug_classes; -#define DASSERT(class, desired_type, action, assertion) do \ +#define DASSERT(class_, desired_type, action, assertion) do \ { \ - if (active_debug_classes.##class \ - && (active_debug_classes.types_of_##class & desired_type)) \ + if (active_debug_classes.##class_ \ + && (active_debug_classes.types_of_##class_ & desired_type)) \ { \ if (! (assertion)) \ { \ @@ -70,7 +70,7 @@ } while (0) #else /* !DEBUG_XEMACS */ -#define DASSERT(class, desired_type, action, assertion) ((void) 0) +#define DASSERT(class_, desired_type, action, assertion) ((void) 0) #endif /* !DEBUG_XEMACS */ Index: src/depend =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/depend,v retrieving revision 1.34 retrieving revision 1.37 diff -u -r1.34 -r1.37 --- src/depend 18 Nov 2002 06:52:37 -0000 1.34 +++ src/depend 15 Feb 2003 10:16:04 -0000 1.37 @@ -1,150 +1,166 @@ +## This file is automatically generated by `make-src-depend'. Do not modify. + #if defined(USE_UNION_TYPE) LISP_UNION_H=lisp-union.h #else LISP_UNION_H=lisp-disunion.h #endif + +#if defined(QUICK_BUILD) +CONFIG_H= +LISP_H= +#else +CONFIG_H=config.h LISP_H=lisp.h config.h general-slots.h lrecord.h symeval.h symsinit.h text.h $(LISP_UNION_H) +#endif + #if defined(HAVE_MS_WINDOWS) console-msw.o: $(LISP_H) conslots.h console-impl.h console-msw-impl.h console-msw.h console.h events.h intl-auto-encap-win32.h opaque.h systime.h syswindows.h -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 opaque.h redisplay.h sysdep.h systime.h syswindows.h +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-tty.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 opaque.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.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 opaque.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 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 opaque.h redisplay.h scrollbar.h specifier.h systime.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-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 +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 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 opaque.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h syswindows.h window-impl.h window.h winslots.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 -select-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 file-coding.h frame-impl.h frame.h frameslots.h intl-auto-encap-win32.h opaque.h redisplay.h select.h syswindows.h +select-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h file-coding.h frame-impl.h frame.h frameslots.h intl-auto-encap-win32.h opaque.h redisplay.h select.h syswindows.h toolbar-msw.o: $(LISP_H) charset.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h elhash.h faces.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h syswindows.h toolbar.h window-impl.h window.h winslots.h #endif +#if defined(HAVE_XLIKE) +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 +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_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 -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 opaque.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 +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 opaque.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 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 +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 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 +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 +xgccache.o: $(LISP_H) hash.h xgccache.h #endif #if defined(HAVE_TTY) -console-tty.o: $(LISP_H) charset.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h faces.h file-coding.h frame.h glyphs.h lstream.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systty.h window-impl.h window.h winslots.h -device-tty.o: $(LISP_H) charset.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h events.h faces.h frame.h lstream.h opaque.h redisplay.h sysdep.h sysfile.h syssignal.h systime.h systty.h -event-tty.o: $(LISP_H) conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h events.h frame.h opaque.h process.h redisplay.h sysproc.h syssignal.h systime.h systty.h syswait.h -frame-tty.o: $(LISP_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-impl.h frame.h frameslots.h opaque.h redisplay.h systime.h systty.h +console-tty.o: $(LISP_H) charset.h coding-system-slots.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h faces.h file-coding.h frame.h glyphs.h lstream.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systty.h window-impl.h window.h winslots.h +device-tty.o: $(LISP_H) charset.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h events.h faces.h frame.h lstream.h redisplay.h sysdep.h sysfile.h syssignal.h systime.h systty.h +event-tty.o: $(LISP_H) conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h events.h frame.h process.h redisplay.h sysproc.h syssignal.h systime.h systty.h syswait.h +frame-tty.o: $(LISP_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-impl.h frame.h frameslots.h redisplay.h systime.h systty.h objects-tty.o: $(LISP_H) charset.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h insdel.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h specifier.h systty.h -redisplay-tty.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-impl.h device.h devslots.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs.h lstream.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h window-impl.h window.h winslots.h +redisplay-tty.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-impl.h device.h devslots.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs.h lstream.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h window-impl.h window.h winslots.h #endif #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 opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h window-impl.h window.h winslots.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 -event-gtk.o: $(LISP_H) blocktype.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-tty.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h event-gtk.h 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 opaque.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 opaque.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.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 -glyphs-gtk.o: $(LISP_H) bitmaps.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 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 +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 +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 +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 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 +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 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-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 opaque.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-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 #endif #if defined(HAVE_DATABASE) database.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h database.h sysfile.h #endif #if defined(MULE) -mule-canna.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h file-coding.h -mule-ccl.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h file-coding.h mule-ccl.h +mule-canna.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h file-coding.h +mule-ccl.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h file-coding.h mule-ccl.h mule-charset.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h elhash.h faces.h lstream.h mule-ccl.h objects.h -mule-coding.o: $(LISP_H) charset.h file-coding.h mule-ccl.h +mule-coding.o: $(LISP_H) charset.h coding-system-slots.h file-coding.h mule-ccl.h mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h redisplay.h scrollbar.h sysdep.h window.h #endif #if defined(EXTERNAL_WIDGET) ExternalClient-Xlib.o: extw-Xlib.h -ExternalClient.o: ExternalClient.h ExternalClientP.h config.h extw-Xlib.h extw-Xt.h xintrinsicp.h -ExternalShell.o: ExternalShell.h ExternalShellP.h config.h extw-Xlib.h extw-Xt.h xintrinsic.h xintrinsicp.h -extw-Xlib.o: config.h extw-Xlib.h -extw-Xt.o: config.h extw-Xlib.h extw-Xt.h +ExternalClient.o: $(CONFIG_H) ExternalClient.h ExternalClientP.h extw-Xlib.h extw-Xt.h xintrinsicp.h +ExternalShell.o: $(CONFIG_H) ExternalShell.h ExternalShellP.h extw-Xlib.h extw-Xt.h xintrinsic.h xintrinsicp.h +extw-Xlib.o: $(CONFIG_H) extw-Xlib.h +extw-Xt.o: $(CONFIG_H) extw-Xlib.h extw-Xt.h #endif -EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h 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: EmacsManager.h EmacsManagerP.h config.h xintrinsicp.h xmmanagerp.h -EmacsShell-sub.o: EmacsShell.h EmacsShellP.h config.h xintrinsic.h xintrinsicp.h -EmacsShell.o: EmacsShell.h ExternalShell.h config.h xintrinsicp.h abbrev.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h insdel.h redisplay.h scrollbar.h syntax.h window.h -alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h glyphs.h opaque.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h window-impl.h window.h winslots.h +alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console-stream.h console.h device.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h glyphs.h lstream.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h window-impl.h window.h winslots.h alloca.o: $(LISP_H) -balloon_help.o: balloon_help.h config.h xintrinsic.h blocktype.o: $(LISP_H) blocktype.h -buffer.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h insdel.h intl-auto-encap-win32.h lstream.h ndir.h process.h redisplay.h scrollbar.h select.h specifier.h syntax.h sysdir.h sysfile.h syswindows.h window.h +buffer.o: $(LISP_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 extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h insdel.h intl-auto-encap-win32.h lstream.h ndir.h process.h redisplay.h scrollbar.h select.h specifier.h syntax.h sysdir.h sysfile.h syswindows.h window.h bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h opaque.h redisplay.h scrollbar.h syntax.h window.h -callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h events.h insdel.h opaque.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h +callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h events.h insdel.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h casefiddle.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h insdel.h syntax.h casetab.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h opaque.h chartab.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h syntax.h cm.o: $(LISP_H) conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h frame.h lstream.h redisplay.h systty.h -cmdloop.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-msw.h console.h device.h events.h frame.h intl-auto-encap-win32.h opaque.h redisplay.h scrollbar.h systime.h syswindows.h window.h +cmdloop.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-msw.h console.h device.h events.h frame.h intl-auto-encap-win32.h redisplay.h scrollbar.h systime.h syswindows.h window.h cmds.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h extents.h insdel.h syntax.h -console-stream.o: $(LISP_H) conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h opaque.h redisplay.h scrollbar.h sysdep.h sysfile.h systime.h systty.h window.h -console.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-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h opaque.h redisplay.h scrollbar.h sysdep.h systime.h systty.h window.h +console-stream.o: $(LISP_H) conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h redisplay.h scrollbar.h sysdep.h sysfile.h systime.h systty.h window.h +console.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.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 frame-impl.h frame.h frameslots.h redisplay.h scrollbar.h sysdep.h systime.h systty.h window.h data.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h sysfloat.h syssignal.h debug.o: $(LISP_H) bytecode.h debug.h -device.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-msw-impl.h console-msw.h console-tty-impl.h console-tty.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 intl-auto-encap-win32.h keymap.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h syswindows.h toolbar.h window.h xintrinsic.h +device.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 elhash.h events.h faces.h frame-impl.h frame.h frameslots.h keymap.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h dgif_lib.o: $(LISP_H) gifrlib.h sysfile.h dialog.o: $(LISP_H) conslots.h console-impl.h console.h frame-impl.h frame.h frameslots.h redisplay.h dired.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h elhash.h intl-auto-encap-win32.h ndir.h opaque.h regex.h syntax.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h syswindows.h -doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h file-coding.h insdel.h keymap.h lstream.h sysfile.h +doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h file-coding.h insdel.h keymap.h lstream.h sysfile.h doprnt.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h lstream.h dragdrop.o: $(LISP_H) dragdrop.h -dumper.o: $(LISP_H) console-stream.h console.h dumper.h elhash.h file-coding.h intl-auto-encap-win32.h specifier.h sysfile.h syswindows.h +dumper.o: $(LISP_H) coding-system-slots.h console-stream.h console.h elhash.h file-coding.h intl-auto-encap-win32.h lstream.h specifier.h sysfile.h syswindows.h dynarr.o: $(LISP_H) -ecrt0.o: config.h -editfns.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console.h device.h events.h frame.h insdel.h line-number.h ndir.h opaque.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h window.h +ecrt0.o: $(CONFIG_H) +editfns.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console.h device.h events.h frame.h insdel.h line-number.h ndir.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h window.h elhash.o: $(LISP_H) bytecode.h elhash.h opaque.h -emacs-marshals.o: hash.h -emacs-widget-accessors.o: -emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console-msw.h console.h dumper.h frame.h intl-auto-encap-win32.h paths.h process.h redisplay.h sysdep.h sysdll.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h -emodules.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h emodules.h file-coding.h frame.h insdel.h lstream.h redisplay.h scrollbar.h sysdep.h sysdll.h window.h +emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console-msw.h console.h frame.h intl-auto-encap-win32.h paths.h process.h redisplay.h sysdep.h sysdll.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h +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 redisplay.h scrollbar.h window.h -event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h charset.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 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 opaque.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-stream.o: $(LISP_H) blocktype.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 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 opaque.h process.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.h events.h lstream.h opaque.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-x.h console.h device.h events.h extents.h frame-impl.h frame.h frameslots.h glyphs.h keymap.h lstream.h opaque.h redisplay.h scrollbar.h specifier.h systime.h systty.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h -extents.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h debug.h device.h elhash.h extents-impl.h extents.h faces.h frame.h glyphs.h gutter.h insdel.h keymap.h opaque.h process.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.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-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 +extents.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h console.h debug.h device.h elhash.h extents-impl.h extents.h faces.h frame.h glyphs.h gutter.h insdel.h keymap.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h faces.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 elhash.h extents-impl.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h -file-coding.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h elhash.h file-coding.h insdel.h lstream.h opaque.h -fileio.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h events.h file-coding.h frame.h insdel.h intl-auto-encap-win32.h lstream.h ndir.h opaque.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h window-impl.h window.h winslots.h +file-coding.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h elhash.h file-coding.h insdel.h lstream.h opaque.h +fileio.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h console.h device.h events.h file-coding.h frame.h insdel.h intl-auto-encap-win32.h lstream.h ndir.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h window-impl.h window.h winslots.h filelock.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h ndir.h paths.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h filemode.o: $(LISP_H) sysfile.h floatfns.o: $(LISP_H) sysfloat.h syssignal.h fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h console.h device.h events.h extents.h frame.h insdel.h lstream.h opaque.h process.h redisplay.h sysfile.h sysproc.h syssignal.h systime.h 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 opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window-impl.h window.h winslots.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) getloadavg.o: $(LISP_H) sysfile.h syssignal.h gif_io.o: $(LISP_H) gifrlib.h sysfile.h -glade.o: bytecode.h -glyphs-eimage.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 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 +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 glyphs-shared.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h elhash.h faces.h frame.h glyphs.h imgproc.h insdel.h lstream.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h window-impl.h window.h winslots.h glyphs-widget.o: $(LISP_H) bytecode.h charset.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h faces.h frame.h glyphs.h gui.h insdel.h lstream.h objects.h opaque.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h 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 opaque.h process.h redisplay.h sysdep.h sysproc.h syssignal.h systime.h systty.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 +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 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 @@ -152,95 +168,92 @@ 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 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 +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 opaque.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.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 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 -intl-win32.o: $(LISP_H) charset.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h intl-auto-encap-win32.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syswindows.h window-impl.h window.h winslots.h +intl-win32.o: $(LISP_H) charset.h coding-system-slots.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h intl-auto-encap-win32.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syswindows.h window-impl.h window.h winslots.h intl.o: $(LISP_H) -keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h elhash.h events.h extents.h frame.h insdel.h keymap.h opaque.h redisplay.h scrollbar.h systime.h window.h -lastfile.o: config.h +keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h elhash.h events.h extents.h frame.h insdel.h keymap.h redisplay.h scrollbar.h systime.h window.h +lastfile.o: $(CONFIG_H) libinterface.o: $(LISP_H) gifrlib.h libinterface.h libsst.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h libsst.h sound.h sysfile.h line-number.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h line-number.h linuxplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h miscplay.h sound.h sysfile.h syssignal.h systty.h -lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h elhash.h file-coding.h intl-auto-encap-win32.h lstream.h opaque.h sysfile.h sysfloat.h syswindows.h +lread.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h elhash.h file-coding.h intl-auto-encap-win32.h lstream.h opaque.h profile.h sysfile.h sysfloat.h syswindows.h lstream.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h insdel.h lstream.h sysfile.h -macros.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device.h events.h frame.h keymap.h macros.h opaque.h redisplay.h scrollbar.h systime.h window.h -malloc.o: config.h getpagesize.h syssignal.h +macros.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device.h events.h frame.h keymap.h macros.h redisplay.h scrollbar.h systime.h window.h +malloc.o: $(CONFIG_H) getpagesize.h syssignal.h marker.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h -md5.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h file-coding.h lstream.h +md5.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h file-coding.h lstream.h menubar.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 gui.h keymap.h menubar.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h -minibuf.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-stream.h console.h events.h frame-impl.h frame.h frameslots.h insdel.h opaque.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h +minibuf.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-stream.h console.h events.h frame-impl.h frame.h frameslots.h insdel.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h miscplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h miscplay.h sound.h sysfile.h syssignal.h nas.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h sound.h sysdep.h syssignal.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 nt.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h intl-auto-encap-win32.h ndir.h process.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h ntheap.o: $(LISP_H) intl-auto-encap-win32.h sysdep.h syswindows.h ntplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h intl-auto-encap-win32.h sound.h sysfile.h syswindows.h -objects.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 elhash.h faces.h frame.h glyphs.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h +objects.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h elhash.h faces.h frame.h glyphs.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h systty.h window-impl.h window.h winslots.h offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h opaque.o: $(LISP_H) opaque.h print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h extents.h frame.h insdel.h intl-auto-encap-win32.h lstream.h opaque.h redisplay.h sysfile.h systty.h syswindows.h -process-nt.o: $(LISP_H) console-msw.h console.h hash.h intl-auto-encap-win32.h lstream.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 console.h events.h file-coding.h frame.h hash.h lstream.h ndir.h opaque.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 commands.h console.h device.h events.h file-coding.h frame.h hash.h insdel.h lstream.h opaque.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 +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 ralloc.o: $(LISP_H) getpagesize.h rangetab.o: $(LISP_H) rangetab.h -realpath.o: $(LISP_H) intl-auto-encap-win32.h sysfile.h syswindows.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) buffer.h bufslots.h casetab.h charset.h chartab.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 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 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 select.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 extents.h frame.h objects.h opaque.h redisplay.h select.h 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 opaque.h process.h redisplay.h sysdep.h sysfile.h syssignal.h systime.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 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 -strcpy.o: config.h +strcat.o: $(CONFIG_H) +strcmp.o: $(CONFIG_H) +strcpy.o: $(CONFIG_H) strftime.o: $(LISP_H) sunplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h sound.h sysdep.h sysfile.h syssignal.h sunpro.o: $(LISP_H) symbols.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h elhash.h syntax.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h extents.h syntax.h -sysdep.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.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 frame.h intl-auto-encap-win32.h ndir.h opaque.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h systty.h syswait.h syswindows.h window.h -sysdll.o: config.h sysdll.h +sysdep.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.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 frame.h intl-auto-encap-win32.h ndir.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h systty.h syswait.h syswindows.h window.h +sysdll.o: $(LISP_H) sysdll.h termcap.o: $(LISP_H) console.h device.h -terminfo.o: config.h +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) buffer.h bufslots.h casetab.h charset.h chartab.h file-coding.h lstream.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.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) -ui-byhand.o: gui.h undo.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h extents.h unexaix.o: $(LISP_H) getpagesize.h -unexalpha.o: config.h -unexapollo.o: config.h -unexconvex.o: config.h getpagesize.h +unexalpha.o: $(CONFIG_H) +unexapollo.o: $(CONFIG_H) +unexconvex.o: $(CONFIG_H) getpagesize.h unexcw.o: $(LISP_H) sysfile.h unexec.o: $(LISP_H) getpagesize.h -unexelf.o: config.h -unexelfsgi.o: config.h -unexenix.o: config.h -unexfreebsd.o: config.h -unexhp9k3.o: config.h sysdep.h syssignal.h +unexelf.o: $(CONFIG_H) +unexelfsgi.o: $(CONFIG_H) +unexenix.o: $(CONFIG_H) +unexfreebsd.o: $(CONFIG_H) +unexhp9k3.o: $(CONFIG_H) sysdep.h syssignal.h unexhp9k800.o: $(LISP_H) -unexmips.o: config.h getpagesize.h +unexmips.o: $(CONFIG_H) getpagesize.h unexnt.o: $(LISP_H) intl-auto-encap-win32.h sysfile.h syswindows.h -unexsunos4.o: config.h -unicode.o: $(LISP_H) charset.h file-coding.h opaque.h sysfile.h +unexsunos4.o: $(CONFIG_H) +unicode.o: $(LISP_H) charset.h coding-system-slots.h file-coding.h opaque.h sysfile.h vm-limit.o: $(LISP_H) mem-limits.h widget.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h win32.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console-msw.h console.h intl-auto-encap-win32.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h window.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 elhash.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gutter.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h -xgccache.o: $(LISP_H) hash.h xgccache.h -xmu.o: config.h +xmu.o: $(CONFIG_H) Index: src/device-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/device-gtk.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/device-gtk.c 20 Jun 2002 21:18:25 -0000 1.10 +++ src/device-gtk.c 12 Jan 2003 11:08:10 -0000 1.11 @@ -67,6 +67,18 @@ static void gtk_device_init_x_specific_cruft (struct device *d); +static const struct memory_description gtk_device_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct gtk_device, x_keysym_map_hashtable) }, + { XD_LISP_OBJECT, offsetof (struct gtk_device, WM_COMMAND_frame) }, + { XD_END } +}; + +extern const struct sized_memory_description gtk_device_data_description; + +const struct sized_memory_description gtk_device_data_description = { + sizeof (struct gtk_device), gtk_device_data_description_1 +}; + /************************************************************************/ /* helper functions */ Index: src/device-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/device-impl.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/device-impl.h 29 Jul 2002 09:21:16 -0000 1.3 +++ src/device-impl.h 12 Jan 2003 11:08:11 -0000 1.4 @@ -77,9 +77,8 @@ through device->console, but it's faster this way. */ struct console_methods *devmeths; -#ifdef USE_KKCC + /* Duplicates devmeths->symbol. See comment in struct console. */ enum console_variant devtype; -#endif /* USE_KKCC */ /* A structure of auxiliary data specific to the device type. struct x_device is used for X window frames; defined in console-x.h @@ -123,7 +122,7 @@ unsigned int on_console_p :1; unsigned int connected_to_nas_p :1; -#define MARKED_SLOT(x) Lisp_Object x +#define MARKED_SLOT(x) Lisp_Object x; #include "devslots.h" /* File descriptors for input and output. Much of the time Index: src/device-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/device-msw.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- src/device-msw.c 16 Aug 2002 08:15:33 -0000 1.49 +++ src/device-msw.c 12 Jan 2003 11:08:11 -0000 1.50 @@ -68,6 +68,17 @@ static Lisp_Object Q_selected_page_button; static Lisp_Object Qselected_page_button; +static const struct memory_description mswindows_device_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct mswindows_device, fontlist) }, + { XD_END } +}; + +extern const struct sized_memory_description mswindows_device_data_description; + +const struct sized_memory_description mswindows_device_data_description = { + sizeof (struct mswindows_device), mswindows_device_data_description_1 +}; + static Lisp_Object allocate_devmode (DEVMODEW *src_devmode, int do_copy, Lisp_Object src_name, struct device *d); @@ -1074,13 +1085,11 @@ /* devmode */ /************************************************************************/ -#ifdef USE_KKCC -static const struct lrecord_description devmode_description[] = { +static const struct memory_description devmode_description[] = { { XD_LISP_OBJECT, offsetof (struct Lisp_Devmode, printer_name) }, { XD_LISP_OBJECT, offsetof (struct Lisp_Devmode, device) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_devmode (Lisp_Object obj) @@ -1151,19 +1160,12 @@ internal_hash (dm->printer_name, depth + 1)); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("msprinter-settings", devmode, 0, /*dumpable-flag*/ mark_devmode, print_devmode, finalize_devmode, equal_devmode, hash_devmode, devmode_description, Lisp_Devmode); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("msprinter-settings", devmode, - mark_devmode, print_devmode, finalize_devmode, - equal_devmode, hash_devmode, 0/*description*/, - Lisp_Devmode); -#endif /* not USE_KKCC */ static Lisp_Object allocate_devmode (DEVMODEW* src_devmode, int do_copy, Index: src/device-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/device-x.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- src/device-x.c 20 Jun 2002 21:18:26 -0000 1.48 +++ src/device-x.c 12 Jan 2003 11:08:11 -0000 1.49 @@ -102,6 +102,18 @@ {"-fontset", "*FontSet", XrmoptionSepArg, NULL}, }; +static const struct memory_description x_device_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct x_device, x_keysym_map_hash_table) }, + { XD_LISP_OBJECT, offsetof (struct x_device, WM_COMMAND_frame) }, + { XD_END } +}; + +extern const struct sized_memory_description x_device_data_description; + +const struct sized_memory_description x_device_data_description = { + sizeof (struct x_device), x_device_data_description_1 +}; + /* Functions to synchronize mirroring resources and specifiers */ int in_resource_setting; @@ -244,7 +256,7 @@ { if (DEVICE_X_DEPTH(d) > 2) { - switch (DEVICE_X_VISUAL(d)->class) + switch (DEVICE_X_VISUAL(d)->X_CLASSFIELD) { case StaticGray: case GrayScale: @@ -372,9 +384,9 @@ { if ( left->colormap_size > right->colormap_size ) return 1; - if ( left->class > right->class ) + if ( left->X_CLASSFIELD > right->X_CLASSFIELD ) return 1; - else if ( left->class < right->class ) + else if ( left->X_CLASSFIELD < right->X_CLASSFIELD ) return -1; else return 0; @@ -393,7 +405,7 @@ XVisualInfo *vi_out = NULL; int out_count; - vi_in.class = visual_class; + vi_in.X_CLASSFIELD = visual_class; vi_in.screen = scrnum; vi_out = XGetVisualInfo (dpy, (VisualClassMask | VisualScreenMask), &vi_in, &out_count); @@ -744,7 +756,7 @@ { sprintf (buf1, "%s.privateColormap", app_name); sprintf (buf2, "%s.PrivateColormap", app_class); - if ((visual->class == PseudoColor) && + if ((visual->X_CLASSFIELD == PseudoColor) && (XrmGetResource (XtDatabase (dpy), buf1, buf2, &type, &value) == True)) cmap = XCopyColormapAndFree (dpy, DefaultColormap (dpy, screen)); @@ -1223,7 +1235,7 @@ static void construct_name_list (Display *display, Widget widget, char *fake_name, - char *fake_class, char *name, char *class) + char *fake_class, char *name, char *class_) { char *stack [100][2]; Widget this; @@ -1260,10 +1272,10 @@ &stack [count][1]); name [0] = 0; - class [0] = 0; + class_ [0] = 0; name_tail = name; - class_tail = class; + class_tail = class_; for (; count >= 0; count--) { strcat (name_tail, stack [count][0]); @@ -1292,7 +1304,7 @@ static void x_get_resource_prefix (Lisp_Object locale, Lisp_Object device, Display **display_out, Extbyte_dynarr *name, - Extbyte_dynarr *class) + Extbyte_dynarr *class_) { if (NILP (locale)) locale = Qglobal; @@ -1333,9 +1345,9 @@ name_len = strlen (appname); class_len = strlen (appclass); Dynarr_add_many (name, appname, name_len); - Dynarr_add_many (class, appclass, class_len); + Dynarr_add_many (class_, appclass, class_len); validify_resource_component (Dynarr_atp (name, 0), name_len); - validify_resource_component (Dynarr_atp (class, 0), class_len); + validify_resource_component (Dynarr_atp (class_, 0), class_len); } if (EQ (locale, Qglobal)) @@ -1345,14 +1357,14 @@ Dynarr_add_literal_string (name, ".buffer."); /* we know buffer is live; otherwise we got an error above. */ Dynarr_add_validified_lisp_string (name, Fbuffer_name (locale)); - Dynarr_add_literal_string (class, ".EmacsLocaleType.EmacsBuffer"); + Dynarr_add_literal_string (class_, ".EmacsLocaleType.EmacsBuffer"); } else if (FRAMEP (locale)) { Dynarr_add_literal_string (name, ".frame."); /* we know frame is live; otherwise we got an error above. */ Dynarr_add_validified_lisp_string (name, Fframe_name (locale)); - Dynarr_add_literal_string (class, ".EmacsLocaleType.EmacsFrame"); + Dynarr_add_literal_string (class_, ".EmacsLocaleType.EmacsFrame"); } else { @@ -1360,7 +1372,7 @@ Dynarr_add_literal_string (name, ".device."); /* we know device is live; otherwise we got an error above. */ Dynarr_add_validified_lisp_string (name, Fdevice_name (locale)); - Dynarr_add_literal_string (class, ".EmacsLocaleType.EmacsDevice"); + Dynarr_add_literal_string (class_, ".EmacsLocaleType.EmacsDevice"); } return; } @@ -1447,7 +1459,7 @@ returned value is the list (t) for true, (nil) for false, and is nil to mean ``unspecified''. */ - (name, class, type, locale, device, noerror)) + (name, class_, type, locale, device, noerror)) { Extbyte *name_string, *class_string; Extbyte *raw_result; @@ -1457,7 +1469,7 @@ Lisp_Object codesys; CHECK_STRING (name); - CHECK_STRING (class); + CHECK_STRING (class_); CHECK_SYMBOL (type); Dynarr_reset (name_Extbyte_dynarr); @@ -1473,7 +1485,7 @@ Dynarr_add (name_Extbyte_dynarr, '.'); Dynarr_add_lisp_string (name_Extbyte_dynarr, name, Qbinary); Dynarr_add (class_Extbyte_dynarr, '.'); - Dynarr_add_lisp_string (class_Extbyte_dynarr, class, Qbinary); + Dynarr_add_lisp_string (class_Extbyte_dynarr, class_, Qbinary); Dynarr_add (name_Extbyte_dynarr, '\0'); Dynarr_add (class_Extbyte_dynarr, '\0'); @@ -1500,7 +1512,7 @@ { maybe_signal_error_2 (Qstructure_formation_error, - "class list and name list must be the same length", name, class, + "class list and name list must be the same length", name, class_, Qresource, errb); return Qnil; } @@ -1641,7 +1653,7 @@ (device)) { Visual *vis = DEVICE_X_VISUAL (decode_x_device (device)); - switch (vis->class) + switch (vis->X_CLASSFIELD) { case StaticGray: return intern ("static-gray"); case GrayScale: return intern ("gray-scale"); Index: src/device.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/device.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- src/device.c 29 Jul 2002 09:21:16 -0000 1.27 +++ src/device.c 12 Jan 2003 11:08:11 -0000 1.28 @@ -45,19 +45,6 @@ #include "toolbar.h" #include "window.h" -#ifdef USE_KKCC -#include "console-tty-impl.h" -#ifdef HAVE_MS_WINDOWS -#include "console-msw-impl.h" -#endif -#ifdef HAVE_X_WINDOWS -#include "console-x-impl.h" -#endif -#ifdef HAVE_GTK -#include "console-gtk-impl.h" -#endif -#endif /* USE_KKCC */ - #ifdef HAVE_SCROLLBARS #include "scrollbar.h" #endif @@ -98,89 +85,45 @@ -#ifdef USE_KKCC +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 x_device_data_description; -static const struct lrecord_description empty_devdata_description [] = { - { XD_END } -}; - -static const struct lrecord_description mswindows_devdata_description [] = { -#ifdef HAVE_MS_WINDOWS - { XD_LISP_OBJECT, offsetof (struct mswindows_device, fontlist) }, -#endif - { XD_END } -}; - -static const struct lrecord_description gtk_devdata_description [] = { +static const struct memory_description device_data_description_1 []= { #ifdef HAVE_GTK - { XD_LISP_OBJECT, offsetof (struct gtk_device, x_keysym_map_hash_table) }, - { XD_LISP_OBJECT, offsetof (struct gtk_device, WM_COMMAND_frame) }, + { XD_STRUCT_PTR, gtk_console, 1, >k_device_data_description}, +#endif +#ifdef HAVE_MS_WINDOWS + { XD_STRUCT_PTR, mswindows_console, 1, &mswindows_device_data_description}, #endif - { XD_END } -}; - -static const struct lrecord_description x_devdata_description [] = { #ifdef HAVE_X_WINDOWS - { XD_LISP_OBJECT, offsetof (struct x_device, x_keysym_map_hash_table) }, - { XD_LISP_OBJECT, offsetof (struct x_device, WM_COMMAND_frame) }, + { XD_STRUCT_PTR, x_console, 1, &x_device_data_description}, #endif { XD_END } }; -static const struct struct_description devdata_description []= { - { dead_console, empty_devdata_description}, - { tty_console, empty_devdata_description}, - { gtk_console, gtk_devdata_description}, - { x_console, x_devdata_description}, - { mswindows_console, mswindows_devdata_description}, - { stream_console, empty_devdata_description}, - { XD_END } -}; - -static const struct lrecord_description conmeths_description_1 [] = { - { XD_LISP_OBJECT, offsetof (struct console_methods, symbol) }, - { XD_END } -}; - -static const struct struct_description conmeths_description = { - sizeof (struct console_methods), - conmeths_description_1 +static const struct sized_memory_description device_data_description = { + sizeof (void *), device_data_description_1 }; -static const struct lrecord_description device_description [] = { +static const struct memory_description device_description [] = { { XD_INT, offsetof (struct device, devtype) }, - { XD_LISP_OBJECT, offsetof (struct device, name) }, - { XD_LISP_OBJECT, offsetof (struct device, connection) }, - { XD_LISP_OBJECT, offsetof (struct device, canon_connection) }, - { XD_LISP_OBJECT, offsetof (struct device, frame_list) }, - { XD_LISP_OBJECT, offsetof (struct device, console) }, - { XD_LISP_OBJECT, offsetof (struct device, selected_frame) }, - { XD_LISP_OBJECT, offsetof (struct device, frame_with_focus_real) }, - { XD_LISP_OBJECT, offsetof (struct device, frame_with_focus_for_hooks) }, - { XD_LISP_OBJECT, offsetof (struct device, frame_that_ought_to_have_focus) }, - { XD_LISP_OBJECT, offsetof (struct device, device_class) }, - { XD_LISP_OBJECT, offsetof (struct device, user_defined_tags) }, - { XD_LISP_OBJECT, offsetof (struct device, color_instance_cache) }, - { XD_LISP_OBJECT, offsetof (struct device, font_instance_cache) }, -#ifdef MULE - { XD_LISP_OBJECT, offsetof (struct device, charset_font_cache_stage_1) }, - { XD_LISP_OBJECT, offsetof (struct device, charset_font_cache_stage_2) }, -#endif - { XD_LISP_OBJECT, offsetof (struct device, image_instance_cache) }, - { XD_LISP_OBJECT, offsetof (struct device, frame_list) }, - { XD_STRUCT_PTR, offsetof (struct device, devmeths), 1, &conmeths_description }, +#define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (struct device, x) }, +#include "devslots.h" + + { XD_STRUCT_PTR, offsetof (struct device, devmeths), 1, + &console_methods_description }, { XD_UNION, offsetof (struct device, device_data), - XD_INDIRECT (0, 0), devdata_description }, + XD_INDIRECT (0, 0), &device_data_description }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_device (Lisp_Object obj) { struct device *d = XDEVICE (obj); -#define MARKED_SLOT(x) mark_object (d->x) +#define MARKED_SLOT(x) mark_object (d->x); #include "devslots.h" if (d->devmeths) @@ -208,22 +151,16 @@ write_fmt_string (printcharfun, " 0x%x>", d->header.uid); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("device", device, 0, /*dumpable-flag*/ mark_device, print_device, 0, 0, 0, device_description, struct device); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("device", device, - mark_device, print_device, 0, 0, 0, 0, - struct device); -#endif /* not USE_KKCC */ int -valid_device_class_p (Lisp_Object class) +valid_device_class_p (Lisp_Object class_) { - return !NILP (memq_no_quit (class, Vdevice_class_list)); + return !NILP (memq_no_quit (class_, Vdevice_class_list)); } DEFUN ("valid-device-class-p", Fvalid_device_class_p, 1, 1, 0, /* @@ -248,7 +185,7 @@ { zero_lcrecord (d); -#define MARKED_SLOT(x) d->x = zap +#define MARKED_SLOT(x) d->x = zap; #include "devslots.h" } @@ -259,8 +196,6 @@ struct device *d = alloc_lcrecord_type (struct device, &lrecord_device); struct gcpro gcpro1; - zero_lcrecord (d); - device = wrap_device (d); GCPRO1 (device); @@ -660,7 +595,7 @@ Lisp_Object console = Qnil; Lisp_Object name = Qnil; struct console_methods *conmeths; - int speccount = specpdl_depth(); + int speccount = specpdl_depth (); struct gcpro gcpro1, gcpro2, gcpro3; /* If this is the first device we are creating of a particular type @@ -702,9 +637,7 @@ device = wrap_device (d); d->devmeths = con->conmeths; -#ifdef USE_KKCC d->devtype = get_console_variant (type); -#endif /* USE_KKCC */ DEVICE_NAME (d) = name; DEVICE_CONNECTION (d) = @@ -902,7 +835,7 @@ /* #### This should probably be a device method but it is time for 19.14 to go out the door. */ - /* #### BILL!!! Should this deal with HAVE_MSWINDOWS as well? */ + /* #### BILL!!! Should this deal with HAVE_MS_WINDOWS as well? */ #if defined (HAVE_X_WINDOWS) || defined (HAVE_GTK) /* Next delete all frames which have the popup property to avoid deleting a child after its parent. */ @@ -993,6 +926,7 @@ them. */ nuke_all_device_slots (d, Qnil); d->devmeths = dead_console_methods; + d->devtype = dead_console; note_object_deleted (device); UNGCPRO; @@ -1048,18 +982,18 @@ This is only allowed on device such as TTY devices, where the color behavior cannot necessarily be determined automatically. */ - (device, class)) + (device, class_)) { struct device *d = decode_device (device); device = wrap_device (d); if (!DEVICE_TTY_P (d)) gui_error ("Cannot change the class of this device", device); - if (!EQ (class, Qcolor) && !EQ (class, Qmono) && !EQ (class, Qgrayscale)) - invalid_constant ("Must be color, mono, or grayscale", class); - if (! EQ (DEVICE_CLASS (d), class)) + if (!EQ (class_, Qcolor) && !EQ (class_, Qmono) && !EQ (class_, Qgrayscale)) + invalid_constant ("Must be color, mono, or grayscale", class_); + if (! EQ (DEVICE_CLASS (d), class_)) { Lisp_Object frmcons; - DEVICE_CLASS (d) = class; + DEVICE_CLASS (d) = class_; DEVICE_FRAME_LOOP (frmcons, d) { struct frame *f = XFRAME (XCAR (frmcons)); Index: src/device.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/device.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/device.h 20 Jun 2002 21:18:26 -0000 1.17 +++ src/device.h 12 Jan 2003 11:08:11 -0000 1.18 @@ -98,7 +98,7 @@ extern Lisp_Object Qinit_post_tty_win, Qmono; extern Lisp_Object Vdevice_class_list; -int valid_device_class_p (Lisp_Object class); +int valid_device_class_p (Lisp_Object class_); void select_device_1 (Lisp_Object); struct device *decode_device (Lisp_Object); Index: src/devslots.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/devslots.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/devslots.h 20 Jun 2002 21:18:26 -0000 1.2 +++ src/devslots.h 12 Jan 2003 11:08:11 -0000 1.3 @@ -26,31 +26,30 @@ as when defining them in the structure, initializing them, or marking them. - To use, define MARKED_SLOT before including this file. In the structure - definition, you also need to define FRAME_SLOT_DECLARATION. No need to - undefine either value; that happens automatically. */ + To use, define MARKED_SLOT before including this file. No need to + undefine; that happens automatically. */ /* Name of this device, for resourcing and printing purposes. If not explicitly given, it's initialized in a device-specific manner. */ - MARKED_SLOT (name); + MARKED_SLOT (name) /* What this device is connected to */ - MARKED_SLOT (connection); + MARKED_SLOT (connection) /* A canonical name for the connection that is used to determine whether `make-device' is being called on an existing device. */ - MARKED_SLOT (canon_connection); + MARKED_SLOT (canon_connection) /* List of frames on this device. */ - MARKED_SLOT (frame_list); + MARKED_SLOT (frame_list) /* The console this device is on. */ - MARKED_SLOT (console); + MARKED_SLOT (console) /* Frame which is "currently selected". This is what `selected-frame' returns and is the default frame for many operations. This may - not be the same as frame_with_focus; `select-frame' changes the + not be the same as frame_with_focus `select-frame' changes the selected_frame but not the frame_with_focus. However, eventually either the two values will be the same, or frame_with_focus will be nil: right before waiting for an event, the focus is changed @@ -59,18 +58,18 @@ frames on this device have the window-system focus), but selected_frame will never be nil if there are any frames on the device. */ - MARKED_SLOT (selected_frame); + MARKED_SLOT (selected_frame) /* Frame that currently contains the window-manager focus, or none. Note that we've split frame_with_focus into two variables. frame_with_focus_real is the value we use most of the time, but frame_with_focus_for_hooks is used for running the select-frame-hook and deselect-frame-hook. We do this because we split the focus handling into two parts: one part (deals with drawing the solid/box cursor) - runs as soon as a focus event is received; the other (running the + runs as soon as a focus event is received the other (running the hooks) runs after any pending sit-for/sleep-for/accept-process-output calls are done. */ - MARKED_SLOT (frame_with_focus_real); - MARKED_SLOT (frame_with_focus_for_hooks); + MARKED_SLOT (frame_with_focus_real) + MARKED_SLOT (frame_with_focus_for_hooks) /* If we have recently issued a request to change the focus as a result of select-frame having been called, the following variable records the frame we are trying to focus on. The reason for this @@ -78,13 +77,13 @@ the focus (so we can't just change frame_with_focus), and we don't want to keep sending requests again and again to the window manager. This variable is reset whenever a focus-change event is seen. */ - MARKED_SLOT (frame_that_ought_to_have_focus); + MARKED_SLOT (frame_that_ought_to_have_focus) /* Color class of this device. */ - MARKED_SLOT (device_class); + MARKED_SLOT (device_class) /* Alist of values for user-defined tags in this device. */ - MARKED_SLOT (user_defined_tags); + MARKED_SLOT (user_defined_tags) /* Hash tables for device-specific objects (fonts, colors, etc). These are key-weak hash tables (or hash tables containing key-weak @@ -92,11 +91,11 @@ /* This is a simple key-weak hash table hashing color names to instances. */ - MARKED_SLOT (color_instance_cache); + MARKED_SLOT (color_instance_cache) /* This is a simple key-weak hash table hashing font names to instances. */ - MARKED_SLOT (font_instance_cache); + MARKED_SLOT (font_instance_cache) #ifdef MULE /* This is a bi-level cache, where the hash table in this slot here @@ -105,16 +104,16 @@ given charset's registry. This speeds up the horrendously slow XListFonts() operation that needs to be done in order to determine an appropriate font. */ - MARKED_SLOT (charset_font_cache_stage_1); + MARKED_SLOT (charset_font_cache_stage_1) /* Similar cache for stage 2, if it exists. See objects.c. */ - MARKED_SLOT (charset_font_cache_stage_2); + MARKED_SLOT (charset_font_cache_stage_2) #endif /* This is a bi-level cache, where the hash table in this slot here indexes image-instance-type masks (there are currently 6 image-instance types and thus 64 possible masks) to key-weak hash tables like the one for colors. */ - MARKED_SLOT (image_instance_cache); + MARKED_SLOT (image_instance_cache) #undef MARKED_SLOT Index: src/dialog-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dialog-msw.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- src/dialog-msw.c 16 Aug 2002 08:15:35 -0000 1.24 +++ src/dialog-msw.c 12 Jan 2003 11:08:11 -0000 1.25 @@ -169,13 +169,11 @@ return 0; } -#ifdef USE_KKCC -static const struct lrecord_description mswindows_dialog_id_description [] = { +static const struct memory_description mswindows_dialog_id_description [] = { { XD_LISP_OBJECT, offsetof (struct mswindows_dialog_id, frame) }, { XD_LISP_OBJECT, offsetof (struct mswindows_dialog_id, callbacks) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_mswindows_dialog_id (Lisp_Object obj) @@ -185,19 +183,12 @@ return data->callbacks; } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("mswindows-dialog-id", mswindows_dialog_id, 0, /* dump-able flag */ mark_mswindows_dialog_id, internal_object_printer, 0, 0, 0, mswindows_dialog_id_description, struct mswindows_dialog_id); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("mswindows-dialog-id", mswindows_dialog_id, - mark_mswindows_dialog_id, - internal_object_printer, 0, 0, 0, 0, - struct mswindows_dialog_id); -#endif /* not USE_KKCC */ /* Dialog procedure */ static BOOL CALLBACK Index: src/dired-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dired-msw.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- src/dired-msw.c 20 Jun 2002 21:18:27 -0000 1.14 +++ src/dired-msw.c 12 Jan 2003 11:08:11 -0000 1.15 @@ -147,7 +147,7 @@ switch (mswindows_sort_method) { case MSWINDOWS_SORT_BY_NAME: - status = strcmp (e1->cFileName, e2->cFileName); + status = qxestrcmp (e1->cFileName, e2->cFileName); break; case MSWINDOWS_SORT_BY_NAME_NOCASE: status = qxestrcasecmp (e1->cFileName, e2->cFileName); @@ -274,7 +274,7 @@ eilwr (filename); len = eilen (filename); result = (NILP (pattern) - || (0 <= re_search (bufp, eidata (filename), + || (0 <= re_search (bufp, (char *) eidata (filename), len, 0, len, 0, Qnil, 0, scache))); if (result) { @@ -341,11 +341,11 @@ DEC_IBYTEPTR (end); DEC_IBYTEPTR (end); DEC_IBYTEPTR (end); - if (qxestrcasecmp (end, ".exe") == 0 - || qxestrcasecmp (end, ".com") == 0 - || qxestrcasecmp (end, ".bat") == 0 + if (qxestrcasecmp_c (end, ".exe") == 0 + || qxestrcasecmp_c (end, ".com") == 0 + || qxestrcasecmp_c (end, ".bat") == 0 #if 0 - || qxestrcasecmp (end, ".pif") == 0 + || qxestrcasecmp_c (end, ".pif") == 0 #endif ) is_executable = 1; Index: src/doprnt.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/doprnt.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- src/doprnt.c 5 Jun 2002 09:55:13 -0000 1.22 +++ src/doprnt.c 12 Jan 2003 11:08:11 -0000 1.23 @@ -306,7 +306,7 @@ Dynarr_add (specs, spec); } - RETURN_NOT_REACHED(specs) /* suppress compiler warning */ + RETURN_NOT_REACHED(specs); /* suppress compiler warning */ } static int Index: src/dumper.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dumper.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/dumper.c 29 Jul 2002 09:21:17 -0000 1.12 +++ src/dumper.c 12 Jan 2003 11:08:12 -0000 1.13 @@ -30,9 +30,9 @@ #include "specifier.h" #include "file-coding.h" #include "elhash.h" +#include "lstream.h" #include "sysfile.h" #include "console-stream.h" -#include "dumper.h" #ifdef WIN32_NATIVE #include "syswindows.h" @@ -46,17 +46,18 @@ { const void *varaddress; Bytecount size; -} pdump_opaque; + const struct memory_description *desc; +} pdump_root_block; typedef struct { - Dynarr_declare (pdump_opaque); -} pdump_opaque_dynarr; + Dynarr_declare (pdump_root_block); +} pdump_root_block_dynarr; typedef struct { void **ptraddress; - const struct struct_description *desc; + const struct sized_memory_description *desc; } pdump_root_struct_ptr; typedef struct @@ -76,22 +77,24 @@ char * value; } pdump_static_pointer; -static pdump_opaque_dynarr *pdump_opaques; +static pdump_root_block_dynarr *pdump_root_blocks; static pdump_root_struct_ptr_dynarr *pdump_root_struct_ptrs; -static Lisp_Object_ptr_dynarr *pdump_root_objects; +static Lisp_Object_ptr_dynarr *pdump_root_lisp_objects; static Lisp_Object_ptr_dynarr *pdump_weak_object_chains; -/* Mark SIZE bytes at non-heap address VARADDRESS for dumping as is, - without any bit-twiddling. */ +/* Mark SIZE bytes at non-heap address VARADDRESS for dumping, described + by DESC. */ void -dump_add_opaque (const void *varaddress, Bytecount size) +dump_add_root_block (const void *varaddress, Bytecount size, + const struct memory_description *desc) { - pdump_opaque info; + pdump_root_block info; info.varaddress = varaddress; info.size = size; - if (pdump_opaques == NULL) - pdump_opaques = Dynarr_new (pdump_opaque); - Dynarr_add (pdump_opaques, info); + info.desc = desc; + if (pdump_root_blocks == NULL) + pdump_root_blocks = Dynarr_new (pdump_root_block); + Dynarr_add (pdump_root_blocks, info); } /* Mark the struct described by DESC and pointed to by the pointer at @@ -99,7 +102,7 @@ All the objects reachable from this pointer will also be dumped. */ void dump_add_root_struct_ptr (void *ptraddress, - const struct struct_description *desc) + const struct sized_memory_description *desc) { pdump_root_struct_ptr info; info.ptraddress = (void **) ptraddress; @@ -112,11 +115,11 @@ /* Mark the Lisp_Object at non-heap address VARADDRESS for dumping. All the objects reachable from this var will also be dumped. */ void -dump_add_root_object (Lisp_Object *varaddress) +dump_add_root_lisp_object (Lisp_Object *varaddress) { - if (pdump_root_objects == NULL) - pdump_root_objects = Dynarr_new2 (Lisp_Object_ptr_dynarr, Lisp_Object *); - Dynarr_add (pdump_root_objects, varaddress); + if (pdump_root_lisp_objects == NULL) + pdump_root_lisp_objects = Dynarr_new2 (Lisp_Object_ptr_dynarr, Lisp_Object *); + Dynarr_add (pdump_root_lisp_objects, varaddress); } /* Mark the list pointed to by the Lisp_Object at VARADDRESS for dumping. */ @@ -158,7 +161,7 @@ typedef struct { - const struct lrecord_description *desc; + const struct memory_description *desc; int count; } pdump_reloc_table; @@ -189,12 +192,13 @@ } -/* The structure of the file +/* The structure of the dump file looks like this: 0 - header - dumped objects - stab_offset - nb_root_struct_ptrs*pair(void *, adr) - for pointers to structures - - nb_opaques*pair(void *, size) for raw bits to restore + stab_offset - nb_root_struct_ptrs*struct(void *, adr) + for global pointers to structures + - nb_root_blocks*struct(void *, size, info) for global + objects to restore - relocation table - root lisp object address/value couples with the count preceding the list @@ -211,7 +215,7 @@ EMACS_UINT stab_offset; EMACS_UINT reloc_address; int nb_root_struct_ptrs; - int nb_opaques; + int nb_root_blocks; } pdump_header; char *pdump_start; @@ -260,7 +264,7 @@ typedef struct pdump_struct_list_elt { pdump_entry_list list; - const struct struct_description *sdesc; + const struct memory_description *desc; } pdump_struct_list_elt; typedef struct @@ -350,11 +354,11 @@ } static pdump_entry_list * -pdump_get_entry_list (const struct struct_description *sdesc) +pdump_get_entry_list (const struct memory_description *desc) { int i; for (i=0; iname, - backtrace[i].position, - backtrace[i].offset); + LHEADER_IMPLEMENTATION (backtrace[i].obj)->name, + backtrace[i].position, + backtrace[i].offset); } } } +static void +pdump_bump_depth (void) +{ + int me = pdump_depth++; + if (me > 65536) + { + stderr_out ("Backtrace overflow, loop ?\n"); + abort (); + } + backtrace[me].obj = 0; + backtrace[me].position = 0; + backtrace[me].offset = 0; +} + static void pdump_register_object (Lisp_Object obj); static void pdump_register_struct_contents (const void *data, - const struct struct_description * + const struct sized_memory_description * sdesc, int count); static void pdump_register_struct (const void *data, - const struct struct_description *sdesc, + const struct sized_memory_description *sdesc, int count); -static EMACS_INT -pdump_get_indirect_count (EMACS_INT code, - const struct lrecord_description *idesc, - const void *idata) -{ - EMACS_INT count; - const void *irdata; - - int line = XD_INDIRECT_VAL (code); - int delta = XD_INDIRECT_DELTA (code); - - irdata = ((char *)idata) + idesc[line].offset; - switch (idesc[line].type) - { - case XD_BYTECOUNT: - count = *(Bytecount *)irdata; - break; - case XD_ELEMCOUNT: - count = *(Elemcount *)irdata; - break; - case XD_HASHCODE: - count = *(Hashcode *)irdata; - break; - case XD_INT: - count = *(int *)irdata; - break; - case XD_LONG: - count = *(long *)irdata; - break; - default: - stderr_out ("Unsupported count type : %d (line = %d, code=%ld)\n", - idesc[line].type, line, (long)code); - pdump_backtrace (); - count = 0; /* warning suppression */ - abort (); - } - count += delta; - return count; -} - static void -pdump_register_sub (const void *data, const struct lrecord_description *desc, int me) +pdump_register_sub (const void *data, const struct memory_description *desc) { int pos; + int me = pdump_depth - 1; - restart: for (pos = 0; desc[pos].type != XD_END; pos++) { - const void *rdata = (const char *)data + desc[pos].offset; + const struct memory_description *desc1 = &desc[pos]; + EMACS_INT offset = lispdesc_indirect_count (desc1->offset, desc, + data); + const void *rdata = (const char *) data + offset; backtrace[me].position = pos; - backtrace[me].offset = desc[pos].offset; + backtrace[me].offset = offset; + + union_switcheroo: - switch (desc[pos].type) + /* If the flag says don't dump, then don't dump. */ + if ((desc1->flags) & XD_FLAG_NO_PDUMP) + continue; + + switch (desc1->type) { - case XD_SPECIFIER_END: - pos = 0; - desc = ((const Lisp_Specifier *)data)->methods->extra_description; - goto restart; - case XD_CODING_SYSTEM_END: - pos = 0; - desc = - ((const Lisp_Coding_System *)data)->methods->extra_description; - goto restart; case XD_BYTECOUNT: case XD_ELEMCOUNT: case XD_HASHCODE: @@ -488,9 +466,8 @@ break; case XD_OPAQUE_DATA_PTR: { - EMACS_INT count = desc[pos].data1; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, data); + EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, + data); pdump_add_entry (&pdump_opaque_data_list, *(void **)rdata, count, 1); @@ -498,78 +475,80 @@ } case XD_C_STRING: { - const char *str = *(const char **)rdata; + const char *str = * (const char **) rdata; if (str) - pdump_add_entry (&pdump_opaque_data_list, str, strlen (str)+1, 1); + pdump_add_entry (&pdump_opaque_data_list, str, strlen (str) + 1, + 1); break; } case XD_DOC_STRING: { - const char *str = *(const char **)rdata; - if ((EMACS_INT)str > 0) - pdump_add_entry (&pdump_opaque_data_list, str, strlen (str)+1, 1); + const char *str = * (const char **) rdata; + if ((EMACS_INT) str > 0) + pdump_add_entry (&pdump_opaque_data_list, str, strlen (str) + 1, + 1); break; } case XD_LISP_OBJECT: { - const Lisp_Object *pobj = (const Lisp_Object *)rdata; + const Lisp_Object *pobj = (const Lisp_Object *) rdata; - assert (desc[pos].data1 == 0); + assert (desc1->data1 == 0); - backtrace[me].offset = (const char *)pobj - (const char *)data; + backtrace[me].offset = (const char *) pobj - (const char *) data; pdump_register_object (*pobj); break; } case XD_LISP_OBJECT_ARRAY: { int i; - EMACS_INT count = desc[pos].data1; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, data); + EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, + data); for (i = 0; i < count; i++) { - const Lisp_Object *pobj = ((const Lisp_Object *)rdata) + i; + const Lisp_Object *pobj = ((const Lisp_Object *) rdata) + i; Lisp_Object dobj = *pobj; - backtrace[me].offset = (const char *)pobj - (const char *)data; + backtrace[me].offset = + (const char *) pobj - (const char *) data; pdump_register_object (dobj); } break; } case XD_STRUCT_PTR: { - EMACS_INT count = desc[pos].data1; - const struct struct_description *sdesc = desc[pos].data2; + EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, + data); + const struct sized_memory_description *sdesc = + lispdesc_indirect_description (data, desc1->data2); const char *dobj = *(const char **)rdata; if (dobj) - { - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, data); - - pdump_register_struct (dobj, sdesc, count); - } + pdump_register_struct (dobj, sdesc, count); break; } case XD_STRUCT_ARRAY: { - EMACS_INT count = desc[pos].data1; - const struct struct_description *sdesc = desc[pos].data2; - - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, data); + EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, + data); + const struct sized_memory_description *sdesc = + lispdesc_indirect_description (data, desc1->data2); pdump_register_struct_contents (rdata, sdesc, count); break; } case XD_UNION: - abort (); /* #### IMPLEMENT ME! NEEDED FOR UNICODE SUPPORT */ + case XD_UNION_DYNAMIC_SIZE: + desc1 = lispdesc_process_xd_union (desc1, desc, data); + if (desc1) + goto union_switcheroo; + break; default: - stderr_out ("Unsupported dump type : %d\n", desc[pos].type); + stderr_out ("Unsupported dump type : %d\n", desc1->type); pdump_backtrace (); abort (); - }; + } } } @@ -591,31 +570,15 @@ imp = LHEADER_IMPLEMENTATION (objh); -#ifdef USE_KKCC if (imp->description - && RECORD_DUMPABLE(objh)) -#else /* not USE_KKCC */ - if (imp->description) -#endif /* not USE_KKCC */ + && RECORD_DUMPABLE (objh)) { - int me = depth++; - if (me > 65536) - { - stderr_out ("Backtrace overflow, loop ?\n"); - abort (); - } - backtrace[me].obj = objh; - backtrace[me].position = 0; - backtrace[me].offset = 0; - + pdump_bump_depth (); + backtrace[pdump_depth - 1].obj = objh; pdump_add_entry (pdump_object_table + objh->type, - objh, - imp->static_size ? - imp->static_size : - imp->size_in_bytes_method (objh), - 1); - pdump_register_sub (objh, imp->description, me); - --depth; + objh, detagged_lisp_object_size (objh), 1); + pdump_register_sub (objh, imp->description); + --pdump_depth; } else { @@ -625,144 +588,6 @@ } } -/* Return the size of the memory block (NOT necessarily a structure!) - described by SDESC and pointed to by OBJ. If SDESC records an - explicit size (i.e. non-zero), it is simply returned; otherwise, - the size is calculated by the maximum offset and the size of the - object at that offset, rounded up to the maximum alignment. In - this case, we may need the object, for example when retrieving an - "indirect count" of an inlined array (the count is not constant, - but is specified by one of the elements of the memory block). (It - is generally not a problem if we return an overly large size -- we - will simply end up reserving more space than necessary; but if the - size is too small we could be in serious trouble, in particular - with nested inlined structures, where there may be alignment - padding in the middle of a block. #### In fact there is an (at - least theoretical) problem with an overly large size -- we may - trigger a protection fault when reading from invalid memory. We - need to handle this -- perhaps in a stupid but dependable way, - i.e. by trapping SIGSEGV and SIGBUS.) */ - -static Bytecount -pdump_structure_size (const void *obj, const struct struct_description *sdesc) -{ - int max_offset = -1; - int max_offset_pos = -1; - int size_at_max = 0; - int pos; - const struct lrecord_description *desc; - void *rdata; - - if (sdesc->size) - return sdesc->size; - - desc = sdesc->description; - - for (pos = 0; desc[pos].type != XD_END; pos++) - { - if (desc[pos].offset == max_offset) - { - stderr_out ("Two relocatable elements at same offset?\n"); - abort (); - } - else if (desc[pos].offset > max_offset) - { - max_offset = desc[pos].offset; - max_offset_pos = pos; - } - } - - if (max_offset_pos < 0) - return 0; - - pos = max_offset_pos; - rdata = (char *) obj + desc[pos].offset; - - switch (desc[pos].type) - { - case XD_LISP_OBJECT_ARRAY: - { - EMACS_INT val = desc[pos].data1; - if (XD_IS_INDIRECT (val)) - val = pdump_get_indirect_count (val, desc, obj); - size_at_max = val * sizeof (Lisp_Object); - break; - } - case XD_LISP_OBJECT: - case XD_LO_LINK: - size_at_max = sizeof (Lisp_Object); - break; - case XD_OPAQUE_PTR: - size_at_max = sizeof (void *); - break; - case XD_STRUCT_PTR: - { - EMACS_INT val = desc[pos].data1; - if (XD_IS_INDIRECT (val)) - val = pdump_get_indirect_count (val, desc, obj); - size_at_max = val * sizeof (void *); - break; - } - break; - case XD_STRUCT_ARRAY: - { - EMACS_INT val = desc[pos].data1; - - if (XD_IS_INDIRECT (val)) - val = pdump_get_indirect_count (val, desc, obj); - - size_at_max = val * pdump_structure_size (rdata, desc[pos].data2); - break; - } - break; - case XD_OPAQUE_DATA_PTR: - size_at_max = sizeof (void *); - break; - case XD_UNION: - abort (); /* #### IMPLEMENT ME! NEEDED FOR UNICODE - SUPPORT */ - break; - case XD_C_STRING: - size_at_max = sizeof (void *); - break; - case XD_DOC_STRING: - size_at_max = sizeof (void *); - break; - case XD_INT_RESET: - size_at_max = sizeof (int); - break; - case XD_BYTECOUNT: - size_at_max = sizeof (Bytecount); - break; - case XD_ELEMCOUNT: - size_at_max = sizeof (Elemcount); - break; - case XD_HASHCODE: - size_at_max = sizeof (Hashcode); - break; - case XD_INT: - size_at_max = sizeof (int); - break; - case XD_LONG: - size_at_max = sizeof (long); - break; - case XD_SPECIFIER_END: - case XD_CODING_SYSTEM_END: - stderr_out - ("Should not be seeing XD_SPECIFIER_END or\n" - "XD_CODING_SYSTEM_END outside of struct Lisp_Specifier\n" - "and struct Lisp_Coding_System.\n"); - abort (); - default: - stderr_out ("Unsupported dump type : %d\n", desc[pos].type); - abort (); - } - - /* We have no way of knowing the required alignment for this structure, - so just max it maximally aligned. */ - return MAX_ALIGN_SIZE (max_offset + size_at_max); -} - /* Register the referenced objects in the array of COUNT objects of located at DATA; each object is described by SDESC. "Object" here simply means any block of memory; it need not actually be a C @@ -776,32 +601,20 @@ static void pdump_register_struct_contents (const void *data, - const struct struct_description *sdesc, + const struct sized_memory_description *sdesc, int count) { - int me = depth++; int i; Bytecount elsize; - if (me>65536) - { - stderr_out ("Backtrace overflow, loop ?\n"); - abort (); - } - backtrace[me].obj = 0; - backtrace[me].position = 0; - backtrace[me].offset = 0; - - elsize = pdump_structure_size (data, sdesc); - + pdump_bump_depth (); + elsize = lispdesc_structure_size (data, sdesc); for (i = 0; i < count; i++) { - pdump_register_sub (((char *) data) + elsize * i, - sdesc->description, - me); + pdump_register_sub (((char *) data) + elsize * i, sdesc->description); } - --depth; + --pdump_depth; } /* Register the array of COUNT objects of located at DATA; each object is @@ -814,47 +627,47 @@ static void pdump_register_struct (const void *data, - const struct struct_description *sdesc, + const struct sized_memory_description *sdesc, int count) { if (data && !pdump_get_entry (data)) { - pdump_add_entry (pdump_get_entry_list (sdesc), data, - pdump_structure_size (data, sdesc), count); + pdump_add_entry (pdump_get_entry_list (sdesc->description), data, + lispdesc_structure_size (data, sdesc), count); pdump_register_struct_contents (data, sdesc, count); } } -/* Store the already-calculated new pointer offsets for all pointers - in the COUNT contiguous blocks of memory, each described by DESC - and of size SIZE, whose original is located at ORIG_DATA and the - modifiable copy at DATA. - - This is done just before writing the modified block of memory to - the dump file. The new pointer offsets have been carefully - calculated so that the data being pointed gets written at that - offset in the dump file. That way, the dump file is a correct - memory image except perhaps for a constant that needs to be added - to all pointers. (#### In fact, we SHOULD be starting up a dumped - XEmacs, seeing where the dumped file gets loaded into memory, and - then rewriting the dumped file after relocating all the pointers - relative to this memory location. That way, if the file gets - loaded again at the same location, which will be common, we don't - have to do any relocating, which is both faster at startup and +/* Store the already-calculated new pointer offsets for all pointers in the + COUNT contiguous blocks of memory, each described by DESC and of size + SIZE, whose original is located at ORIG_DATA and the modifiable copy at + DATA. We examine the description to figure out where the pointers are, + and then look up the replacement values using pdump_get_entry(). + + This is done just before writing the modified block of memory to the + dump file. The new pointer offsets have been carefully calculated so + that the data being pointed gets written at that offset in the dump + file. That way, the dump file is a correct memory image except perhaps + for a constant that needs to be added to all pointers. (#### In fact, we + SHOULD be starting up a dumped XEmacs, seeing where the dumped file gets + loaded into memory, and then rewriting the dumped file after relocating + all the pointers relative to this memory location. That way, if the + file gets loaded again at the same location, which will be common, we + don't have to do any relocating, which is both faster at startup and allows the read-only part of the dumped data to be shared read-only between different invocations of XEmacs.) #### Do we distinguish between read-only and writable dumped data? Should we? It's tricky because the dumped data, once loaded again, - cannot really be free()d or garbage collected since it's all stored - in one contiguous block of data with no malloc() headers, and we - don't keep track of the pointers used internally in malloc() and - the Lisp allocator to track allocated blocks of memory. */ + cannot really be free()d or garbage collected since it's all stored in + one contiguous block of data with no malloc() headers, and we don't keep + track of the pointers used internally in malloc() and the Lisp allocator + to track allocated blocks of memory. */ static void pdump_store_new_pointer_offsets (int count, void *data, const void *orig_data, - const struct lrecord_description *desc, + const struct memory_description *desc, int size) { int pos, i; @@ -863,22 +676,22 @@ { /* CUR points to the beginning of each block in the new data. */ char *cur = ((char *)data) + i*size; - restart: /* Scan each line of the description for relocatable pointers */ for (pos = 0; desc[pos].type != XD_END; pos++) { /* RDATA points to the beginning of each element in the new data. */ - void *rdata = cur + desc[pos].offset; - switch (desc[pos].type) + const struct memory_description *desc1 = &desc[pos]; + /* #### Change ORIG_DATA to DATA. See below. */ + void *rdata = cur + lispdesc_indirect_count (desc1->offset, desc, + orig_data); + union_switcheroo: + + /* If the flag says don't dump, then don't dump. */ + if ((desc1->flags) & XD_FLAG_NO_PDUMP) + continue; + + switch (desc1->type) { - case XD_SPECIFIER_END: - desc = ((const Lisp_Specifier *)(orig_data))-> - methods->extra_description; - goto restart; - case XD_CODING_SYSTEM_END: - desc = ((const Lisp_Coding_System *)(orig_data))-> - methods->extra_description; - goto restart; case XD_BYTECOUNT: case XD_ELEMCOUNT: case XD_HASHCODE: @@ -887,9 +700,8 @@ break; case XD_INT_RESET: { - EMACS_INT val = desc[pos].data1; - if (XD_IS_INDIRECT (val)) - val = pdump_get_indirect_count (val, desc, orig_data); + EMACS_INT val = lispdesc_indirect_count (desc1->data1, desc, + orig_data); * (int *) rdata = val; break; } @@ -914,12 +726,23 @@ chain will always be a referenced object.) */ Lisp_Object obj = * (Lisp_Object *) rdata; pdump_entry_list_elt *elt1; + /* #### Figure out how to handle indirect offsets here. + #### In general, when computing indirect counts, do we + really need to use the orig_data pointer? Why not just + use the new stuff? + + No, we don't usually need orig_data. We only need it + when fetching pointers out of the data, not integers. + This currently occurs only with description maps. We + should change the other places to DATA to emphasize + this. */ + assert (!XD_IS_INDIRECT (desc1->offset)); for (;;) { elt1 = pdump_get_entry (XRECORD_LHEADER (obj)); if (elt1) break; - obj = * (Lisp_Object *) (desc[pos].offset + + obj = * (Lisp_Object *) (desc1->offset + (char *)(XRECORD_LHEADER (obj))); } * (EMACS_INT *) rdata = elt1->save_offset; @@ -929,7 +752,7 @@ { Lisp_Object *pobj = (Lisp_Object *) rdata; - assert (desc[pos].data1 == 0); + assert (desc1->data1 == 0); if (POINTER_TYPE_P (XTYPE (*pobj)) && XRECORD_LHEADER (*pobj)) * (EMACS_INT *) pobj = @@ -938,10 +761,9 @@ } case XD_LISP_OBJECT_ARRAY: { - EMACS_INT num = desc[pos].data1; + EMACS_INT num = lispdesc_indirect_count (desc1->data1, desc, + orig_data); int j; - if (XD_IS_INDIRECT (num)) - num = pdump_get_indirect_count (num, desc, orig_data); for (j = 0; j < num; j++) { @@ -963,25 +785,29 @@ } case XD_STRUCT_ARRAY: { - EMACS_INT num = desc[pos].data1; - if (XD_IS_INDIRECT (num)) - num = pdump_get_indirect_count (num, desc, orig_data); + EMACS_INT num = lispdesc_indirect_count (desc1->data1, desc, + orig_data); + const struct sized_memory_description *sdesc = + lispdesc_indirect_description (orig_data, desc1->data2); pdump_store_new_pointer_offsets (num, rdata, ((char *) rdata - (char *) data) + (char *) orig_data, - desc[pos].data2->description, - pdump_structure_size + sdesc->description, + lispdesc_structure_size (((char *) rdata - (char *) data) + (char *) orig_data, - desc[pos].data2)); + sdesc)); break; } case XD_UNION: - abort (); /* #### IMPLEMENT ME! NEEDED FOR UNICODE - SUPPORT */ + case XD_UNION_DYNAMIC_SIZE: + desc1 = lispdesc_process_xd_union (desc1, desc, orig_data); + if (desc1) + goto union_switcheroo; + break; default: - stderr_out ("Unsupported dump type : %d\n", desc[pos].type); + stderr_out ("Unsupported dump type : %d\n", desc1->type); abort (); } } @@ -997,7 +823,7 @@ static void pdump_dump_data (pdump_entry_list_elt *elt, - const struct lrecord_description *desc) + const struct memory_description *desc) { Bytecount size = elt->size; int count = elt->count; @@ -1013,32 +839,33 @@ } /* Relocate a single memory block at DATA, described by DESC, from its - assumed load location to its actual one by adding DELTA to all - pointers in the block. Does not recursively relocate any other - memory blocks pointed to. (We already have a list of all memory - blocks in the dump file.) */ + assumed load location to its actual one by adding DELTA to all pointers + in the block. Does not recursively relocate any other memory blocks + pointed to. (We already have a list of all memory blocks in the dump + file.) This is used once the dump data has been loaded back in, both + for blocks sitting in the dumped data and in global data objects whose + contents have been restored from the dumped data. */ static void pdump_reloc_one (void *data, EMACS_INT delta, - const struct lrecord_description *desc) + const struct memory_description *desc) { int pos; - restart: for (pos = 0; desc[pos].type != XD_END; pos++) { - void *rdata = (char *)data + desc[pos].offset; - switch (desc[pos].type) + const struct memory_description *desc1 = &desc[pos]; + void *rdata = (char *) data + lispdesc_indirect_count (desc1->offset, + desc, data); + + union_switcheroo: + + /* If the flag says don't dump, then don't dump. */ + if ((desc1->flags) & XD_FLAG_NO_PDUMP) + continue; + + switch (desc1->type) { - case XD_SPECIFIER_END: - pos = 0; - desc = ((const Lisp_Specifier *)data)->methods->extra_description; - goto restart; - case XD_CODING_SYSTEM_END: - pos = 0; - desc = - ((const Lisp_Coding_System *)data)->methods->extra_description; - goto restart; case XD_BYTECOUNT: case XD_ELEMCOUNT: case XD_HASHCODE: @@ -1060,7 +887,7 @@ { Lisp_Object *pobj = (Lisp_Object *) rdata; - assert (desc[pos].data1 == 0); + assert (desc1->data1 == 0); if (POINTER_TYPE_P (XTYPE (*pobj)) && ! EQ (*pobj, Qnull_pointer)) @@ -1070,10 +897,9 @@ } case XD_LISP_OBJECT_ARRAY: { - EMACS_INT num = desc[pos].data1; + EMACS_INT num = lispdesc_indirect_count (desc1->data1, desc, + data); int j; - if (XD_IS_INDIRECT (num)) - num = pdump_get_indirect_count (num, desc, data); for (j=0; jdata1, desc, + data); int j; - const struct struct_description *sdesc = desc[pos].data2; - Bytecount size = pdump_structure_size (rdata, sdesc); + const struct sized_memory_description *sdesc = + lispdesc_indirect_description (data, desc1->data2); + Bytecount size = lispdesc_structure_size (rdata, sdesc); - if (XD_IS_INDIRECT (num)) - num = pdump_get_indirect_count (num, desc, data); /* Note: We are recursing over data in the block itself */ for (j = 0; j < num; j++) pdump_reloc_one ((char *) rdata + j * size, delta, @@ -1108,19 +934,23 @@ break; } - case XD_UNION: - abort (); /* #### IMPLEMENT ME! NEEDED FOR UNICODE SUPPORT */ + case XD_UNION_DYNAMIC_SIZE: + desc1 = lispdesc_process_xd_union (desc1, desc, data); + if (desc1) + goto union_switcheroo; + break; + default: - stderr_out ("Unsupported dump type : %d\n", desc[pos].type); + stderr_out ("Unsupported dump type : %d\n", desc1->type); abort (); - }; + } } } static void pdump_allocate_offset (pdump_entry_list_elt *elt, - const struct lrecord_description *desc) + const struct memory_description *desc) { Bytecount size = elt->count * elt->size; elt->save_offset = cur_offset; @@ -1131,7 +961,7 @@ static void pdump_scan_by_alignment (void (*f)(pdump_entry_list_elt *, - const struct lrecord_description *)) + const struct memory_description *)) { int align; @@ -1150,7 +980,7 @@ pdump_struct_list_elt list = pdump_struct_table.list[i]; if (list.list.align == align) for (elt = list.list.first; elt; elt = elt->next) - f (elt, list.sdesc->description); + f (elt, list.desc); } for (elt = pdump_opaque_data_list.first; elt; elt = elt->next) @@ -1175,13 +1005,13 @@ } static void -pdump_dump_opaques (void) +pdump_dump_root_blocks (void) { int i; - for (i = 0; i < Dynarr_length (pdump_opaques); i++) + for (i = 0; i < Dynarr_length (pdump_root_blocks); i++) { - pdump_opaque *info = Dynarr_atp (pdump_opaques, i); - PDUMP_WRITE_ALIGNED (pdump_opaque, *info); + pdump_root_block *info = Dynarr_atp (pdump_root_blocks, i); + PDUMP_WRITE_ALIGNED (pdump_root_block, *info); retry_fwrite (info->varaddress, info->size, 1, pdump_out); } } @@ -1216,7 +1046,7 @@ for (i=0; idescription; + rt.desc = pdump_struct_table.list[i].desc; rt.count = pdump_struct_table.list[i].list.count; PDUMP_WRITE_ALIGNED (pdump_reloc_table, rt); while (elt) @@ -1237,19 +1067,19 @@ } static void -pdump_dump_root_objects (void) +pdump_dump_root_lisp_objects (void) { - Elemcount count = (Dynarr_length (pdump_root_objects) + + Elemcount count = (Dynarr_length (pdump_root_lisp_objects) + Dynarr_length (pdump_weak_object_chains)); Elemcount i; PDUMP_WRITE_ALIGNED (Elemcount, count); PDUMP_ALIGN_OUTPUT (pdump_static_Lisp_Object); - for (i = 0; i < Dynarr_length (pdump_root_objects); i++) + for (i = 0; i < Dynarr_length (pdump_root_lisp_objects); i++) { pdump_static_Lisp_Object obj; - obj.address = Dynarr_at (pdump_root_objects, i); + obj.address = Dynarr_at (pdump_root_lisp_objects, i); obj.value = * obj.address; if (POINTER_TYPE_P (XTYPE (obj.value))) @@ -1270,7 +1100,7 @@ for (;;) { - const struct lrecord_description *desc; + const struct memory_description *desc; int pos; elt = pdump_get_entry (XRECORD_LHEADER (obj.value)); if (elt) @@ -1279,7 +1109,11 @@ for (pos = 0; desc[pos].type != XD_LO_LINK; pos++) assert (desc[pos].type != XD_END); - obj.value = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj.value))); + /* #### Figure out how to handle indirect offsets here. */ + assert (!XD_IS_INDIRECT (desc[pos].offset)); + obj.value = + * (Lisp_Object *) (desc[pos].offset + + (char *) (XRECORD_LHEADER (obj.value))); } obj.value = wrap_pointer_1 ((void *) elt->save_offset); @@ -1295,6 +1129,8 @@ int none; pdump_header header; + in_pdump = 1; + pdump_object_table = xnew_array (pdump_entry_list, lrecord_type_count); pdump_alert_undump_object = xnew_array (int, lrecord_type_count); @@ -1312,7 +1148,8 @@ t_device = Vterminal_device; Vterminal_device = Qnil; dump_add_opaque (&lrecord_implementations_table, - lrecord_type_count * sizeof (lrecord_implementations_table[0])); + lrecord_type_count * + sizeof (lrecord_implementations_table[0])); dump_add_opaque (&lrecord_markers, lrecord_type_count * sizeof (lrecord_markers[0])); @@ -1331,10 +1168,10 @@ pdump_opaque_data_list.first = 0; pdump_opaque_data_list.align = ALIGNOF (max_align_t); pdump_opaque_data_list.count = 0; - depth = 0; + pdump_depth = 0; - for (i=0; iname, pdump_alert_undump_object[i]); + printf (" - %s (%d)\n", lrecord_implementations_table[i]->name, + pdump_alert_undump_object[i]); } if (!none) - return; + { + in_pdump = 0; + return; + } for (i=0; ireloc_address; + delta = ((EMACS_INT) pdump_start) - header->reloc_address; p = pdump_start + header->stab_offset; /* Put back the pdump_root_struct_ptrs */ p = (char *) ALIGN_PTR (p, pdump_static_pointer); - for (i=0; inb_root_struct_ptrs; i++) + for (i = 0; i < header->nb_root_struct_ptrs; i++) { pdump_static_pointer ptr = PDUMP_READ (p, pdump_static_pointer); (* ptr.address) = ptr.value + delta; } - /* Put back the pdump_opaques */ - for (i=0; inb_opaques; i++) + /* Put back the pdump_root_blocks and relocate */ + for (i = 0; i < header->nb_root_blocks; i++) { - pdump_opaque info = PDUMP_READ_ALIGNED (p, pdump_opaque); - memcpy ((void*)info.varaddress, p, info.size); + pdump_root_block info = PDUMP_READ_ALIGNED (p, pdump_root_block); + memcpy ((void *) info.varaddress, p, info.size); + if (info.desc) + pdump_reloc_one ((void *) info.varaddress, delta, info.desc); p += info.size; } - /* Do the relocations */ + /* Relocate the heap objects */ pdump_rt_list = p; count = 2; for (;;) @@ -1452,19 +1296,19 @@ p = (char *) ALIGN_PTR (p, char *); if (rt.desc) { - char **reloc = (char **)p; - for (i=0; i < rt.count; i++) + char **reloc = (char **) p; + for (i = 0; i < rt.count; i++) { reloc[i] += delta; pdump_reloc_one (reloc[i], delta, rt.desc); } p += rt.count * sizeof (char *); - } else - if (!(--count)) - break; + } + else if (!(--count)) + break; } - /* Put the pdump_root_objects variables in place */ + /* Put the pdump_root_lisp_objects variables in place */ i = PDUMP_READ_ALIGNED (p, Elemcount); p = (char *) ALIGN_PTR (p, pdump_static_Lisp_Object); while (i--) @@ -1488,11 +1332,12 @@ break; if (rt.desc == hash_table_description) { - for (i=0; i < rt.count; i++) + for (i = 0; i < rt.count; i++) pdump_reorganize_hash_table (PDUMP_READ (p, Lisp_Object)); break; - } else - p += sizeof (Lisp_Object) * rt.count; + } + else + p += sizeof (Lisp_Object) * rt.count; } return 1; @@ -1532,11 +1377,11 @@ if (pdump_hMap == INVALID_HANDLE_VALUE) return 0; - pdump_start = MapViewOfFile (pdump_hMap, - FILE_MAP_COPY, /* Copy on write */ - 0, /* Start at zero */ - 0, - 0); /* Map all of it */ + pdump_start = (char *) MapViewOfFile (pdump_hMap, + FILE_MAP_COPY, /* Copy on write */ + 0, /* Start at zero */ + 0, + 0); /* Map all of it */ pdump_free = pdump_file_unmap; return 1; } @@ -1571,11 +1416,11 @@ return 0; /* Found it, use the data in the resource */ - hResLoad = LoadResource (NULL, hRes); + hResLoad = (HRSRC) LoadResource (NULL, hRes); if (hResLoad == NULL) return 0; - pdump_start = LockResource (hResLoad); + pdump_start = (char *) LockResource (hResLoad); if (pdump_start == NULL) return 0; @@ -1696,6 +1541,7 @@ Extbyte *w; const Extbyte *dir, *p; + in_pdump = 1; dir = argv0; if (dir[0] == '-') { @@ -1753,6 +1599,7 @@ if (pdump_file_try (exe_path)) { pdump_load_finish (); + in_pdump = 0; return 1; } @@ -1762,11 +1609,13 @@ if (pdump_load_check ()) { pdump_load_finish (); + in_pdump = 0; return 1; } pdump_free (); } #endif + in_pdump = 0; return 0; } Index: src/editfns.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/editfns.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- src/editfns.c 23 Jun 2002 09:54:41 -0000 1.45 +++ src/editfns.c 12 Jan 2003 11:08:12 -0000 1.46 @@ -361,8 +361,8 @@ /* Free all the junk we allocated, so that a `save-excursion' comes for free in terms of GC junk. */ - free_marker (XMARKER (XCAR (info))); - free_marker (XMARKER (XCDR (info))); + free_marker (XCAR (info)); + free_marker (XCDR (info)); free_cons (info); return Qnil; } @@ -726,7 +726,7 @@ return (Ibyte *) (pw ? pw->pw_name : "unknown"); #else /* For all but Cygwin return NULL (nil) */ - return pw ? pw->pw_name : NULL; + return pw ? (Ibyte *) pw->pw_name : NULL; #endif } } @@ -2104,8 +2104,8 @@ /* Free all the junk we allocated, so that a `save-restriction' comes for free in terms of GC junk. */ - free_marker (XMARKER (XCAR (markers))); - free_marker (XMARKER (XCDR (markers))); + free_marker (XCAR (markers)); + free_marker (XCDR (markers)); free_cons (markers); free_cons (data); Index: src/elhash.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/elhash.c,v retrieving revision 1.30 retrieving revision 1.32 diff -u -r1.30 -r1.32 --- src/elhash.c 27 Nov 2002 07:15:12 -0000 1.30 +++ src/elhash.c 13 Feb 2003 09:57:06 -0000 1.32 @@ -22,6 +22,27 @@ /* Synched up with: Not in FSF. */ +/* Author: Lost in the mists of history. At least back to Lucid 19.3, + circa Sep 1992. Early hash table implementation allowed only `eq' as a + test -- other tests possible only when these objects were created from + the C code. + + Expansion to allow general `equal'-test Lisp-creatable tables, and hash + methods for the various Lisp objects in existence at the time, added + during 19.12 I think (early 1995?), by Ben Wing. + + Weak hash tables added by Jamie (maybe?) early on, perhaps around 19.6, + maybe earlier; again, only possible through the C code, and only + supported fully weak hash tables. Expansion to other kinds of weakness, + and exporting of the interface to Lisp, by Ben Wing during 19.12 + (early-mid 1995) or maybe 19.13 cycle (mid 1995). + + Expansion to full Common Lisp spec and interface, redoing of the + implementation, by Martin Buchholz, 1997? (Former hash table + implementation used "double hashing", I'm pretty sure, and was weirdly + tied into the generic hash.c code. Martin completely separated them.) +*/ + /* This file implements the hash table lisp object type. This implementation was mostly written by Martin Buchholz in 1997. @@ -73,11 +94,11 @@ static Lisp_Object Qweak, Qkey_weak, Qvalue_weak, Qkey_or_value_weak; static Lisp_Object Qnon_weak, Q_type; -typedef struct hentry +typedef struct htentry { Lisp_Object key; Lisp_Object value; -} hentry; +} htentry; struct Lisp_Hash_Table { @@ -90,16 +111,16 @@ Elemcount golden_ratio; hash_table_hash_function_t hash_function; hash_table_test_function_t test_function; - hentry *hentries; + htentry *hentries; enum hash_table_weakness weakness; Lisp_Object next_weak; /* Used to chain together all of the weak hash tables. Don't mark through this. */ }; -#define HENTRY_CLEAR_P(hentry) ((*(EMACS_UINT*)(&((hentry)->key))) == 0) -#define CLEAR_HENTRY(hentry) \ - ((*(EMACS_UINT*)(&((hentry)->key))) = 0, \ - (*(EMACS_UINT*)(&((hentry)->value))) = 0) +#define HTENTRY_CLEAR_P(htentry) ((*(EMACS_UINT*)(&((htentry)->key))) == 0) +#define CLEAR_HTENTRY(htentry) \ + ((*(EMACS_UINT*)(&((htentry)->key))) = 0, \ + (*(EMACS_UINT*)(&((htentry)->value))) = 0) #define HASH_TABLE_DEFAULT_SIZE 16 #define HASH_TABLE_DEFAULT_REHASH_SIZE 1.3 @@ -115,9 +136,9 @@ #define LINEAR_PROBING_LOOP(probe, entries, size) \ for (; \ - !HENTRY_CLEAR_P (probe) || \ + !HTENTRY_CLEAR_P (probe) || \ (probe == entries + size ? \ - (probe = entries, !HENTRY_CLEAR_P (probe)) : 0); \ + (probe = entries, !HTENTRY_CLEAR_P (probe)) : 0); \ probe++) #ifdef ERROR_CHECK_STRUCTURES @@ -128,7 +149,7 @@ assert (ht->count <= ht->rehash_count); assert (ht->rehash_count < ht->size); assert ((double) ht->count * ht->rehash_threshold - 1 <= (double) ht->rehash_count); - assert (HENTRY_CLEAR_P (ht->hentries + ht->size)); + assert (HTENTRY_CLEAR_P (ht->hentries + ht->size)); } #else #define check_hash_table_invariants(ht) @@ -223,10 +244,10 @@ and mark or remove them as necessary). */ if (ht->weakness == HASH_TABLE_NON_WEAK) { - hentry *e, *sentinel; + htentry *e, *sentinel; for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) { mark_object (e->key); mark_object (e->value); @@ -250,7 +271,7 @@ { Lisp_Hash_Table *ht1 = XHASH_TABLE (hash_table1); Lisp_Hash_Table *ht2 = XHASH_TABLE (hash_table2); - hentry *e, *sentinel; + htentry *e, *sentinel; if ((ht1->test_function != ht2->test_function) || (ht1->weakness != ht2->weakness) || @@ -260,7 +281,7 @@ depth++; for (e = ht1->hentries, sentinel = e + ht1->size; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) /* Look up the key in the other hash table, and compare the values. */ { Lisp_Object value_in_other = Fgethash (e->key, hash_table2, Qunbound); @@ -312,12 +333,12 @@ print_hash_table_data (Lisp_Hash_Table *ht, Lisp_Object printcharfun) { int count = 0; - hentry *e, *sentinel; + htentry *e, *sentinel; write_c_string (printcharfun, " data ("); for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) { if (count > 0) write_c_string (printcharfun, " "); @@ -386,14 +407,14 @@ } static void -free_hentries (hentry *hentries, size_t size) +free_hentries (htentry *hentries, size_t size) { #ifdef ERROR_CHECK_STRUCTURES /* Ensure a crash if other code uses the discarded entries afterwards. */ - hentry *e, *sentinel; + htentry *e, *sentinel; for (e = hentries, sentinel = e + size; e < sentinel; e++) - * (unsigned long *) e = 0xdeadbeef; + * (unsigned long *) e = 0xdeadbeef; /* -559038737 base 10 */ #endif if (!DUMPEDP (hentries)) @@ -411,25 +432,41 @@ } } -static const struct lrecord_description hentry_description_1[] = { - { XD_LISP_OBJECT, offsetof (hentry, key) }, - { XD_LISP_OBJECT, offsetof (hentry, value) }, +static const struct memory_description htentry_description_1[] = { + { XD_LISP_OBJECT, offsetof (htentry, key) }, + { XD_LISP_OBJECT, offsetof (htentry, value) }, + { XD_END } +}; + +static const struct sized_memory_description htentry_description = { + sizeof (htentry), + htentry_description_1 +}; + +static const struct memory_description htentry_union_description_1[] = { + /* Note: XD_INDIRECT in this table refers to the surrounding table, + and so this will work. */ + { XD_STRUCT_PTR, HASH_TABLE_NON_WEAK, XD_INDIRECT (0, 1), + &htentry_description }, + { XD_STRUCT_PTR, 0, XD_INDIRECT (0, 1), &htentry_description, + XD_FLAG_UNION_DEFAULT_ENTRY | XD_FLAG_NO_KKCC }, { XD_END } }; -static const struct struct_description hentry_description = { - sizeof (hentry), - hentry_description_1 +static const struct sized_memory_description htentry_union_description = { + sizeof (htentry *), + htentry_union_description_1 }; -const struct lrecord_description hash_table_description[] = { - { XD_ELEMCOUNT, offsetof (Lisp_Hash_Table, size) }, - { XD_STRUCT_PTR, offsetof (Lisp_Hash_Table, hentries), XD_INDIRECT(0, 1), &hentry_description }, +const struct memory_description hash_table_description[] = { + { XD_ELEMCOUNT, offsetof (Lisp_Hash_Table, size) }, + { XD_INT, offsetof (Lisp_Hash_Table, weakness) }, + { XD_UNION, offsetof (Lisp_Hash_Table, hentries), XD_INDIRECT (1, 0), + &htentry_union_description }, { XD_LO_LINK, offsetof (Lisp_Hash_Table, next_weak) }, { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("hash-table", hash_table, 1, /*dumpable-flag*/ mark_hash_table, print_hash_table, @@ -437,14 +474,6 @@ hash_table_equal, hash_table_hash, hash_table_description, Lisp_Hash_Table); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("hash-table", hash_table, - mark_hash_table, print_hash_table, - finalize_hash_table, - hash_table_equal, hash_table_hash, - hash_table_description, - Lisp_Hash_Table); -#endif /* not USE_KKCC */ static Lisp_Hash_Table * xhash_table (Lisp_Object hash_table) @@ -537,8 +566,8 @@ compute_hash_table_derived_values (ht); - /* We leave room for one never-occupied sentinel hentry at the end. */ - ht->hentries = xnew_array_and_zero (hentry, ht->size + 1); + /* We leave room for one never-occupied sentinel htentry at the end. */ + ht->hentries = xnew_array_and_zero (htentry, ht->size + 1); hash_table = wrap_hash_table (ht); @@ -628,7 +657,7 @@ if (EQ (obj, Qvalue_weak)) return HASH_TABLE_VALUE_WEAK; invalid_constant ("Invalid hash table weakness", obj); - RETURN_NOT_REACHED (HASH_TABLE_NON_WEAK) + RETURN_NOT_REACHED (HASH_TABLE_NON_WEAK); } static int @@ -654,7 +683,7 @@ if (EQ (obj, Qeql)) return HASH_TABLE_EQL; invalid_constant ("Invalid hash table test", obj); - RETURN_NOT_REACHED (HASH_TABLE_EQ) + RETURN_NOT_REACHED (HASH_TABLE_EQ); } static int @@ -941,8 +970,8 @@ copy_lcrecord (ht, ht_old); - ht->hentries = xnew_array (hentry, ht_old->size + 1); - memcpy (ht->hentries, ht_old->hentries, (ht_old->size + 1) * sizeof (hentry)); + ht->hentries = xnew_array (htentry, ht_old->size + 1); + memcpy (ht->hentries, ht_old->hentries, (ht_old->size + 1) * sizeof (htentry)); hash_table = wrap_hash_table (ht); @@ -958,7 +987,7 @@ static void resize_hash_table (Lisp_Hash_Table *ht, Elemcount new_size) { - hentry *old_entries, *new_entries, *sentinel, *e; + htentry *old_entries, *new_entries, *sentinel, *e; Elemcount old_size; old_size = ht->size; @@ -966,15 +995,15 @@ old_entries = ht->hentries; - ht->hentries = xnew_array_and_zero (hentry, new_size + 1); + ht->hentries = xnew_array_and_zero (htentry, new_size + 1); new_entries = ht->hentries; compute_hash_table_derived_values (ht); for (e = old_entries, sentinel = e + old_size; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) { - hentry *probe = new_entries + HASHCODE (e->key, ht); + htentry *probe = new_entries + HASHCODE (e->key, ht); LINEAR_PROBING_LOOP (probe, new_entries, new_size) ; *probe = *e; @@ -990,19 +1019,19 @@ pdump_reorganize_hash_table (Lisp_Object hash_table) { const Lisp_Hash_Table *ht = xhash_table (hash_table); - hentry *new_entries = xnew_array_and_zero (hentry, ht->size + 1); - hentry *e, *sentinel; + htentry *new_entries = xnew_array_and_zero (htentry, ht->size + 1); + htentry *e, *sentinel; for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) { - hentry *probe = new_entries + HASHCODE (e->key, ht); + htentry *probe = new_entries + HASHCODE (e->key, ht); LINEAR_PROBING_LOOP (probe, new_entries, ht->size) ; *probe = *e; } - memcpy (ht->hentries, new_entries, ht->size * sizeof (hentry)); + memcpy (ht->hentries, new_entries, ht->size * sizeof (htentry)); xfree (new_entries); } @@ -1015,12 +1044,12 @@ resize_hash_table (ht, new_size); } -static hentry * -find_hentry (Lisp_Object key, const Lisp_Hash_Table *ht) +static htentry * +find_htentry (Lisp_Object key, const Lisp_Hash_Table *ht) { hash_table_test_function_t test_function = ht->test_function; - hentry *entries = ht->hentries; - hentry *probe = entries + HASHCODE (key, ht); + htentry *entries = ht->hentries; + htentry *probe = entries + HASHCODE (key, ht); LINEAR_PROBING_LOOP (probe, entries, ht->size) if (KEYS_EQUAL_P (probe->key, key, test_function)) @@ -1036,9 +1065,9 @@ (key, hash_table, default_)) { const Lisp_Hash_Table *ht = xhash_table (hash_table); - hentry *e = find_hentry (key, ht); + htentry *e = find_htentry (key, ht); - return HENTRY_CLEAR_P (e) ? default_ : e->value; + return HTENTRY_CLEAR_P (e) ? default_ : e->value; } DEFUN ("puthash", Fputhash, 3, 3, 0, /* @@ -1047,9 +1076,9 @@ (key, value, hash_table)) { Lisp_Hash_Table *ht = xhash_table (hash_table); - hentry *e = find_hentry (key, ht); + htentry *e = find_htentry (key, ht); - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) return e->value = value; e->key = key; @@ -1061,28 +1090,28 @@ return value; } -/* Remove hentry pointed at by PROBE. +/* Remove htentry pointed at by PROBE. Subsequent entries are removed and reinserted. We don't use tombstones - too wasteful. */ static void -remhash_1 (Lisp_Hash_Table *ht, hentry *entries, hentry *probe) +remhash_1 (Lisp_Hash_Table *ht, htentry *entries, htentry *probe) { Elemcount size = ht->size; - CLEAR_HENTRY (probe); + CLEAR_HTENTRY (probe); probe++; ht->count--; LINEAR_PROBING_LOOP (probe, entries, size) { Lisp_Object key = probe->key; - hentry *probe2 = entries + HASHCODE (key, ht); + htentry *probe2 = entries + HASHCODE (key, ht); LINEAR_PROBING_LOOP (probe2, entries, size) if (EQ (probe2->key, key)) - /* hentry at probe doesn't need to move. */ + /* htentry at probe doesn't need to move. */ goto continue_outer_loop; - /* Move hentry from probe to new home at probe2. */ + /* Move htentry from probe to new home at probe2. */ *probe2 = *probe; - CLEAR_HENTRY (probe); + CLEAR_HTENTRY (probe); continue_outer_loop: continue; } } @@ -1095,9 +1124,9 @@ (key, hash_table)) { Lisp_Hash_Table *ht = xhash_table (hash_table); - hentry *e = find_hentry (key, ht); + htentry *e = find_htentry (key, ht); - if (HENTRY_CLEAR_P (e)) + if (HTENTRY_CLEAR_P (e)) return Qnil; remhash_1 (ht, ht->hentries, e); @@ -1110,10 +1139,10 @@ (hash_table)) { Lisp_Hash_Table *ht = xhash_table (hash_table); - hentry *e, *sentinel; + htentry *e, *sentinel; for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) - CLEAR_HENTRY (e); + CLEAR_HTENTRY (e); ht->count = 0; return hash_table; @@ -1280,11 +1309,11 @@ Lisp_Object * const objs = /* If the hash table is empty, ht->count could be 0. */ xnew_array (Lisp_Object, 2 * (ht->count > 0 ? ht->count : 1)); - const hentry *e, *sentinel; + const htentry *e, *sentinel; Lisp_Object *pobj; for (e = ht->hentries, sentinel = e + ht->size, pobj = objs; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) { *(pobj++) = e->key; *(pobj++) = e->value; @@ -1339,10 +1368,10 @@ Lisp_Object hash_table, void *extra_arg) { const Lisp_Hash_Table *ht = XHASH_TABLE (hash_table); - const hentry *e, *sentinel; + const htentry *e, *sentinel; for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) if (function (e->key, e->value, extra_arg)) return; } @@ -1422,8 +1451,8 @@ hash_table = XHASH_TABLE (hash_table)->next_weak) { const Lisp_Hash_Table *ht = XHASH_TABLE (hash_table); - const hentry *e = ht->hentries; - const hentry *sentinel = e + ht->size; + const htentry *e = ht->hentries; + const htentry *sentinel = e + ht->size; if (! marked_p (hash_table)) /* The hash table is probably garbage. Ignore it. */ @@ -1436,21 +1465,21 @@ { case HASH_TABLE_KEY_WEAK: for (; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) if (marked_p (e->key)) MARK_OBJ (e->value); break; case HASH_TABLE_VALUE_WEAK: for (; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) if (marked_p (e->value)) MARK_OBJ (e->key); break; case HASH_TABLE_KEY_VALUE_WEAK: for (; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) { if (marked_p (e->value)) MARK_OBJ (e->key); @@ -1461,7 +1490,7 @@ case HASH_TABLE_KEY_CAR_WEAK: for (; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) if (!CONSP (e->key) || marked_p (XCAR (e->key))) { MARK_OBJ (e->key); @@ -1475,7 +1504,7 @@ glyph code. */ case HASH_TABLE_KEY_CAR_VALUE_WEAK: for (; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) { if (!CONSP (e->key) || marked_p (XCAR (e->key))) { @@ -1489,7 +1518,7 @@ case HASH_TABLE_VALUE_CAR_WEAK: for (; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) if (!CONSP (e->value) || marked_p (XCAR (e->value))) { MARK_OBJ (e->key); @@ -1527,18 +1556,18 @@ in which the key or value, or both, is unmarked (depending on the weakness of the hash table). */ Lisp_Hash_Table *ht = XHASH_TABLE (hash_table); - hentry *entries = ht->hentries; - hentry *sentinel = entries + ht->size; - hentry *e; + htentry *entries = ht->hentries; + htentry *sentinel = entries + ht->size; + htentry *e; for (e = entries; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) { again: if (!marked_p (e->key) || !marked_p (e->value)) { remhash_1 (ht, entries, e); - if (!HENTRY_CLEAR_P (e)) + if (!HTENTRY_CLEAR_P (e)) goto again; } } Index: src/elhash.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/elhash.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/elhash.h 29 Mar 2002 04:47:17 -0000 1.12 +++ src/elhash.h 12 Jan 2003 11:08:12 -0000 1.13 @@ -52,7 +52,7 @@ HASH_TABLE_EQUAL }; -extern const struct lrecord_description hash_table_description[]; +extern const struct memory_description hash_table_description[]; EXFUN (Fcopy_hash_table, 1); EXFUN (Fhash_table_count, 1); Index: src/emacs.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emacs.c,v retrieving revision 1.131 retrieving revision 1.133 diff -u -r1.131 -r1.133 --- src/emacs.c 12 Nov 2002 18:58:28 -0000 1.131 +++ src/emacs.c 15 Feb 2003 10:16:04 -0000 1.133 @@ -256,10 +256,6 @@ #include "systime.h" #include "sysproc.h" /* for qxe_getpid() */ -#ifdef PDUMP -#include "dumper.h" -#endif - #ifdef QUANTIFY #include #endif @@ -699,15 +695,6 @@ invoking a bare (without dumped data) XEmacs (i.e. `temacs' with the conventional dumper or `xemacs -nd' with the pdumper). See Frun_emacs_from_temacs(). - - restart interacts with initialized as follows (per Olivier Galibert): - - It's perverted. - - initialized==0 => temacs - initialized!=0 && restart!=0 => run-temacs - initialized!=0 && restart==0 => either xemacs after conventional dump, - or xemacs post pdump_load() */ DECLARE_DOESNT_RETURN (main_1 (int, Extbyte **, Extbyte **, int)); DOESNT_RETURN @@ -763,10 +750,10 @@ defined (ERROR_CHECK_MALLOC) && \ !defined (HAVE_LIBMCHECK) */ -#if defined(LOSING_GCC_DESTRUCTOR_FREE_BUG) +#if defined (LOSING_GCC_DESTRUCTOR_FREE_BUG) /* Prior to XEmacs 21, this was `#if 0'ed out. */ /* I'm enabling this because it is the only reliable way I've found to */ - /* prevent a very annoying problem where GCC will attempt to free(3) */ + /* prevent a very annoying problem where GCC will attempt to free (3) */ /* memory at exit() and cause a coredump. */ init_free_hook (); #endif @@ -790,9 +777,9 @@ #if defined (HAVE_MMAP) && defined (REL_ALLOC) /* ralloc can only be used if using the GNU memory allocator. */ init_ralloc (); -#elif defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC) +#elif defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC) if (initialized) - init_ralloc(); + init_ralloc (); #endif #ifdef HAVE_SOCKS @@ -1042,6 +1029,35 @@ /****** Now initialize everything *******/ + /* NOTE NOTE NOTE: + + In the code below, there are three different states we are concerned + about: + + "raw-temacs" == No dumped Lisp data present. `temacs', or (with pdump) + `xemacs -nd'. + + "run-temacs" == We are restarting. run-emacs-from-temacs is called, + aka `run-temacs' on the command line. + + "post-dump" == We are running an unexec()ed XEmacs, or we have loaded + dump data using pdump_load(). + + initialized==0 => raw-temacs + initialized!=0 && restart!=0 => run-temacs + initialized!=0 && restart==0 => post-dump + + When post-pdump_load(), we need to reinitialize various structures. + This case is noted in the code below by + + initialized + + !restart + + ifdef PDUMP. + + In the comments below, "dump time" or "dumping" == raw-temacs. + "run time" == run-temacs or post-dump. +*/ + /* First, do really basic environment initialization -- catching signals and the like. These functions have no dependence on any part of the Lisp engine and need to be done both at dump time and at run time. */ @@ -1075,6 +1091,7 @@ purify_flag = 0; #ifdef PDUMP + in_pdump = 0; if (restart) initialized = 1; else if (nodumpfile) @@ -1129,6 +1146,8 @@ purify_flag = 1; #endif + init_alloc_early (); + if (!initialized) { /* Initialize things so that new Lisp objects @@ -1155,16 +1174,7 @@ /* Make sure that eistrings can be created. */ init_eistring_once_early (); - } - - /* The following will get called in raw-temacs, post-dump/pdump-load XEmacs, - and run-temacs. */ - /* Initialize some vars that will also be reset post-dumping */ - init_alloc_early (); - - if (!initialized) - { /* Now declare all the symbols and define all the Lisp primitives. The *only* thing that the syms_of_*() functions are allowed to do @@ -1262,7 +1272,7 @@ #endif #endif syms_of_profile (); -#if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC) +#if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC) syms_of_ralloc (); #endif /* HAVE_MMAP && REL_ALLOC */ syms_of_rangetab (); @@ -1591,7 +1601,7 @@ #endif /* HAVE_X_WINDOWS */ #ifdef HAVE_MS_WINDOWS image_instantiator_format_create_glyphs_mswindows (); -#endif /* HAVE_MSWINDOWS_WINDOWS */ +#endif /* HAVE_MS_WINDOWS */ #ifdef HAVE_GTK image_instantiator_format_create_glyphs_gtk (); #endif @@ -1637,7 +1647,7 @@ -- xmalloc*(), xnew*(), and friends -- Dynarr_*() -- Blocktype_*() - -- Fprovide(symbol) + -- Fprovide (symbol) -- intern() -- Fput() -- dump_add_*() @@ -1654,7 +1664,7 @@ - make_int() - make_char() - make_extent() - - alloc_lcrecord() + - basic_alloc_lcrecord() - Fcons() - listN() - make_lcrecord_list() @@ -1711,7 +1721,7 @@ #ifdef HAVE_X_WINDOWS vars_of_event_Xt (); #endif -#if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) +#if defined (HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) vars_of_event_tty (); #endif #ifdef HAVE_MS_WINDOWS @@ -1784,7 +1794,7 @@ #endif vars_of_profile (); -#if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC) +#if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC) vars_of_ralloc (); #endif /* HAVE_MMAP && REL_ALLOC */ vars_of_redisplay (); @@ -2041,15 +2051,16 @@ garbage_collect_1 (); } #endif -#ifdef PDUMP } - else if (!restart) /* after successful pdump_load() + +#ifdef PDUMP + if (initialized && !restart) /* after successful pdump_load() (note, we are inside ifdef PDUMP) */ { - reinit_alloc_once_early (); - reinit_symbols_once_early (); - reinit_opaque_once_early (); - reinit_eistring_once_early (); + reinit_alloc_early (); + reinit_symbols_early (); + reinit_opaque_early (); + reinit_eistring_early (); reinit_console_type_create_stream (); #ifdef HAVE_TTY @@ -2109,7 +2120,7 @@ #endif reinit_vars_of_device (); reinit_vars_of_eval (); -#if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) +#if defined (HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) reinit_vars_of_event_tty (); #endif reinit_vars_of_event_stream (); @@ -2173,8 +2184,8 @@ reinit_complex_vars_of_buffer_runtime_only (); reinit_complex_vars_of_console_runtime_only (); reinit_complex_vars_of_minibuf (); -#endif /* PDUMP */ } +#endif /* PDUMP */ /* CONGRATULATIONS!!! We have successfully initialized the Lisp engine. */ @@ -2266,7 +2277,7 @@ if (!restart) { Vinvocation_name = Fcar (Vcommand_line_args); - if (XSTRING_DATA(Vinvocation_name)[0] == '-') + if (XSTRING_DATA (Vinvocation_name)[0] == '-') { /* XEmacs as a login shell, oh goody! */ Vinvocation_name = build_intstring (egetenv ("SHELL")); @@ -2296,7 +2307,7 @@ Vinvocation_directory = Ffile_name_directory (Vinvocation_directory); } -#if defined(HAVE_SHLIB) && !defined(WIN32_NATIVE) +#if defined (HAVE_SHLIB) && !defined (WIN32_NATIVE) /* This is Unix only. MS Windows NT has a library call that does The Right Thing on that system. Rumor has it, this must be called for GNU dld in temacs and xemacs. */ @@ -2640,11 +2651,11 @@ unbind_to (0); /* this closes loadup.el */ purify_flag = 0; run_temacs_argc = nargs + 1; -#if defined (HEAP_IN_DATA) && !defined(PDUMP) +#if defined (HEAP_IN_DATA) && !defined (PDUMP) report_sheap_usage (0); #endif LONGJMP (run_temacs_catch, 1); - RETURN_NOT_REACHED (Qnil) + RETURN_NOT_REACHED (Qnil); } /* ARGSUSED */ @@ -2764,10 +2775,10 @@ free (malloc_state_ptr); #endif /* mmap works in glibc-2.1, glibc-2.0 (Non-Mule only) and Linux libc5 */ -#if (defined(__GLIBC__) && __GLIBC_MINOR__ >= 1) || \ - defined(_NO_MALLOC_WARNING_) || \ - (defined(__GLIBC__) && __GLIBC_MINOR__ < 1 && !defined(MULE)) || \ - defined(DEBUG_DOUG_LEA_MALLOC) +#if (defined (__GLIBC__) && __GLIBC_MINOR__ >= 1) || \ + defined (_NO_MALLOC_WARNING_) || \ + (defined (__GLIBC__) && __GLIBC_MINOR__ < 1 && !defined (MULE)) || \ + defined (DEBUG_DOUG_LEA_MALLOC) mallopt (M_MMAP_MAX, 64); #endif #ifdef REL_ALLOC @@ -2787,7 +2798,7 @@ __except (mswindows_handle_hardware_exceptions (GetExceptionCode ())) {} #endif - RETURN_NOT_REACHED (0) + RETURN_NOT_REACHED (0); } @@ -2797,8 +2808,8 @@ #ifndef CANNOT_DUMP -#if !defined(PDUMP) || !defined(SYSTEM_MALLOC) -extern char my_edata[]; +#if !defined (PDUMP) || !defined (SYSTEM_MALLOC) +extern Char_Binary my_edata[]; #endif extern void disable_free_hook (void); @@ -2841,7 +2852,7 @@ opurify = purify_flag; purify_flag = 0; -#if defined (HEAP_IN_DATA) && !defined(PDUMP) +#if defined (HEAP_IN_DATA) && !defined (PDUMP) report_sheap_usage (1); #endif @@ -3161,30 +3172,38 @@ stderr_out ("\nFatal error (%d).\n\n", sig); stderr_out ("Your files have been auto-saved.\n" - "Use `M-x recover-session' to recover them.\n" - "\n" - "Your version of XEmacs was distributed with a PROBLEMS file that may describe\n" - "your crash, and with luck a workaround. Please check it first, but do report\n" - "the crash anyway. " +"Use `M-x recover-session' to recover them.\n" +"\n" +"Your version of XEmacs was distributed with a PROBLEMS file that may describe\n" +"your crash, and with luck a workaround. Please check it first, but do report\n" +"the crash anyway.\n\n" #ifdef INFODOCK - "\n\nPlease report this bug by selecting `Report-Bug' in the InfoDock menu.\n" - "*BE SURE* to include the XEmacs configuration from M-x describe-installation,\n" - "or the file Installation in the top directory of the build tree.\n" -#else - "Please report this bug by invoking M-x report-emacs-bug,\n" - "or by selecting `Send Bug Report' from the Help menu. If necessary, send\n" - "ordinary email to `crashes@xemacs.org'. *MAKE SURE* to include the XEmacs\n" - "configuration from M-x describe-installation, or equivalently the file\n" - "Installation in the top of the build tree.\n" -#endif -#ifndef _MSC_VER - "\n" - "*Please* try *hard* to obtain a C stack backtrace; without it, we are unlikely\n" - "to be able to analyze the problem. Locate the core file produced as a result\n" - "of this crash (often called `core' or `core.', and located in\n" - "the directory in which you started XEmacs or your home directory), and type\n" - "\n" - " gdb " +"Please report this bug by selecting `Report-Bug' in the InfoDock menu, or\n" +"(last resort) by emailing `crashes@xemacs.org' -- note that this is for XEmacs\n" +"in general, not just Infodock." +#else +"Please report this bug by invoking M-x report-emacs-bug, or by selecting\n" +"`Send Bug Report' from the Help menu. If that won't work, send ordinary\n" +"email to `crashes@xemacs.org'." +#endif +" *MAKE SURE* to include this entire output\n" +"from this crash, especially including the Lisp backtrace, as well as the\n" +"XEmacs configuration from M-x describe-installation (or equivalently, the\n" +"file `Installation' in the top of the build tree).\n" +#ifdef _MSC_VER +"\n" +"If you are fortunate enough to have some sort of debugging aid installed\n" +"on your system, for example Visual C++, and you can get a C stack backtrace,\n" +"*please* include it, as it will make our life far easier.\n" +"\n" +#else +"\n" +"*Please* try *hard* to obtain a C stack backtrace; without it, we are unlikely\n" +"to be able to analyze the problem. Locate the core file produced as a result\n" +"of this crash (often called `core' or `core.', and located in\n" +"the directory in which you started XEmacs or your home directory), and type\n" +"\n" +" gdb " #endif ); #ifndef _MSC_VER @@ -3211,10 +3230,10 @@ stderr_out (" core\n" "\n" - "then type `where' at the debugger prompt. No GDB on your system? You may\n" - "have DBX, or XDB, or SDB. (Ask your system administrator if you need help.)\n" - "If no core file was produced, enable them (often with `ulimit -c unlimited'\n" - "in case of future recurrance of the crash.\n"); +"then type `where' at the debugger prompt. No GDB on your system? You may\n" +"have DBX, or XDB, or SDB. (Ask your system administrator if you need help.)\n" +"If no core file was produced, enable them (often with `ulimit -c unlimited')\n" +"in case of future recurrance of the crash.\n"); #endif /* _MSC_VER */ } @@ -3239,7 +3258,7 @@ /* The following needs conditionalization on whether either XEmacs or */ /* various system shared libraries have been built and linked with */ /* GCC >= 2.8. -slb */ -#if defined(GNU_MALLOC) +#if defined (GNU_MALLOC) static void voodoo_free_hook (void *mem) { @@ -3309,7 +3328,7 @@ shut_down_emacs (0, STRINGP (arg) ? arg : Qnil, 0); -#if defined(GNU_MALLOC) +#if defined (GNU_MALLOC) __free_hook = #ifdef __GNUC__ /* prototype of __free_hook varies with glibc version */ (__typeof__ (__free_hook)) @@ -3582,7 +3601,7 @@ #if !defined (ASSERTIONS_DONT_ABORT) #ifdef _MSC_VER /* 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 + 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.) @@ -4005,13 +4024,13 @@ of the symbols in MAIL-LOCK-METHODS. */ ); { -#if defined(MAIL_LOCK_FLOCK) && defined(HAVE_FLOCK) +#if defined (MAIL_LOCK_FLOCK) && defined (HAVE_FLOCK) Vconfigure_mail_lock_method = intern ("flock"); -#elif defined(MAIL_LOCK_LOCKF) && defined(HAVE_LOCKF) +#elif defined (MAIL_LOCK_LOCKF) && defined (HAVE_LOCKF) Vconfigure_mail_lock_method = intern ("lockf"); -#elif defined(MAIL_LOCK_MMDF) && defined(HAVE_MMDF) +#elif defined (MAIL_LOCK_MMDF) && defined (HAVE_MMDF) Vconfigure_mail_lock_method = intern ("mmdf"); -#elif defined(MAIL_LOCK_LOCKING) && defined(HAVE_LOCKING) +#elif defined (MAIL_LOCK_LOCKING) && defined (HAVE_LOCKING) Vconfigure_mail_lock_method = intern ("locking"); #else Vconfigure_mail_lock_method = intern ("dot"); @@ -4239,7 +4258,7 @@ #endif } -#if defined(__sgi) && !defined(PDUMP) +#if defined (__sgi) && !defined (PDUMP) /* This is so tremendously ugly I'd puke. But then, it works. * The target is to override the static constructor from the * libiflPNG.so library which is masquerading as libz, and Index: src/emodules.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emodules.h,v retrieving revision 1.5 retrieving revision 1.7 diff -u -r1.5 -r1.7 --- src/emodules.h 18 Nov 2002 06:52:37 -0000 1.5 +++ src/emodules.h 17 Jan 2003 16:59:21 -0000 1.7 @@ -82,23 +82,29 @@ /* We should not expose module entities to the portable dumper. */ #if defined(PDUMP) && !defined(EMODULES_DO_NOT_REDEFINE) +#undef dump_add_root_struct_ptr #define dump_add_root_struct_ptr(varaddr,descaddr) DO_NOTHING +#undef dump_add_opaque #define dump_add_opaque(varaddr,size) DO_NOTHING +#undef dump_add_root_block #define dump_add_root_block(ptraddress,desc) DO_NOTHING #undef dump_add_opaque_int #define dump_add_opaque_int(int_varaddr) DO_NOTHING #undef dump_add_opaque_fixnum #define dump_add_opaque_fixnum(fixnum_varaddr) DO_NOTHING -#define dump_add_root_object(varaddr) DO_NOTHING +#undef dump_add_root_lisp_object +#define dump_add_root_lisp_object(varaddr) DO_NOTHING +#undef dump_add_weak_object_chain #define dump_add_weak_object_chain(varaddr) DO_NOTHING #undef staticpro #define staticpro(DSF_location) staticpro_nodump(DSF_location) #undef DEFSYMBOL -#undef DEFSYMBOL_MULTIWORD_PREDICATE #define DEFSYMBOL(name) DEFSYMBOL_NO_DUMP (name) +#undef DEFSYMBOL_MULTIWORD_PREDICATE #define DEFSYMBOL_MULTIWORD_PREDICATE(name) \ DEFSYMBOL_MULTIWORD_PREDICATE_NO_DUMP (name) +#undef defsymbol #define defsymbol(location,name) defsymbol_nodump (location, name) #endif Index: src/esd.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/esd.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/esd.c 6 Jun 2001 12:34:45 -0000 1.5 +++ src/esd.c 6 Feb 2003 06:36:03 -0000 1.6 @@ -51,8 +51,7 @@ fmtType ffmt; int fmt,speed,tracks; unsigned char *pptr,*optr,*cptr,*sptr; - ssize_t wrtn; - size_t crtn; + Bytecount wrtn, crtn; size_t prtn; int flags, sock; @@ -116,18 +115,21 @@ for (pptr = data; (prtn = parsesndfile((void **)&pptr,&length, (void **)&optr)) > 0; ) for (cptr = optr; (crtn = sndcnv((void **)&cptr,&prtn, - (void **)&sptr)) > 0; ) { - if ((wrtn = write(sock,sptr,crtn)) < 0) { - sound_perror ("write error"); - goto END_OF_PLAY; - } - if (wrtn != crtn) { - Extbyte warn_buf[255]; - sprintf (warn_buf , "only wrote %d of %d bytes", wrtn, crtn); - sound_warn (warn_buf); - goto END_OF_PLAY; + (void **)&sptr)) > 0; ) + { + if ((wrtn = write(sock,sptr,crtn)) < 0) + { + sound_perror ("write error"); + goto END_OF_PLAY; + } + if (wrtn != crtn) + { + Extbyte warn_buf[255]; + sprintf (warn_buf, "only wrote %ld of %ld bytes", wrtn, crtn); + sound_warn (warn_buf); + goto END_OF_PLAY; + } } - } if (ffmt == fmtWave) parse_wave_complete(); Index: src/eval.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/eval.c,v retrieving revision 1.64 retrieving revision 1.67 diff -u -r1.64 -r1.67 --- src/eval.c 30 Nov 2002 08:10:25 -0000 1.64 +++ src/eval.c 13 Feb 2003 09:57:06 -0000 1.67 @@ -1,7 +1,7 @@ /* Evaluator for XEmacs Lisp interpreter. Copyright (C) 1985-1987, 1992-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. @@ -147,23 +147,11 @@ #include "frame.h" #include "lstream.h" #include "opaque.h" +#include "profile.h" #include "window.h" struct backtrace *backtrace_list; -/* Note: you must always fill in all of the fields in a backtrace structure - before pushing them on the backtrace_list. The profiling code depends - on this. */ - -#define PUSH_BACKTRACE(bt) do { \ - (bt).next = backtrace_list; \ - backtrace_list = &(bt); \ -} while (0) - -#define POP_BACKTRACE(bt) do { \ - backtrace_list = (bt).next; \ -} while (0) - /* Macros for calling subrs with an argument list whose length is only known at runtime. See EXFUN and DEFUN for similar hackery. */ @@ -292,7 +280,7 @@ Fixnum max_specpdl_size; /* Depth in Lisp evaluations and function calls. */ -static int lisp_eval_depth; +int lisp_eval_depth; /* Maximum allowed depth in Lisp evaluations and function calls. */ Fixnum max_lisp_eval_depth; @@ -300,6 +288,8 @@ /* Nonzero means enter debugger before next function call */ static int debug_on_next_call; +int backtrace_with_internal_sections; + /* List of conditions (non-nil atom means all) which cause a backtrace if an error is handled by the command loop's error handler. */ Lisp_Object Vstack_trace_on_error; @@ -438,23 +428,16 @@ write_c_string (printcharfun, trailer); } -static const struct lrecord_description subr_description[] = { +static const struct memory_description subr_description[] = { { XD_DOC_STRING, offsetof (Lisp_Subr, doc) }, { XD_END } }; -#ifdef USE_KKCC DEFINE_BASIC_LRECORD_IMPLEMENTATION ("subr", subr, 1, /*dumpable-flag*/ 0, print_subr, 0, 0, 0, subr_description, Lisp_Subr); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("subr", subr, - 0, print_subr, 0, 0, 0, - subr_description, - Lisp_Subr); -#endif /* not USE_KKCC */ /************************************************************************/ /* Entering the debugger */ @@ -1601,8 +1584,17 @@ check_catchlist_sanity (); #endif /* Former code */ - gcprolist = c->gcpro; - backtrace_list = c->backlist; + UNWIND_GCPRO_TO (c->gcpro); + if (profiling_active) + { + while (backtrace_list != c->backlist) + { + profile_record_unwind (backtrace_list); + backtrace_list = backtrace_list->next; + } + } + else + backtrace_list = c->backlist; lisp_eval_depth = c->lisp_eval_depth; #ifdef DEFEND_AGAINST_THROW_RECURSION @@ -1713,7 +1705,7 @@ /************************************************************************/ -/* Signalling and trapping errors */ +/* Trapping errors */ /************************************************************************/ static Lisp_Object @@ -2163,6 +2155,8 @@ { } +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS + static void check_proper_critical_section_gc_protection (void) { @@ -2171,6 +2165,8 @@ "Potential GC from within redisplay without being properly wrapped"); } +#endif /* ERROR_CHECK_TRAPPING_PROBLEMS */ + static void check_proper_critical_section_nonlocal_exit_protection (void) { @@ -2446,15 +2442,15 @@ Qresource, etc.). */ void -maybe_signal_error_1 (Lisp_Object sig, Lisp_Object data, Lisp_Object class, +maybe_signal_error_1 (Lisp_Object sig, Lisp_Object data, Lisp_Object class_, Error_Behavior errb) { if (ERRB_EQ (errb, ERROR_ME_NOT)) return; else if (ERRB_EQ (errb, ERROR_ME_DEBUG_WARN)) - warn_when_safe_lispobj (class, Qdebug, Fcons (sig, data)); + warn_when_safe_lispobj (class_, Qdebug, Fcons (sig, data)); else if (ERRB_EQ (errb, ERROR_ME_WARN)) - warn_when_safe_lispobj (class, Qwarning, Fcons (sig, data)); + warn_when_safe_lispobj (class_, Qwarning, Fcons (sig, data)); else for (;;) Fsignal (sig, data); @@ -2465,18 +2461,18 @@ Lisp_Object maybe_signal_continuable_error_1 (Lisp_Object sig, Lisp_Object data, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { if (ERRB_EQ (errb, ERROR_ME_NOT)) return Qnil; else if (ERRB_EQ (errb, ERROR_ME_DEBUG_WARN)) { - warn_when_safe_lispobj (class, Qdebug, Fcons (sig, data)); + warn_when_safe_lispobj (class_, Qdebug, Fcons (sig, data)); return Qnil; } else if (ERRB_EQ (errb, ERROR_ME_WARN)) { - warn_when_safe_lispobj (class, Qwarning, Fcons (sig, data)); + warn_when_safe_lispobj (class_, Qwarning, Fcons (sig, data)); return Qnil; } else @@ -2522,13 +2518,13 @@ void maybe_signal_error (Lisp_Object type, const CIbyte *reason, - Lisp_Object frob, Lisp_Object class, + Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { /* Optimization: */ if (ERRB_EQ (errb, ERROR_ME_NOT)) return; - maybe_signal_error_1 (type, build_error_data (reason, frob), class, errb); + maybe_signal_error_1 (type, build_error_data (reason, frob), class_, errb); } Lisp_Object @@ -2540,7 +2536,7 @@ Lisp_Object maybe_signal_continuable_error (Lisp_Object type, const CIbyte *reason, - Lisp_Object frob, Lisp_Object class, + Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { /* Optimization: */ @@ -2548,7 +2544,7 @@ return Qnil; return maybe_signal_continuable_error_1 (type, build_error_data (reason, frob), - class, errb); + class_, errb); } @@ -2571,13 +2567,13 @@ void maybe_signal_error_2 (Lisp_Object type, const CIbyte *reason, Lisp_Object frob0, Lisp_Object frob1, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { /* Optimization: */ if (ERRB_EQ (errb, ERROR_ME_NOT)) return; maybe_signal_error_1 (type, list3 (build_msg_string (reason), frob0, - frob1), class, errb); + frob1), class_, errb); } Lisp_Object @@ -2591,14 +2587,14 @@ Lisp_Object maybe_signal_continuable_error_2 (Lisp_Object type, const CIbyte *reason, Lisp_Object frob0, Lisp_Object frob1, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { /* Optimization: */ if (ERRB_EQ (errb, ERROR_ME_NOT)) return Qnil; return maybe_signal_continuable_error_1 (type, list3 (build_msg_string (reason), frob0, frob1), - class, errb); + class_, errb); } @@ -2623,7 +2619,7 @@ } void -maybe_signal_ferror (Lisp_Object type, Lisp_Object class, Error_Behavior errb, +maybe_signal_ferror (Lisp_Object type, Lisp_Object class_, Error_Behavior errb, const CIbyte *fmt, ...) { Lisp_Object obj; @@ -2638,7 +2634,7 @@ va_end (args); /* Fsignal GC-protects its args */ - maybe_signal_error (type, 0, obj, class, errb); + maybe_signal_error (type, 0, obj, class_, errb); } Lisp_Object @@ -2656,7 +2652,7 @@ } Lisp_Object -maybe_signal_continuable_ferror (Lisp_Object type, Lisp_Object class, +maybe_signal_continuable_ferror (Lisp_Object type, Lisp_Object class_, Error_Behavior errb, const CIbyte *fmt, ...) { Lisp_Object obj; @@ -2671,7 +2667,7 @@ va_end (args); /* Fsignal GC-protects its args */ - return maybe_signal_continuable_error (type, 0, obj, class, errb); + return maybe_signal_continuable_error (type, 0, obj, class_, errb); } @@ -2706,7 +2702,7 @@ void maybe_signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, - Lisp_Object class, Error_Behavior errb, + Lisp_Object class_, Error_Behavior errb, const CIbyte *fmt, ...) { Lisp_Object obj; @@ -2721,7 +2717,7 @@ va_end (args); /* Fsignal GC-protects its args */ - maybe_signal_error_1 (type, Fcons (obj, build_error_data (0, frob)), class, + maybe_signal_error_1 (type, Fcons (obj, build_error_data (0, frob)), class_, errb); } @@ -2742,7 +2738,7 @@ Lisp_Object maybe_signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, - Lisp_Object class, + Lisp_Object class_, Error_Behavior errb, const CIbyte *fmt, ...) { @@ -2761,7 +2757,7 @@ return maybe_signal_continuable_error_1 (type, Fcons (obj, build_error_data (0, frob)), - class, errb); + class_, errb); } @@ -2845,9 +2841,9 @@ void maybe_syntax_error (const CIbyte *reason, Lisp_Object frob, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { - maybe_signal_error (Qsyntax_error, reason, frob, class, errb); + maybe_signal_error (Qsyntax_error, reason, frob, class_, errb); } DOESNT_RETURN @@ -2864,9 +2860,9 @@ void maybe_sferror (const CIbyte *reason, Lisp_Object frob, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { - maybe_signal_error (Qstructure_formation_error, reason, frob, class, errb); + maybe_signal_error (Qstructure_formation_error, reason, frob, class_, errb); } DOESNT_RETURN @@ -2884,9 +2880,9 @@ void maybe_invalid_argument (const CIbyte *reason, Lisp_Object frob, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { - maybe_signal_error (Qinvalid_argument, reason, frob, class, errb); + maybe_signal_error (Qinvalid_argument, reason, frob, class_, errb); } DOESNT_RETURN @@ -2904,9 +2900,9 @@ void maybe_invalid_constant (const CIbyte *reason, Lisp_Object frob, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { - maybe_signal_error (Qinvalid_constant, reason, frob, class, errb); + maybe_signal_error (Qinvalid_constant, reason, frob, class_, errb); } DOESNT_RETURN @@ -2924,9 +2920,9 @@ void maybe_invalid_operation (const CIbyte *reason, Lisp_Object frob, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { - maybe_signal_error (Qinvalid_operation, reason, frob, class, errb); + maybe_signal_error (Qinvalid_operation, reason, frob, class_, errb); } DOESNT_RETURN @@ -2943,9 +2939,9 @@ void maybe_invalid_change (const CIbyte *reason, Lisp_Object frob, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { - maybe_signal_error (Qinvalid_change, reason, frob, class, errb); + maybe_signal_error (Qinvalid_change, reason, frob, class_, errb); } DOESNT_RETURN @@ -2962,9 +2958,9 @@ void maybe_invalid_state (const CIbyte *reason, Lisp_Object frob, - Lisp_Object class, Error_Behavior errb) + Lisp_Object class_, Error_Behavior errb) { - maybe_signal_error (Qinvalid_state, reason, frob, class, errb); + maybe_signal_error (Qinvalid_state, reason, frob, class_, errb); } DOESNT_RETURN @@ -3095,11 +3091,14 @@ backtrace.args = &cmd; backtrace.nargs = 1; backtrace.evalargs = 0; - backtrace.pdlcount = specpdl_depth(); + backtrace.pdlcount = specpdl_depth (); backtrace.debug_on_exit = 0; + backtrace.function_being_called = 0; PUSH_BACKTRACE (backtrace); + PROFILE_ENTER_FUNCTION (); final = Fcall_interactively (cmd, record_flag, keys); + PROFILE_EXIT_FUNCTION (); POP_BACKTRACE (backtrace); return final; @@ -3471,7 +3470,7 @@ && !(inhibit_flags & INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY)) { struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - Lisp_Object this_warning_cons, this_warning, class, level, messij; + Lisp_Object this_warning_cons, this_warning, class_, level, messij; int speccount = internal_bind_int (&in_warnings, 1); this_warning_cons = Vpending_warnings; @@ -3480,7 +3479,7 @@ it won't happen infinitely */ Vpending_warnings = XCDR (Vpending_warnings); free_cons (this_warning_cons); - class = XCAR (this_warning); + class_ = XCAR (this_warning); level = XCAR (XCDR (this_warning)); messij = XCAR (XCDR (XCDR (this_warning))); free_list (this_warning); @@ -3489,10 +3488,10 @@ Vpending_warnings_tail = Qnil; /* perhaps not strictly necessary, but safer */ - GCPRO4 (form, class, level, messij); + GCPRO4 (form, class_, level, messij); if (!STRINGP (messij)) messij = Fprin1_to_string (messij, Qnil); - call3 (Qdisplay_warning, class, messij, level); + call3 (Qdisplay_warning, class_, messij, level); UNGCPRO; unbind_to (speccount); } @@ -3538,14 +3537,12 @@ backtrace.nargs = UNEVALLED; backtrace.evalargs = 1; backtrace.debug_on_exit = 0; + backtrace.function_being_called = 0; PUSH_BACKTRACE (backtrace); if (debug_on_next_call) do_debug_on_call (Qt); - if (profiling_active) - profile_increase_call_count (original_fun); - /* At this point, only original_fun and original_args have values that will be used below. */ retry: @@ -3562,8 +3559,10 @@ if (max_args == UNEVALLED) /* Optimize for the common case */ { backtrace.evalargs = 0; + PROFILE_ENTER_FUNCTION (); val = (((Lisp_Object (*) (Lisp_Object)) subr_function (subr)) (original_args)); + PROFILE_EXIT_FUNCTION (); } else if (nargs <= max_args) { @@ -3589,7 +3588,9 @@ backtrace.args = args; backtrace.nargs = nargs; + PROFILE_ENTER_FUNCTION (); FUNCALL_SUBR (val, subr, args, max_args); + PROFILE_EXIT_FUNCTION (); UNGCPRO; } @@ -3614,8 +3615,10 @@ backtrace.args = args; backtrace.nargs = nargs; + PROFILE_ENTER_FUNCTION (); val = (((Lisp_Object (*) (int, Lisp_Object *)) subr_function (subr)) (nargs, args)); + PROFILE_EXIT_FUNCTION (); UNGCPRO; } @@ -3646,7 +3649,9 @@ backtrace.nargs = nargs; backtrace.evalargs = 0; + PROFILE_ENTER_FUNCTION (); val = funcall_compiled_function (fun, nargs, args); + PROFILE_EXIT_FUNCTION (); /* Do the debug-on-exit now, while args is still GCPROed. */ if (backtrace.debug_on_exit) @@ -3668,7 +3673,9 @@ } else if (EQ (funcar, Qmacro)) { + PROFILE_ENTER_FUNCTION (); val = Feval (apply1 (XCDR (fun), original_args)); + PROFILE_EXIT_FUNCTION (); } else if (EQ (funcar, Qlambda)) { @@ -3693,7 +3700,9 @@ backtrace.nargs = nargs; backtrace.evalargs = 0; + PROFILE_ENTER_FUNCTION (); val = funcall_lambda (fun, nargs, args); + PROFILE_EXIT_FUNCTION (); /* Do the debug-on-exit now, while args is still GCPROed. */ if (backtrace.debug_on_exit) @@ -3748,6 +3757,7 @@ struct backtrace backtrace; int fun_nargs = nargs - 1; Lisp_Object *fun_args = args + 1; + Lisp_Object orig_fun; QUIT; @@ -3784,25 +3794,24 @@ Qunbound); } - backtrace.pdlcount = specpdl_depth(); + backtrace.pdlcount = specpdl_depth (); backtrace.function = &args[0]; backtrace.args = fun_args; backtrace.nargs = fun_nargs; backtrace.evalargs = 0; backtrace.debug_on_exit = 0; + backtrace.function_being_called = 0; PUSH_BACKTRACE (backtrace); if (debug_on_next_call) do_debug_on_call (Qlambda); + orig_fun = args[0]; + retry: fun = args[0]; - /* It might be useful to place this *after* all the checks. */ - if (profiling_active) - profile_increase_call_count (fun); - /* We could call indirect_function directly, but profiling shows this is worth optimizing by partially unrolling the loop. */ if (SYMBOLP (fun)) @@ -3825,7 +3834,9 @@ if (fun_nargs == max_args) /* Optimize for the common case */ { funcall_subr: + PROFILE_ENTER_FUNCTION (); FUNCALL_SUBR (val, subr, fun_args, max_args); + PROFILE_EXIT_FUNCTION (); } else if (fun_nargs < subr->min_args) { @@ -3846,7 +3857,9 @@ } else if (max_args == MANY) { + PROFILE_ENTER_FUNCTION (); val = SUBR_FUNCTION (subr, MANY) (fun_nargs, fun_args); + PROFILE_EXIT_FUNCTION (); } else if (max_args == UNEVALLED) /* Can't funcall a special form */ { @@ -3860,7 +3873,9 @@ } else if (COMPILED_FUNCTIONP (fun)) { + PROFILE_ENTER_FUNCTION (); val = funcall_compiled_function (fun, fun_nargs, fun_args); + PROFILE_EXIT_FUNCTION (); } else if (CONSP (fun)) { @@ -3868,7 +3883,9 @@ if (EQ (funcar, Qlambda)) { + PROFILE_ENTER_FUNCTION (); val = funcall_lambda (fun, fun_nargs, fun_args); + PROFILE_EXIT_FUNCTION (); } else if (EQ (funcar, Qautoload)) { @@ -5071,7 +5088,7 @@ tem = (fun) (arg); if (thrown && !EQ (thrown_tag, package.catchtag) - && (!flags & INHIBIT_WARNING_ISSUE) + && !(flags & INHIBIT_WARNING_ISSUE) && !warning_will_be_discarded (current_warning_level ())) { Lisp_Object errstr; @@ -5195,7 +5212,7 @@ Lisp_Object call_with_suspended_errors (lisp_fn_t fun, Lisp_Object retval, - Lisp_Object class, Error_Behavior errb, + Lisp_Object class_, Error_Behavior errb, int nargs, ...) { va_list vargs; @@ -5205,8 +5222,8 @@ int flags; struct gcpro gcpro1; - assert (SYMBOLP (class)); /* sanity-check */ - assert (!NILP (class)); + assert (SYMBOLP (class_)); /* sanity-check */ + assert (!NILP (class_)); assert (nargs >= 0 && nargs < 20); va_start (vargs, nargs); @@ -5243,7 +5260,7 @@ { Lisp_Object its_way_too_goddamn_late = call_trapping_problems - (class, 0, flags, 0, va_call_trapping_problems_1, + (class_, 0, flags, 0, va_call_trapping_problems_1, &fazer_invocacao_atrapalhando_problemas); UNGCPRO; if (UNBOUNDP (its_way_too_goddamn_late)) @@ -6059,6 +6076,15 @@ if (printing_bindings) write_c_string (stream, ")\n"); } +static Lisp_Object +backtrace_unevalled_args (Lisp_Object *args) +{ + if (args) + return *args; + else + return list1 (build_string ("[internal]")); +} + DEFUN ("backtrace", Fbacktrace, 0, 2, "", /* Print a trace of Lisp function calls currently active. Optional arg STREAM specifies the output stream to send the backtrace to, @@ -6097,10 +6123,7 @@ GCPRO2 (stream, old_level); - if (NILP (stream)) - stream = Vstandard_output; - if (!noninteractive && (NILP (stream) || EQ (stream, Qt))) - stream = Fselected_frame (Qnil); + stream = canonicalize_printcharfun (stream); for (;;) { @@ -6141,7 +6164,9 @@ write_c_string (stream, backlist->debug_on_exit ? "* " : " "); if (backlist->nargs == UNEVALLED) { - Fprin1 (Fcons (*backlist->function, *backlist->args), stream); + Fprin1 (Fcons (*backlist->function, + backtrace_unevalled_args (backlist->args)), + stream); write_c_string (stream, "\n"); /* from FSFmacs 19.30 */ } else @@ -6219,7 +6244,8 @@ if (!backlist) return Qnil; if (backlist->nargs == UNEVALLED) - return Fcons (Qnil, Fcons (*backlist->function, *backlist->args)); + return Fcons (Qnil, Fcons (*backlist->function, + backtrace_unevalled_args (backlist->args))); else { if (backlist->nargs == MANY) @@ -6246,13 +6272,13 @@ } void -warn_when_safe_lispobj (Lisp_Object class, Lisp_Object level, +warn_when_safe_lispobj (Lisp_Object class_, Lisp_Object level, Lisp_Object obj) { if (warning_will_be_discarded (level)) return; - obj = list1 (list3 (class, level, obj)); + obj = list1 (list3 (class_, level, obj)); if (NILP (Vpending_warnings)) Vpending_warnings = Vpending_warnings_tail = obj; else @@ -6270,7 +6296,7 @@ automatically be called when it is safe to do so. */ void -warn_when_safe (Lisp_Object class, Lisp_Object level, const CIbyte *fmt, ...) +warn_when_safe (Lisp_Object class_, Lisp_Object level, const CIbyte *fmt, ...) { Lisp_Object obj; va_list args; @@ -6282,7 +6308,7 @@ obj = emacs_vsprintf_string (CGETTEXT (fmt), args); va_end (args); - warn_when_safe_lispobj (class, level, obj); + warn_when_safe_lispobj (class_, level, obj); } @@ -6520,6 +6546,19 @@ Non-nil means enter debugger before next `eval', `apply' or `funcall'. */ ); + DEFVAR_BOOL ("backtrace-with-interal-sections", + &backtrace_with_internal_sections /* +Non-nil means backtraces will contain additional information indicating +when particular sections of the C code have been entered, e.g. redisplay(), +byte-char conversion, internal-external conversion, etc. This can be +particularly useful when XEmacs crashes, in helping to pinpoint the problem. +*/ ); +#ifdef ERROR_CHECK_STRUCTURES + backtrace_with_internal_sections = 1; +#else + backtrace_with_internal_sections = 0; +#endif + DEFVAR_LISP ("debugger", &Vdebugger /* Function to call to invoke debugger. If due to frame exit, args are `exit' and the value being returned; @@ -6535,7 +6574,7 @@ staticpro (&Vpending_warnings); Vpending_warnings = Qnil; - dump_add_root_object (&Vpending_warnings_tail); + dump_add_root_lisp_object (&Vpending_warnings_tail); Vpending_warnings_tail = Qnil; DEFVAR_LISP ("log-warning-minimum-level", &Vlog_warning_minimum_level); Index: src/event-Xt.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-Xt.c,v retrieving revision 1.71 retrieving revision 1.74 diff -u -r1.71 -r1.74 --- src/event-Xt.c 18 Nov 2002 06:52:38 -0000 1.71 +++ src/event-Xt.c 13 Feb 2003 09:57:06 -0000 1.74 @@ -1,7 +1,7 @@ /* The event_stream interface for X11 with Xt, and/or tty frames. Copyright (C) 1991-5, 1997 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1996, 2001, 2002 Ben Wing. + Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -67,6 +67,10 @@ #include "offix.h" #endif +#ifdef WIN32_ANY +extern int mswindows_is_blocking; +#endif + /* used in glyphs-x.c */ void enqueue_focus_event (Widget wants_it, Lisp_Object frame, int in_p); static void handle_focus_event_1 (struct frame *f, int in_p); @@ -98,7 +102,8 @@ static Widget widget_with_focus; /* 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 const String x_fallback_resources[] = { @@ -121,6 +126,9 @@ Lisp_Object Qkey_mapping; Lisp_Object Qsans_modifiers; +#define THIS_IS_X +#include "event-xlike-inc.c" + /************************************************************************/ /* keymap handling */ @@ -295,14 +303,7 @@ #endif } -/* #### The way that keysym correspondence to characters should work: - - a Lisp_Event should contain a keysym AND a character slot. - - keybindings are tried with the keysym. If no binding can be found, - and there is a corresponding character, call self-insert-command. - - #### Nuke x-iso8859-1.el. - #### Nuke the Qascii_character property. - #### Nuke Vcharacter_set_property. +/* See comment near character_to_event(). */ static void maybe_define_x_key_as_self_inserting_character (KeySym keysym, Lisp_Object symbol) @@ -1075,16 +1076,10 @@ Lisp_Event *ev = XEVENT (emacs_event); ev->channel = DEVICE_CONSOLE (d); ev->timestamp = event->time; - ev->event_type = key_press_event; -#ifdef USE_KKCC XSET_EVENT_TYPE (emacs_event, key_press_event); - XSET_KEY_DATA_MODIFIERS (XEVENT_DATA (emacs_event), 0); - XSET_KEY_DATA_KEYSYM (XEVENT_DATA (emacs_event), make_char (ch)); -#else - ev->event.key.modifiers = 0; - ev->event.key.keysym = make_char (ch); -#endif - enqueue_Xt_dispatch_event (emacs_event); + XSET_EVENT_KEY_MODIFIERS (emacs_event, 0); + XSET_EVENT_KEY_KEYSYM (emacs_event, make_char (ch)); + enqueue_dispatch_event (emacs_event); } Lstream_close (istr); UNGCPRO; @@ -1219,11 +1214,7 @@ XKeyEvent *ev = &x_event->xkey; /* This used to compute the frame from the given X window and store it here, but we really don't care about the frame. */ -#ifdef USE_KKCC SET_EVENT_CHANNEL (emacs_event, DEVICE_CONSOLE (d)); -#else /* not USE_KKCC */ - emacs_event->channel = DEVICE_CONSOLE (d); -#endif /* not USE_KKCC */ keysym = x_to_emacs_keysym (&x_event->xkey, 0); /* If the emacs keysym is nil, then that means that the X @@ -1267,17 +1258,10 @@ if (top && bot && top != bot) modifiers &= ~XEMACS_MOD_SHIFT; } -#ifdef USE_KKCC set_event_type (emacs_event, key_press_event); SET_EVENT_TIMESTAMP (emacs_event, ev->time); - XSET_KEY_DATA_MODIFIERS (EVENT_DATA (emacs_event), modifiers); - XSET_KEY_DATA_KEYSYM (EVENT_DATA (emacs_event), keysym); -#else /* not USE_KKCC */ - emacs_event->event_type = key_press_event; - emacs_event->timestamp = ev->time; - emacs_event->event.key.modifiers = modifiers; - emacs_event->event.key.keysym = keysym; -#endif /* not USE_KKCC */ + SET_EVENT_KEY_MODIFIERS (emacs_event, modifiers); + SET_EVENT_KEY_KEYSYM (emacs_event, keysym); } else /* Mouse press/release event */ { @@ -1286,27 +1270,15 @@ if (! frame) return 0; /* not for us */ -#ifdef USE_KKCC set_event_type (emacs_event, (x_event->type == ButtonPress) ? button_press_event : button_release_event); - SET_EVENT_CHANNEL (emacs_event, wrap_frame(frame)); + SET_EVENT_CHANNEL (emacs_event, wrap_frame (frame)); - XSET_BUTTON_DATA_MODIFIERS (EVENT_DATA (emacs_event), modifiers); + SET_EVENT_BUTTON_MODIFIERS (emacs_event, modifiers); SET_EVENT_TIMESTAMP (emacs_event, ev->time); - XSET_BUTTON_DATA_BUTTON (EVENT_DATA (emacs_event), ev->button); - XSET_BUTTON_DATA_X (EVENT_DATA (emacs_event), ev->x); - XSET_BUTTON_DATA_Y (EVENT_DATA (emacs_event), ev->y); -#else /* not USE_KKCC */ - emacs_event->channel = wrap_frame (frame); - emacs_event->event_type = (x_event->type == ButtonPress) ? - button_press_event : button_release_event; - - emacs_event->event.button.modifiers = modifiers; - emacs_event->timestamp = ev->time; - emacs_event->event.button.button = ev->button; - emacs_event->event.button.x = ev->x; - emacs_event->event.button.y = ev->y; -#endif /* not USE_KKCC */ + SET_EVENT_BUTTON_BUTTON (emacs_event, ev->button); + SET_EVENT_BUTTON_X (emacs_event, ev->x); + SET_EVENT_BUTTON_Y (emacs_event, ev->y); /* because we don't seem to get a FocusIn event for button clicks when a widget-glyph is selected we will assume that we want the focus if a button gets pressed. */ @@ -1343,19 +1315,11 @@ ev = &event2; /* only one structure copy */ DEVICE_X_MOUSE_TIMESTAMP (d) = ev->time; -#ifdef USE_KKCC - SET_EVENT_CHANNEL (emacs_event, wrap_frame(frame)); + SET_EVENT_CHANNEL (emacs_event, wrap_frame (frame)); set_event_type (emacs_event, pointer_motion_event); SET_EVENT_TIMESTAMP (emacs_event, ev->time); - XSET_MOTION_DATA_X (EVENT_DATA (emacs_event), ev->x); - XSET_MOTION_DATA_Y (EVENT_DATA (emacs_event), ev->y); -#else /* not USE_KKCC */ - emacs_event->channel = wrap_frame (frame); - emacs_event->event_type = pointer_motion_event; - emacs_event->timestamp = ev->time; - emacs_event->event.motion.x = ev->x; - emacs_event->event.motion.y = ev->y; -#endif /* not USE_KKCC */ + SET_EVENT_MOTION_X (emacs_event, ev->x); + SET_EVENT_MOTION_Y (emacs_event, ev->y); if (ev->state & ShiftMask) modifiers |= XEMACS_MOD_SHIFT; if (ev->state & ControlMask) modifiers |= XEMACS_MOD_CONTROL; if (ev->state & xd->MetaMask) modifiers |= XEMACS_MOD_META; @@ -1369,11 +1333,7 @@ if (ev->state & Button5Mask) modifiers |= XEMACS_MOD_BUTTON5; /* Currently ignores Shift_Lock but probably shouldn't (but it definitely should ignore Caps_Lock). */ -#ifdef USE_KKCC - XSET_MOTION_DATA_MODIFIERS (EVENT_DATA (emacs_event), modifiers); -#else /* not USE_KKCC */ - emacs_event->event.motion.modifiers = modifiers; -#endif /* not USE_KKCC */ + SET_EVENT_MOTION_MODIFIERS (emacs_event, modifiers); } break; @@ -1400,16 +1360,10 @@ return 0; /* not for us */ GCPRO4 (l_type, l_data, l_dndlist, l_item); -#ifdef USE_KKCC set_event_type (emacs_event, misc_user_event); - SET_EVENT_CHANNEL (emacs_event, wrap_frame(frame)); + SET_EVENT_CHANNEL (emacs_event, wrap_frame (frame)); SET_EVENT_TIMESTAMP (emacs_event, DEVICE_X_LAST_SERVER_TIMESTAMP (d)); -#else /* not USE_KKCC */ - emacs_event->channel = wrap_frame (frame); - emacs_event->event_type = misc_user_event; - emacs_event->timestamp = DEVICE_X_LAST_SERVER_TIMESTAMP (d); -#endif /* not USE_KKCC */ - state=DndDragButtons(x_event); + state=DndDragButtons (x_event); if (state & ShiftMask) modifiers |= XEMACS_MOD_SHIFT; if (state & ControlMask) modifiers |= XEMACS_MOD_CONTROL; @@ -1429,24 +1383,15 @@ if (state & Button2Mask) button = Button2; if (state & Button1Mask) button = Button1; -#ifdef USE_KKCC - XSET_MISC_USER_DATA_MODIFIERS (EVENT_DATA (emacs_event), modifiers); - XSET_MISC_USER_DATA_BUTTON (EVENT_DATA (emacs_event), button); - - DndDropCoordinates(FRAME_X_TEXT_WIDGET(frame), x_event, - &(XMISC_USER_DATA_X (EVENT_DATA (emacs_event))), - &(XMISC_USER_DATA_Y (EVENT_DATA (emacs_event))) ); -#else /* not USE_KKCC */ - emacs_event->event.misc.modifiers = modifiers; - emacs_event->event.misc.button = button; - - DndDropCoordinates(FRAME_X_TEXT_WIDGET(frame), x_event, - &(emacs_event->event.misc.x), - &(emacs_event->event.misc.y) ); -#endif /* not USE_KKCC */ - DndGetData(x_event,&data,&size); + SET_EVENT_MISC_USER_MODIFIERS (emacs_event, modifiers); + SET_EVENT_MISC_USER_BUTTON (emacs_event, button); + + DndDropCoordinates (FRAME_X_TEXT_WIDGET (frame), x_event, + &(EVENT_MISC_USER_X (emacs_event)), + &(EVENT_MISC_USER_Y (emacs_event))); + DndGetData (x_event,&data,&size); - dtype=DndDataType(x_event); + dtype=DndDataType (x_event); switch (dtype) { case DndFiles: /* null terminated strings, end null */ @@ -1519,13 +1464,8 @@ break; } -#ifdef USE_KKCC - XSET_MISC_USER_DATA_FUNCTION (EVENT_DATA (emacs_event), Qdragdrop_drop_dispatch); - XSET_MISC_USER_DATA_OBJECT (EVENT_DATA (emacs_event), Fcons (l_type, l_dndlist)); -#else /* not USE_KKCC */ - emacs_event->event.misc.function = Qdragdrop_drop_dispatch; - emacs_event->event.misc.object = Fcons (l_type, l_dndlist); -#endif /* not USE_KKCC */ + SET_EVENT_MISC_USER_FUNCTION (emacs_event, Qdragdrop_drop_dispatch); + SET_EVENT_MISC_USER_OBJECT (emacs_event, Fcons (l_type, l_dndlist)); UNGCPRO; @@ -1545,13 +1485,9 @@ { struct frame *frame; Window w; -#ifdef USE_KKCC XEvent *x_event_copy; SET_EVENT_TYPE (emacs_event, magic_event); - x_event_copy = &XMAGIC_DATA_X_EVENT (EVENT_DATA (emacs_event)); -#else /* not USE_KKCC */ - XEvent *x_event_copy = &emacs_event->event.magic.underlying_x_event; -#endif /* not USE_KKCC */ + x_event_copy = &EVENT_MAGIC_X_EVENT (emacs_event); #define FROB(event_member, window_member) \ x_event_copy->event_member = x_event->event_member; \ @@ -1586,14 +1522,8 @@ if (!frame) return 0; -#ifdef USE_KKCC - SET_EVENT_TYPE (emacs_event, magic_event); - SET_EVENT_CHANNEL (emacs_event, wrap_frame(frame)); - XSET_MAGIC_DATA_X_EVENT (EVENT_DATA(emacs_event), *x_event_copy); -#else /* not USE_KKCC */ - emacs_event->event_type = magic_event; - emacs_event->channel = wrap_frame (frame); -#endif /* not USE_KKCC */ + SET_EVENT_CHANNEL (emacs_event, wrap_frame (frame)); + SET_EVENT_MAGIC_X_EVENT (emacs_event, *x_event_copy); break; } } @@ -1693,25 +1623,15 @@ Lisp_Event *ev = XEVENT (emacs_event); XEvent *x_event; - ev->event_type = magic_event; - -#ifdef USE_KKCC XSET_EVENT_TYPE (emacs_event, magic_event); - x_event = &XMAGIC_DATA_X_EVENT (EVENT_DATA (ev)); -#else /* not USE_KKCC */ - x_event = &ev->event.magic.underlying_x_event; -#endif /* not USE_KKCC */ + x_event = &EVENT_MAGIC_X_EVENT (ev); x_event->type = in_p ? FocusIn : FocusOut; x_event->xfocus.window = XtWindow (wants_it); -#ifdef USE_KKCC SET_EVENT_CHANNEL (ev, frame); -#else /* not USE_KKCC */ - ev->channel = frame; -#endif /* not USE_KKCC */ - enqueue_Xt_dispatch_event (emacs_event); + enqueue_dispatch_event (emacs_event); } /* The idea here is that when a widget glyph gets unmapped we don't @@ -1948,9 +1868,9 @@ cannot rely on it to do the right thing at the right time for widget display. - drain_X_queue () - this happens when SIGIO gets tripped, - processing the event queue allows C-g to be checked for. It gets - called from emacs_Xt_event_pending_p (). + emacs_Xt_drain_queue () - this happens when SIGIO gets tripped, + processing the event queue allows C-g to be checked for. It gets + called from emacs_Xt_event_pending_p (). #### Update this comment. In order to solve this I have tried introducing a list primitive - dispatch-non-command-events - which forces processing of X events @@ -1990,11 +1910,7 @@ Lisp_Object console = CDFW_CONSOLE (EVENT_CHANNEL (event)); if (CONSOLE_X_P (XCONSOLE (console))) write_c_string -#ifdef USE_KKCC - (pstream, x_event_name ((XMAGIC_DATA_X_EVENT (EVENT_DATA(event))).type)); -#else /* not USE_KKCC */ - (pstream, x_event_name (event->event.magic.underlying_x_event.type)); -#endif /* not USE_KKCC */ + (pstream, x_event_name ((EVENT_MAGIC_X_EVENT (event)).type)); } static int @@ -2002,13 +1918,8 @@ { if (CONSOLE_X_P (XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e1)))) && CONSOLE_X_P (XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e2))))) -#ifdef USE_KKCC - return ((XMAGIC_DATA_X_EVENT (EVENT_DATA(e1))).xany.serial == - (XMAGIC_DATA_X_EVENT (EVENT_DATA(e2))).xany.serial); -#else /* not USE_KKCC */ - return (e1->event.magic.underlying_x_event.xany.serial == - e2->event.magic.underlying_x_event.xany.serial); -#endif /* not USE_KKCC */ + return ((EVENT_MAGIC_X_EVENT (e1)).xany.serial == + (EVENT_MAGIC_X_EVENT (e2)).xany.serial); if (CONSOLE_X_P (XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e1)))) || CONSOLE_X_P (XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e2))))) return 0; @@ -2020,11 +1931,7 @@ { Lisp_Object console = CDFW_CONSOLE (EVENT_CHANNEL (e)); if (CONSOLE_X_P (XCONSOLE (console))) -#ifdef USE_KKCC - return (XMAGIC_DATA_X_EVENT (EVENT_DATA(e))).xany.serial; -#else /* not USE_KKCC */ - return e->event.magic.underlying_x_event.xany.serial; -#endif /* not USE_KKCC */ + return (EVENT_MAGIC_X_EVENT (e)).xany.serial; return 0; } @@ -2032,11 +1939,7 @@ emacs_Xt_handle_magic_event (Lisp_Event *emacs_event) { /* This function can GC */ -#ifdef USE_KKCC - XEvent *event = &XMAGIC_DATA_X_EVENT (EVENT_DATA(emacs_event)); -#else /* not USE_KKCC */ - XEvent *event = &emacs_event->event.magic.underlying_x_event; -#endif /* not USE_KKCC */ + XEvent *event = &EVENT_MAGIC_X_EVENT (emacs_event); struct frame *f = XFRAME (EVENT_CHANNEL (emacs_event)); if (!FRAME_LIVE_P (f) || DEVICE_X_BEING_DELETED (XDEVICE (FRAME_DEVICE (f)))) @@ -2286,19 +2189,11 @@ assert (timeout); completed_timeouts = completed_timeouts->next; /* timeout events have nil as channel */ -#ifdef USE_KKCC - set_event_type(emacs_event, timeout_event); + set_event_type (emacs_event, timeout_event); SET_EVENT_TIMESTAMP_ZERO (emacs_event); /* #### wrong!! */ - XSET_TIMEOUT_DATA_INTERVAL_ID (EVENT_DATA (emacs_event), timeout->id); - XSET_TIMEOUT_DATA_FUNCTION (EVENT_DATA (emacs_event), Qnil); - XSET_TIMEOUT_DATA_OBJECT (EVENT_DATA (emacs_event), Qnil); -#else /* not USE_KKCC */ - emacs_event->event_type = timeout_event; - emacs_event->timestamp = 0; /* #### wrong!! */ - emacs_event->event.timeout.interval_id = timeout->id; - emacs_event->event.timeout.function = Qnil; - emacs_event->event.timeout.object = Qnil; -#endif /* not USE_KKCC */ + SET_EVENT_TIMEOUT_INTERVAL_ID (emacs_event, timeout->id); + SET_EVENT_TIMEOUT_FUNCTION (emacs_event, Qnil); + SET_EVENT_TIMEOUT_OBJECT (emacs_event, Qnil); Blocktype_free (the_Xt_timeout_blocktype, timeout); } @@ -2552,15 +2447,9 @@ filedesc_with_input[i] = Qnil; process_events_occurred--; /* process events have nil as channel */ -#ifdef USE_KKCC set_event_type (emacs_event, process_event); SET_EVENT_TIMESTAMP_ZERO (emacs_event); /* #### */ - XSET_PROCESS_DATA_PROCESS (EVENT_DATA (emacs_event), process); -#else /* not USE_KKCC */ - emacs_event->event_type = process_event; - emacs_event->timestamp = 0; /* #### */ - emacs_event->event.process.process = process; -#endif /* not USE_KKCC */ + SET_EVENT_PROCESS_PROCESS (emacs_event, process); return; } } @@ -2857,20 +2746,6 @@ /* get the next event from Xt */ /************************************************************************/ -static Lisp_Object dispatch_event_queue, dispatch_event_queue_tail; - -void -enqueue_Xt_dispatch_event (Lisp_Object event) -{ - enqueue_event (event, &dispatch_event_queue, &dispatch_event_queue_tail); -} - -static Lisp_Object -dequeue_Xt_dispatch_event (void) -{ - return dequeue_event (&dispatch_event_queue, &dispatch_event_queue_tail); -} - /* This business exists because menu events "happen" when menubar_selection_callback() is called from somewhere deep within XtAppProcessEvent in emacs_Xt_next_event(). The @@ -2886,18 +2761,11 @@ { Lisp_Object event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, misc_user_event); XSET_EVENT_CHANNEL (event, channel); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), function); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), object); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->channel = channel; - XEVENT (event)->event.eval.function = function; - XEVENT (event)->event.eval.object = object; -#endif /* not USE_KKCC */ - enqueue_Xt_dispatch_event (event); + XSET_EVENT_MISC_USER_FUNCTION (event, function); + XSET_EVENT_MISC_USER_OBJECT (event, object); + enqueue_dispatch_event (event); } static void @@ -2911,39 +2779,71 @@ !process_events_occurred && !tty_events_occurred) { - - /* Stupid logic in XtAppProcessEvent() dictates that, if process - events and X events are both available, the process event gets - taken first. This will cause an infinite loop if we're being - called from Fdiscard_input(). - */ - if (XtAppPending (Xt_app_con) & XtIMXEvent) - XtAppProcessEvent (Xt_app_con, XtIMXEvent); + if (in_modal_loop) + { + /* in_modal_loop gets set when we are in the process of + dispatching an event (more specifically, when we are inside of + a menu callback -- if we get here, it means we called a filter + and the filter did something that tried to fetch an event, + e.g. sit-for). In such a case, we cannot safely dispatch any + more events. This is because those dispatching those events + could cause lwlib to be entered reentranty, specifically if + they are menu events. lwlib is not designed for this and will + crash. We used to see this crash constantly as a result of + QUIT checking, but QUIT will not now function in a modal loop. + However, we can't just not process any events at all, because + that will make sit-for etc. hang. So we go ahead and process + the non-X kinds of events. */ +#ifdef WIN32_ANY + mswindows_is_blocking = 1; +#endif + XtAppProcessEvent (Xt_app_con, XtIMTimer | XtIMAlternateInput); +#ifdef WIN32_ANY + mswindows_is_blocking = 0; +#endif + } else { - Lisp_Object devcons, concons; + /* Stupid logic in XtAppProcessEvent() dictates that, if process + events and X events are both available, the process event gets + taken first. This will cause an infinite loop if we're being + called from Fdiscard_input(). + */ - /* We're about to block. Xt has a bug in it (big surprise, - there) in that it blocks using select() and doesn't - flush the Xlib output buffers (XNextEvent() does this - automatically before blocking). So it's necessary - for us to do this ourselves. If we don't do it, then - display output may not be seen until the next time - an X event is received. (This happens esp. with - subprocess output that gets sent to a visible buffer.) + if (XtAppPending (Xt_app_con) & XtIMXEvent) + XtAppProcessEvent (Xt_app_con, XtIMXEvent); + else + { + Lisp_Object devcons, concons; - #### The above comment may not have any validity. */ + /* We're about to block. Xt has a bug in it (big surprise, + there) in that it blocks using select() and doesn't + flush the Xlib output buffers (XNextEvent() does this + automatically before blocking). So it's necessary + for us to do this ourselves. If we don't do it, then + display output may not be seen until the next time + an X event is received. (This happens esp. with + subprocess output that gets sent to a visible buffer.) - DEVICE_LOOP_NO_BREAK (devcons, concons) - { - struct device *d; - d = XDEVICE (XCAR (devcons)); + #### The above comment may not have any validity. */ - if (DEVICE_X_P (d) && DEVICE_X_DISPLAY (d)) - /* emacs may be exiting */ - XFlush (DEVICE_X_DISPLAY (d)); + DEVICE_LOOP_NO_BREAK (devcons, concons) + { + struct device *d; + d = XDEVICE (XCAR (devcons)); + + if (DEVICE_X_P (d) && DEVICE_X_DISPLAY (d)) + /* emacs may be exiting */ + XFlush (DEVICE_X_DISPLAY (d)); + } +#ifdef WIN32_ANY + mswindows_is_blocking = 1; +#endif + XtAppProcessEvent (Xt_app_con, XtIMAll); +#ifdef WIN32_ANY + mswindows_is_blocking = 0; +#endif } - XtAppProcessEvent (Xt_app_con, XtIMAll); } } @@ -2951,7 +2851,7 @@ { Lisp_Object event, event2; event2 = wrap_event (emacs_event); - event = dequeue_Xt_dispatch_event (); + event = dequeue_dispatch_event (); Fcopy_event (event, event2); Fdeallocate_event (event); } @@ -2967,15 +2867,9 @@ /* A dummy event, so that a cycle of the command loop will occur. */ fake_event_occurred = 0; /* eval events have nil as channel */ -#ifdef USE_KKCC set_event_type (emacs_event, eval_event); - XSET_EVAL_DATA_FUNCTION (EVENT_DATA (emacs_event), Qidentity); - XSET_EVAL_DATA_OBJECT (EVENT_DATA (emacs_event), Qnil); -#else /* not USE_KKCC */ - emacs_event->event_type = eval_event; - emacs_event->event.eval.function = Qidentity; - emacs_event->event.eval.object = Qnil; -#endif /* not USE_KKCC */ + SET_EVENT_EVAL_FUNCTION (emacs_event, Qidentity); + SET_EVENT_EVAL_OBJECT (emacs_event, Qnil); } else /* if (process_events_occurred) */ Xt_process_to_emacs_event (emacs_event); @@ -2996,304 +2890,68 @@ describe_event (event, Qexternal_debugging_output); #endif /* DEBUG_XEMACS */ if (x_event_to_emacs_event (event, XEVENT (emacs_event))) - enqueue_Xt_dispatch_event (emacs_event); + enqueue_dispatch_event (emacs_event); else Fdeallocate_event (emacs_event); } /************************************************************************/ -/* input pending / C-g checking */ +/* input pending */ /************************************************************************/ -static Bool -quit_char_predicate (Display *display, XEvent *event, XPointer data) -{ - struct device *d = get_device_from_display (display); - struct x_device *xd = DEVICE_X_DATA (d); - char c, quit_char; - Bool *critical = (Bool *) data; - Lisp_Object keysym; - - if (critical) - *critical = False; - if ((event->type != KeyPress) || - (! x_any_window_to_frame (d, event->xany.window)) || - (event->xkey.state - & (xd->MetaMask | xd->HyperMask | xd->SuperMask | xd->AltMask))) - return 0; - - /* This duplicates some code that exists elsewhere, but it's relatively - fast and doesn't cons. */ - keysym = x_to_emacs_keysym (&event->xkey, 1); - if (NILP (keysym)) return 0; - if (CHAR_OR_CHAR_INTP (keysym)) - c = XCHAR_OR_CHAR_INT (keysym); - /* Highly doubtful that these are the quit character, but... */ - else if (EQ (keysym, QKbackspace)) c = '\b'; - else if (EQ (keysym, QKtab)) c = '\t'; - else if (EQ (keysym, QKlinefeed)) c = '\n'; - else if (EQ (keysym, QKreturn)) c = '\r'; - else if (EQ (keysym, QKescape)) c = 27; - else if (EQ (keysym, QKspace)) c = ' '; - else if (EQ (keysym, QKdelete)) c = 127; - else return 0; - - if (event->xkey.state & xd->MetaMask) c |= 0x80; - if ((event->xkey.state & ControlMask) && !(c >= 'A' && c <= 'Z')) - c &= 0x1F; /* unshifted control characters */ - quit_char = CONSOLE_QUIT_CHAR (XCONSOLE (DEVICE_CONSOLE (d))); - if (c == quit_char) - return True; - /* If we've got Control-Shift-G instead of Control-G, that means - we have a critical_quit. Caps_Lock is its own modifier, so it - won't cause ^G to act differently than before. */ - if (event->xkey.state & ControlMask) c &= 0x1F; - if (c == quit_char) - { - if (critical) *critical = True; - return True; - } - return False; -} - -/* This scans the X input queue for a KeyPress event that matches the - quit character, and sets Vquit_flag. This is called from the - QUIT macro to determine whether we should quit. - - In a SIGIO world, this won't be called unless a SIGIO has happened - since the last time we checked. - - In a non-SIGIO world, this is called from emacs_Xt_event_pending_p - (which is called from input_pending_p). - */ -static void -x_check_for_quit_char (Display *display) -{ - XEvent event; - int queued; - Bool critical_quit = False; - XEventsQueued (display, QueuedAfterReading); - queued = XCheckIfEvent (display, &event, - quit_char_predicate, - (char *) &critical_quit); - if (queued) - { - Vquit_flag = (critical_quit ? Qcritical : Qt); - /* don't put the event back onto the queue. Those functions that - wanted to read a ^G directly have arranged to do this. */ - } -} - -static void -check_for_tty_quit_char (struct device *d) -{ - SELECT_TYPE temp_mask; - int infd = DEVICE_INFD (d); - struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); - Ichar quit_char = CONSOLE_QUIT_CHAR (con); - - FD_ZERO (&temp_mask); - FD_SET (infd, &temp_mask); - - while (1) - { - Lisp_Object event; - Ichar the_char; - - if (!poll_fds_for_input (temp_mask)) - return; - - event = Fmake_event (Qnil, Qnil); - if (!read_event_from_tty_or_stream_desc (XEVENT (event), con)) - /* EOF, or something ... */ - return; - /* #### bogus. quit-char should be allowed to be any sort - of event. */ - the_char = event_to_character (XEVENT (event), 1, 0, 0); - if (the_char >= 0 && the_char == quit_char) - { - Vquit_flag = Qt; - /* do not queue the C-g. See above. */ - return; - } - - /* queue the read event to be read for real later. */ - enqueue_Xt_dispatch_event (event); - } -} - static void -emacs_Xt_quit_p (void) +emacs_Xt_drain_queue (void) { Lisp_Object devcons, concons; - CONSOLE_LOOP (concons) + if (!in_modal_loop) { - struct console *con = XCONSOLE (XCAR (concons)); - if (!con->input_enabled) - continue; - - CONSOLE_DEVICE_LOOP (devcons, con) + CONSOLE_LOOP (concons) { - struct device *d; - d = XDEVICE (XCAR (devcons)); + struct console *con = XCONSOLE (XCAR (concons)); + if (!con->input_enabled) + continue; - if (DEVICE_X_P (d) && DEVICE_X_DISPLAY (d)) - /* emacs may be exiting */ - x_check_for_quit_char (DEVICE_X_DISPLAY (d)); - else if (DEVICE_TTY_P (d)) - check_for_tty_quit_char (d); + CONSOLE_DEVICE_LOOP (devcons, con) + { + struct device *d; + Display *display; + d = XDEVICE (XCAR (devcons)); + if (DEVICE_X_P (d) && DEVICE_X_DISPLAY (d)) + { + display = DEVICE_X_DISPLAY (d); + while (XEventsQueued (display, QueuedAfterReading)) + XtAppProcessEvent (Xt_app_con, XtIMXEvent); + } + } } + /* + while (XtAppPending (Xt_app_con) & XtIMXEvent) + XtAppProcessEvent (Xt_app_con, XtIMXEvent); + */ } -} -static void -drain_X_queue (void) -{ - Lisp_Object devcons, concons; - CONSOLE_LOOP (concons) - { - struct console *con = XCONSOLE (XCAR (concons)); - if (!con->input_enabled) - continue; - - CONSOLE_DEVICE_LOOP (devcons, con) - { - struct device* d; - Display* display; - d = XDEVICE (XCAR (devcons)); - if (DEVICE_X_P (d) && DEVICE_X_DISPLAY (d)) { - display = DEVICE_X_DISPLAY (d); - while (XEventsQueued (display, QueuedAfterReading)) - XtAppProcessEvent (Xt_app_con, XtIMXEvent); - } - } - } - /* - while (XtAppPending (Xt_app_con) & XtIMXEvent) - XtAppProcessEvent (Xt_app_con, XtIMXEvent); - */ +#ifdef HAVE_TTY + drain_tty_devices (); +#endif } -static int -emacs_Xt_event_pending_p (int user_p) +int +check_if_pending_expose_event (struct device *dev) { + Display *d = DEVICE_X_DISPLAY (dev); Lisp_Object event; - int tick_count_val; - /* If `user_p' is false, then this function returns whether there are any - X, timeout, or fd events pending (that is, whether emacs_Xt_next_event() - would return immediately without blocking). - - if `user_p' is true, then this function returns whether there are any - *user generated* events available (that is, whether there are keyboard - or mouse-click events ready to be read). This also implies that - emacs_Xt_next_event() would not block. - - In a non-SIGIO world, this also checks whether the user has typed ^G, - since this is a convenient place to do so. We don't need to do this - in a SIGIO world, since input causes an interrupt. - */ + emacs_Xt_drain_queue (); -#if 0 - /* I don't think there's any point to this and it will nullify - the speed gains achieved by the sigio_happened checking below. - Its only advantage is that it may possibly make C-g response - a bit faster. The C-g will be noticed within 0.25 second, anyway, - even without this. */ -#ifndef SIGIO - /* First check for C-g if necessary */ - emacs_Xt_quit_p (); -#endif -#endif - - /* This function used to simply check whether there were any X - events (or if user_p was 1, it iterated over all the pending - X events using XCheckIfEvent(), looking for keystrokes and - button events). That worked in the old cheesoid event loop, - which didn't go through XtAppDispatchEvent(), but it doesn't - work any more -- X events may not result in anything. For - example, a button press in a blank part of the menubar appears - as an X event but will not result in any Emacs events (a - button press that activates the menubar results in an Emacs - event through the stop_next_event mechanism). - - The only accurate way of determining whether these X events - translate into Emacs events is to go ahead and dispatch them - until there's something on the dispatch queue. */ - - /* See if there are any user events already on the queue. */ EVENT_CHAIN_LOOP (event, dispatch_event_queue) - if (!user_p || command_event_p (event)) - return 1; - - /* See if there's any TTY input available. - */ - if (poll_fds_for_input (tty_only_mask)) - return 1; - - if (!user_p) - { - /* If not user_p and there are any timer or file-desc events - pending, we know there will be an event so we're through. */ - XtInputMask pending_value; - - /* Note that formerly we just checked the value of XtAppPending() - to determine if there was file-desc input. This doesn't - work any more with the signal_event_pipe; XtAppPending() - will says "yes" in this case but there isn't really any - input. Another way of fixing this problem is for the - signal_event_pipe to generate actual input in the form - of an identity eval event or something. (#### maybe this - actually happens?) */ - - if (poll_fds_for_input (process_only_mask)) - return 1; - - pending_value = XtAppPending (Xt_app_con); - - if (pending_value & XtIMTimer) - return 1; - } - - /* XtAppPending() can be super-slow, esp. over a network connection. - Quantify results have indicated that in some cases the call to - detect_input_pending() completely dominates the running time of - redisplay(). Fortunately, in a SIGIO world we can more quickly - determine whether there are any X events: if an event has - happened since the last time we checked, then a SIGIO will have - happened. On a machine with broken SIGIO, we'll still be in an - OK state -- quit_check_signal_tick_count will get ticked at least - every 1/4 second, so we'll be no more than that much behind - reality. (In general it's OK if we erroneously report no input - pending when input is actually pending() -- preemption is just a - bit less efficient, that's all. It's bad bad bad if you err the - other way -- you've promised that `next-event' won't block but it - actually will, and some action might get delayed until the next - time you hit a key.) - */ - - /* quit_check_signal_tick_count is volatile so try to avoid race conditions - by using a temporary variable */ - tick_count_val = quit_check_signal_tick_count; - if (last_quit_check_signal_tick_count != tick_count_val -#if !defined (SIGIO) || defined (CYGWIN) - || (XtIMXEvent & XtAppPending (Xt_app_con)) -#endif - ) - { - last_quit_check_signal_tick_count = tick_count_val; - - /* We need to drain the entire queue now -- if we only - drain part of it, we may later on end up with events - actually pending but detect_input_pending() returning - false because there wasn't another SIGIO. */ - drain_X_queue (); - - EVENT_CHAIN_LOOP (event, dispatch_event_queue) - if (!user_p || command_event_p (event)) - return 1; - } + if (XEVENT_TYPE (event) == magic_event) + { + XEvent *xev = &XEVENT_MAGIC_X_EVENT (event); + if (xev->type == Expose && + xev->xexpose.display == d) + return 1; + } return 0; } @@ -3524,9 +3182,9 @@ void reinit_vars_of_event_Xt (void) { - Xt_event_stream = xnew (struct event_stream); + Xt_event_stream = xnew_and_zero (struct event_stream); Xt_event_stream->event_pending_p = emacs_Xt_event_pending_p; - Xt_event_stream->force_event_pending = emacs_Xt_force_event_pending; + Xt_event_stream->force_event_pending_cb= emacs_Xt_force_event_pending; Xt_event_stream->next_event_cb = emacs_Xt_next_event; Xt_event_stream->handle_magic_event_cb = emacs_Xt_handle_magic_event; Xt_event_stream->format_magic_event_cb = emacs_Xt_format_magic_event; @@ -3538,7 +3196,7 @@ Xt_event_stream->unselect_console_cb = emacs_Xt_unselect_console; Xt_event_stream->select_process_cb = emacs_Xt_select_process; Xt_event_stream->unselect_process_cb = emacs_Xt_unselect_process; - Xt_event_stream->quit_p_cb = emacs_Xt_quit_p; + Xt_event_stream->drain_queue_cb = emacs_Xt_drain_queue; Xt_event_stream->create_io_streams_cb = emacs_Xt_create_io_streams; Xt_event_stream->delete_io_streams_cb = emacs_Xt_delete_io_streams; Xt_event_stream->current_event_timestamp_cb = @@ -3556,11 +3214,6 @@ vars_of_event_Xt (void) { reinit_vars_of_event_Xt (); - - dispatch_event_queue = Qnil; - staticpro (&dispatch_event_queue); - dispatch_event_queue_tail = Qnil; - dump_add_root_object (&dispatch_event_queue_tail); DEFVAR_BOOL ("x-allow-sendevents", &x_allow_sendevents /* *Non-nil means to allow synthetic events. Nil means they are ignored. Index: src/event-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-gtk.c,v retrieving revision 1.18 retrieving revision 1.21 diff -u -r1.18 -r1.21 --- src/event-gtk.c 23 Jun 2002 09:25:12 -0000 1.18 +++ src/event-gtk.c 13 Feb 2003 09:57:06 -0000 1.21 @@ -1,7 +1,7 @@ /* The event_stream interface for X11 with gtk, and/or tty frames. Copyright (C) 1991-5, 1997 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1996, 2001, 2002 Ben Wing. + Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. Copyright (C) 2000 William Perry. This file is part of XEmacs. @@ -68,6 +68,10 @@ static struct event_stream *gtk_event_stream; +#ifdef WIN32_ANY +extern int mswindows_is_blocking; +#endif + /* Do we accept events sent by other clients? */ int gtk_allow_sendevents; @@ -88,13 +92,13 @@ Lisp_Object Qkey_mapping; Lisp_Object Qsans_modifiers; -static void enqueue_gtk_dispatch_event (Lisp_Object event); - #define IS_MODIFIER_KEY(keysym) \ ((((keysym) >= GDK_Shift_L) && ((keysym) <= GDK_Hyper_R)) \ || ((keysym) == GDK_Mode_switch) \ || ((keysym) == GDK_Num_Lock)) +#define THIS_IS_GTK +#include "event-xlike-inc.c" /************************************************************************/ @@ -213,7 +217,7 @@ if (CONSOLE_GTK_P (XCONSOLE (console))) write_c_string (pstream, - gtk_event_name (emacs_event->event.magic.underlying_gdk_event.type)); + gtk_event_name (EVENT_MAGIC_GDK_EVENT (emacs_event).type)); } static int @@ -221,8 +225,8 @@ { if (CONSOLE_GTK_P (XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e1)))) && CONSOLE_GTK_P (XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e2))))) - return (!memcmp (&e1->event.magic.underlying_gdk_event, - &e2->event.magic.underlying_gdk_event, + return (!memcmp (&EVENT_MAGIC_GDK_EVENT (e1), + &EVENT_MAGIC_GDK_EVENT (e2), sizeof (GdkEvent))); if (CONSOLE_GTK_P (XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e1)))) || CONSOLE_GTK_P (XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e2))))) @@ -235,7 +239,7 @@ { Lisp_Object console = CDFW_CONSOLE (EVENT_CHANNEL (e)); if (CONSOLE_GTK_P (XCONSOLE (console))) - return memory_hash (&e->event.magic.underlying_gdk_event, + return memory_hash (&EVENT_MAGIC_GDK_EVENT (e), sizeof (GdkEvent)); return 0; } @@ -244,7 +248,7 @@ emacs_gtk_handle_magic_event (struct Lisp_Event *emacs_event) { /* This function can GC */ - GdkEvent *event = &emacs_event->event.magic.underlying_gdk_event; + GdkEvent *event = &EVENT_MAGIC_GDK_EVENT (emacs_event); struct frame *f = XFRAME (EVENT_CHANNEL (emacs_event)); if (!FRAME_LIVE_P (f)) @@ -467,13 +471,13 @@ while ((ch = Lstream_get_ichar (istr)) != EOF) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - struct Lisp_Event *ev = XEVENT (emacs_event); - ev->channel = DEVICE_CONSOLE (d); - ev->event_type = key_press_event; + Lisp_Event *ev = XEVENT (emacs_event); + ev->channel = DEVICE_CONSOLE (d); ev->timestamp = event->time; - ev->event.key.modifiers = 0; - ev->event.key.keysym = make_char (ch); - enqueue_gtk_dispatch_event (emacs_event); + XSET_EVENT_TYPE (emacs_event, key_press_event); + XSET_EVENT_KEY_MODIFIERS (emacs_event, 0); + XSET_EVENT_KEY_KEYSYM (emacs_event, make_char (ch)); + enqueue_dispatch_event (emacs_event); } Lstream_close (istr); UNGCPRO; @@ -619,10 +623,12 @@ struct GTK_timeout *timeout = completed_timeouts; assert (timeout); completed_timeouts = completed_timeouts->next; - emacs_event->event_type = timeout_event; /* timeout events have nil as channel */ - emacs_event->timestamp = 0; /* #### wrong!! */ - emacs_event->event.timeout.interval_id = timeout->id; + set_event_type (emacs_event, timeout_event); + SET_EVENT_TIMESTAMP_ZERO (emacs_event); /* #### wrong!! */ + SET_EVENT_TIMEOUT_INTERVAL_ID (emacs_event, timeout->id); + SET_EVENT_TIMEOUT_FUNCTION (emacs_event, Qnil); + SET_EVENT_TIMEOUT_OBJECT (emacs_event, Qnil); Blocktype_free (the_GTK_timeout_blocktype, timeout); } @@ -862,22 +868,24 @@ gtk_process_to_emacs_event (struct Lisp_Event *emacs_event) { int i; - Lisp_Object process; assert (process_events_occurred > 0); + for (i = 0; i < MAXDESC; i++) { - process = filedesc_with_input[i]; + Lisp_Object process = filedesc_with_input[i]; if (PROCESSP (process)) - break; + { + filedesc_with_input[i] = Qnil; + process_events_occurred--; + /* process events have nil as channel */ + set_event_type (emacs_event, process_event); + SET_EVENT_TIMESTAMP_ZERO (emacs_event); /* #### */ + SET_EVENT_PROCESS_PROCESS (emacs_event, process); + return; + } } - assert (i < MAXDESC); - filedesc_with_input[i] = Qnil; - process_events_occurred--; - /* process events have nil as channel */ - emacs_event->event_type = process_event; - emacs_event->timestamp = 0; /* #### */ - emacs_event->event.process.process = process; + abort (); } static void @@ -968,13 +976,11 @@ GCPRO4 (l_type, l_data, l_dndlist, l_item); - ev->event_type = misc_user_event; - ev->timestamp = time; - - ev->channel = wrap_frame (f); - - ev->event.misc.x = x; - ev->event.misc.y = y; + set_event_type (ev, misc_user_event); + SET_EVENT_CHANNEL (ev, wrap_frame (f)); + SET_EVENT_TIMESTAMP (ev, time); + SET_EVENT_MISC_USER_X (ev, x); + SET_EVENT_MISC_USER_Y (ev, y); if (data->type == preferred_targets[TARGET_URI_LIST]) { @@ -1034,13 +1040,14 @@ data->length, Qbinary))); } - ev->event.misc.function = Qdragdrop_drop_dispatch; - ev->event.misc.object = Fcons (l_type, l_dndlist); + + SET_EVENT_MISC_USER_FUNCTION (ev, Qdragdrop_drop_dispatch); + SET_EVENT_MISC_USER_OBJECT (ev, Fcons (l_type, l_dndlist)); UNGCPRO; gtk_drag_finish (context, TRUE, FALSE, time); - enqueue_gtk_dispatch_event (event); + enqueue_dispatch_event (event); } gboolean @@ -1122,20 +1129,6 @@ /* get the next event from gtk */ /************************************************************************/ -static Lisp_Object dispatch_event_queue, dispatch_event_queue_tail; - -static void -enqueue_gtk_dispatch_event (Lisp_Object event) -{ - enqueue_event (event, &dispatch_event_queue, &dispatch_event_queue_tail); -} - -static Lisp_Object -dequeue_gtk_dispatch_event (void) -{ - return dequeue_event (&dispatch_event_queue, &dispatch_event_queue_tail); -} - /* This business exists because menu events "happen" when menubar_selection_callback() is called from somewhere deep within XtAppProcessEvent in emacs_Xt_next_event(). The @@ -1151,12 +1144,11 @@ { Lisp_Object event = Fmake_event (Qnil, Qnil); - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->channel = channel; - XEVENT (event)->event.eval.function = function; - XEVENT (event)->event.eval.object = object; - - enqueue_gtk_dispatch_event (event); + XSET_EVENT_TYPE (event, misc_user_event); + XSET_EVENT_CHANNEL (event, channel); + XSET_EVENT_MISC_USER_FUNCTION (event, function); + XSET_EVENT_MISC_USER_OBJECT (event, object); + enqueue_dispatch_event (event); } static void @@ -1170,14 +1162,20 @@ !process_events_occurred && !tty_events_occurred) { - gtk_main_iteration(); +#ifdef WIN32_ANY + mswindows_is_blocking = 1; +#endif + gtk_main_iteration (); +#ifdef WIN32_ANY + mswindows_is_blocking = 0; +#endif } if (!NILP (dispatch_event_queue)) { Lisp_Object event, event2; event2 = wrap_event (emacs_event); - event = dequeue_gtk_dispatch_event (); + event = dequeue_dispatch_event (); Fcopy_event (event, event2); Fdeallocate_event (event); } @@ -1193,9 +1191,9 @@ /* A dummy event, so that a cycle of the command loop will occur. */ fake_event_occurred = 0; /* eval events have nil as channel */ - emacs_event->event_type = eval_event; - emacs_event->event.eval.function = Qidentity; - emacs_event->event.eval.object = Qnil; + set_event_type (emacs_event, eval_event); + SET_EVENT_EVAL_FUNCTION (emacs_event, Qidentity); + SET_EVENT_EVAL_OBJECT (emacs_event, Qnil); } else /* if (process_events_occurred) */ gtk_process_to_emacs_event (emacs_event); @@ -1376,24 +1374,25 @@ } } - emacs_event->event_type = key_press_event; - emacs_event->timestamp = key_event->time; - emacs_event->event.key.modifiers = modifiers; - emacs_event->event.key.keysym = keysym; + set_event_type (emacs_event, key_press_event); + SET_EVENT_TIMESTAMP (emacs_event, key_event->time); + SET_EVENT_KEY_MODIFIERS (emacs_event, modifiers); + SET_EVENT_KEY_KEYSYM (emacs_event, keysym); } else /* Mouse press/release event */ { GdkEventButton *button_event = &gdk_event->button; - emacs_event->channel = wrap_frame (frame); - emacs_event->event_type = (button_event->type == GDK_BUTTON_RELEASE) ? - button_release_event : button_press_event; - - emacs_event->event.button.modifiers = modifiers; - emacs_event->timestamp = button_event->time; - emacs_event->event.button.button = button_event->button; - emacs_event->event.button.x = button_event->x; - emacs_event->event.button.y = button_event->y; + set_event_type (emacs_event, + button_event->type == GDK_BUTTON_RELEASE ? + button_release_event : button_press_event); + SET_EVENT_CHANNEL (emacs_event, wrap_frame (frame)); + + SET_EVENT_BUTTON_MODIFIERS (emacs_event, modifiers); + SET_EVENT_TIMESTAMP (emacs_event, button_event->time); + SET_EVENT_BUTTON_BUTTON (emacs_event, button_event->button); + SET_EVENT_BUTTON_X (emacs_event, button_event->x); + SET_EVENT_BUTTON_Y (emacs_event, button_event->y); } } break; @@ -1419,11 +1418,12 @@ DEVICE_GTK_MOUSE_TIMESTAMP (d) = ev->time; - emacs_event->channel = wrap_frame (frame); - emacs_event->event_type = pointer_motion_event; - emacs_event->timestamp = ev->time; - emacs_event->event.motion.x = x; - emacs_event->event.motion.y = y; + SET_EVENT_CHANNEL (emacs_event, wrap_frame (frame)); + set_event_type (emacs_event, pointer_motion_event); + SET_EVENT_TIMESTAMP (emacs_event, ev->time); + SET_EVENT_MOTION_X (emacs_event, x); + SET_EVENT_MOTION_Y (emacs_event, y); + if (mask & GDK_SHIFT_MASK) modifiers |= XEMACS_MOD_SHIFT; if (mask & GDK_CONTROL_MASK) modifiers |= XEMACS_MOD_CONTROL; if (mask & gd->MetaMask) modifiers |= XEMACS_MOD_META; @@ -1438,7 +1438,7 @@ /* Currently ignores Shift_Lock but probably shouldn't (but it definitely should ignore Caps_Lock). */ - emacs_event->event.motion.modifiers = modifiers; + SET_EVENT_MOTION_MODIFIERS (emacs_event, modifiers); } break; @@ -1465,7 +1465,7 @@ if (gtk_event_to_emacs_event (GTK_XEMACS_FRAME (widget), event, XEVENT (emacs_event))) { - enqueue_gtk_dispatch_event (emacs_event); + enqueue_dispatch_event (emacs_event); return (TRUE); } else @@ -1498,7 +1498,7 @@ struct frame *frame = (struct frame *) closure; Lisp_Object lisp_event = Fmake_event (Qnil, Qnil); struct Lisp_Event *emacs_event = XEVENT (lisp_event); - GdkEvent *gdk_event_copy = &emacs_event->event.magic.underlying_gdk_event; + GdkEvent *gdk_event_copy = &EVENT_MAGIC_GDK_EVENT (emacs_event); struct device *d = XDEVICE (FRAME_DEVICE (frame)); gboolean ignore_p = FALSE; @@ -1539,7 +1539,7 @@ } else { - enqueue_gtk_dispatch_event (lisp_event); + enqueue_dispatch_event (lisp_event); return (TRUE); } } @@ -1548,83 +1548,18 @@ /************************************************************************/ /* input pending / C-g checking */ /************************************************************************/ -static void -gtk_check_for_quit_char (struct device *d); - -static void -check_for_tty_quit_char (struct device *d) -{ - SELECT_TYPE temp_mask; - int infd = DEVICE_INFD (d); - struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); - Ichar quit_char = CONSOLE_QUIT_CHAR (con); - - FD_ZERO (&temp_mask); - FD_SET (infd, &temp_mask); - - while (1) - { - Lisp_Object event; - Ichar the_char; - - if (!poll_fds_for_input (temp_mask)) - return; - - event = Fmake_event (Qnil, Qnil); - if (!read_event_from_tty_or_stream_desc (XEVENT (event), con)) - /* EOF, or something ... */ - return; - /* #### bogus. quit-char should be allowed to be any sort - of event. */ - the_char = event_to_character (XEVENT (event), 1, 0, 0); - if (the_char >= 0 && the_char == quit_char) - { - Vquit_flag = Qt; - /* do not queue the C-g. See above. */ - return; - } - - /* queue the read event to be read for real later. */ - enqueue_gtk_dispatch_event (event); - } -} - -static void -emacs_gtk_quit_p (void) -{ - Lisp_Object devcons, concons; - - CONSOLE_LOOP (concons) - { - struct console *con = XCONSOLE (XCAR (concons)); - if (!con->input_enabled) - continue; - - CONSOLE_DEVICE_LOOP (devcons, con) - { - struct device *d; - d = XDEVICE (XCAR (devcons)); - - if (DEVICE_GTK_P (d)) - /* emacs may be exiting */ - gtk_check_for_quit_char (d); - else if (DEVICE_TTY_P (d)) - check_for_tty_quit_char (d); - } - } -} #include static void -drain_gtk_queue (void) +emacs_gtk_drain_queue (void) { /* We can't just spin through here and wait for GTKs idea of the event queue to get empty, or the queue never gets drained. The situation is as follows. A process event gets signalled, we put it on the queue, then we go into Fnext_event(), which calls - drain_gtk_queue(). But gtk_events_pending() will always return + emacs_gtk_drain_queue(). But gtk_events_pending() will always return TRUE if there are file-descriptor (aka our process) events pending. Using GDK_events_pending() only shows us windowing system events. @@ -1632,119 +1567,10 @@ if (GDK_DISPLAY ()) while (gdk_events_pending ()) gtk_main_iteration (); -} - -static int -emacs_gtk_event_pending_p (int user_p) -{ - Lisp_Object event; - int tick_count_val; - - /* If `user_p' is false, then this function returns whether there are any - X, timeout, or fd events pending (that is, whether emacs_gtk_next_event() - would return immediately without blocking). - - if `user_p' is true, then this function returns whether there are any - *user generated* events available (that is, whether there are keyboard - or mouse-click events ready to be read). This also implies that - emacs_Xt_next_event() would not block. - - In a non-SIGIO world, this also checks whether the user has typed ^G, - since this is a convenient place to do so. We don't need to do this - in a SIGIO world, since input causes an interrupt. - */ - - /* This function used to simply check whether there were any X - events (or if user_p was 1, it iterated over all the pending - X events using XCheckIfEvent(), looking for keystrokes and - button events). That worked in the old cheesoid event loop, - which didn't go through XtAppDispatchEvent(), but it doesn't - work any more -- X events may not result in anything. For - example, a button press in a blank part of the menubar appears - as an X event but will not result in any Emacs events (a - button press that activates the menubar results in an Emacs - event through the stop_next_event mechanism). - - The only accurate way of determining whether these X events - translate into Emacs events is to go ahead and dispatch them - until there's something on the dispatch queue. */ - - /* See if there are any user events already on the queue. */ - EVENT_CHAIN_LOOP (event, dispatch_event_queue) - if (!user_p || command_event_p (event)) - return 1; - - /* See if there's any TTY input available. - */ - if (poll_fds_for_input (tty_only_mask)) - return 1; - if (!user_p) - { - /* If not user_p and there are any timer or file-desc events - pending, we know there will be an event so we're through. */ -/* XtInputMask pending_value; */ - - /* Note that formerly we just checked the value of XtAppPending() - to determine if there was file-desc input. This doesn't - work any more with the signal_event_pipe; XtAppPending() - will says "yes" in this case but there isn't really any - input. Another way of fixing this problem is for the - signal_event_pipe to generate actual input in the form - of an identity eval event or something. (#### maybe this - actually happens?) */ - - if (poll_fds_for_input (process_only_mask)) - return 1; - - /* #### Is there any way to do this in Gtk? I don't think there - is a 'peek' for events */ -#if 0 - pending_value = XtAppPending (Xt_app_con); - - if (pending_value & XtIMTimer) - return 1; +#ifdef HAVE_TTY + drain_tty_devices (); #endif - } - - /* XtAppPending() can be super-slow, esp. over a network connection. - Quantify results have indicated that in some cases the - call to detect_input_pending() completely dominates the - running time of redisplay(). Fortunately, in a SIGIO world - we can more quickly determine whether there are any X events: - if an event has happened since the last time we checked, then - a SIGIO will have happened. On a machine with broken SIGIO, - we'll still be in an OK state -- the sigio_happened flag - will get set at least once a second, so we'll be no more than - one second behind reality. (In general it's OK if we - erroneously report no input pending when input is actually - pending() -- preemption is just a bit less efficient, that's - all. It's bad bad bad if you err the other way -- you've - promised that `next-event' won't block but it actually will, - and some action might get delayed until the next time you - hit a key.) - */ - - /* quit_check_signal_tick_count is volatile so try to avoid race conditions - by using a temporary variable */ - tick_count_val = quit_check_signal_tick_count; - if (last_quit_check_signal_tick_count != tick_count_val) - { - last_quit_check_signal_tick_count = tick_count_val; - - /* We need to drain the entire queue now -- if we only - drain part of it, we may later on end up with events - actually pending but detect_input_pending() returning - false because there wasn't another SIGIO. */ - - drain_gtk_queue (); - - EVENT_CHAIN_LOOP (event, dispatch_event_queue) - if (!user_p || command_event_p (event)) - return 1; - } - - return 0; } static void @@ -1769,7 +1595,7 @@ void reinit_vars_of_event_gtk (void) { - gtk_event_stream = xnew (struct event_stream); + gtk_event_stream = xnew_and_zero (struct event_stream); gtk_event_stream->event_pending_p = emacs_gtk_event_pending_p; gtk_event_stream->next_event_cb = emacs_gtk_next_event; gtk_event_stream->handle_magic_event_cb= emacs_gtk_handle_magic_event; @@ -1782,10 +1608,10 @@ gtk_event_stream->unselect_console_cb = emacs_gtk_unselect_console; gtk_event_stream->select_process_cb = emacs_gtk_select_process; gtk_event_stream->unselect_process_cb = emacs_gtk_unselect_process; - gtk_event_stream->quit_p_cb = emacs_gtk_quit_p; + gtk_event_stream->drain_queue_cb = emacs_gtk_drain_queue; gtk_event_stream->create_io_streams_cb= emacs_gtk_create_io_streams; gtk_event_stream->delete_io_streams_cb= emacs_gtk_delete_io_streams; - gtk_event_stream->force_event_pending = emacs_gtk_force_event_pending; + gtk_event_stream->force_event_pending_cb= emacs_gtk_force_event_pending; the_GTK_timeout_blocktype = Blocktype_new (struct GTK_timeout_blocktype); @@ -1798,11 +1624,6 @@ { reinit_vars_of_event_gtk (); - dispatch_event_queue = Qnil; - staticpro (&dispatch_event_queue); - dispatch_event_queue_tail = Qnil; - staticpro (&dispatch_event_queue_tail); - DEFVAR_BOOL ("gtk-allow-sendevents", >k_allow_sendevents /* *Non-nil means to allow synthetic events. Nil means they are ignored. Beware: allowing emacs to process SendEvents opens a big security hole. @@ -2138,104 +1959,3 @@ return 0; } #endif - -struct _quit_predicate_closure { - struct device *device; - Bool *critical; -}; - -static Bool -quit_char_predicate (Display *display, XEvent *event, XPointer data) -{ - struct _quit_predicate_closure *cl = (struct _quit_predicate_closure *) data; - struct device *d = cl->device; - struct frame *f = NULL; - struct gtk_device *gd = DEVICE_GTK_DATA (d); - char c, quit_char; - Bool *critical = cl->critical; - Lisp_Object keysym; - GdkWindow *window = gdk_window_lookup (event->xany.window); - guint32 keycode = 0; - GdkEventKey gdk_event; - - if (window) - f = gtk_any_window_to_frame (d, window); - - if (critical) - *critical = False; - - if ((event->type != KeyPress) || - (! window) || - (! f) || - (event->xkey.state - & (gd->MetaMask | gd->HyperMask | gd->SuperMask | gd->AltMask))) - { - return 0; - } - - { - char dummy[256]; - XLookupString (&(event->xkey), dummy, 200, (KeySym *)&keycode, 0); - } - - memset (&gdk_event, 0, sizeof (gdk_event)); - gdk_event.type = GDK_KEY_PRESS; - gdk_event.window = window; - gdk_event.keyval = keycode; - gdk_event.state = event->xkey.state; - - /* This duplicates some code that exists elsewhere, but it's relatively - fast and doesn't cons. */ - keysym = gtk_to_emacs_keysym (d, &gdk_event, 1); - if (NILP (keysym)) return 0; - if (CHAR_OR_CHAR_INTP (keysym)) - c = XCHAR_OR_CHAR_INT (keysym); - /* Highly doubtful that these are the quit character, but... */ - else if (EQ (keysym, QKbackspace)) c = '\b'; - else if (EQ (keysym, QKtab)) c = '\t'; - else if (EQ (keysym, QKlinefeed)) c = '\n'; - else if (EQ (keysym, QKreturn)) c = '\r'; - else if (EQ (keysym, QKescape)) c = 27; - else if (EQ (keysym, QKspace)) c = ' '; - else if (EQ (keysym, QKdelete)) c = 127; - else return 0; - - if (event->xkey.state & gd->MetaMask) c |= 0x80; - if ((event->xkey.state & ControlMask) && !(c >= 'A' && c <= 'Z')) - c &= 0x1F; /* unshifted control characters */ - quit_char = CONSOLE_QUIT_CHAR (XCONSOLE (DEVICE_CONSOLE (d))); - - if (c == quit_char) - return True; - /* If we've got Control-Shift-G instead of Control-G, that means - we have a critical_quit. Caps_Lock is its own modifier, so it - won't cause ^G to act differently than before. */ - if (event->xkey.state & ControlMask) c &= 0x1F; - if (c == quit_char) - { - if (critical) *critical = True; - return True; - } - return False; -} - -static void -gtk_check_for_quit_char (struct device *d) -{ - XEvent event; - int queued; - Bool critical_quit = False; - struct _quit_predicate_closure closure; - - XEventsQueued (GDK_DISPLAY (), QueuedAfterReading); - - closure.device = d; - closure.critical = &critical_quit; - - queued = XCheckIfEvent (GDK_DISPLAY (), &event, quit_char_predicate, (char *) &closure); - - if (queued) - { - Vquit_flag = (critical_quit ? Qcritical : Qt); - } -} Index: src/event-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-msw.c,v retrieving revision 1.86 retrieving revision 1.92 diff -u -r1.86 -r1.92 --- src/event-msw.c 18 Nov 2002 06:52:38 -0000 1.86 +++ src/event-msw.c 15 Feb 2003 11:20:39 -0000 1.92 @@ -1,7 +1,7 @@ /* The mswindows event_stream interface. Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1996, 2000, 2001, 2002 Ben Wing. + Copyright (C) 1996, 2000, 2001, 2002, 2003 Ben Wing. Copyright (C) 1997 Jonathan Harris. This file is part of XEmacs. @@ -73,6 +73,7 @@ #include "sysdep.h" #include "window.h" +#include "console-stream-impl.h" #include "console-msw-impl.h" #include "objects-msw-impl.h" @@ -94,21 +95,12 @@ #include "systime.h" #include "syswait.h" -#ifdef CYGWIN -#include "console-tty.h" -#endif - #ifdef HAVE_MENUBARS #define ADJR_MENUFLAG TRUE #else #define ADJR_MENUFLAG FALSE #endif -/* Fake key modifier which is attached to a quit char event. - Removed upon dequeueing an event */ -#define FAKE_MOD_QUIT (1 << 20) -#define FAKE_MOD_QUIT_CRITICAL (1 << 21) - /* Timer ID used for button2 emulation */ #define BUTTON_2_TIMER_ID 1 @@ -147,23 +139,18 @@ #endif /* - * Two separate queues, for efficiency, one (_u_) for user events, and - * another (_s_) for non-user ones. We always return events out of the - * first one until it is empty and only then proceed with the second - * one. + * We use an additional queue, as well as the normal dispatch queue, for + * efficiency, the normal one for user events, and another (_s_) for non-user + * ones. We always return events out of the first one until it is empty and + * only then proceed with the second one. */ -static Lisp_Object mswindows_u_dispatch_event_queue, mswindows_u_dispatch_event_queue_tail; -static Lisp_Object mswindows_s_dispatch_event_queue, mswindows_s_dispatch_event_queue_tail; +static Lisp_Object mswindows_s_dispatch_event_queue; +static Lisp_Object mswindows_s_dispatch_event_queue_tail; /* Brush for painting widgets */ static HBRUSH widget_brush = 0; static LONG last_widget_brushed = 0; -/* Count of quit chars currently in the queue */ -/* Incremented in WM_[SYS]KEYDOWN handler in the mswindows_wnd_proc() - Decremented in mswindows_dequeue_dispatch_event() */ -int mswindows_quit_chars_count = 0; - /* These are Lisp integers; see DEFVARS in this file for description. */ int mswindows_dynamic_frame_resize; int mswindows_alt_by_itself_activates_menu; @@ -182,13 +169,14 @@ /* This is the event signaled by the event pump. See mswindows_pump_outstanding_events for comments */ static int mswindows_error_caught_in_modal_loop; -static int mswindows_in_modal_loop; /* Count of wound timers */ static int mswindows_pending_timers_count; static DWORD mswindows_last_mouse_button_state; +extern int mswindows_is_blocking; + #ifndef CYGWIN /* Skips past slurp, shove, or winsock streams */ @@ -690,7 +678,7 @@ OVERLAPPED ov; /* Overlapped I/O structure */ void *buffer; /* Buffer. */ DWORD bufsize; /* Number of bytes last read */ - DWORD charbpos; /* Position in buffer for next fetch */ + DWORD charbpos; /* Position in buffer for next fetch */ unsigned int error_p :1; /* I/O Error seen */ unsigned int eof_p :1; /* EOF Error seen */ unsigned int pending_p :1; /* There is a pending I/O operation */ @@ -737,7 +725,8 @@ } else { - if (!GetOverlappedResult ((HANDLE)str->s, &str->ov, &str->bufsize, TRUE)) + if (!GetOverlappedResult ((HANDLE)str->s, &str->ov, &str->bufsize, + TRUE)) { if (GetLastError() == ERROR_HANDLE_EOF) str->bufsize = 0; @@ -783,7 +772,8 @@ else { DWORD dw_unused; - if (!GetOverlappedResult ((HANDLE)str->s, &str->ov, &dw_unused, TRUE)) + if (!GetOverlappedResult ((HANDLE)str->s, &str->ov, &dw_unused, + TRUE)) str->error_p = 1; str->pending_p = 0; } @@ -927,12 +917,12 @@ void mswindows_enqueue_dispatch_event (Lisp_Object event) { - int user_p = mswindows_user_event_p (XEVENT(event)); - enqueue_event (event, - user_p ? &mswindows_u_dispatch_event_queue : - &mswindows_s_dispatch_event_queue, - user_p ? &mswindows_u_dispatch_event_queue_tail : - &mswindows_s_dispatch_event_queue_tail); + int user_p = mswindows_user_event_p (XEVENT (event)); + if (user_p) + enqueue_dispatch_event (event); + else + enqueue_event (event, &mswindows_s_dispatch_event_queue, + &mswindows_s_dispatch_event_queue_tail); /* Avoid blocking on WaitMessage */ qxePostMessage (NULL, XM_BUMPQUEUE, 0, 0); @@ -940,9 +930,6 @@ /* * Add a misc-user event to the dispatch queue. - * - * Stuff it into our own dispatch queue, so we have something - * to return from next_event callback. */ void mswindows_enqueue_misc_user_event (Lisp_Object channel, Lisp_Object function, @@ -950,22 +937,11 @@ { Lisp_Object event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC - XSET_EVENT_TYPE (event, misc_user_event); XSET_EVENT_CHANNEL (event, channel); XSET_EVENT_TIMESTAMP (event, GetTickCount()); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), function); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), object); -#else /* not USE_KKCC */ - Lisp_Event *e = XEVENT (event); - - e->event_type = misc_user_event; - e->channel = channel; - e->timestamp = GetTickCount (); - e->event.misc.function = function; - e->event.misc.object = object; -#endif /* not USE_KKCC */ + XSET_EVENT_MISC_USER_FUNCTION (event, function); + XSET_EVENT_MISC_USER_OBJECT (event, object); mswindows_enqueue_dispatch_event (event); } @@ -975,19 +951,10 @@ { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC - XSET_EVENT_CHANNEL (emacs_event, (hwnd ? mswindows_find_frame (hwnd) : Qnil)); + XSET_EVENT_CHANNEL (emacs_event, hwnd ? mswindows_find_frame (hwnd) : Qnil); XSET_EVENT_TIMESTAMP (emacs_event, GetMessageTime ()); XSET_EVENT_TYPE (emacs_event, magic_event); - XSET_MAGIC_DATA_MSWINDOWS_EVENT (XEVENT_DATA(emacs_event), msg); -#else /* not USE_KKCC */ - Lisp_Event *event = XEVENT (emacs_event); - - event->channel = hwnd ? mswindows_find_frame (hwnd) : Qnil; - event->timestamp = GetMessageTime(); - event->event_type = magic_event; - EVENT_MSWINDOWS_MAGIC_TYPE (event) = msg; -#endif /* not USE_KKCC */ + XSET_EVENT_MAGIC_MSWINDOWS_EVENT (emacs_event, msg); mswindows_enqueue_dispatch_event (emacs_event); } @@ -996,19 +963,11 @@ mswindows_enqueue_process_event (Lisp_Process *p) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event *event = XEVENT (emacs_event); Lisp_Object process = wrap_process (p); - -#ifdef USE_KKCC XSET_EVENT_TYPE (emacs_event, process_event); - XSET_EVENT_TIMESTAMP (emacs_event, GetTickCount()); - XSET_PROCESS_DATA_PROCESS (XEVENT_DATA (emacs_event), process); -#else /* not USE_KKCC */ - event->event_type = process_event; - event->timestamp = GetTickCount (); - event->event.process.process = process; -#endif /* not USE_KKCC */ + XSET_EVENT_TIMESTAMP (emacs_event, GetTickCount ()); + XSET_EVENT_PROCESS_PROCESS (emacs_event, process); mswindows_enqueue_dispatch_event (emacs_event); } @@ -1025,47 +984,27 @@ recognition will fail */ Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event *event = XEVENT (emacs_event); mswindows_handle_sticky_modifiers (0, 0, downp, 0); if (downp) { -#ifdef USE_KKCC XSET_EVENT_TYPE (emacs_event, button_press_event); -#else /* not USE_KKCC */ - event->event_type = button_press_event; -#endif /* not USE_KKCC */ } else { -#ifdef USE_KKCC XSET_EVENT_TYPE (emacs_event, button_release_event); -#else /* not USE_KKCC */ - event->event_type = button_release_event; -#endif /* not USE_KKCC */ } -#ifdef USE_KKCC XSET_EVENT_CHANNEL (emacs_event, mswindows_find_frame (hwnd)); XSET_EVENT_TIMESTAMP (emacs_event, when); - XSET_BUTTON_DATA_BUTTON (XEVENT_DATA (emacs_event), + XSET_EVENT_BUTTON_BUTTON (emacs_event, (msg==WM_LBUTTONDOWN || msg==WM_LBUTTONUP) ? 1 : ((msg==WM_RBUTTONDOWN || msg==WM_RBUTTONUP) ? 3 : 2)); - XSET_BUTTON_DATA_X (XEVENT_DATA (emacs_event), where.x); - XSET_BUTTON_DATA_Y (XEVENT_DATA (emacs_event), where.y); - XSET_BUTTON_DATA_MODIFIERS (XEVENT_DATA (emacs_event), - mswindows_modifier_state (NULL, mods, 0)); -#else /* not USE_KKCC */ - event->channel = mswindows_find_frame (hwnd); - event->timestamp = when; - event->event.button.button = - (msg==WM_LBUTTONDOWN || msg==WM_LBUTTONUP) ? 1 : - ((msg==WM_RBUTTONDOWN || msg==WM_RBUTTONUP) ? 3 : 2); - event->event.button.x = where.x; - event->event.button.y = where.y; - event->event.button.modifiers = mswindows_modifier_state (NULL, mods, 0); -#endif /* not USE_KKCC */ + XSET_EVENT_BUTTON_X (emacs_event, where.x); + XSET_EVENT_BUTTON_Y (emacs_event, where.y); + XSET_EVENT_BUTTON_MODIFIERS (emacs_event, + mswindows_modifier_state (NULL, mods, 0)); if (downp) { @@ -1091,21 +1030,11 @@ { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_CHANNEL (emacs_event, mswindows_find_console(hwnd)); XSET_EVENT_TIMESTAMP (emacs_event, GetMessageTime()); XSET_EVENT_TYPE (emacs_event, key_press_event); - XSET_KEY_DATA_KEYSYM (XEVENT_DATA (emacs_event), keysym); - XSET_KEY_DATA_MODIFIERS (XEVENT_DATA (emacs_event), mods); -#else /* not USE_KKCC */ - Lisp_Event *event = XEVENT(emacs_event); - - event->channel = mswindows_find_console(hwnd); - event->timestamp = GetMessageTime(); - event->event_type = key_press_event; - event->event.key.keysym = keysym; - event->event.key.modifiers = mods; -#endif /* not USE_KKCC */ + XSET_EVENT_KEY_KEYSYM (emacs_event, keysym); + XSET_EVENT_KEY_MODIFIERS (emacs_event, mods); mswindows_enqueue_dispatch_event (emacs_event); return emacs_event; } @@ -1117,92 +1046,14 @@ static Lisp_Object mswindows_dequeue_dispatch_event (void) { - Lisp_Object event; - Lisp_Event *sevt; - - assert (!NILP(mswindows_u_dispatch_event_queue) || - !NILP(mswindows_s_dispatch_event_queue)); - - event = dequeue_event ( - NILP(mswindows_u_dispatch_event_queue) ? - &mswindows_s_dispatch_event_queue : - &mswindows_u_dispatch_event_queue, - NILP(mswindows_u_dispatch_event_queue) ? - &mswindows_s_dispatch_event_queue_tail : - &mswindows_u_dispatch_event_queue_tail); - -#ifdef USE_KKCC - if (XEVENT_TYPE (event) == key_press_event - && (XKEY_DATA_MODIFIERS (XEVENT_DATA(event)) & FAKE_MOD_QUIT)) - XSET_KEY_DATA_MODIFIERS (XEVENT_DATA (event), - XKEY_DATA_MODIFIERS (XEVENT_DATA (event)) & - ~(FAKE_MOD_QUIT | FAKE_MOD_QUIT_CRITICAL)); -#else /* not USE_KKCC */ - sevt = XEVENT (event); - if (sevt->event_type == key_press_event - && (sevt->event.key.modifiers & FAKE_MOD_QUIT)) - sevt->event.key.modifiers &= - ~(FAKE_MOD_QUIT | FAKE_MOD_QUIT_CRITICAL); -#endif /* not USE_KKCC */ - - return event; -} - -/* - * Remove and return the first emacs event on the dispatch queue that matches - * the supplied event. - * Timeout event matches if interval_id is equal to that of the given event. - * Keypress event matches if logical AND between modifiers bitmask of the - * event in the queue and that of the given event is non-zero. - * For all other event types, this function aborts. - */ - -Lisp_Object -mswindows_cancel_dispatch_event (Lisp_Event *match) -{ - Lisp_Object event; - Lisp_Object previous_event = Qnil; - int user_p = mswindows_user_event_p (match); - Lisp_Object *head = user_p ? &mswindows_u_dispatch_event_queue : - &mswindows_s_dispatch_event_queue; - Lisp_Object *tail = user_p ? &mswindows_u_dispatch_event_queue_tail : - &mswindows_s_dispatch_event_queue_tail; - - assert (match->event_type == timeout_event - || match->event_type == key_press_event); - - EVENT_CHAIN_LOOP (event, *head) - { - Lisp_Event *e = XEVENT (event); -#ifdef USE_KKCC - if ((EVENT_TYPE (e) == EVENT_TYPE (match)) && - ((EVENT_TYPE (e) == timeout_event) ? - (XTIMEOUT_DATA_INTERVAL_ID (EVENT_DATA (e)) == - XTIMEOUT_DATA_INTERVAL_ID (EVENT_DATA (match))) : - ((XKEY_DATA_MODIFIERS (EVENT_DATA (e)) & - XKEY_DATA_MODIFIERS (EVENT_DATA (match))) != 0))) -#else /* not USE_KKCC */ - if ((e->event_type == match->event_type) && - ((e->event_type == timeout_event) ? - (e->event.timeout.interval_id == match->event.timeout.interval_id) : - /* Must be key_press_event */ - ((e->event.key.modifiers & match->event.key.modifiers) != 0))) -#endif /* not USE_KKCC */ - { - if (NILP (previous_event)) - dequeue_event (head, tail); - else - { - XSET_EVENT_NEXT (previous_event, XEVENT_NEXT (event)); - if (EQ (*tail, event)) - *tail = previous_event; - } + assert (!NILP (dispatch_event_queue) || + !NILP (mswindows_s_dispatch_event_queue)); - return event; - } - previous_event = event; - } - return Qnil; + if (!NILP (dispatch_event_queue)) + return dequeue_dispatch_event (); + else + return dequeue_event (&mswindows_s_dispatch_event_queue, + &mswindows_s_dispatch_event_queue_tail); } #ifndef CYGWIN @@ -1279,43 +1130,6 @@ return !ascii_strcasecmp (class_name_buf, XEMACS_CLASS); } -struct mswindows_protect_modal_loop -{ - Lisp_Object (*bfun) (Lisp_Object barg); - Lisp_Object barg; -}; - -static Lisp_Object -mswindows_protect_modal_loop_1 (void *gack) -{ - struct mswindows_protect_modal_loop *gata = - (struct mswindows_protect_modal_loop *) gack; - - return (gata->bfun) (gata->barg); -} - -Lisp_Object -mswindows_protect_modal_loop (const char *error_string, - Lisp_Object (*bfun) (Lisp_Object barg), - Lisp_Object barg, int flags) -{ - Lisp_Object tmp; - struct mswindows_protect_modal_loop bluh; - - bluh.bfun = bfun; - bluh.barg = barg; - - ++mswindows_in_modal_loop; - tmp = call_trapping_problems (Qevent, error_string, - flags, 0, - mswindows_protect_modal_loop_1, &bluh); - if (UNBOUNDP (tmp)) - mswindows_error_caught_in_modal_loop = 1; - --mswindows_in_modal_loop; - - return tmp; -} - void mswindows_unmodalize_signal_maybe (void) { @@ -1327,7 +1141,7 @@ * condition_case. See mswindows_pump_outstanding_events */ static Lisp_Object -mswindows_unsafe_pump_events (Lisp_Object u_n_u_s_e_d) +mswindows_unsafe_pump_events (void *arg) { /* This function can call lisp */ Lisp_Object event = Fmake_event (Qnil, Qnil); @@ -1335,7 +1149,7 @@ int do_redisplay = 0; GCPRO1 (event); - while (detect_input_pending ()) + while (detect_input_pending (1)) { Fnext_event (event, Qnil); Fdispatch_event (event); @@ -1362,7 +1176,7 @@ * neither are waitable handles checked. The function pumps * thus only dispatch events already queued, as well as those * resulted in dispatching thereof. This is done by setting - * module local variable mswindows_in_modal_loop to nonzero. + * in_modal_loop to nonzero. * * Return value is Qt if no errors was trapped, or Qunbound if * there was an error. @@ -1394,71 +1208,15 @@ GCPRO1 (result); if (!mswindows_error_caught_in_modal_loop) - result = mswindows_protect_modal_loop - ("Error during event handling", mswindows_unsafe_pump_events, Qnil, 0); + result = event_stream_protect_modal_loop + ("Error during event handling", mswindows_unsafe_pump_events, 0, 0); UNGCPRO; + if (UNBOUNDP (result)) + mswindows_error_caught_in_modal_loop = 1; return result; } /* - * KEYBOARD_ONLY_P is set to non-zero when we are called from - * QUITP, and are interesting in keyboard messages only. - */ -static void -mswindows_drain_windows_queue (void) -{ - MSG msg; - - /* should call mswindows_need_event_in_modal_loop() if in modal loop */ - assert (!mswindows_in_modal_loop); - - while (qxePeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) - { -#ifdef HAVE_DIALOGS - /* Don't translate messages destined for a dialog box, this - makes keyboard traversal work. I think?? */ - if (mswindows_is_dialog_msg (&msg)) - { - mswindows_unmodalize_signal_maybe (); - continue; - } -#endif /* HAVE_DIALOGS */ - - /* We have to translate messages that are not sent to an XEmacs - frame. This is so that key presses work ok in things like - edit fields. However, we *musn't* translate message for XEmacs - frames as this is handled in the wnd proc. - We also have to avoid generating paint magic events for windows - that aren't XEmacs frames */ - - if (!mswindows_window_is_xemacs (msg.hwnd)) - TranslateMessage (&msg); - else if (msg.message == WM_PAINT) - { - struct mswindows_frame *msframe; - - /* hdc will be NULL unless this is a subwindow - in which case we - shouldn't have received a paint message for it here. */ - assert (msg.wParam == 0); - - /* Queue a magic event for handling when safe */ - msframe = - FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (msg.hwnd))); - if (!msframe->paint_pending) - { - msframe->paint_pending = 1; - mswindows_enqueue_magic_event (msg.hwnd, WM_PAINT); - } - /* Don't dispatch. WM_PAINT is always the last message in the - queue so it's OK to just return. */ - return; - } - qxeDispatchMessage (&msg); - mswindows_unmodalize_signal_maybe (); - } -} - -/* * This is a special flavor of the mswindows_need_event function, * used while in event pump. Actually, there is only kind of events * allowed while in event pump: a timer. An attempt to fetch any @@ -1481,7 +1239,7 @@ MSG msg; /* Check if already have one */ - if (!NILP (mswindows_u_dispatch_event_queue) + if (!NILP (dispatch_event_queue) || !NILP (mswindows_s_dispatch_event_queue)) return; @@ -1489,12 +1247,14 @@ if (!badly_p) return; - /* We do not check the _u_ queue, because timers go to _s_ */ + /* We do not check the user queue, because timers go to _s_ */ while (NILP (mswindows_s_dispatch_event_queue)) { /* We'll deadlock if go waiting */ if (mswindows_pending_timers_count == 0) - invalid_operation ("Deadlock due to an attempt to call next-event in a wrong context", Qunbound); + invalid_operation + ("Deadlock due to an attempt to call next-event in a wrong context", + Qunbound); /* Fetch and dispatch any pending timers */ if (qxeGetMessage (&msg, NULL, WM_TIMER, WM_TIMER) > 0) @@ -1502,6 +1262,73 @@ } } +/* BADLY_P non-zero means we were called from mswindows_need_event(1). It + only matters when we are in a modal loop, and causes us to fetch timer + events (the only kinds we can fetch in such a case). + */ +static void +mswindows_drain_windows_queue (int badly_p) +{ + MSG msg; + + if (in_modal_loop) + mswindows_need_event_in_modal_loop (badly_p); + else + while (qxePeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) + { +#ifdef HAVE_DIALOGS + /* Don't translate messages destined for a dialog box, this + makes keyboard traversal work. I think?? */ + if (mswindows_is_dialog_msg (&msg)) + { + mswindows_unmodalize_signal_maybe (); + continue; + } +#endif /* HAVE_DIALOGS */ + + /* We have to translate messages that are not sent to an XEmacs + frame. This is so that key presses work ok in things like + edit fields. However, we *musn't* translate message for XEmacs + frames as this is handled in the wnd proc. + We also have to avoid generating paint magic events for windows + that aren't XEmacs frames */ + + if (!mswindows_window_is_xemacs (msg.hwnd)) + TranslateMessage (&msg); + else if (msg.message == WM_PAINT) + { + struct mswindows_frame *msframe; + + /* hdc will be NULL unless this is a subwindow - in which case we + shouldn't have received a paint message for it here. */ + assert (msg.wParam == 0); + + /* Queue a magic event for handling when safe */ + msframe = + FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (msg.hwnd))); + if (!msframe->paint_pending) + { + msframe->paint_pending = 1; + mswindows_enqueue_magic_event (msg.hwnd, WM_PAINT); + } + /* Don't dispatch. WM_PAINT is always the last message in the + queue so it's OK to just return. */ + return; + } + qxeDispatchMessage (&msg); + mswindows_unmodalize_signal_maybe (); + } +} + +static void +emacs_mswindows_drain_queue (void) +{ + mswindows_drain_windows_queue (0); +#ifdef HAVE_TTY + drain_tty_devices (); +#endif +} + /* * This drains the event queue and fills up two internal queues until * an event of a type specified by USER_P is retrieved. @@ -1512,7 +1339,7 @@ static void mswindows_need_event (int badly_p) { - while (NILP (mswindows_u_dispatch_event_queue) + while (NILP (dispatch_event_queue) && NILP (mswindows_s_dispatch_event_queue)) { #ifdef CYGWIN @@ -1529,13 +1356,15 @@ EMACS_SET_SECS_USECS (sometime, 0, 0); EMACS_TIME_TO_SELECT_TIME (sometime, select_time_to_block); pointer_to_this = &select_time_to_block; - if (mswindows_in_modal_loop) + if (in_modal_loop) /* In modal loop with badly_p false, don't care about Windows events. */ FD_CLR (windows_fd, &temp_mask); } + mswindows_is_blocking = 1; active = select (MAXDESC, &temp_mask, 0, 0, pointer_to_this); + mswindows_is_blocking = 0; if (active == 0) { @@ -1545,24 +1374,20 @@ else if (active > 0) { if (FD_ISSET (windows_fd, &temp_mask)) - { - if (mswindows_in_modal_loop) - mswindows_need_event_in_modal_loop (badly_p); - else - mswindows_drain_windows_queue (); - } + mswindows_drain_windows_queue (badly_p); else { #ifdef HAVE_TTY /* Look for a TTY event */ - for (i = 0; i < MAXDESC-1; i++) + for (i = 0; i < MAXDESC; i++) { /* To avoid race conditions (among other things, an infinite loop when called from Fdiscard_input()), we must return user events ahead of process events. */ if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &tty_only_mask)) { - struct console *c = tty_find_console_from_fd (i); + struct console *c = + find_tty_or_stream_console_from_fd (i); Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); Lisp_Event *event = XEVENT (emacs_event); @@ -1576,14 +1401,14 @@ } #endif /* Look for a process event */ - for (i = 0; i < MAXDESC-1; i++) + for (i = 0; i < MAXDESC; i++) { if (FD_ISSET (i, &temp_mask)) { if (FD_ISSET (i, &process_only_mask)) { Lisp_Process *p = - get_process_from_usid (FD_TO_USID(i)); + get_process_from_usid (FD_TO_USID (i)); mswindows_enqueue_process_event (p); } @@ -1605,18 +1430,18 @@ if (errno != EINTR) { /* something bad happened */ - assert(0); + assert (0); } } else { - assert(0); + assert (0); } #else /* not CYGWIN */ /* Now try getting a message or process event */ DWORD active; DWORD what_events; - if (mswindows_in_modal_loop) + if (in_modal_loop) /* In a modal loop, only look for timer events, and only if we really need one. */ { @@ -1714,10 +1539,15 @@ qxePeekMessage (&msg, 0, 0, 0, PM_NOREMOVE)) active = WAIT_OBJECT_0 + mswindows_waitable_count; else - active = MsgWaitForMultipleObjects (mswindows_waitable_count, - mswindows_waitable_handles, - FALSE, badly_p ? INFINITE : 0, - what_events); + { + mswindows_is_blocking = 1; + active = MsgWaitForMultipleObjects (mswindows_waitable_count, + mswindows_waitable_handles, + FALSE, + badly_p ? INFINITE : 0, + what_events); + mswindows_is_blocking = 0; + } } __except (GetExceptionCode () == EXCEPTION_BREAKPOINT ? EXCEPTION_CONTINUE_EXECUTION : @@ -1737,52 +1567,88 @@ return; } else if (active == WAIT_OBJECT_0 + mswindows_waitable_count) - { - /* Got your message, thanks */ - if (mswindows_in_modal_loop) - mswindows_need_event_in_modal_loop (badly_p); - else - mswindows_drain_windows_queue (); - } + mswindows_drain_windows_queue (badly_p); else { int ix = active - WAIT_OBJECT_0; - /* First, try to find which process' output has signaled */ - Lisp_Process *p = - get_process_from_usid (HANDLE_TO_USID - (mswindows_waitable_handles[ix])); - if (p != NULL) + + /* look for a stream console event; see + emacs_mswindows_select_console below. */ + LIST_LOOP_3 (porca_troia, Vconsole_list, vcontail) { - /* Found a signaled process input handle */ - mswindows_enqueue_process_event (p); + struct console *con = XCONSOLE (porca_troia); + + if (CONSOLE_STREAM_P (con)) + { + Lisp_Object instr = CONSOLE_STREAM_DATA (con)->instream; + if (!NILP (instr) && !UNBOUNDP (instr) && + get_ntpipe_input_stream_waitable (XLSTREAM (instr)) == + mswindows_waitable_handles [ix]) + { + Ichar ch = Lstream_get_ichar (XLSTREAM (instr)); + if (ch < 0) + { + /* deleting the console might not be safe right now + ... */ + enqueue_magic_eval_event (io_error_delete_console, + porca_troia); + /* but we definitely need to unselect it to avoid + infinite loops reading EOF's */ + Fconsole_disable_input (porca_troia); + mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + } + else + { + Lisp_Object event = Fmake_event (Qnil, Qnil); + /* Here we really do want to set the + use_console_meta_flag because the char is from the + TTY. */ + character_to_event (ch, XEVENT (event), con, 1, 1); + XSET_EVENT_CHANNEL (event, porca_troia); + enqueue_dispatch_event (event); + } + break; + } + } } - else - { - /* None. This means that the process handle itself has signaled. - Remove the handle from the wait vector, and make status_notify - note the exited process. First find the process object if - possible. */ - LIST_LOOP_3 (vaffanculo, Vprocess_list, vproctail) - if (get_nt_process_handle (XPROCESS (vaffanculo)) == - mswindows_waitable_handles [ix]) - break; - mswindows_waitable_handles [ix] = - mswindows_waitable_handles [--mswindows_waitable_count]; - kick_status_notify (); - /* We need to return a process event here so that - (1) accept-process-output will return when called on this - process, and (2) status notifications will happen in - accept-process-output, sleep-for, and sit-for. */ - if (!NILP (vproctail)) - mswindows_enqueue_process_event (XPROCESS (vaffanculo)); + + if (NILP (vcontail)) + { /* no stream console event, look for process event */ + /* First, try to find which process' output has signaled */ + Lisp_Process *p = + get_process_from_usid (HANDLE_TO_USID + (mswindows_waitable_handles[ix])); + if (p != NULL) + /* Found a signaled process input handle */ + mswindows_enqueue_process_event (p); else { - /* abort (); */ - /* #### FUCKME! When can this happen? I hit this abort() - when I tried enabling it. */ - /* Have to return something: there may be no accompanying - process event */ - mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + /* None. This means that the process handle itself has + signaled. Remove the handle from the wait vector, and + make status_notify note the exited process. First + find the process object if possible. */ + LIST_LOOP_3 (vaffanculo, Vprocess_list, vproctail) + if (get_nt_process_handle (XPROCESS (vaffanculo)) == + mswindows_waitable_handles [ix]) + break; + mswindows_waitable_handles [ix] = + mswindows_waitable_handles [--mswindows_waitable_count]; + kick_status_notify (); + /* We need to return a process event here so that (1) + accept-process-output will return when called on this + process, and (2) status notifications will happen in + accept-process-output, sleep-for, and sit-for. */ + if (!NILP (vproctail)) + mswindows_enqueue_process_event (XPROCESS (vaffanculo)); + else + { + /* abort (); */ + /* #### FUCKME! When can this happen? I hit this + abort() when I tried enabling it. */ + /* Have to return something: there may be no + accompanying process event */ + mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + } } } } @@ -1801,26 +1667,16 @@ mswindows_wm_timer_callback (HWND hwnd, UINT umsg, UINT id_timer, DWORD dwtime) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event *event = XEVENT (emacs_event); if (KillTimer (NULL, id_timer)) --mswindows_pending_timers_count; -#ifdef USE_KKCC XSET_EVENT_CHANNEL (emacs_event, Qnil); XSET_EVENT_TIMESTAMP (emacs_event, dwtime); XSET_EVENT_TYPE (emacs_event, timeout_event); - XSET_TIMEOUT_DATA_INTERVAL_ID (XEVENT_DATA(emacs_event), id_timer); - XSET_TIMEOUT_DATA_FUNCTION (XEVENT_DATA(emacs_event), Qnil); - XSET_TIMEOUT_DATA_OBJECT (XEVENT_DATA(emacs_event), Qnil); -#else /* not USE_KKCC */ - event->channel = Qnil; - event->timestamp = dwtime; - event->event_type = timeout_event; - event->event.timeout.interval_id = id_timer; - event->event.timeout.function = Qnil; - event->event.timeout.object = Qnil; -#endif /* not USE_KKCC */ + XSET_EVENT_TIMEOUT_INTERVAL_ID (emacs_event, id_timer); + XSET_EVENT_TIMEOUT_FUNCTION (emacs_event, Qnil); + XSET_EVENT_TIMEOUT_OBJECT (emacs_event, Qnil); mswindows_enqueue_dispatch_event (emacs_event); } @@ -1901,7 +1757,7 @@ GCPRO1 (obj); obj = Feval (XCAR (obj)); - RETURN_UNGCPRO(obj); + RETURN_UNGCPRO (obj); } /* Evaluate the supplied string as a sequence of Lisp forms, wrapped in @@ -1966,7 +1822,7 @@ Fput(token, QHSZ, make_float ((int)hsz)); Vdde_advise_items = Fcons (token, Vdde_advise_items); - RETURN_UNGCPRO(token); + RETURN_UNGCPRO (token); } DEFUN("dde-free-advise-item", Fdde_free_advise_item, 1, 1, 0, /* @@ -2262,29 +2118,17 @@ }; assert (!NILP (event->channel)); -#ifdef USE_KKCC SET_EVENT_TIMESTAMP (event, GetTickCount()); SET_EVENT_TYPE (event, misc_user_event); - XSET_MISC_USER_DATA_BUTTON (EVENT_DATA (event), 1); - XSET_MISC_USER_DATA_MODIFIERS (EVENT_DATA (event), 0); - XSET_MISC_USER_DATA_X (EVENT_DATA (event), -1); - XSET_MISC_USER_DATA_Y (EVENT_DATA (event), -1); - XSET_MISC_USER_DATA_FUNCTION (EVENT_DATA (event), + SET_EVENT_MISC_USER_BUTTON (event, 1); + SET_EVENT_MISC_USER_MODIFIERS (event, 0); + SET_EVENT_MISC_USER_X (event, -1); + SET_EVENT_MISC_USER_Y (event, -1); + SET_EVENT_MISC_USER_FUNCTION (event, Qdragdrop_drop_dispatch); - XSET_MISC_USER_DATA_OBJECT (EVENT_DATA (event), + SET_EVENT_MISC_USER_OBJECT (event, Fcons (Qdragdrop_URL, Fcons (l_dndlist, Qnil))); -#else /* not USE_KKCC */ - event->timestamp = GetTickCount(); - event->event_type = misc_user_event; - event->event.misc.button = 1; - event->event.misc.modifiers = 0; - event->event.misc.x = -1; - event->event.misc.y = -1; - event->event.misc.function = Qdragdrop_drop_dispatch; - event->event.misc.object = Fcons (Qdragdrop_URL, - Fcons (l_dndlist, Qnil)); -#endif /* not USE_KKCC */ mswindows_enqueue_dispatch_event (emacs_event); UNGCPRO; return (HDDEDATA) DDE_FACK; @@ -2587,7 +2431,7 @@ { BYTE keymap[256]; SHORT keystate[3]; - // SHORT asyncstate[3]; + /* SHORT asyncstate[3]; */ GetKeyboardState (keymap); keystate[0] = GetKeyState (VK_MENU); @@ -2630,8 +2474,9 @@ LRESULT WINAPI mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam) { - /* Note: Remember to initialize emacs_event and event before use. - This code calls code that can GC. You must GCPRO before calling such code. */ + /* Note: Remember to initialize emacs_event and event before use. This + code calls code that can GC. You must GCPRO before calling such + code. */ Lisp_Object emacs_event = Qnil; Lisp_Object fobj = Qnil; @@ -2696,8 +2541,8 @@ } if (should_set_keymap) - // && (message_ != WM_SYSKEYUP - // || NILP (Vmenu_accelerator_enabled))) + /* && (message_ != WM_SYSKEYUP */ + /* || NILP (Vmenu_accelerator_enabled))) */ SetKeyboardState (keymap); } @@ -2801,11 +2646,11 @@ } else /* Normal keys & modifiers */ { - Ichar quit_ch = - CONSOLE_QUIT_CHAR (XCONSOLE (mswindows_find_console (hwnd))); POINT pnt = { LOWORD (GetMessagePos()), HIWORD (GetMessagePos()) }; MSG msg, tranmsg; +#ifdef HAVE_MENUBARS int potential_accelerator = 0; +#endif int got_accelerator = 0; /* No need to gcpro because the event is already on a queue when we retrieve it. */ @@ -2901,27 +2746,9 @@ } #endif /* DEBUG_XEMACS */ - /* If a quit char with no modifiers other than control and - shift, then mark it with a fake modifier, which is removed - upon dequeueing the event */ - if (((quit_ch < ' ' && (mods & XEMACS_MOD_CONTROL) - && DOWNCASE (0, quit_ch + 'a' - 1) == - DOWNCASE (0, ch)) - || (quit_ch >= ' ' && !(mods & XEMACS_MOD_CONTROL) - && DOWNCASE (0, quit_ch) == - DOWNCASE (0, ch))) - && ((mods_with_shift & - ~(XEMACS_MOD_CONTROL | XEMACS_MOD_SHIFT)) - == 0)) - { - mods_with_quit |= FAKE_MOD_QUIT; - if (mods_with_shift & XEMACS_MOD_SHIFT) - mods_with_quit |= FAKE_MOD_QUIT_CRITICAL; - mswindows_quit_chars_count++; - } #ifdef HAVE_MENUBARS - else if (potential_accelerator && !got_accelerator && - mswindows_char_is_accelerator (frame, ch)) + if (potential_accelerator && !got_accelerator && + mswindows_char_is_accelerator (frame, ch)) { got_accelerator = 1; break; @@ -3012,8 +2839,8 @@ (received_keys + (tounret - 1) * 2, 2), C_STRING_ALLOCA, intchar, Qmswindows_unicode); - XEVENT (lastev)->event.key.alt_keychars[i] = - itext_ichar (intchar); + XSET_EVENT_KEY_ALT_KEYCHARS + (lastev, i, itext_ichar (intchar)); } } else @@ -3050,8 +2877,8 @@ mswindows_locale_to_code_page (lcid), NULL); - XEVENT (lastev)->event.key.alt_keychars[i] = - itext_ichar (intchar); + XSET_EVENT_KEY_ALT_KEYCHARS + (lastev, i, itext_ichar (intchar)); xfree (intchar); } } @@ -3067,7 +2894,7 @@ else altch = 0; - XEVENT (lastev)->event.key.alt_keychars[i] = altch; + XSET_EVENT_KEY_ALT_KEYCHARS (lastev, i, altch); } } } @@ -3319,23 +3146,13 @@ emacs_event = Fmake_event (Qnil, Qnil); event = XEVENT(emacs_event); -#ifdef USE_KKCC XSET_EVENT_CHANNEL (emacs_event, mswindows_find_frame(hwnd)); XSET_EVENT_TIMESTAMP (emacs_event, GetMessageTime()); XSET_EVENT_TYPE (emacs_event, pointer_motion_event); - XSET_MOTION_DATA_X (XEVENT_DATA (emacs_event),MAKEPOINTS (lParam).x); - XSET_MOTION_DATA_Y (XEVENT_DATA (emacs_event),MAKEPOINTS (lParam).y); - XSET_MOTION_DATA_MODIFIERS (XEVENT_DATA(emacs_event), + XSET_EVENT_MOTION_X (emacs_event,MAKEPOINTS (lParam).x); + XSET_EVENT_MOTION_Y (emacs_event,MAKEPOINTS (lParam).y); + XSET_EVENT_MOTION_MODIFIERS (emacs_event, mswindows_modifier_state (NULL, wParam, 0)); -#else /* not USE_KKCC */ - event->channel = mswindows_find_frame (hwnd); - event->timestamp = GetMessageTime (); - event->event_type = pointer_motion_event; - event->event.motion.x = MAKEPOINTS (lParam).x; - event->event.motion.y = MAKEPOINTS (lParam).y; - event->event.motion.modifiers = - mswindows_modifier_state (NULL, wParam, 0); -#endif /* not USE_KKCC */ mswindows_enqueue_dispatch_event (emacs_event); } @@ -3558,9 +3375,9 @@ } else { - GetClientRect(hwnd, &rect); - FRAME_PIXWIDTH(frame) = rect.right; - FRAME_PIXHEIGHT(frame) = rect.bottom; + GetClientRect (hwnd, &rect); + FRAME_PIXWIDTH (frame) = rect.right; + FRAME_PIXHEIGHT (frame) = rect.bottom; pixel_to_real_char_size (frame, rect.right, rect.bottom, &FRAME_MSWINDOWS_CHARWIDTH (frame), @@ -3598,7 +3415,8 @@ FRAME_VISIBLE_P (frame) = 1; } - if (!msframe->sizing || mswindows_dynamic_frame_resize) + if (frame->init_finished && + (!msframe->sizing || mswindows_dynamic_frame_resize)) redisplay (); } } @@ -3620,11 +3438,11 @@ efficiency, the code below has about one in 4 billion probability that the HDC is not recreated, provided that XEmacs is running sufficiently longer than 52 days. */ - if (DEVICE_MSWINDOWS_UPDATE_TICK(d) != message_tick) + if (DEVICE_MSWINDOWS_UPDATE_TICK (d) != message_tick) { - DEVICE_MSWINDOWS_UPDATE_TICK(d) = message_tick; - DeleteDC (DEVICE_MSWINDOWS_HCDC(d)); - DEVICE_MSWINDOWS_HCDC(d) = CreateCompatibleDC (NULL); + DEVICE_MSWINDOWS_UPDATE_TICK (d) = message_tick; + DeleteDC (DEVICE_MSWINDOWS_HCDC (d)); + DEVICE_MSWINDOWS_HCDC (d) = CreateCompatibleDC (NULL); } } break; @@ -3699,8 +3517,8 @@ case WM_HSCROLL: { /* Direction of scroll is determined by scrollbar instance. */ - int code = (int) LOWORD(wParam); - int pos = (short int) HIWORD(wParam); + int code = (int) LOWORD (wParam); + int pos = (short int) HIWORD (wParam); HWND hwndScrollBar = (HWND) lParam; struct gcpro gcpro1, gcpro2; @@ -3856,28 +3674,16 @@ if (!DragQueryPoint ((HDROP) wParam, &point)) point.x = point.y = -1; /* outside client area */ -#ifdef USE_KKCC XSET_EVENT_TYPE (emacs_event, misc_user_event); XSET_EVENT_CHANNEL (emacs_event, mswindows_find_frame(hwnd)); XSET_EVENT_TIMESTAMP (emacs_event, GetMessageTime()); - XSET_MISC_USER_DATA_BUTTON (XEVENT_DATA (emacs_event), 1); - XSET_MISC_USER_DATA_MODIFIERS (XEVENT_DATA (emacs_event), + XSET_EVENT_MISC_USER_BUTTON (emacs_event, 1); + XSET_EVENT_MISC_USER_MODIFIERS (emacs_event, mswindows_modifier_state (NULL, (DWORD) -1, 0)); - XSET_MISC_USER_DATA_X (XEVENT_DATA (emacs_event), point.x); - XSET_MISC_USER_DATA_Y (XEVENT_DATA (emacs_event), point.y); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (emacs_event), + XSET_EVENT_MISC_USER_X (emacs_event, point.x); + XSET_EVENT_MISC_USER_Y (emacs_event, point.y); + XSET_EVENT_MISC_USER_FUNCTION (emacs_event, Qdragdrop_drop_dispatch); -#else /* not USE_KKCC */ - event->event_type = misc_user_event; - event->channel = mswindows_find_frame (hwnd); - event->timestamp = GetMessageTime(); - event->event.misc.button = 1; /* #### Should try harder */ - event->event.misc.modifiers = mswindows_modifier_state (NULL, - (DWORD) -1, 0); - event->event.misc.x = point.x; - event->event.misc.y = point.y; - event->event.misc.function = Qdragdrop_drop_dispatch; -#endif /* not USE_KKCC */ filecount = qxeDragQueryFile ((HDROP) wParam, 0xffffffff, NULL, 0); for (i = 0; i < filecount; i++) @@ -3977,7 +3783,9 @@ But "cch" means "count of characters", not bytes. I'll assume the doc writers messed up and the programmer was correct. Also, this approach is safe even if it's actually the other way around. */ -#ifdef CYGWIN_HEADERS /* Another Cygwin prototype error */ +#if defined (CYGWIN_HEADERS) && !defined (W32API_2_2) + /* Another Cygwin prototype error, + fixed in v2.2 of w32api */ XECOMCALL4 (psl, GetPath, (LPSTR) resolved, PATH_MAX, &wfd, 0) #else @@ -4053,12 +3861,8 @@ DragFinish ((HDROP) wParam); -#ifdef USE_KKCC - XSET_MISC_USER_DATA_OBJECT (EVENT_DATA (event), + SET_EVENT_MISC_USER_OBJECT (event, Fcons (Qdragdrop_URL, l_dndlist)); -#else /* not USE_KKCC */ - event->event.misc.object = Fcons (Qdragdrop_URL, l_dndlist); -#endif /* not USE_KKCC */ mswindows_enqueue_dispatch_event (emacs_event); UNGCPRO; } @@ -4501,27 +4305,30 @@ (TIMERPROC) mswindows_wm_timer_callback); } +static int +remove_timeout_mapper (Lisp_Object ev, void *data) +{ + if (XEVENT_TYPE (ev) == timeout_event) + { + if ((int) data == XEVENT_TIMEOUT_INTERVAL_ID (ev)) + return 1; + } + + return 0; +} + static void emacs_mswindows_remove_timeout (int id) { - Lisp_Event match_against; - Lisp_Object emacs_event; - if (KillTimer (NULL, id)) --mswindows_pending_timers_count; /* If there is a dispatch event generated by this timeout in the queue, we have to remove it too. */ -#ifdef USE_KKCC - SET_EVENT_TYPE(&match_against, timeout_event); - XSET_TIMEOUT_DATA_INTERVAL_ID (EVENT_DATA (&match_against), id); -#else /* not USE_KKCC */ - match_against.event_type = timeout_event; - match_against.event.timeout.interval_id = id; -#endif /* not USE_KKCC */ - emacs_event = mswindows_cancel_dispatch_event (&match_against); - if (!NILP (emacs_event)) - Fdeallocate_event(emacs_event); + map_event_chain_remove (remove_timeout_mapper, + &mswindows_s_dispatch_event_queue, + &mswindows_s_dispatch_event_queue_tail, + (void *) id, MECR_DEALLOCATE_EVENT); } /* If `user_p' is false, then return whether there are any win32, timeout, @@ -4534,11 +4341,32 @@ * emacs_mswindows_next_event() would not block. */ static int -emacs_mswindows_event_pending_p (int user_p) +emacs_mswindows_event_pending_p (int how_many) { - mswindows_need_event (0); - return (!NILP (mswindows_u_dispatch_event_queue) - || (!user_p && !NILP (mswindows_s_dispatch_event_queue))); + if (!how_many) + { + mswindows_need_event (0); + return (!NILP (dispatch_event_queue) + || !NILP (mswindows_s_dispatch_event_queue)); + } + else + { + Lisp_Object event; + int count = 0; + + EVENT_CHAIN_LOOP (event, dispatch_event_queue) + count++; + + if (count >= how_many) + return 1; + + emacs_mswindows_drain_queue (); + + EVENT_CHAIN_LOOP (event, dispatch_event_queue) + count++; + + return count >= how_many; + } } /* @@ -4563,11 +4391,7 @@ { #define FROB(msg) case msg: write_c_string (pstream, "type=" #msg); break -#ifdef USE_KKCC - switch (XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA(emacs_event))) -#else /* not USE_KKCC */ - switch (EVENT_MSWINDOWS_MAGIC_TYPE (emacs_event)) -#endif /* not USE_KKCC */ + switch (EVENT_MAGIC_MSWINDOWS_EVENT (emacs_event)) { FROB (XM_BUMPQUEUE); FROB (WM_PAINT); @@ -4590,23 +4414,14 @@ static int emacs_mswindows_compare_magic_event (Lisp_Event *e1, Lisp_Event *e2) { -#ifdef USE_KKCC - return (XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA (e1)) == - XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA (e2))); -#else /* not USE_KKCC */ - return (e1->event.magic.underlying_mswindows_event == - e2->event.magic.underlying_mswindows_event); -#endif /* not USE_KKCC */ + return (EVENT_MAGIC_MSWINDOWS_EVENT (e1) == + EVENT_MAGIC_MSWINDOWS_EVENT (e2)); } static Hashcode emacs_mswindows_hash_magic_event (Lisp_Event *e) { -#ifdef USE_KKCC - return (XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA (e))); -#else /* not USE_KKCC */ - return e->event.magic.underlying_mswindows_event; -#endif /* not USE_KKCC */ + return (EVENT_MAGIC_MSWINDOWS_EVENT (e)); } /* @@ -4615,11 +4430,7 @@ static void emacs_mswindows_handle_magic_event (Lisp_Event *emacs_event) { -#ifdef USE_KKCC - switch (XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA(emacs_event))) -#else /* not USE_KKCC */ - switch (EVENT_MSWINDOWS_MAGIC_TYPE (emacs_event)) -#endif /* not USE_KKCC */ + switch (EVENT_MAGIC_MSWINDOWS_EVENT (emacs_event)) { case XM_BUMPQUEUE: break; @@ -4637,12 +4448,8 @@ { Lisp_Object frame = EVENT_CHANNEL (emacs_event); struct frame *f = XFRAME (frame); -#ifdef USE_KKCC - int in_p = (XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA(emacs_event)) + int in_p = (EVENT_MAGIC_MSWINDOWS_EVENT (emacs_event) == WM_SETFOCUS); -#else /* not USE_KKCC */ - int in_p = (EVENT_MSWINDOWS_MAGIC_TYPE (emacs_event) == WM_SETFOCUS); -#endif /* not USE_KKCC */ Lisp_Object conser; struct gcpro gcpro1; @@ -4665,11 +4472,7 @@ case XM_UNMAPFRAME: { Lisp_Object frame = EVENT_CHANNEL (emacs_event); -#ifdef USE_KKCC - va_run_hook_with_args (XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA(emacs_event)) -#else /* not USE_KKCC */ - va_run_hook_with_args (EVENT_MSWINDOWS_MAGIC_TYPE (emacs_event) -#endif /* not USE_KKCC */ + va_run_hook_with_args (EVENT_MAGIC_MSWINDOWS_EVENT (emacs_event) == XM_MAPFRAME ? Qmap_frame_hook : Qunmap_frame_hook, 1, frame); @@ -4806,6 +4609,30 @@ return; /* mswindows consoles are automatically selected */ event_stream_unixoid_select_console (con); +#else +#if 0 + /* This is an attempt to get `xemacs -batch -l dunnet' to work. + Doesn't currently work and fucks other things up. */ + if (CONSOLE_STREAM_P (con) && + !UNBOUNDP (CONSOLE_STREAM_DATA (con)->instream)) + { + HANDLE h = + (HANDLE) _get_osfhandle (fileno (CONSOLE_STREAM_DATA (con)->in)); + if (PeekNamedPipe (h, 0, 0, 0, 0, 0)) + { + Lisp_Object lstr = make_ntpipe_input_stream (h, 0); + HANDLE hwait = get_ntpipe_input_stream_waitable (XLSTREAM (lstr)); + + if (!add_waitable_handle (hwait)) + invalid_operation ("Too many active processes", + wrap_console (con)); + CONSOLE_STREAM_DATA (con)->instream = lstr; + } + else + /* Unable to select on this stream */ + CONSOLE_STREAM_DATA (con)->instream = Qunbound; + } +#endif /* 0 */ #endif } @@ -4817,56 +4644,21 @@ return; /* mswindows consoles are automatically selected */ event_stream_unixoid_unselect_console (con); -#endif -} - -static void -emacs_mswindows_quit_p (void) -{ - /* Quit cannot happen in modal loop: all program - input is dedicated to Windows. */ - if (mswindows_in_modal_loop) - return; +#else +#if 0 /* see above */ + if (CONSOLE_STREAM_P (con) && + !UNBOUNDP (CONSOLE_STREAM_DATA (con)->instream)) + { + Lisp_Object instr = CONSOLE_STREAM_DATA (con)->instream; + HANDLE hwait; - mswindows_quit_chars_count = 0; - /* Drain windows queue. This sets up number of quit characters in - the queue. */ - mswindows_drain_windows_queue (); - - if (mswindows_quit_chars_count > 0) - { - /* Yes there's a hidden one... Throw it away */ - Lisp_Event match_against; - Lisp_Object emacs_event; - int critical_p = 0; - -#ifdef USE_KKCC - SET_EVENT_TYPE (&match_against, key_press_event); - XSET_KEY_DATA_MODIFIERS (EVENT_DATA (&match_against), FAKE_MOD_QUIT); -#else /* not USE_KKCC */ - match_against.event_type = key_press_event; - match_against.event.key.modifiers = FAKE_MOD_QUIT; -#endif /* not USE_KKCC */ - - while (mswindows_quit_chars_count > 0) - { - emacs_event = mswindows_cancel_dispatch_event (&match_against); - assert (!NILP (emacs_event)); - -#ifdef USE_KKCC - if (XKEY_DATA_MODIFIERS (XEVENT_DATA(emacs_event)) & -#else /* not USE_KKCC */ - if (XEVENT (emacs_event)->event.key.modifiers & -#endif /* not USE_KKCC */ - FAKE_MOD_QUIT_CRITICAL) - critical_p = 1; + assert (!NILP (instr)); + hwait = get_ntpipe_input_stream_waitable (XLSTREAM (instr)); - Fdeallocate_event (emacs_event); - mswindows_quit_chars_count--; - } - - Vquit_flag = critical_p ? Qcritical : Qt; + remove_waitable_handle (hwait); } +#endif /* 0 */ +#endif } static void @@ -5331,13 +5123,11 @@ void reinit_vars_of_event_mswindows (void) { - mswindows_in_modal_loop = 0; mswindows_pending_timers_count = 0; - mswindows_event_stream = xnew (struct event_stream); + mswindows_event_stream = xnew_and_zero (struct event_stream); mswindows_event_stream->event_pending_p = emacs_mswindows_event_pending_p; - mswindows_event_stream->force_event_pending = 0; mswindows_event_stream->next_event_cb = emacs_mswindows_next_event; mswindows_event_stream->handle_magic_event_cb = emacs_mswindows_handle_magic_event; mswindows_event_stream->format_magic_event_cb = emacs_mswindows_format_magic_event; @@ -5345,7 +5135,7 @@ mswindows_event_stream->hash_magic_event_cb = emacs_mswindows_hash_magic_event; mswindows_event_stream->add_timeout_cb = emacs_mswindows_add_timeout; mswindows_event_stream->remove_timeout_cb = emacs_mswindows_remove_timeout; - mswindows_event_stream->quit_p_cb = emacs_mswindows_quit_p; + mswindows_event_stream->drain_queue_cb = emacs_mswindows_drain_queue; mswindows_event_stream->select_console_cb = emacs_mswindows_select_console; mswindows_event_stream->unselect_console_cb = emacs_mswindows_unselect_console; mswindows_event_stream->select_process_cb = emacs_mswindows_select_process; @@ -5363,15 +5153,10 @@ { reinit_vars_of_event_mswindows (); - mswindows_u_dispatch_event_queue = Qnil; - staticpro (&mswindows_u_dispatch_event_queue); - mswindows_u_dispatch_event_queue_tail = Qnil; - dump_add_root_object (&mswindows_u_dispatch_event_queue_tail); - mswindows_s_dispatch_event_queue = Qnil; staticpro (&mswindows_s_dispatch_event_queue); mswindows_s_dispatch_event_queue_tail = Qnil; - dump_add_root_object (&mswindows_s_dispatch_event_queue_tail); + dump_add_root_lisp_object (&mswindows_s_dispatch_event_queue_tail); mswindows_error_caught_in_modal_loop = 0; Index: src/event-stream.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-stream.c,v retrieving revision 1.74 retrieving revision 1.78 diff -u -r1.74 -r1.78 --- src/event-stream.c 8 Dec 2002 10:25:08 -0000 1.74 +++ src/event-stream.c 13 Feb 2003 09:57:07 -0000 1.78 @@ -2,7 +2,7 @@ Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. 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. @@ -50,7 +50,12 @@ */ /* TODO: - This stuff is way too hard to maintain - needs rework. + [This stuff is way too hard to maintain - needs rework.] + I don't think it's that bad in the main. I've done a fair amount of + cleanup work over the ages; the only stuff that's probably still somewhat + messy is the command-builder handling, which is that way because it's + trying to be "compatible" with pseudo-standards established by Emacs + v18. The command builder should deal only with key and button events. Other command events should be able to come in the MIDDLE of a key @@ -85,6 +90,7 @@ #include "macros.h" /* for defining_keyboard_macro */ #include "menubar.h" /* #### for evil kludges. */ #include "process.h" +#include "profile.h" #include "window-impl.h" #include "sysdep.h" /* init_poll_for_quit() */ @@ -135,11 +141,6 @@ do not execute it; call disabled-command-hook's value instead. */ Lisp_Object Qdisabled; -EXFUN (Fnext_command_event, 2); - -static void pre_command_hook (void); -static void post_command_hook (void); - /* Last keyboard or mouse input event read as a command. */ Lisp_Object Vlast_command_event; @@ -244,8 +245,13 @@ Lisp_Object Qself_insert_defer_undo; -/* this is in keymap.c */ -extern Lisp_Object Fmake_keymap (Lisp_Object name); +int in_modal_loop; + +/* the number of keyboard characters read. callint.c wants this. */ +Charcount num_input_chars; + +static Lisp_Object Qnext_event, Qdispatch_event, QSnext_event_internal; +static Lisp_Object QSexecute_internal_event; #ifdef DEBUG_XEMACS Fixnum debug_emacs_events; @@ -271,19 +277,59 @@ /* The callback routines for the window system or terminal driver */ struct event_stream *event_stream; -static void echo_key_event (struct command_builder *, Lisp_Object event); -static void maybe_kbd_translate (Lisp_Object event); - -/* This structure is basically a typeahead queue: things like - wait-reading-process-output will delay the execution of - keyboard and mouse events by pushing them here. - - Chained through event_next() - command_event_queue_tail is a pointer to the last-added element. +/* There are two event queues here -- the command event queue (#### which + should be called "deferred event queue" and is in my glyph ws) and the + dispatch event queue. (MS Windows actually has an extra dispatch + queue for non-user events and uses the generic one only for user events. + This is because user and non-user events in Windows come through the + same place -- the window procedure -- but under X, it's possible to + selectively process events such that we take all the user events before + the non-user ones. #### In fact, given the way we now drain the queue, + we might need two separate queues, like under Windows. Need to think + carefully exactly how this works, and should certainly generalize the + two different queues. + + The dispatch queue (which used to occur duplicated inside of each event + implementation) is used for events that have been read from the + window-system event queue(s) and not yet process by + next_event_internal(). It exists for two reasons: (1) because in many + implementations, events often come from the window system by way of + callbacks, and need to push the event to be returned onto a queue; (2) + in order to handle QUIT in a guaranteed correct fashion without + resorting to weird implementation-specific hacks that may or may not + work well, we need to drain the window-system event queues and then look + through to see if there's an event matching quit-char (usually ^G). the + drained events need to go onto a queue. (There are other, similar cases + where we need to drain the pending events so we can look ahead -- for + example, checking for pending expose events under X to avoid excessive + server activity.) + + The command event queue is used *AFTER* an event has been read from + next_event_internal(), when it needs to be pushed back. This includes, + for example, accept-process-output, sleep-for and + wait_delaying_user_input(). Eval events and the like, generated by + enqueue-eval-event, enqueue_magic_eval_event(), etc. are also pushed + onto this queue. Some events generated by callbacks are also pushed + onto this queue, #### although maybe shouldn't be. + + The command queue takes precedence over the dispatch queue. + + #### It is worth investigating to see whether both queues are really + needed, and how exactly they should be used. enqueue-eval-event, for + example, could certainly push onto the dispatch queue, and all callbacks + maybe should. wait_delaying_user_input() seems to need both queues, + since it can take events from the dispatch queue and push them onto the + command queue; but it perhaps could be rewritten to avoid this. #### + In general we need to review the handling of these two queues, figure + out exactly what ought to be happening, and document it. */ + static Lisp_Object command_event_queue; static Lisp_Object command_event_queue_tail; +Lisp_Object dispatch_event_queue; +static Lisp_Object dispatch_event_queue_tail; + /* Nonzero means echo unfinished commands after this many seconds of pause. */ static Lisp_Object Vecho_keystrokes; @@ -301,8 +347,16 @@ are not allowed to recursively call these routines. We record here if we are in that situation. */ -static Lisp_Object recursive_sit_for; +static int recursive_sit_for; +static void pre_command_hook (void); +static void post_command_hook (void); +static void maybe_kbd_translate (Lisp_Object event); +static void push_this_command_keys (Lisp_Object event); +static void push_recent_keys (Lisp_Object event); +static void dribble_out_event (Lisp_Object event); +static void execute_internal_event (Lisp_Object event); +static int is_scrollbar_event (Lisp_Object event); /**********************************************************************/ @@ -318,26 +372,14 @@ static Lisp_Object Vcommand_builder_free_list; -#ifdef USE_KKCC -static const struct lrecord_description munging_key_translation_description_1 [] = { - { XD_LISP_OBJECT, offsetof (struct munging_key_translation, first_mungeable_event) }, - { XD_END } -}; - -static const struct struct_description munging_key_translation_description = { - sizeof (Lisp_Object), - munging_key_translation_description_1 -}; - -static const struct lrecord_description command_builder_description [] = { +static const struct memory_description command_builder_description [] = { { XD_LISP_OBJECT, offsetof (struct command_builder, current_events) }, { XD_LISP_OBJECT, offsetof (struct command_builder, most_current_event) }, { XD_LISP_OBJECT, offsetof (struct command_builder, last_non_munged_event) }, { XD_LISP_OBJECT, offsetof (struct command_builder, console) }, - { XD_STRUCT_ARRAY, offsetof (struct command_builder, munge_me), 2, &munging_key_translation_description }, + { XD_LISP_OBJECT_ARRAY, offsetof (struct command_builder, first_mungeable_event), 2 }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_command_builder (Lisp_Object obj) @@ -346,8 +388,8 @@ mark_object (builder->current_events); mark_object (builder->most_current_event); mark_object (builder->last_non_munged_event); - mark_object (builder->munge_me[0].first_mungeable_event); - mark_object (builder->munge_me[1].first_mungeable_event); + mark_object (builder->first_mungeable_event[0]); + mark_object (builder->first_mungeable_event[1]); return builder->console; } @@ -365,19 +407,12 @@ } } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("command-builder", command_builder, 0, /*dumpable-flag*/ mark_command_builder, internal_object_printer, finalize_command_builder, 0, 0, command_builder_description, struct command_builder); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("command-builder", command_builder, - mark_command_builder, internal_object_printer, - finalize_command_builder, 0, 0, 0, - struct command_builder); -#endif /* not USE_KKCC */ static void reset_command_builder_event_chain (struct command_builder *builder) @@ -385,15 +420,15 @@ builder->current_events = Qnil; builder->most_current_event = Qnil; builder->last_non_munged_event = Qnil; - builder->munge_me[0].first_mungeable_event = Qnil; - builder->munge_me[1].first_mungeable_event = Qnil; + builder->first_mungeable_event[0] = Qnil; + builder->first_mungeable_event[1] = Qnil; } Lisp_Object allocate_command_builder (Lisp_Object console, int with_echo_buf) { Lisp_Object builder_obj = - allocate_managed_lcrecord (Vcommand_builder_free_list); + alloc_managed_lcrecord (Vcommand_builder_free_list); struct command_builder *builder = XCOMMAND_BUILDER (builder_obj); builder->console = console; @@ -442,14 +477,12 @@ transfer_event_chain_pointer (collapsing->last_non_munged_event, collapsing->current_events, new_buildings->current_events); - new_buildings->munge_me[0].first_mungeable_event = - transfer_event_chain_pointer (collapsing->munge_me[0]. - first_mungeable_event, + new_buildings->first_mungeable_event[0] = + transfer_event_chain_pointer (collapsing->first_mungeable_event[0], collapsing->current_events, new_buildings->current_events); - new_buildings->munge_me[1].first_mungeable_event = - transfer_event_chain_pointer (collapsing->munge_me[1]. - first_mungeable_event, + new_buildings->first_mungeable_event[1] = + transfer_event_chain_pointer (collapsing->first_mungeable_event[1], collapsing->current_events, new_buildings->current_events); @@ -481,10 +514,10 @@ builder->current_events = event; builder->most_current_event = event; - if (NILP (builder->munge_me[0].first_mungeable_event)) - builder->munge_me[0].first_mungeable_event = event; - if (NILP (builder->munge_me[1].first_mungeable_event)) - builder->munge_me[1].first_mungeable_event = event; + if (NILP (builder->first_mungeable_event[0])) + builder->first_mungeable_event[0] = event; + if (NILP (builder->first_mungeable_event[1])) + builder->first_mungeable_event[1] = event; } @@ -492,17 +525,8 @@ /* Low-level interfaces onto event methods */ /**********************************************************************/ -enum event_stream_operation -{ - EVENT_STREAM_PROCESS, - EVENT_STREAM_TIMEOUT, - EVENT_STREAM_CONSOLE, - EVENT_STREAM_READ, - EVENT_STREAM_NOTHING, -}; - static void -check_event_stream_ok (enum event_stream_operation op) +check_event_stream_ok (void) { if (!event_stream && noninteractive) /* See comment in init_event_stream() */ @@ -510,145 +534,52 @@ else assert (event_stream); } -static int -event_stream_event_pending_p (int user) -{ - return event_stream && event_stream->event_pending_p (user); -} - -static void -event_stream_force_event_pending (struct frame *f) -{ - if (event_stream->force_event_pending) - event_stream->force_event_pending (f); -} - -static int -maybe_read_quit_event (Lisp_Event *event) -{ - /* A C-g that came from `sigint_happened' will always come from the - controlling terminal. If that doesn't exist, however, then the - user manually sent us a SIGINT, and we pretend the C-g came from - the selected console. */ - struct console *con; - - if (CONSOLEP (Vcontrolling_terminal) && - CONSOLE_LIVE_P (XCONSOLE (Vcontrolling_terminal))) - con = XCONSOLE (Vcontrolling_terminal); - else - con = XCONSOLE (Fselected_console ()); - - if (sigint_happened) - { - int ch = CONSOLE_QUIT_CHAR (con); - sigint_happened = 0; - Vquit_flag = Qnil; - character_to_event (ch, event, con, 1, 1); - event->channel = wrap_console (con); - return 1; - } - return 0; -} - -static void -event_stream_next_event (Lisp_Event *event) -{ - Lisp_Object event_obj; - - check_event_stream_ok (EVENT_STREAM_READ); - - event_obj = wrap_event (event); - zero_event (event); - /* SIGINT occurs when C-g was pressed on a TTY. (SIGINT might have - been sent manually by the user, but we don't care; we treat it - the same.) - - The SIGINT signal handler sets Vquit_flag as well as sigint_happened - and write a byte on our "fake pipe", which unblocks us when we are - waiting for an event. */ - - /* If SIGINT was received after we disabled quit checking (because - we want to read C-g's as characters), but before we got a chance - to start reading, notice it now and treat it as a character to be - read. If above callers wanted this to be QUIT, they can - determine this by comparing the event against quit-char. */ - - if (maybe_read_quit_event (event)) - { - DEBUG_PRINT_EMACS_EVENT ("SIGINT", event_obj); - return; - } - - /* If a longjmp() happens in the callback, we're screwed. - Let's hope it doesn't. I think the code here is fairly - clean and doesn't do this. */ - emacs_is_blocking = 1; - event_stream->next_event_cb (event); - emacs_is_blocking = 0; - - /* Now check to see if C-g was pressed while we were blocking. - We treat it as an event, just like above. */ - if (maybe_read_quit_event (event)) - { - DEBUG_PRINT_EMACS_EVENT ("SIGINT", event_obj); - return; - } - -#ifdef DEBUG_XEMACS - /* timeout events have more info set later, so - print the event out in next_event_internal(). */ - if (event->event_type != timeout_event) - DEBUG_PRINT_EMACS_EVENT ("real", event_obj); -#endif - maybe_kbd_translate (event_obj); -} - void event_stream_handle_magic_event (Lisp_Event *event) { - check_event_stream_ok (EVENT_STREAM_READ); + check_event_stream_ok (); event_stream->handle_magic_event_cb (event); } void event_stream_format_magic_event (Lisp_Event *event, Lisp_Object pstream) { - check_event_stream_ok (EVENT_STREAM_NOTHING); + check_event_stream_ok (); event_stream->format_magic_event_cb (event, pstream); } int event_stream_compare_magic_event (Lisp_Event *e1, Lisp_Event *e2) { - check_event_stream_ok (EVENT_STREAM_NOTHING); + check_event_stream_ok (); return event_stream->compare_magic_event_cb (e1, e2); } Hashcode event_stream_hash_magic_event (Lisp_Event *e) { - check_event_stream_ok (EVENT_STREAM_NOTHING); + check_event_stream_ok (); return event_stream->hash_magic_event_cb (e); } static int event_stream_add_timeout (EMACS_TIME timeout) { - check_event_stream_ok (EVENT_STREAM_TIMEOUT); + check_event_stream_ok (); return event_stream->add_timeout_cb (timeout); } static void event_stream_remove_timeout (int id) { - check_event_stream_ok (EVENT_STREAM_TIMEOUT); + check_event_stream_ok (); event_stream->remove_timeout_cb (id); } void event_stream_select_console (struct console *con) { - check_event_stream_ok (EVENT_STREAM_CONSOLE); + check_event_stream_ok (); if (!con->input_enabled) { event_stream->select_console_cb (con); @@ -659,7 +590,7 @@ void event_stream_unselect_console (struct console *con) { - check_event_stream_ok (EVENT_STREAM_CONSOLE); + check_event_stream_ok (); if (con->input_enabled) { event_stream->unselect_console_cb (con); @@ -672,7 +603,7 @@ { int cur_in, cur_err; - check_event_stream_ok (EVENT_STREAM_PROCESS); + check_event_stream_ok (); cur_in = get_process_selected_p (proc, 0); if (cur_in) @@ -702,7 +633,7 @@ { int cur_in, cur_err; - check_event_stream_ok (EVENT_STREAM_PROCESS); + check_event_stream_ok (); cur_in = get_process_selected_p (proc, 0); if (!cur_in) @@ -736,7 +667,7 @@ USID *err_usid, int flags) { - check_event_stream_ok (EVENT_STREAM_PROCESS); + check_event_stream_ok (); event_stream->create_io_streams_cb (inhandle, outhandle, errhandle, instream, outstream, errstream, in_usid, err_usid, flags); @@ -749,18 +680,11 @@ USID *in_usid, USID *err_usid) { - check_event_stream_ok (EVENT_STREAM_PROCESS); + check_event_stream_ok (); event_stream->delete_io_streams_cb (instream, outstream, errstream, in_usid, err_usid); } -void -event_stream_quit_p (void) -{ - if (event_stream) - event_stream->quit_p_cb (); -} - static int event_stream_current_event_timestamp (struct console *c) { @@ -791,11 +715,7 @@ clear_echo_area (selected_frame (), Qnil, 0); } -#ifdef USE_KKCC format_event_object (buf, event, 1); -#else /* not USE_KKCC */ - format_event_object (buf, XEVENT(event), 1); -#endif /* not USE_KKCC */ len = eilen (buf); if (len + buf_index + 4 > command_builder->echo_buf_length) @@ -890,119 +810,6 @@ /* random junk */ /**********************************************************************/ -static void -maybe_kbd_translate (Lisp_Object event) -{ - Ichar c; - int did_translate = 0; - - if (XEVENT_TYPE (event) != key_press_event) - return; - if (!HASH_TABLEP (Vkeyboard_translate_table)) - return; - if (EQ (Fhash_table_count (Vkeyboard_translate_table), Qzero)) - return; - - c = event_to_character (XEVENT (event), 0, 0, 0); - if (c != -1) - { - Lisp_Object traduit = Fgethash (make_char (c), Vkeyboard_translate_table, - Qnil); - if (!NILP (traduit) && SYMBOLP (traduit)) - { -#ifdef USE_KKCC - XSET_KEY_DATA_KEYSYM (XEVENT_DATA (event), traduit); - XSET_KEY_DATA_MODIFIERS (XEVENT_DATA (event), 0); -#else /* not USE_KKCC */ - XEVENT (event)->event.key.keysym = traduit; - XEVENT (event)->event.key.modifiers = 0; -#endif /* not USE_KKCC */ - did_translate = 1; - } - else if (CHARP (traduit)) - { -#ifdef USE_KKCC - Lisp_Object ev2 = Fmake_event(Qnil, Qnil); -#else /* not USE_KKCC */ - Lisp_Event ev2; - - /* This used to call Fcharacter_to_event() directly into EVENT, - but that can eradicate timestamps and other such stuff. - This way is safer. */ - zero_event (&ev2); -#endif /* not USE_KKCC */ - -#ifdef USE_KKCC - character_to_event (XCHAR (traduit), XEVENT (ev2), - XCONSOLE (XEVENT_CHANNEL (event)), 1, 1); - XSET_KEY_DATA_KEYSYM (XEVENT_DATA (event), XKEY_DATA_KEYSYM (XEVENT_DATA (ev2))); - XSET_KEY_DATA_MODIFIERS (XEVENT_DATA (event), - XKEY_DATA_MODIFIERS (XEVENT_DATA (ev2))); -#else /* not USE_KKCC */ - character_to_event (XCHAR (traduit), &ev2, - XCONSOLE (EVENT_CHANNEL (XEVENT (event))), 1, 1); - XEVENT (event)->event.key.keysym = ev2.event.key.keysym; - XEVENT (event)->event.key.modifiers = ev2.event.key.modifiers; -#endif /* not USE_KKCC */ - did_translate = 1; - } - } - - if (!did_translate) - { -#ifdef USE_KKCC - Lisp_Object traduit = Fgethash (XKEY_DATA_KEYSYM (XEVENT_DATA (event)), - Vkeyboard_translate_table, Qnil); -#else /* not USE_KKCC */ - Lisp_Object traduit = Fgethash (XEVENT (event)->event.key.keysym, - Vkeyboard_translate_table, Qnil); -#endif /* not USE_KKCC */ - if (!NILP (traduit) && SYMBOLP (traduit)) - { -#ifdef USE_KKCC - XSET_KEY_DATA_KEYSYM (XEVENT_DATA (event), traduit); -#else /* not USE_KKCC */ - XEVENT (event)->event.key.keysym = traduit; -#endif /* not USE_KKCC */ - did_translate = 1; - } - else if (CHARP (traduit)) - { -#ifdef USE_KKCC - Lisp_Object ev2 = Fmake_event(Qnil, Qnil); -#else /* not USE_KKCC */ - Lisp_Event ev2; - - /* This used to call Fcharacter_to_event() directly into EVENT, - but that can eradicate timestamps and other such stuff. - This way is safer. */ - zero_event (&ev2); -#endif /* not USE_KKCC */ - -#ifdef USE_KKCC - character_to_event (XCHAR (traduit), XEVENT (ev2), - XCONSOLE (XEVENT_CHANNEL (event)), 1, 1); - XSET_KEY_DATA_KEYSYM (XEVENT_DATA (event), XKEY_DATA_KEYSYM (XEVENT_DATA (ev2))); - XSET_KEY_DATA_MODIFIERS (XEVENT_DATA (event), - XKEY_DATA_MODIFIERS (XEVENT_DATA (event)) | - XKEY_DATA_MODIFIERS (XEVENT_DATA (ev2))); -#else /* not USE_KKCC */ - character_to_event (XCHAR (traduit), &ev2, - XCONSOLE (EVENT_CHANNEL (XEVENT (event))), 1, 1); - XEVENT (event)->event.key.keysym = ev2.event.key.keysym; - XEVENT (event)->event.key.modifiers |= ev2.event.key.modifiers; -#endif /* not USE_KKCC */ - - did_translate = 1; - } - } - -#ifdef DEBUG_XEMACS - if (did_translate) - DEBUG_PRINT_EMACS_EVENT ("->keyboard-translate-table", event); -#endif -} - /* NB: The following auto-save stuff is in keyboard.c in FSFmacs, and keystrokes_since_auto_save is equivalent to the difference between num_nonmacro_input_chars and last_auto_save. */ @@ -1031,7 +838,7 @@ keystrokes_since_auto_save++; if (auto_save_interval > 0 && keystrokes_since_auto_save > max (auto_save_interval, 20) && - !detect_input_pending ()) + !detect_input_pending (1)) { Fdo_auto_save (Qnil, Qnil); record_auto_save (); @@ -1086,7 +893,7 @@ } redisplay (); - if (event_matches_key_specifier_p (XEVENT (event), make_char (' '))) + if (event_matches_key_specifier_p (event, make_char (' '))) { /* Discard next key if it is a space */ reset_key_echo (command_builder, 1); @@ -1102,45 +909,6 @@ /**********************************************************************/ -/* input pending */ -/**********************************************************************/ - -int -detect_input_pending (void) -{ - /* Always call the event_pending_p hook even if there's an unread - character, because that might do some needed ^G detection (on - systems without SIGIO, for example). - */ - if (event_stream_event_pending_p (1)) - return 1; - if (!NILP (Vunread_command_events) || !NILP (Vunread_command_event)) - return 1; - if (!NILP (command_event_queue)) - { - Lisp_Object event; - - EVENT_CHAIN_LOOP (event, command_event_queue) - { - if (XEVENT_TYPE (event) != eval_event - && XEVENT_TYPE (event) != magic_eval_event) - return 1; - } - } - return 0; -} - -DEFUN ("input-pending-p", Finput_pending_p, 0, 0, 0, /* -Return t if command input is currently available with no waiting. -Actually, the value is nil only if we can be sure that no input is available. -*/ - ()) -{ - return detect_input_pending () ? Qt : Qnil; -} - - -/**********************************************************************/ /* timeouts */ /**********************************************************************/ @@ -1303,22 +1071,16 @@ return tm->object; } -static const struct lrecord_description timeout_description[] = { +static const struct memory_description timeout_description[] = { { XD_LISP_OBJECT, offsetof (Lisp_Timeout, function) }, { XD_LISP_OBJECT, offsetof (Lisp_Timeout, object) }, { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("timeout", timeout, 1, /*dumpable-flag*/ mark_timeout, internal_object_printer, 0, 0, 0, timeout_description, Lisp_Timeout); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("timeout", timeout, - mark_timeout, internal_object_printer, - 0, 0, 0, timeout_description, Lisp_Timeout); -#endif /* not USE_KKCC */ /* Generate a timeout and return its ID. */ @@ -1328,7 +1090,7 @@ Lisp_Object function, Lisp_Object object, int async_p) { - Lisp_Object op = allocate_managed_lcrecord (Vtimeout_free_list); + Lisp_Object op = alloc_managed_lcrecord (Vtimeout_free_list); Lisp_Timeout *timeout = XTIMEOUT (op); EMACS_TIME current_time; EMACS_TIME interval; @@ -1698,6 +1460,18 @@ return dequeue_event (&command_event_queue, &command_event_queue_tail); } +void +enqueue_dispatch_event (Lisp_Object event) +{ + enqueue_event (event, &dispatch_event_queue, &dispatch_event_queue_tail); +} + +Lisp_Object +dequeue_dispatch_event (void) +{ + return dequeue_event (&dispatch_event_queue, &dispatch_event_queue_tail); +} + static void enqueue_command_event_1 (Lisp_Object event_to_copy) { @@ -1708,17 +1482,10 @@ enqueue_magic_eval_event (void (*fun) (Lisp_Object), Lisp_Object object) { Lisp_Object event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, magic_eval_event); /* channel for magic_eval events is nil */ - XSET_MAGIC_EVAL_DATA_INTERNAL_FUNCTION (XEVENT_DATA (event), fun); - XSET_MAGIC_EVAL_DATA_OBJECT (XEVENT_DATA (event), object); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = magic_eval_event; - /* channel for magic_eval events is nil */ - XEVENT (event)->event.magic_eval.internal_function = fun; - XEVENT (event)->event.magic_eval.object = object; -#endif /* not USE_KKCC */ + XSET_EVENT_MAGIC_EVAL_INTERNAL_FUNCTION (event, fun); + XSET_EVENT_MAGIC_EVAL_OBJECT (event, object); enqueue_command_event (event); } @@ -1733,17 +1500,10 @@ { Lisp_Object event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, eval_event); /* channel for eval events is nil */ - XSET_EVAL_DATA_FUNCTION (XEVENT_DATA (event), function); - XSET_EVAL_DATA_OBJECT (XEVENT_DATA (event), object); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = eval_event; - /* channel for eval events is nil */ - XEVENT (event)->event.eval.function = function; - XEVENT (event)->event.eval.object = object; -#endif /* not USE_KKCC */ + XSET_EVENT_EVAL_FUNCTION (event, function); + XSET_EVENT_EVAL_OBJECT (event, object); enqueue_command_event (event); return event; @@ -1754,25 +1514,14 @@ Lisp_Object object) { Lisp_Object event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, misc_user_event); XSET_EVENT_CHANNEL (event, channel); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), function); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), object); - XSET_MISC_USER_DATA_BUTTON (XEVENT_DATA (event), 0); - XSET_MISC_USER_DATA_MODIFIERS (XEVENT_DATA (event), 0); - XSET_MISC_USER_DATA_X (XEVENT_DATA (event), -1); - XSET_MISC_USER_DATA_Y (XEVENT_DATA (event), -1); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->channel = channel; - XEVENT (event)->event.misc.function = function; - XEVENT (event)->event.misc.object = object; - XEVENT (event)->event.misc.button = 0; - XEVENT (event)->event.misc.modifiers = 0; - XEVENT (event)->event.misc.x = -1; - XEVENT (event)->event.misc.y = -1; -#endif /* not USE_KKCC */ + XSET_EVENT_MISC_USER_FUNCTION (event, function); + XSET_EVENT_MISC_USER_OBJECT (event, object); + XSET_EVENT_MISC_USER_BUTTON (event, 0); + XSET_EVENT_MISC_USER_MODIFIERS (event, 0); + XSET_EVENT_MISC_USER_X (event, -1); + XSET_EVENT_MISC_USER_Y (event, -1); enqueue_command_event (event); return event; @@ -1785,25 +1534,14 @@ { Lisp_Object event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, misc_user_event); XSET_EVENT_CHANNEL (event, channel); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), function); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), object); - XSET_MISC_USER_DATA_BUTTON (XEVENT_DATA (event), button); - XSET_MISC_USER_DATA_MODIFIERS (XEVENT_DATA (event), modifiers); - XSET_MISC_USER_DATA_X (XEVENT_DATA (event), x); - XSET_MISC_USER_DATA_Y (XEVENT_DATA (event), y); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->channel = channel; - XEVENT (event)->event.misc.function = function; - XEVENT (event)->event.misc.object = object; - XEVENT (event)->event.misc.button = button; - XEVENT (event)->event.misc.modifiers = modifiers; - XEVENT (event)->event.misc.x = x; - XEVENT (event)->event.misc.y = y; -#endif /* not USE_KKCC */ + XSET_EVENT_MISC_USER_FUNCTION (event, function); + XSET_EVENT_MISC_USER_OBJECT (event, object); + XSET_EVENT_MISC_USER_BUTTON (event, button); + XSET_EVENT_MISC_USER_MODIFIERS (event, modifiers); + XSET_EVENT_MISC_USER_X (event, x); + XSET_EVENT_MISC_USER_Y (event, y); enqueue_command_event (event); return event; @@ -2117,6 +1855,165 @@ /**********************************************************************/ +/* input pending/quit checking */ +/**********************************************************************/ + +/* If HOW_MANY is 0, return true if there are any user or non-user events + pending. If HOW_MANY is > 0, return true if there are that many *user* + events pending, irrespective of non-user events. */ + +static int +event_stream_event_pending_p (int how_many) +{ + /* #### Hmmm ... There may be some duplication in "drain queue" and + "event pending". Couldn't we just drain the queue and see what's in + it, and not maybe need a separate event method for this? Would this + work when HOW_MANY is 0? Maybe this would be slow? */ + return event_stream && event_stream->event_pending_p (how_many); +} + +static void +event_stream_force_event_pending (struct frame *f) +{ + if (event_stream->force_event_pending_cb) + event_stream->force_event_pending_cb (f); +} + +void +event_stream_drain_queue (void) +{ + if (event_stream && event_stream->drain_queue_cb) + event_stream->drain_queue_cb (); +} + +/* Return non-zero if at least HOW_MANY user events are pending. */ +int +detect_input_pending (int how_many) +{ + Lisp_Object event; + + if (!NILP (Vunread_command_event)) + how_many--; + + how_many -= XINT (Fsafe_length (Vunread_command_events)); + + if (how_many <= 0) + return 1; + + EVENT_CHAIN_LOOP (event, command_event_queue) + { + if (XEVENT_TYPE (event) != eval_event + && XEVENT_TYPE (event) != magic_eval_event) + { + how_many--; + if (how_many <= 0) + return 1; + } + } + + return event_stream_event_pending_p (how_many); +} + +DEFUN ("input-pending-p", Finput_pending_p, 0, 0, 0, /* +Return t if command input is currently available with no waiting. +Actually, the value is nil only if we can be sure that no input is available. +*/ + ()) +{ + return detect_input_pending (1) ? Qt : Qnil; +} + +static int +maybe_read_quit_event (Lisp_Event *event) +{ + /* A C-g that came from `sigint_happened' will always come from the + controlling terminal. If that doesn't exist, however, then the + user manually sent us a SIGINT, and we pretend the C-g came from + the selected console. */ + struct console *con; + + if (CONSOLEP (Vcontrolling_terminal) && + CONSOLE_LIVE_P (XCONSOLE (Vcontrolling_terminal))) + con = XCONSOLE (Vcontrolling_terminal); + else + con = XCONSOLE (Fselected_console ()); + + if (sigint_happened) + { + sigint_happened = 0; + Vquit_flag = Qnil; + Fcopy_event (CONSOLE_QUIT_EVENT (con), wrap_event (event)); + return 1; + } + return 0; +} + +struct remove_quit_p_data +{ + int critical; +}; + +static int +remove_quit_p_event (Lisp_Object ev, void *the_data) +{ + struct remove_quit_p_data *data = (struct remove_quit_p_data *) the_data; + struct console *con = event_console_or_selected (ev); + + if (XEVENT_TYPE (ev) == key_press_event) + { + if (event_matches_key_specifier_p (ev, CONSOLE_QUIT_EVENT (con))) + return 1; + if (event_matches_key_specifier_p (ev, + CONSOLE_CRITICAL_QUIT_EVENT (con))) + { + data->critical = 1; + return 1; + } + } + + return 0; +} + +void +event_stream_quit_p (void) +{ + struct remove_quit_p_data data; + + /* Quit checking cannot happen in modal loop. Because it attempts to + retrieve and dispatch events, it will cause lots of problems if we try + to do this when already in the process of doing this -- deadlocking + under Windows, crashes in lwlib etc. under X due to non-reentrant + code. This is automatically caught, however, in + event_stream_drain_queue() (checks for in_modal_loop in the + event-specific code). */ + + /* Drain queue so we can check for pending C-g events. */ + event_stream_drain_queue (); + data.critical = 0; + + if (map_event_chain_remove (remove_quit_p_event, + &dispatch_event_queue, + &dispatch_event_queue_tail, + &data, MECR_DEALLOCATE_EVENT)) + Vquit_flag = data.critical ? Qcritical : Qt; +} + +Lisp_Object +event_stream_protect_modal_loop (const char *error_string, + Lisp_Object (*bfun) (void *barg), + void *barg, int flags) +{ + Lisp_Object tmp; + + ++in_modal_loop; + tmp = call_trapping_problems (Qevent, error_string, flags, 0, bfun, barg); + --in_modal_loop; + + return tmp; +} + + +/**********************************************************************/ /* retrieving the next event */ /**********************************************************************/ @@ -2141,8 +2038,58 @@ return in_single_console; } -/* the number of keyboard characters read. callint.c wants this. */ -Charcount num_input_chars; +static void +event_stream_next_event (Lisp_Event *event) +{ + Lisp_Object event_obj; + + check_event_stream_ok (); + + event_obj = wrap_event (event); + zero_event (event); + /* SIGINT occurs when C-g was pressed on a TTY. (SIGINT might have + been sent manually by the user, but we don't care; we treat it + the same.) + + The SIGINT signal handler sets Vquit_flag as well as sigint_happened + and write a byte on our "fake pipe", which unblocks us when we are + waiting for an event. */ + + /* If SIGINT was received after we disabled quit checking (because + we want to read C-g's as characters), but before we got a chance + to start reading, notice it now and treat it as a character to be + read. If above callers wanted this to be QUIT, they can + determine this by comparing the event against quit-char. */ + + if (maybe_read_quit_event (event)) + { + DEBUG_PRINT_EMACS_EVENT ("SIGINT", event_obj); + return; + } + + /* If a longjmp() happens in the callback, we're screwed. + Let's hope it doesn't. I think the code here is fairly + clean and doesn't do this. */ + emacs_is_blocking = 1; + event_stream->next_event_cb (event); + emacs_is_blocking = 0; + + /* Now check to see if C-g was pressed while we were blocking. + We treat it as an event, just like above. */ + if (maybe_read_quit_event (event)) + { + DEBUG_PRINT_EMACS_EVENT ("SIGINT", event_obj); + return; + } + +#ifdef DEBUG_XEMACS + /* timeout events have more info set later, so + print the event out in next_event_internal(). */ + if (event->event_type != timeout_event) + DEBUG_PRINT_EMACS_EVENT ("real", event_obj); +#endif + maybe_kbd_translate (event_obj); +} /* Read an event from the window system (or tty). If ALLOW_QUEUED is non-zero, read from the command-event queue first. @@ -2160,8 +2107,12 @@ next_event_internal (Lisp_Object target_event, int allow_queued) { struct gcpro gcpro1; + PROFILE_DECLARE (); + QUIT; + PROFILE_RECORD_ENTERING_SECTION (QSnext_event_internal); + assert (NILP (XEVENT_NEXT (target_event))); GCPRO1 (target_event); @@ -2188,45 +2139,26 @@ /* If this was a timeout, then we need to extract some data out of the returned closure and might need to resignal it. */ -#ifdef USE_KKCC if (EVENT_TYPE (e) == timeout_event) -#else /* not USE_KKCC */ - if (e->event_type == timeout_event) -#endif /* not USE_KKCC */ { Lisp_Object tristan, isolde; -#ifdef USE_KKCC - XSET_TIMEOUT_DATA_ID_NUMBER (EVENT_DATA (e), - event_stream_resignal_wakeup (XTIMEOUT_DATA_INTERVAL_ID (EVENT_DATA (e)), 0, &tristan, &isolde)); + SET_EVENT_TIMEOUT_ID_NUMBER (e, + event_stream_resignal_wakeup (EVENT_TIMEOUT_INTERVAL_ID (e), 0, &tristan, &isolde)); - XSET_TIMEOUT_DATA_FUNCTION (EVENT_DATA (e), tristan); - XSET_TIMEOUT_DATA_OBJECT (EVENT_DATA (e), isolde); + SET_EVENT_TIMEOUT_FUNCTION (e, tristan); + SET_EVENT_TIMEOUT_OBJECT (e, isolde); /* next_event_internal() doesn't print out timeout events because of the extra info we just set. */ -#else /* not USE_KKCC */ - e->event.timeout.id_number = - event_stream_resignal_wakeup (e->event.timeout.interval_id, 0, - &tristan, &isolde); - - e->event.timeout.function = tristan; - e->event.timeout.object = isolde; - /* next_event_internal() doesn't print out timeout events - because of the extra info we just set. */ -#endif /* not USE_KKCC */ DEBUG_PRINT_EMACS_EVENT ("real, timeout", target_event); } /* If we read a ^G, then set quit-flag and try to QUIT. This may be blocked (see above). */ -#ifdef USE_KKCC if (EVENT_TYPE (e) == key_press_event && -#else /* not USE_KKCC */ - if (e->event_type == key_press_event && -#endif /* not USE_KKCC */ event_matches_key_specifier_p - (e, make_char (CONSOLE_QUIT_CHAR (XCONSOLE (EVENT_CHANNEL (e)))))) + (target_event, CONSOLE_QUIT_EVENT (XCONSOLE (EVENT_CHANNEL (e))))) { Vquit_flag = Qt; QUIT; @@ -2234,24 +2166,23 @@ } UNGCPRO; + + PROFILE_RECORD_EXITING_SECTION (QSnext_event_internal); } void run_pre_idle_hook (void) { if (!NILP (Vpre_idle_hook) - && !detect_input_pending ()) + && !detect_input_pending (1)) safe_run_hook_trapping_problems ("Error in `pre-idle-hook' (setting hook to nil)", - Qpre_idle_hook, INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); + 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); } -static void push_this_command_keys (Lisp_Object event); -static void push_recent_keys (Lisp_Object event); -static void dribble_out_event (Lisp_Object event); -static void execute_internal_event (Lisp_Object event); -static int is_scrollbar_event (Lisp_Object event); - DEFUN ("next-event", Fnext_event, 0, 2, 0, /* Return the next available event. Pass this object to `dispatch-event' to handle it. @@ -2307,25 +2238,34 @@ int store_this_key = 0; struct gcpro gcpro1; int depth; + PROFILE_DECLARE (); GCPRO1 (event); - depth = begin_dont_check_for_quit (); - -#ifdef LWLIB_MENUBARS_LUCID - /* - * #### Fix the menu code so this isn't necessary. - * - * We cannot allow the lwmenu code to be reentered, because the - * code is not written to be reentrant and will crash. Therefore - * paths from the menu callbacks back into the menu code have to - * be blocked. Fnext_event is the normal path into the menu code, - * so we signal an error here. - */ + /* This is not strictly necessary. Trying to retrieve an event inside of + a modal loop can cause major problems (see event_stream_quit_p()), but + the event-specific code knows about this and will make sure we don't + do anything dangerous. However, if we've gotten here, it's highly + likely that some code is trying to fetch user events (e.g. in custom + dialog-box code), and will almost certainly deadlock, so it's probably + best to error out. #### This could cause problems because there are + (potentially, at least) legitimate reasons for calling next-event + inside of a modal loop, in particular if the code is trying to search + for a timeout event, which will still get retrieved in such a case. + However, the code to error in such a case has already been present for + a long time without obvious problems so leaving it in isn't so + bad. + + #### 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 */ if (in_menu_callback) invalid_operation ("Attempt to call next-event inside menu callback", Qunbound); -#endif /* LWLIB_MENUBARS_LUCID */ + + PROFILE_RECORD_ENTERING_SECTION (Qnext_event); + + depth = begin_dont_check_for_quit (); if (NILP (event)) event = Fmake_event (Qnil, Qnil); @@ -2495,8 +2435,7 @@ Note that last-input-char will never have its high-bit set, in an effort to sidestep the ambiguity between M-x and oslash. */ - Vlast_input_char = Fevent_to_character (Vlast_input_event, - Qnil, Qnil, Qnil); + Vlast_input_char = Fevent_to_character (Vlast_input_event, Qnil, Qnil, Qnil); { EMACS_TIME t; EMACS_GET_TIME (t); @@ -2538,7 +2477,7 @@ execute_help_form() calls Fnext_command_event(), which calls this function, as well as Fdispatch_event. */ if (!NILP (Vhelp_form) && - event_matches_key_specifier_p (XEVENT (event), Vhelp_char)) + event_matches_key_specifier_p (event, Vhelp_char)) { /* temporarily reenable quit checking here, because we could get stuck */ Vquit_flag = Qnil; /* see begin_dont_check_for_quit() */ @@ -2551,6 +2490,8 @@ Vquit_flag = Qnil; /* see begin_dont_check_for_quit() */ unbind_to (depth); + PROFILE_RECORD_EXITING_SECTION (Qnext_event); + UNGCPRO; return event; @@ -2658,6 +2599,12 @@ deallocate_event_chain (event); } +static int +command_event_p_cb (Lisp_Object ev, void *the_data) +{ + return command_event_p (ev); +} + DEFUN ("discard-input", Fdiscard_input, 0, 0, 0, /* Discard any pending "user" events. Also cancel any kbd macro being defined. @@ -2666,84 +2613,31 @@ */ ()) { - /* This throws away user-input on the queue, but doesn't process any - events. Calling dispatch_event() here leads to a race condition. - */ - Lisp_Object event = Fmake_event (Qnil, Qnil); - Lisp_Object head = Qnil, tail = Qnil; - struct gcpro gcpro1; - /* #### not correct here with Vselected_console? Should - discard-input take a console argument, or maybe map over - all consoles? */ - struct console *con = XCONSOLE (Vselected_console); - - /* next_event_internal() can cause arbitrary Lisp code to be evalled */ - GCPRO1 (event); - /* If a macro was being defined then we have to mark the modeline - has changed to ensure that it gets updated correctly. */ - if (!NILP (con->defining_kbd_macro)) - MARK_MODELINE_CHANGED; - con->defining_kbd_macro = Qnil; - reset_current_events (XCOMMAND_BUILDER (con->command_builder)); - - while (!NILP (command_event_queue) - || event_stream_event_pending_p (1)) - { - /* We want to ignore C-g's along with all other keypresses. */ - int depth = begin_dont_check_for_quit (); - /* This will take stuff off the command_event_queue, or read it - from the event_stream, but it will not block. - */ - next_event_internal (event, 1); - /* The following comment used to be here: - - [[Treat C-g as a user event (ignore it). It is vitally - important that we reset Vquit_flag here. Otherwise, if we're - reading from a TTY console, maybe_read_quit_event() will - notice that C-g has been set and send us another C-g. That - will cause us to get right back here, and read another C-g, - ad infinitum ...]] - - but I don't think this is correct; maybe_read_quit_event() - checks and resets sigint_happened. It shouldn't matter if we - reset here or outside of the while loop. --ben */ - Vquit_flag = Qnil; /* see begin_dont_check_for_quit() */ - - unbind_to (depth); - - /* If the event is a user event, ignore it. */ - if (!command_event_p (event)) - { - /* Otherwise, chain the event onto our list of events not to ignore, - and keep reading until the queue is empty. This does not mean - that if a subprocess is generating an infinite amount of output, - we will never terminate (*provided* that the behavior of - next_event_cb() is correct -- see the comment in events.h), - because this loop ends as soon as there are no more user events - on the command_event_queue or event_stream. - */ - enqueue_event (Fcopy_event (event, Qnil), &head, &tail); - } - } + Lisp_Object concons; - if (!NILP (command_event_queue) || !NILP (command_event_queue_tail)) - abort (); - - /* Now tack our chain of events back on to the front of the queue. - Actually, since the queue is now drained, we can just replace it. - The effect of this will be that we have deleted all user events - from the input stream without changing the relative ordering of - any other events. (Some events may have been taken from the - event_stream and added to the command_event_queue, however.) - - At this time, the command_event_queue will contain only eval_events. - */ - - command_event_queue = head; - command_event_queue_tail = tail; + CONSOLE_LOOP (concons) + { + struct console *con = XCONSOLE (XCAR (concons)); - Fdeallocate_event (event); - UNGCPRO; + /* If a macro was being defined then we have to mark the modeline + has changed to ensure that it gets updated correctly. */ + if (!NILP (con->defining_kbd_macro)) + MARK_MODELINE_CHANGED; + con->defining_kbd_macro = Qnil; + reset_current_events (XCOMMAND_BUILDER (con->command_builder)); + } + + /* This function used to be a lot more complicated. Now, we just + drain the pending queue and discard all user events from the + command and dispatch queues. */ + event_stream_drain_queue (); + + map_event_chain_remove (command_event_p_cb, + &dispatch_event_queue, &dispatch_event_queue_tail, + 0, MECR_DEALLOCATE_EVENT); + map_event_chain_remove (command_event_p_cb, + &command_event_queue, &command_event_queue_tail, + 0, MECR_DEALLOCATE_EVENT); return Qnil; } @@ -2755,8 +2649,8 @@ /* This is used in accept-process-output, sleep-for and sit-for. Before running any process_events in these routines, we set - recursive_sit_for to Qt, and use this unwind protect to reset it to - Qnil upon exit. When recursive_sit_for is Qt, calling sit-for will + recursive_sit_for to 1, and use this unwind protect to reset it to + Qnil upon exit. When recursive_sit_for is 1, calling sit-for will cause it to return immediately. All of these routines install timeouts, so we clear the installed @@ -2773,7 +2667,7 @@ if (!NILP(timeout_id)) Fdisable_timeout (timeout_id); - recursive_sit_for = Qnil; + recursive_sit_for = 0; return Qnil; } @@ -2838,7 +2732,7 @@ count = specpdl_depth (); record_unwind_protect (sit_for_unwind, timeout_enabled ? make_int (timeout_id) : Qnil); - recursive_sit_for = Qt; + recursive_sit_for = 1; while (!done && ((NILP (process) && timeout_enabled) || @@ -2873,11 +2767,7 @@ case process_event: { if (NILP (process) || -#ifdef USE_KKCC - EQ (XPROCESS_DATA_PROCESS (XEVENT_DATA (event)), process)) -#else /* not USE_KKCC */ - EQ (XEVENT (event)->event.process.process, process)) -#endif /* not USE_KKCC */ + EQ (XEVENT_PROCESS_PROCESS (event), process)) { done = 1; /* RMS's version always returns nil when proc is nil, @@ -2939,7 +2829,7 @@ count = specpdl_depth (); record_unwind_protect (sit_for_unwind, make_int (id)); - recursive_sit_for = Qt; + recursive_sit_for = 1; while (1) { @@ -3020,7 +2910,7 @@ return Qnil; /* Recursive call from a filter function or timeout handler. */ - if (!NILP (recursive_sit_for)) + if (recursive_sit_for) { if (!event_stream_event_pending_p (1) && NILP (nodisplay)) redisplay (); @@ -3045,7 +2935,7 @@ count = specpdl_depth (); record_unwind_protect (sit_for_unwind, make_int (id)); - recursive_sit_for = Qt; + recursive_sit_for = 1; while (1) { @@ -3147,54 +3037,44 @@ static void execute_internal_event (Lisp_Object event) { + PROFILE_DECLARE (); + /* events on dead channels get silently eaten */ if (object_dead_p (XEVENT (event)->channel)) return; + PROFILE_RECORD_ENTERING_SECTION (QSexecute_internal_event); + /* This function can GC */ switch (XEVENT_TYPE (event)) { case empty_event: - return; + goto done; case eval_event: { -#ifdef USE_KKCC - call1 (XEVAL_DATA_FUNCTION (XEVENT_DATA (event)), - XEVAL_DATA_OBJECT (XEVENT_DATA (event))); -#else /* not USE_KKCC */ - call1 (XEVENT (event)->event.eval.function, - XEVENT (event)->event.eval.object); -#endif /* not USE_KKCC */ - return; + call1 (XEVENT_EVAL_FUNCTION (event), + XEVENT_EVAL_OBJECT (event)); + goto done; } case magic_eval_event: { -#ifdef USE_KKCC - XMAGIC_EVAL_DATA_INTERNAL_FUNCTION (XEVENT_DATA (event)) - XMAGIC_EVAL_DATA_OBJECT (XEVENT_DATA (event)); -#else /* not USE_KKCC */ - (XEVENT (event)->event.magic_eval.internal_function) - (XEVENT (event)->event.magic_eval.object); -#endif /* not USE_KKCC */ - return; + XEVENT_MAGIC_EVAL_INTERNAL_FUNCTION (event) + XEVENT_MAGIC_EVAL_OBJECT (event); + goto done; } case pointer_motion_event: { if (!NILP (Vmouse_motion_handler)) call1 (Vmouse_motion_handler, event); - return; + goto done; } case process_event: { -#ifdef USE_KKCC - Lisp_Object p = XPROCESS_DATA_PROCESS (XEVENT_DATA (event)); -#else /* not USE_KKCC */ - Lisp_Object p = XEVENT (event)->event.process.process; -#endif /* not USE_KKCC */ + Lisp_Object p = XEVENT_PROCESS_PROCESS (event); Charcount readstatus; int iter; @@ -3281,30 +3161,27 @@ */ status_notify (); } - return; + goto done; } case timeout_event: { Lisp_Event *e = XEVENT (event); -#ifdef USE_KKCC - if (!NILP (XTIMEOUT_DATA_FUNCTION (EVENT_DATA (e)))) - call1 (XTIMEOUT_DATA_FUNCTION (EVENT_DATA (e)), - XTIMEOUT_DATA_OBJECT (EVENT_DATA (e))); -#else /* not USE_KKCC */ - if (!NILP (e->event.timeout.function)) - call1 (e->event.timeout.function, - e->event.timeout.object); -#endif /* not USE_KKCC */ - return; + if (!NILP (EVENT_TIMEOUT_FUNCTION (e))) + call1 (EVENT_TIMEOUT_FUNCTION (e), + EVENT_TIMEOUT_OBJECT (e)); + goto done; } case magic_event: event_stream_handle_magic_event (XEVENT (event)); - return; + goto done; default: abort (); } + + done: + PROFILE_RECORD_EXITING_SECTION (QSexecute_internal_event); } @@ -3349,6 +3226,80 @@ return event_binding (event0, 1); } +static void +maybe_kbd_translate (Lisp_Object event) +{ + Ichar c; + int did_translate = 0; + + if (XEVENT_TYPE (event) != key_press_event) + return; + if (!HASH_TABLEP (Vkeyboard_translate_table)) + return; + if (EQ (Fhash_table_count (Vkeyboard_translate_table), Qzero)) + return; + + c = event_to_character (event, 0, 0, 0); + if (c != -1) + { + Lisp_Object traduit = Fgethash (make_char (c), Vkeyboard_translate_table, + Qnil); + if (!NILP (traduit) && SYMBOLP (traduit)) + { + XSET_EVENT_KEY_KEYSYM (event, traduit); + XSET_EVENT_KEY_MODIFIERS (event, 0); + did_translate = 1; + } + else if (CHARP (traduit)) + { + /* This used to call Fcharacter_to_event() directly into EVENT, + but that can eradicate timestamps and other such stuff. + This way is safer. */ + Lisp_Object ev2 = Fmake_event (Qnil, Qnil); + + character_to_event (XCHAR (traduit), XEVENT (ev2), + XCONSOLE (XEVENT_CHANNEL (event)), 0, 1); + XSET_EVENT_KEY_KEYSYM (event, XEVENT_KEY_KEYSYM (ev2)); + XSET_EVENT_KEY_MODIFIERS (event, XEVENT_KEY_MODIFIERS (ev2)); + Fdeallocate_event (ev2); + did_translate = 1; + } + } + + if (!did_translate) + { + Lisp_Object traduit = Fgethash (XEVENT_KEY_KEYSYM (event), + Vkeyboard_translate_table, Qnil); + if (!NILP (traduit) && SYMBOLP (traduit)) + { + XSET_EVENT_KEY_KEYSYM (event, traduit); + did_translate = 1; + } + else if (CHARP (traduit)) + { + /* This used to call Fcharacter_to_event() directly into EVENT, + but that can eradicate timestamps and other such stuff. + This way is safer. */ + Lisp_Object ev2 = Fmake_event (Qnil, Qnil); + + character_to_event (XCHAR (traduit), XEVENT (ev2), + XCONSOLE (XEVENT_CHANNEL (event)), 0, 1); + XSET_EVENT_KEY_KEYSYM (event, XEVENT_KEY_KEYSYM (ev2)); + XSET_EVENT_KEY_MODIFIERS (event, + XEVENT_KEY_MODIFIERS (event) | + XEVENT_KEY_MODIFIERS (ev2)); + + Fdeallocate_event (ev2); + did_translate = 1; + } + } + +#ifdef DEBUG_XEMACS + if (did_translate) + DEBUG_PRINT_EMACS_EVENT ("->keyboard-translate-table", event); +#endif +} + /* See if we can do function-key-map or key-translation-map translation on the current events in the command builder. If so, do this, and return the resulting binding, if any. @@ -3364,7 +3315,7 @@ { Lisp_Object suffix; - EVENT_CHAIN_LOOP (suffix, builder->munge_me[munge].first_mungeable_event) + EVENT_CHAIN_LOOP (suffix, builder->first_mungeable_event[munge]) { Lisp_Object result = munging_key_map_event_binding (suffix, munge); @@ -3408,7 +3359,7 @@ EVENT_CHAIN_LOOP (tempev, suffix) { Lisp_Object *mungeable_event = - &builder->munge_me[1 - munge].first_mungeable_event; + &builder->first_mungeable_event[1 - munge]; if (EQ (tempev, *mungeable_event)) { *mungeable_event = new_chain; @@ -3419,7 +3370,7 @@ /* Now munge the current event chain in the command builder. */ n = event_chain_count (suffix); command_builder_replace_suffix (builder, suffix, new_chain); - builder->munge_me[munge].first_mungeable_event = Qnil; + builder->first_mungeable_event[munge] = Qnil; *did_munge = 1; @@ -3452,13 +3403,8 @@ if (XEVENT_TYPE (evee) == misc_user_event) { if (allow_misc_user_events_p && (NILP (XEVENT_NEXT (evee)))) -#ifdef USE_KKCC - return list2 (XEVAL_DATA_FUNCTION (XEVENT_DATA (evee)), - XEVAL_DATA_OBJECT (XEVENT_DATA (evee))); -#else /* not USE_KKCC */ - return list2 (XEVENT (evee)->event.eval.function, - XEVENT (evee)->event.eval.object); -#endif /* not USE_KKCC */ + return list2 (XEVENT_EVAL_FUNCTION (evee), + XEVENT_EVAL_OBJECT (evee)); else return Qnil; } @@ -3469,7 +3415,7 @@ /* #### this horribly-written crap can mess with global state, which this function should not do. i'm not fixing it now. someone needs to go and rewrite that shit correctly. --ben */ -#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) +#if defined (HAVE_X_WINDOWS) && defined (LWLIB_MENUBARS_LUCID) if (x_kludge_lw_menu_active ()) { return command_builder_operate_menu_accelerator (builder); @@ -3482,7 +3428,7 @@ if (NILP (result)) #endif result = command_builder_find_leaf_1 (builder); -#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) +#if defined (HAVE_X_WINDOWS) && defined (LWLIB_MENUBARS_LUCID) if (NILP (result) && EQ (Vmenu_accelerator_enabled, Qmenu_fallback)) result = command_builder_find_menu_accelerator (builder); @@ -3514,47 +3460,14 @@ if (XEVENT_TYPE (builder->most_current_event) == key_press_event && !NILP (Vretry_undefined_key_binding_unshifted)) { - Lisp_Object terminal = builder->most_current_event; -#ifdef USE_KKCC - Lisp_Key_Data* key = XKEY_DATA (XEVENT_DATA (terminal)); -#else /* not USE_KKCC */ - struct key_data *key = &XEVENT (terminal)->event.key; -#endif /* not USE_KKCC */ - Ichar c = 0; -#ifdef USE_KKCC - if ((KEY_DATA_MODIFIERS (key) & XEMACS_MOD_SHIFT) - || (CHAR_OR_CHAR_INTP (KEY_DATA_KEYSYM(key)) - && ((c = XCHAR_OR_CHAR_INT (KEY_DATA_KEYSYM(key))), - c >= 'A' && c <= 'Z'))) -#else /* not USE_KKCC */ - if ((key->modifiers & XEMACS_MOD_SHIFT) - || (CHAR_OR_CHAR_INTP (key->keysym) - && ((c = XCHAR_OR_CHAR_INT (key->keysym)), - c >= 'A' && c <= 'Z'))) -#endif /* not USE_KKCC */ + if (event_upshifted_p (builder->most_current_event)) { Lisp_Object neubauten = copy_command_builder (builder, 0); struct command_builder *neub = XCOMMAND_BUILDER (neubauten); struct gcpro gcpro1; GCPRO1 (neubauten); - terminal = event_chain_tail (neub->current_events); -#ifdef USE_KKCC - key = XKEY_DATA (XEVENT_DATA (terminal)); - - if (KEY_DATA_MODIFIERS (key) & XEMACS_MOD_SHIFT) - SET_KEY_DATA_MODIFIERS (key, (KEY_DATA_MODIFIERS (key) & (~ XEMACS_MOD_SHIFT))); - else - SET_KEY_DATA_KEYSYM (key, make_char (c + 'a' - 'A')); -#else /* not USE_KKCC */ - key = &XEVENT (terminal)->event.key; - - if (key->modifiers & XEMACS_MOD_SHIFT) - key->modifiers &= (~ XEMACS_MOD_SHIFT); - else - key->keysym = make_char (c + 'a' - 'A'); -#endif /* not USE_KKCC */ - + downshift_event (event_chain_tail (neub->current_events)); result = command_builder_find_leaf_no_mule_processing (neub, allow_misc_user_events_p, did_munge); @@ -3573,8 +3486,7 @@ /* help-char is `auto-bound' in every keymap */ if (!NILP (Vprefix_help_command) && - event_matches_key_specifier_p (XEVENT (builder->most_current_event), - Vhelp_char)) + event_matches_key_specifier_p (builder->most_current_event, Vhelp_char)) return Vprefix_help_command; return Qnil; @@ -3623,13 +3535,7 @@ if (XEVENT_TYPE (builder->most_current_event) == key_press_event && !NILP (Vcomposed_character_default_binding)) { -#ifdef USE_KKCC - Lisp_Object keysym = - XKEY_DATA_KEYSYM(XEVENT_DATA (builder->most_current_event)); -#else /* not USE_KKCC */ - Lisp_Object keysym = - XEVENT (builder->most_current_event)->event.key.keysym; -#endif /* not USE_KKCC */ + Lisp_Object keysym = XEVENT_KEY_KEYSYM (builder->most_current_event); if (CHARP (keysym) && !ichar_ascii_p (XCHAR (keysym))) return Vcomposed_character_default_binding; } @@ -4040,7 +3946,7 @@ Lisp_Object recent = command_builder->most_current_event; if (EVENTP (recent) - && event_matches_key_specifier_p (XEVENT (recent), Vmeta_prefix_char)) + && event_matches_key_specifier_p (recent, Vmeta_prefix_char)) { Lisp_Event *e; /* When we see a sequence like "ESC x", pretend we really saw "M-x". @@ -4052,23 +3958,13 @@ */ Fcopy_event (event, recent); e = XEVENT (recent); -#ifdef USE_KKCC if (EVENT_TYPE (e) == key_press_event) - XSET_KEY_DATA_MODIFIERS (EVENT_DATA (e), - XKEY_DATA_MODIFIERS (EVENT_DATA (e)) | - XEMACS_MOD_META); + SET_EVENT_KEY_MODIFIERS (e, EVENT_KEY_MODIFIERS (e) | + XEMACS_MOD_META); else if (EVENT_TYPE (e) == button_press_event || EVENT_TYPE (e) == button_release_event) - XSET_BUTTON_DATA_MODIFIERS (EVENT_DATA (e), - XBUTTON_DATA_MODIFIERS (EVENT_DATA (e)) | - XEMACS_MOD_META); -#else /* not USE_KKCC */ - if (e->event_type == key_press_event) - e->event.key.modifiers |= XEMACS_MOD_META; - else if (e->event_type == button_press_event - || e->event_type == button_release_event) - e->event.button.modifiers |= XEMACS_MOD_META; -#endif /* not USE_KKCC */ + SET_EVENT_BUTTON_MODIFIERS (e, EVENT_BUTTON_MODIFIERS (e) | + XEMACS_MOD_META); else abort (); @@ -4125,16 +4021,11 @@ #if 0 else if (!NILP (Vquit_flag)) { - Lisp_Object quit_event = Fmake_event (Qnil, Qnil); - Lisp_Event *e = XEVENT (quit_event); /* if quit happened during menu acceleration, pretend we read it */ struct console *con = XCONSOLE (Fselected_console ()); - int ch = CONSOLE_QUIT_CHAR (con); - - character_to_event (ch, e, con, 1, 1); - e->channel = wrap_console (con); - enqueue_command_event (quit_event); + enqueue_command_event (Fcopy_event (CONSOLE_QUIT_EVENT (con), + Qnil)); Vquit_flag = Qnil; } #endif @@ -4162,15 +4053,9 @@ #ifdef HAVE_SCROLLBARS Lisp_Object fun; -#ifdef USE_KKCC if (XEVENT_TYPE (event) != misc_user_event) return 0; - fun = XMISC_USER_DATA_FUNCTION(XEVENT_DATA (event)); -#else /* not USE_KKCC */ - if (XEVENT (event)->event_type != misc_user_event) - return 0; - fun = XEVENT (event)->event.misc.function; -#endif /* not USE_KKCC */ + fun = XEVENT_MISC_USER_FUNCTION (event); return (EQ (fun, Qscrollbar_line_up) || EQ (fun, Qscrollbar_line_down) || @@ -4307,19 +4192,11 @@ pre_command_hook (); -#ifdef USE_KKCC if (XEVENT_TYPE (event) == misc_user_event) { - call1 (XMISC_USER_DATA_FUNCTION (XEVENT_DATA (event)), - XMISC_USER_DATA_OBJECT (XEVENT_DATA (event))); - } -#else /* not USE_KKCC */ - if (XEVENT (event)->event_type == misc_user_event) - { - call1 (XEVENT (event)->event.eval.function, - XEVENT (event)->event.eval.object); + call1 (XEVENT_MISC_USER_FUNCTION (event), + XEVENT_MISC_USER_OBJECT (event)); } -#endif /* not USE_KKCC */ else { Fcommand_execute (Vthis_command, Qnil, Qnil); @@ -4486,6 +4363,7 @@ Lisp_Event *ev; Lisp_Object console; Lisp_Object channel; + PROFILE_DECLARE (); CHECK_LIVE_EVENT (event); ev = XEVENT (event); @@ -4495,6 +4373,8 @@ if (object_dead_p (channel)) return Qnil; + PROFILE_RECORD_ENTERING_SECTION (Qdispatch_event); + /* Some events don't have channels (e.g. eval events). */ console = CDFW_CONSOLE (channel); if (NILP (console)) @@ -4503,11 +4383,7 @@ Fselect_console (console); command_builder = XCOMMAND_BUILDER (XCONSOLE (console)->command_builder); -#ifdef USE_KKCC switch (XEVENT_TYPE (event)) -#else /* not USE_KKCC */ - switch (XEVENT (event)->event_type) -#endif /* not USE_KKCC */ { case button_press_event: case button_release_event: @@ -4669,27 +4545,15 @@ (a lambda expression). So in the `eval' case I'll just convert it into a lambda expression. */ -#ifdef USE_KKCC - if (EQ (XMISC_USER_DATA_FUNCTION (XEVENT_DATA (event)), Qcall_interactively) - && SYMBOLP (XMISC_USER_DATA_OBJECT (XEVENT_DATA (event)))) - Vthis_command = XMISC_USER_DATA_OBJECT (XEVENT_DATA (event)); - else if (EQ (XMISC_USER_DATA_FUNCTION (XEVENT_DATA (event)), Qeval)) - Vthis_command = - Fcons (Qlambda, Fcons (Qnil, XMISC_USER_DATA_OBJECT (XEVENT_DATA (event)))); - else if (SYMBOLP (XMISC_USER_DATA_FUNCTION (XEVENT_DATA (event)))) - /* A scrollbar command or the like. */ - Vthis_command = XMISC_USER_DATA_FUNCTION (XEVENT_DATA (event)); -#else /* not USE_KKCC */ - if (EQ (XEVENT (event)->event.eval.function, Qcall_interactively) - && SYMBOLP (XEVENT (event)->event.eval.object)) - Vthis_command = XEVENT (event)->event.eval.object; - else if (EQ (XEVENT (event)->event.eval.function, Qeval)) + if (EQ (XEVENT_MISC_USER_FUNCTION (event), Qcall_interactively) + && SYMBOLP (XEVENT_MISC_USER_OBJECT (event))) + Vthis_command = XEVENT_MISC_USER_OBJECT (event); + else if (EQ (XEVENT_MISC_USER_FUNCTION (event), Qeval)) Vthis_command = - Fcons (Qlambda, Fcons (Qnil, XEVENT (event)->event.eval.object)); - else if (SYMBOLP (XEVENT (event)->event.eval.function)) + Fcons (Qlambda, Fcons (Qnil, XEVENT_MISC_USER_OBJECT (event))); + else if (SYMBOLP (XEVENT_MISC_USER_FUNCTION (event))) /* A scrollbar command or the like. */ - Vthis_command = XEVENT (event)->event.eval.function; -#endif /* not USE_KKCC */ + Vthis_command = XEVENT_MISC_USER_FUNCTION (event); else /* Huh? */ Vthis_command = Qnil; @@ -4709,6 +4573,8 @@ execute_internal_event (event); break; } + + PROFILE_RECORD_EXITING_SECTION (Qdispatch_event); return Qnil; } @@ -4781,11 +4647,7 @@ execute_internal_event (event); else { -#ifdef USE_KKCC if (XEVENT_TYPE (event) == misc_user_event) -#else /* not USE_KKCC */ - if (XEVENT (event)->event_type == misc_user_event) -#endif /* not USE_KKCC */ reset_current_events (command_builder); result = lookup_command_event (command_builder, event, 1); if (!KEYMAPP (result)) @@ -4852,19 +4714,11 @@ if (NILP (Vdribble_file)) return; -#ifdef USE_KKCC if (XEVENT_TYPE (event) == key_press_event && - !XKEY_DATA_MODIFIERS (XEVENT_DATA (event))) + !XEVENT_KEY_MODIFIERS (event)) { - Lisp_Object keysym = XKEY_DATA_KEYSYM (XEVENT_DATA (event)); - if (CHARP (XKEY_DATA_KEYSYM (XEVENT_DATA (event)))) -#else /* not USE_KKCC */ - if (XEVENT (event)->event_type == key_press_event && - !XEVENT (event)->event.key.modifiers) - { - Lisp_Object keysym = XEVENT (event)->event.key.keysym; - if (CHARP (XEVENT (event)->event.key.keysym)) -#endif /* not USE_KKCC */ + Lisp_Object keysym = XEVENT_KEY_KEYSYM (event); + if (CHARP (XEVENT_KEY_KEYSYM (event))) { Ichar ch = XCHAR (keysym); Ibyte str[MAX_ICHAR_LEN]; @@ -4991,6 +4845,9 @@ DEFSYMBOL (Qself_insert_defer_undo); DEFSYMBOL (Qcancel_mode_internal); + + DEFSYMBOL (Qnext_event); + DEFSYMBOL (Qdispatch_event); } void @@ -5009,7 +4866,8 @@ the_low_level_timeout_blocktype = Blocktype_new (struct low_level_timeout_blocktype); something_happened = 0; - recursive_sit_for = Qnil; + recursive_sit_for = 0; + in_modal_loop = 0; } void @@ -5022,12 +4880,17 @@ Vthis_command_keys = Qnil; staticpro (&Vthis_command_keys); Vthis_command_keys_tail = Qnil; - dump_add_root_object (&Vthis_command_keys_tail); + dump_add_root_lisp_object (&Vthis_command_keys_tail); command_event_queue = Qnil; staticpro (&command_event_queue); command_event_queue_tail = Qnil; - dump_add_root_object (&command_event_queue_tail); + dump_add_root_lisp_object (&command_event_queue_tail); + + dispatch_event_queue = Qnil; + staticpro (&dispatch_event_queue); + dispatch_event_queue_tail = Qnil; + dump_add_root_lisp_object (&dispatch_event_queue_tail); Vlast_selected_frame = Qnil; staticpro (&Vlast_selected_frame); @@ -5040,6 +4903,11 @@ last_point_position_buffer = Qnil; staticpro (&last_point_position_buffer); + + QSnext_event_internal = build_string ("next_event_internal()"); + staticpro (&QSnext_event_internal); + QSexecute_internal_event = build_string ("execute_internal_event()"); + staticpro (&QSexecute_internal_event); DEFVAR_LISP ("echo-keystrokes", &Vecho_keystrokes /* *Nonzero means echo unfinished commands after this many seconds of pause. Index: src/event-tty.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-tty.c,v retrieving revision 1.11 retrieving revision 1.14 diff -u -r1.11 -r1.14 --- src/event-tty.c 29 Jul 2002 09:21:18 -0000 1.11 +++ src/event-tty.c 13 Feb 2003 09:57:07 -0000 1.14 @@ -1,7 +1,7 @@ /* The event_stream interface for tty's. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 2002 Ben Wing. + Copyright (C) 1995, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -41,6 +41,10 @@ static struct event_stream *tty_event_stream; +#ifdef WIN32_ANY +extern int mswindows_is_blocking; +#endif + /************************************************************************/ /* timeout events */ @@ -67,28 +71,20 @@ tty_timeout_to_emacs_event (Lisp_Event *emacs_event) { /* timeout events have nil as channel */ -#ifdef USE_KKCC SET_EVENT_TYPE (emacs_event, timeout_event); SET_EVENT_TIMESTAMP_ZERO (emacs_event); /* #### */ - XSET_TIMEOUT_DATA_INTERVAL_ID (EVENT_DATA (emacs_event), pop_low_level_timeout (&tty_timer_queue, 0)); - XSET_TIMEOUT_DATA_FUNCTION (EVENT_DATA (emacs_event), Qnil); - XSET_TIMEOUT_DATA_OBJECT (EVENT_DATA (emacs_event), Qnil); -#else /* not USE_KKCC */ - emacs_event->event_type = timeout_event; - emacs_event->timestamp = 0; /* #### */ - emacs_event->event.timeout.interval_id = - pop_low_level_timeout (&tty_timer_queue, 0); - emacs_event->event.timeout.function = Qnil; - emacs_event->event.timeout.object = Qnil; -#endif /* not USE_KKCC */ + SET_EVENT_TIMEOUT_INTERVAL_ID (emacs_event, + pop_low_level_timeout (&tty_timer_queue, 0)); + SET_EVENT_TIMEOUT_FUNCTION (emacs_event, Qnil); + SET_EVENT_TIMEOUT_OBJECT (emacs_event, Qnil); } static int -emacs_tty_event_pending_p (int user_p) +emacs_tty_event_pending_p (int how_many) { - if (!user_p) + if (!how_many) { EMACS_TIME sometime; /* see if there's a pending timeout. */ @@ -96,27 +92,14 @@ if (tty_timer_queue && EMACS_TIME_EQUAL_OR_GREATER (sometime, tty_timer_queue->time)) return 1; - } - - return poll_fds_for_input (user_p ? tty_only_mask : - non_fake_input_wait_mask); -} - -struct console * -tty_find_console_from_fd (int fd) -{ - Lisp_Object concons; - CONSOLE_LOOP (concons) - { - struct console *c; - - c = XCONSOLE (XCAR (concons)); - if (CONSOLE_TTY_P (c) && CONSOLE_TTY_DATA (c)->infd == fd) - return c; + return poll_fds_for_input (non_fake_input_wait_mask); } - return 0; + /* #### Not right! We need to *count* the number of pending events, which + means we need to have a dispatch queue and drain the pending events, + using drain_tty_devices(). */ + return poll_fds_for_input (tty_only_mask); } static void @@ -139,7 +122,13 @@ pointer_to_this = &select_time_to_block; } +#ifdef WIN32_ANY + mswindows_is_blocking = 1; +#endif ndesc = select (MAXDESC, &temp_mask, 0, 0, pointer_to_this); +#ifdef WIN32_ANY + mswindows_is_blocking = 0; +#endif if (ndesc > 0) { /* Look for a TTY event */ @@ -150,7 +139,7 @@ user events ahead of process events. */ if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &tty_only_mask)) { - struct console *c = tty_find_console_from_fd (i); + struct console *c = find_tty_or_stream_console_from_fd (i); assert (c); if (read_event_from_tty_or_stream_desc (emacs_event, c)) @@ -168,17 +157,10 @@ assert (p); process = wrap_process (p); -#ifdef USE_KKCC set_event_type (emacs_event, process_event); /* process events have nil as channel */ SET_EVENT_TIMESTAMP_ZERO (emacs_event); /* #### */ - XSET_PROCESS_DATA_PROCESS (EVENT_DATA (emacs_event), process); -#else /* not USE_KKCC */ - emacs_event->event_type = process_event; - /* process events have nil as channel */ - emacs_event->timestamp = 0; /* #### */ - emacs_event->event.process.process = process; -#endif /* not USE_KKCC */ + SET_EVENT_PROCESS_PROCESS (emacs_event, process); return; } } @@ -187,17 +169,10 @@ /* Return a dummy event, so that a cycle of the command loop will occur. */ drain_signal_event_pipe (); -#ifdef USE_KKCC set_event_type (emacs_event, eval_event); /* eval events have nil as channel */ - XSET_EVAL_DATA_FUNCTION (EVENT_DATA (emacs_event), Qidentity); - XSET_EVAL_DATA_OBJECT (EVENT_DATA (emacs_event), Qnil); -#else /* not USE_KKCC */ - emacs_event->event_type = eval_event; - /* eval events have nil as channel */ - emacs_event->event.eval.function = Qidentity; - emacs_event->event.eval.object = Qnil; -#endif /* not USE_KKCC */ + SET_EVENT_EVAL_FUNCTION (emacs_event, Qidentity); + SET_EVENT_EVAL_OBJECT (emacs_event, Qnil); return; } else if (ndesc == 0) /* timeout fired */ @@ -262,10 +237,9 @@ } static void -emacs_tty_quit_p (void) +emacs_tty_drain_queue (void) { - /* Nothing to do currently because QUIT is handled through SIGINT. - This could change. */ + drain_tty_devices (); } static void @@ -301,10 +275,9 @@ void reinit_vars_of_event_tty (void) { - tty_event_stream = xnew (struct event_stream); + tty_event_stream = xnew_and_zero (struct event_stream); tty_event_stream->event_pending_p = emacs_tty_event_pending_p; - tty_event_stream->force_event_pending = 0; tty_event_stream->next_event_cb = emacs_tty_next_event; tty_event_stream->handle_magic_event_cb = emacs_tty_handle_magic_event; tty_event_stream->format_magic_event_cb = emacs_tty_format_magic_event; @@ -316,7 +289,7 @@ tty_event_stream->unselect_console_cb = emacs_tty_unselect_console; tty_event_stream->select_process_cb = emacs_tty_select_process; tty_event_stream->unselect_process_cb = emacs_tty_unselect_process; - tty_event_stream->quit_p_cb = emacs_tty_quit_p; + tty_event_stream->drain_queue_cb = emacs_tty_drain_queue; tty_event_stream->create_io_streams_cb = emacs_tty_create_io_streams; tty_event_stream->delete_io_streams_cb = emacs_tty_delete_io_streams; } Index: src/event-unixoid.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-unixoid.c,v retrieving revision 1.19 retrieving revision 1.21 diff -u -r1.19 -r1.21 --- src/event-unixoid.c 20 Jun 2002 21:18:29 -0000 1.19 +++ src/event-unixoid.c 7 Feb 2003 11:50:53 -0000 1.21 @@ -3,7 +3,7 @@ Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. 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. @@ -31,7 +31,7 @@ #include "console-stream-impl.h" #include "console-tty-impl.h" -#include "device.h" +#include "device-impl.h" #include "events.h" #include "lstream.h" #include "process.h" @@ -44,12 +44,14 @@ /* Mask of bits indicating the descriptors that we wait for input on. These work as follows: + In event-tty.c we call select() directly on this + to retrieve an event. In event-Xt.c we use + XtAppAddInput() and the call to select() is down in + the guts of Xt, but we still use the masks when checking for pending input, even in event-Xt.c. (We can't use XtAppPending() because of the presence of the signal event pipe.) + input_wait_mask == mask of all file descriptors we select() on, including TTY/stream console descriptors, process descriptors, and the signal event pipe. - Only used in event-tty.c; event-Xt.c uses - XtAppAddInput(), and the call to select() is down in - the guts of Xt. non_fake_input_wait_mask == same as input_wait_mask but minus the signal event pipe. Also only used in @@ -70,6 +72,24 @@ int fake_event_occurred; +struct console * +find_tty_or_stream_console_from_fd (int fd) +{ + Lisp_Object concons; + + CONSOLE_LOOP (concons) + { + struct console *c; + + c = XCONSOLE (XCAR (concons)); + if ((CONSOLE_TTY_P (c) && CONSOLE_TTY_DATA (c)->infd == fd) || + (CONSOLE_STREAM_P (c) && fileno (CONSOLE_STREAM_DATA (c)->in) == fd)) + return c; + } + + return 0; +} + int read_event_from_tty_or_stream_desc (Lisp_Event *event, struct console *con) { @@ -98,6 +118,8 @@ } else { + /* Here we really do want to set the use_console_meta_flag because + the char is from the TTY. */ character_to_event (ch, event, con, 1, 1); event->channel = console; return 1; @@ -138,6 +160,48 @@ ; } +void +drain_tty_devices (void) +{ + Lisp_Object devcons, concons; + CONSOLE_LOOP (concons) + { + struct console *con = XCONSOLE (XCAR (concons)); + if (!con->input_enabled) + continue; + + CONSOLE_DEVICE_LOOP (devcons, con) + { + struct device *d = XDEVICE (XCAR (devcons)); + if (DEVICE_TTY_P (d)) + { + SELECT_TYPE temp_mask; + int infd = DEVICE_INFD (d); + + FD_ZERO (&temp_mask); + FD_SET (infd, &temp_mask); + + while (1) + { + Lisp_Object event; + + if (!poll_fds_for_input (temp_mask)) + break; + + event = Fmake_event (Qnil, Qnil); + if (!read_event_from_tty_or_stream_desc (XEVENT (event), + con)) + /* EOF, or something ... */ + break; + + /* queue the read event to be read for real later. */ + enqueue_dispatch_event (event); + } + } + } + } +} + int event_stream_unixoid_select_console (struct console *con) { @@ -277,7 +341,7 @@ /* else, we got interrupted by a signal, so try again. */ } - RETURN_NOT_REACHED (0) + RETURN_NOT_REACHED (0); } /****************************************************************************/ Index: src/event-xlike-inc.c =================================================================== RCS file: src/event-xlike-inc.c diff -N src/event-xlike-inc.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/event-xlike-inc.c 7 Feb 2003 11:50:53 -0000 1.1 @@ -0,0 +1,161 @@ +/* Shared event code between X and GTK -- include file. + Copyright (C) 1991-5, 1997 Free Software Foundation, Inc. + Copyright (C) 1995 Sun Microsystems, Inc. + Copyright (C) 1996, 2001, 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. */ + +/* For some code it's reasonable to have only one copy and conditionalize + at run-time. For other code it isn't. #### Perhaps all code should be + included here, not in event-xlike.c. However, event-xlike.c is always + X-specific, whereas the following code isn't, in the GTK case. */ + +static int +#ifdef THIS_IS_GTK +emacs_gtk_event_pending_p (int how_many) +#else +emacs_Xt_event_pending_p (int how_many) +#endif +{ + Lisp_Object event; + int tick_count_val; + + /* If `how_many' is 0, then this function returns whether there are any + X, timeout, or fd events pending (that is, whether + emacs_Xt_next_event() would return immediately without blocking). + + If `how_many' is > 0, then this function returns whether there are + that many *user generated* events available (keyboard, mouse click, + etc.). This also implies that emacs_Xt_next_event() would not block. + */ + + /* This function used to simply check whether there were any X events (or + if user_p was 1, it iterated over all the pending X events using + XCheckIfEvent(), looking for keystrokes and button events). That + worked in the old cheesoid event loop, which didn't go through + XtAppDispatchEvent(), but it doesn't work any more -- X events may not + result in anything. For example, a button press in a blank part of + the menubar appears as an X event but will not result in any Emacs + events (a button press that activates the menubar results in an Emacs + event through the stop_next_event mechanism). + + The only accurate way of determining whether these X events translate + into Emacs events is to go ahead and dispatch them until there's + something on the dispatch queue. */ + + if (!how_many) + { + /* We're being asked for *ALL* events, not just user events. */ + + /* (1) Any pending events in the dispatch queue? */ + if (!NILP (dispatch_event_queue)) + return 1; + + /* (2) Any TTY or process input available? + + Note that formerly we just checked the value of XtAppPending() to + determine if there was file-desc input. This doesn't work any + more with the signal_event_pipe; XtAppPending() will says "yes" in + this case but there isn't really any input. So instead we keep + track of the file descriptors, and call select() ourselves. + Another way of fixing this problem is for the signal_event_pipe to + generate actual input in the form of an identity eval event or + something. (#### maybe this actually happens?) */ + + if (poll_fds_for_input (non_fake_input_wait_mask)) + return 1; + +#ifndef THIS_IS_GTK + /* (3) Any timeout input available? */ + if (XtAppPending (Xt_app_con) & XtIMTimer) + return 1; +#else + /* #### Is there any way to do this in Gtk? I don't think there + is a 'peek' for events */ +#endif + } + else + { + /* HOW_MANY > 0 */ + EVENT_CHAIN_LOOP (event, dispatch_event_queue) + { + if (command_event_p (event)) + { + how_many--; + if (how_many <= 0) + return 1; + } + } + } + + /* XtAppPending() can be super-slow, esp. over a network connection. + Quantify results have indicated that in some cases the call to + detect_input_pending() completely dominates the running time of + redisplay(). Fortunately, in a SIGIO world we can more quickly + determine whether there are any X events: if an event has happened + since the last time we checked, then a SIGIO will have happened. On a + machine with broken SIGIO, we'll still be in an OK state -- + quit_check_signal_tick_count will get ticked at least every 1/4 + second, so we'll be no more than that much behind reality. (In general + it's OK if we erroneously report no input pending when input is + actually pending() -- preemption is just a bit less efficient, that's + all. It's bad bad bad if you err the other way -- you've promised + that `next-event' won't block but it actually will, and some action + might get delayed until the next time you hit a key.) + */ + + if (!in_modal_loop) + { + /* quit_check_signal_tick_count is volatile so try to avoid race + conditions by using a temporary variable */ + tick_count_val = quit_check_signal_tick_count; + if (last_quit_check_signal_tick_count != tick_count_val +#if !defined (THIS_IS_GTK) && (!defined (SIGIO) || defined (CYGWIN)) + || (XtIMXEvent & XtAppPending (Xt_app_con)) +#endif + ) + { + last_quit_check_signal_tick_count = tick_count_val; + + /* We need to drain the entire queue now -- if we only drain part of + it, we may later on end up with events actually pending but + detect_input_pending() returning false because there wasn't + another SIGIO. */ + event_stream_drain_queue (); + + if (!how_many) + return !NILP (dispatch_event_queue); + + EVENT_CHAIN_LOOP (event, dispatch_event_queue) + { + if (command_event_p (event)) + { + how_many--; + if (how_many <= 0) + return 1; + } + } + + return 0; + } + } + + return 0; +} Index: src/events.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/events.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- src/events.c 13 Aug 2002 11:37:32 -0000 1.57 +++ src/events.c 12 Jan 2003 11:08:14 -0000 1.58 @@ -41,10 +41,6 @@ #include "console-tty-impl.h" /* for stuff in character_to_event */ -#ifdef USE_KKCC -#include "console-x.h" -#endif /* USE_KKCC */ - /* Where old events go when they are explicitly deallocated. The event chain here is cut loose before GC, so these will be freed eventually. @@ -73,666 +69,197 @@ Vevent_resource = Qnil; } -#ifdef USE_KKCC /* Make sure we lose quickly if we try to use this event */ static void deinitialize_event (Lisp_Object ev) { Lisp_Event *event = XEVENT (ev); + int i; + for (i = 0; i < (int) (sizeof (Lisp_Event) / sizeof (int)); i++) + ((int *) event) [i] = 0xdeadbeef; /* -559038737 base 10 */ + set_lheader_implementation (&event->lheader, &lrecord_event); set_event_type (event, dead_event); SET_EVENT_CHANNEL (event, Qnil); - set_lheader_implementation (&event->lheader, &lrecord_event); XSET_EVENT_NEXT (ev, Qnil); - XSET_EVENT_DATA (ev, Qnil); } /* Set everything to zero or nil so that it's predictable. */ void zero_event (Lisp_Event *e) { - SET_EVENT_DATA (e, Qnil); + xzero (*e); + set_lheader_implementation (&e->lheader, &lrecord_event); set_event_type (e, empty_event); - SET_EVENT_NEXT (e, Qnil); SET_EVENT_CHANNEL (e, Qnil); - SET_EVENT_TIMESTAMP_ZERO (e); -} - -static const struct lrecord_description event_description [] = { - { XD_LISP_OBJECT, offsetof (struct Lisp_Event, next) }, - { XD_LISP_OBJECT, offsetof (struct Lisp_Event, channel) }, - { XD_LISP_OBJECT, offsetof (struct Lisp_Event, event_data) }, - { XD_END } -}; - -static Lisp_Object -mark_event (Lisp_Object obj) -{ - mark_object (XEVENT_DATA(obj)); - mark_object (XEVENT_CHANNEL(obj)); - return (XEVENT_NEXT(obj)); + SET_EVENT_NEXT (e, Qnil); } - -static const struct lrecord_description key_data_description [] = { +static const struct memory_description key_data_description_1 [] = { { XD_LISP_OBJECT, offsetof (struct Lisp_Key_Data, keysym) }, { XD_END } }; -static Lisp_Object -mark_key_data (Lisp_Object obj) -{ - return (XKEY_DATA_KEYSYM(obj)); -} - +static const struct sized_memory_description key_data_description = { + sizeof (Lisp_Key_Data), key_data_description_1 +}; -static const struct lrecord_description button_data_description [] = { +static const struct memory_description button_data_description_1 [] = { { XD_END } }; -static Lisp_Object -mark_button_data (Lisp_Object obj) -{ - return Qnil; -} - +static const struct sized_memory_description button_data_description = { + sizeof (Lisp_Button_Data), button_data_description_1 +}; -static const struct lrecord_description motion_data_description [] = { +static const struct memory_description motion_data_description_1 [] = { { XD_END } }; -static Lisp_Object -mark_motion_data (Lisp_Object obj) -{ - return Qnil; -} - +static const struct sized_memory_description motion_data_description = { + sizeof (Lisp_Motion_Data), motion_data_description_1 +}; -static const struct lrecord_description process_data_description [] = { +static const struct memory_description process_data_description_1 [] = { { XD_LISP_OBJECT, offsetof (struct Lisp_Process_Data, process) }, { XD_END } }; -static Lisp_Object -mark_process_data (Lisp_Object obj) -{ - return (XPROCESS_DATA_PROCESS(obj)); -} - +static const struct sized_memory_description process_data_description = { + sizeof (Lisp_Process_Data), process_data_description_1 +}; -static const struct lrecord_description timeout_data_description [] = { +static const struct memory_description timeout_data_description_1 [] = { { XD_LISP_OBJECT, offsetof (struct Lisp_Timeout_Data, function) }, { XD_LISP_OBJECT, offsetof (struct Lisp_Timeout_Data, object) }, { XD_END } }; -static Lisp_Object -mark_timeout_data (Lisp_Object obj) -{ - mark_object (XTIMEOUT_DATA_FUNCTION(obj)); - return (XTIMEOUT_DATA_OBJECT(obj)); -} - +static const struct sized_memory_description timeout_data_description = { + sizeof (Lisp_Timeout_Data), timeout_data_description_1 +}; -static const struct lrecord_description eval_data_description [] = { +static const struct memory_description eval_data_description_1 [] = { { XD_LISP_OBJECT, offsetof (struct Lisp_Eval_Data, function) }, { XD_LISP_OBJECT, offsetof (struct Lisp_Eval_Data, object) }, { XD_END } -}; - -static Lisp_Object -mark_eval_data (Lisp_Object obj) -{ - mark_object (XEVAL_DATA_FUNCTION(obj)); - return (XEVAL_DATA_OBJECT(obj)); -} - - -static const struct lrecord_description misc_user_data_description [] = { - { XD_LISP_OBJECT, offsetof (struct Lisp_Misc_User_Data, function) }, - { XD_LISP_OBJECT, offsetof (struct Lisp_Misc_User_Data, object) }, - { XD_END } -}; - -static Lisp_Object -mark_misc_user_data (Lisp_Object obj) -{ - mark_object (XMISC_USER_DATA_FUNCTION(obj)); - return (XMISC_USER_DATA_OBJECT(obj)); -} - - -static const struct lrecord_description magic_eval_data_description [] = { - { XD_LISP_OBJECT, offsetof (struct Lisp_Magic_Eval_Data, object) }, - { XD_END } -}; - -static Lisp_Object -mark_magic_eval_data (Lisp_Object obj) -{ - return (XMAGIC_EVAL_DATA_OBJECT(obj)); -} - - -static const struct lrecord_description magic_data_description [] = { - { XD_END } -}; - -static Lisp_Object -mark_magic_data (Lisp_Object obj) -{ - return Qnil; -} - - - -static void -print_event (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - if (print_readably) - printing_unreadable_object ("#"); - - switch (XEVENT_TYPE (obj)) - { - case key_press_event: - write_c_string (printcharfun, "#"); - return; - case dead_event: - write_c_string (printcharfun, "#"); - return; - default: - write_c_string (printcharfun, "#"); - return; - } - - print_internal (XEVENT_DATA (obj), printcharfun, 1); - write_c_string (printcharfun, ">"); -} - - -static void -print_key_data (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - char buf[128]; - if (print_readably) - printing_unreadable_object ("#"); - - sprintf (buf, "#"); - write_c_string (printcharfun, buf);*/ -} - -static void -print_button_data (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - char buf[128]; - if (print_readably) - printing_unreadable_object ("#"); - - sprintf (buf, "#"); - write_c_string (printcharfun, buf);*/ -} - - -static void -print_motion_data (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - char buf[64]; - - if (print_readably) - printing_unreadable_object ("#"); - - sprintf (buf, "#", - (long) XMOTION_DATA_X (obj), - (long) XMOTION_DATA_Y (obj)); - write_c_string (printcharfun, buf); -} - - -static void -print_process_data (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - if (print_readably) - printing_unreadable_object ("#"); - - write_c_string (printcharfun, "#"); -} - - -static void -print_timeout_data (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - if (print_readably) - printing_unreadable_object ("#"); - - write_c_string (printcharfun, "#"); -} - - -static void -print_eval_data (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - if (print_readably) - printing_unreadable_object ("#"); - - write_c_string (printcharfun, "#"); -} - - -static void -print_misc_user_data (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - if (print_readably) - printing_unreadable_object ("#"); - - write_c_string (printcharfun, "#"); -} - - -static void -print_magic_eval_data (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - // char buf[128]; - - if (print_readably) - printing_unreadable_object ("#"); - - /* format_event_data_object (buf + 18, obj, 0);*/ -} - - -static void -print_magic_data (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - char buf[128]; - - if (print_readably) - printing_unreadable_object ("#"); - - sprintf (buf, "#"); - write_c_string (print_readably, buf);*/ -} - - -static int -event_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{ - Lisp_Event *e1 = XEVENT (obj1); - Lisp_Event *e2 = XEVENT (obj2); - - if (EVENT_TYPE (e1) != EVENT_TYPE (e2)) return 0; - if (!EQ (EVENT_CHANNEL (e1), EVENT_CHANNEL (e2))) return 0; -/* if (EVENT_TIMESTAMP (e1) != EVENT_TIMESTAMP (e2)) return 0; */ - switch (EVENT_TYPE (e1)) - { - default: abort (); - - case process_event: - case timeout_event: - case pointer_motion_event: - case key_press_event: - case button_press_event: - case button_release_event: - case misc_user_event: - case eval_event: - case magic_eval_event: - return internal_equal (EVENT_DATA (e1), EVENT_DATA (e2), 0); - - case magic_event: - { - struct console *con = XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e1))); - -#ifdef HAVE_X_WINDOWS - if (CONSOLE_X_P (con)) - return (XMAGIC_DATA_X_EVENT (EVENT_DATA (e1)).xany.serial == - XMAGIC_DATA_X_EVENT (EVENT_DATA (e2)).xany.serial); -#endif -#ifdef HAVE_GTK - if (CONSOLE_GTK_P (con)) - return (XMAGIC_DATA_GTK_EVENT (EVENT_DATA (e1)) == - XMAGIC_DATA_GTK_EVENT (EVENT_DATA (e2))); -#endif -#ifdef HAVE_MS_WINDOWS - if (CONSOLE_MSWINDOWS_P (con)) - return (XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA (e1)) == - XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA (e2))); -#endif - abort (); - return 1; /* not reached */ - } - - case empty_event: /* Empty and deallocated events are equal. */ - case dead_event: - return 1; - } -} - -static int -key_data_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{ - return (EQ (XKEY_DATA_KEYSYM (obj1), XKEY_DATA_KEYSYM (obj2)) && - (XKEY_DATA_MODIFIERS (obj1) == XKEY_DATA_MODIFIERS (obj2))); -} - -static int -button_data_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{ - return (XBUTTON_DATA_BUTTON (obj1) == XBUTTON_DATA_BUTTON (obj2) && - XBUTTON_DATA_MODIFIERS (obj1) == XBUTTON_DATA_MODIFIERS (obj2)); -} - -static int -motion_data_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{ - return (XMOTION_DATA_X (obj1) == XMOTION_DATA_X (obj2) && - XMOTION_DATA_Y (obj1) == XMOTION_DATA_Y (obj2)); -} - -static int -process_data_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{ - return EQ (XPROCESS_DATA_PROCESS (obj1), XPROCESS_DATA_PROCESS (obj2)); -} - -static int -timeout_data_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{ - return (internal_equal (XTIMEOUT_DATA_FUNCTION (obj1), - XTIMEOUT_DATA_FUNCTION (obj2), 0) && - internal_equal (XTIMEOUT_DATA_OBJECT (obj1), - XTIMEOUT_DATA_OBJECT (obj2), 0)); -} - -static int -eval_data_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{ - return (internal_equal (XEVAL_DATA_FUNCTION (obj1), - XEVAL_DATA_FUNCTION (obj2), 0) && - internal_equal (XEVAL_DATA_OBJECT (obj1), - XEVAL_DATA_OBJECT (obj2), 0)); -} - -static int -misc_user_data_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{ - return (internal_equal (XMISC_USER_DATA_FUNCTION (obj1), - XMISC_USER_DATA_FUNCTION (obj2), 0) && - internal_equal (XMISC_USER_DATA_OBJECT (obj1), - XMISC_USER_DATA_OBJECT (obj2), 0) && - /* is this really needed for equality - or is x and y also important? */ - XMISC_USER_DATA_BUTTON (obj1) == XMISC_USER_DATA_BUTTON (obj2) && - XMISC_USER_DATA_MODIFIERS (obj1) == - XMISC_USER_DATA_MODIFIERS (obj2)); -} - -static int -magic_eval_data_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{ - return (XMAGIC_EVAL_DATA_INTERNAL_FUNCTION (obj1) == - XMAGIC_EVAL_DATA_INTERNAL_FUNCTION (obj2) && - internal_equal (XMAGIC_EVAL_DATA_OBJECT (obj1), - XMAGIC_EVAL_DATA_OBJECT (obj2), 0)); -} - -static int -magic_data_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) -{assert (0); return 0;} - -static unsigned long -event_hash (Lisp_Object obj, int depth) -{ - Lisp_Event *e = XEVENT (obj); - unsigned long hash; - - hash = HASH2 (EVENT_TYPE (e), LISP_HASH (EVENT_CHANNEL (e))); - switch (EVENT_TYPE (e)) - { - case process_event: - case timeout_event: - case key_press_event: - case button_press_event: - case button_release_event: - case pointer_motion_event: - case misc_user_event: - case eval_event: - case magic_eval_event: - return HASH2 (hash, internal_hash (EVENT_DATA (e), depth + 1)); - - case magic_event: - { - struct console *con = XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e))); -#ifdef HAVE_X_WINDOWS - if (CONSOLE_X_P (con)) - return HASH2 (hash, XMAGIC_DATA_X_EVENT (EVENT_DATA (e)).xany.serial); -#endif -#ifdef HAVE_GTK - if (CONSOLE_GTK_P (con)) - return HASH2 (hash, XMAGIC_DATA_GTK_EVENT (EVENT_DATA (e))); -#endif -#ifdef HAVE_MS_WINDOWS - if (CONSOLE_MSWINDOWS_P (con)) - return HASH2 (hash, XMAGIC_DATA_MSWINDOWS_EVENT (EVENT_DATA (e))); -#endif - abort (); - return 0; - } - - case empty_event: - case dead_event: - return hash; - - default: - abort (); - } +}; - return 0; /* unreached */ -} +static const struct sized_memory_description eval_data_description = { + sizeof (Lisp_Eval_Data), eval_data_description_1 +}; -static unsigned long -key_data_hash (Lisp_Object obj, int depth) -{ - return HASH2 (LISP_HASH (XKEY_DATA_KEYSYM (obj)), - XKEY_DATA_MODIFIERS (obj)); -} +static const struct memory_description misc_user_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct Lisp_Misc_User_Data, function) }, + { XD_LISP_OBJECT, offsetof (struct Lisp_Misc_User_Data, object) }, + { XD_END } +}; -static unsigned long -button_data_hash (Lisp_Object obj, int depth) -{ - return HASH2 (XBUTTON_DATA_BUTTON (obj), XBUTTON_DATA_MODIFIERS (obj)); -} +static const struct sized_memory_description misc_user_data_description = { + sizeof (Lisp_Misc_User_Data), misc_user_data_description_1 +}; -static unsigned long -motion_data_hash (Lisp_Object obj, int depth) -{ - return HASH2 (XMOTION_DATA_X (obj), XMOTION_DATA_Y (obj)); -} +static const struct memory_description magic_eval_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct Lisp_Magic_Eval_Data, object) }, + { XD_END } +}; -static unsigned long -process_data_hash (Lisp_Object obj, int depth) -{ - return LISP_HASH (XPROCESS_DATA_PROCESS (obj)); -} +static const struct sized_memory_description magic_eval_data_description = { + sizeof (Lisp_Magic_Eval_Data), magic_eval_data_description_1 +}; -static unsigned long -timeout_data_hash (Lisp_Object obj, int depth) -{ - return HASH2 (internal_hash (XTIMEOUT_DATA_FUNCTION (obj), depth + 1), - internal_hash (XTIMEOUT_DATA_OBJECT (obj), depth + 1)); -} +static const struct memory_description magic_data_description_1 [] = { + { XD_END } +}; -static unsigned long -eval_data_hash (Lisp_Object obj, int depth) -{ - return HASH2 (internal_hash (XEVAL_DATA_FUNCTION (obj), depth + 1), - internal_hash (XEVAL_DATA_OBJECT (obj), depth + 1)); -} +static const struct sized_memory_description magic_data_description = { + sizeof (Lisp_Magic_Data), magic_data_description_1 +}; -static unsigned long -misc_user_data_hash (Lisp_Object obj, int depth) -{ - return HASH4 (internal_hash (XMISC_USER_DATA_FUNCTION (obj), depth + 1), - internal_hash (XMISC_USER_DATA_OBJECT (obj), depth + 1), - XMISC_USER_DATA_BUTTON (obj), XMISC_USER_DATA_MODIFIERS (obj)); -} +static const struct memory_description event_data_description_1 [] = { + { XD_STRUCT_ARRAY, key_press_event, 1, &key_data_description }, + { XD_STRUCT_ARRAY, button_press_event, 1, &button_data_description }, + { XD_STRUCT_ARRAY, button_release_event, 1, &button_data_description }, + { XD_STRUCT_ARRAY, pointer_motion_event, 1, &motion_data_description }, + { XD_STRUCT_ARRAY, process_event, 1, &process_data_description }, + { XD_STRUCT_ARRAY, timeout_event, 1, &timeout_data_description }, + { XD_STRUCT_ARRAY, magic_event, 1, &magic_data_description }, + { XD_STRUCT_ARRAY, magic_eval_event, 1, &magic_eval_data_description }, + { XD_STRUCT_ARRAY, eval_event, 1, &eval_data_description }, + { XD_STRUCT_ARRAY, misc_user_event, 1, &misc_user_data_description }, + { XD_END } +}; -static unsigned long -magic_eval_data_hash (Lisp_Object obj, int depth) -{ - return HASH2 ((unsigned long) XMAGIC_EVAL_DATA_INTERNAL_FUNCTION (obj), - internal_hash (XMAGIC_EVAL_DATA_OBJECT (obj), depth + 1)); -} +static const struct sized_memory_description event_data_description = { + 0, event_data_description_1 +}; + +static const struct memory_description event_description [] = { + { XD_INT, offsetof (struct Lisp_Event, event_type) }, + { XD_LISP_OBJECT, offsetof (struct Lisp_Event, next) }, + { XD_LISP_OBJECT, offsetof (struct Lisp_Event, channel) }, + { XD_UNION, offsetof (struct Lisp_Event, event), + XD_INDIRECT (0, 0), &event_data_description }, + { XD_END } +}; -static unsigned long -magic_data_hash (Lisp_Object obj, int depth) -{assert(0); return 1;} +#ifdef EVENT_DATA_AS_OBJECTS DEFINE_BASIC_LRECORD_IMPLEMENTATION ("key-data", key_data, 0, /*dumpable-flag*/ - mark_key_data, - print_key_data, 0, - key_data_equal, key_data_hash, + 0, 0, 0, 0, 0, key_data_description, Lisp_Key_Data); DEFINE_BASIC_LRECORD_IMPLEMENTATION ("button-data", button_data, 0, /*dumpable-flag*/ - mark_button_data, print_button_data, 0, - button_data_equal, button_data_hash, + 0, 0, 0, 0, 0, button_data_description, Lisp_Button_Data); DEFINE_BASIC_LRECORD_IMPLEMENTATION ("motion-data", motion_data, 0, /*dumpable-flag*/ - mark_motion_data, print_motion_data, 0, - motion_data_equal, motion_data_hash, + 0, 0, 0, 0, 0, motion_data_description, Lisp_Motion_Data); DEFINE_BASIC_LRECORD_IMPLEMENTATION ("process-data", process_data, 0, /*dumpable-flag*/ - mark_process_data, - print_process_data, 0, - process_data_equal, process_data_hash, + 0, 0, 0, 0, 0, process_data_description, Lisp_Process_Data); DEFINE_BASIC_LRECORD_IMPLEMENTATION ("timeout-data", timeout_data, 0, /*dumpable-flag*/ - mark_timeout_data, - print_timeout_data, 0, - timeout_data_equal, timeout_data_hash, + 0, 0, 0, 0, 0, timeout_data_description, Lisp_Timeout_Data); DEFINE_BASIC_LRECORD_IMPLEMENTATION ("eval-data", eval_data, 0, /*dumpable-flag*/ - mark_eval_data, - print_eval_data, 0, - eval_data_equal, eval_data_hash, + 0, 0, 0, 0, 0, eval_data_description, Lisp_Eval_Data); DEFINE_BASIC_LRECORD_IMPLEMENTATION ("misc-user-data", misc_user_data, 0, /*dumpable-flag*/ - mark_misc_user_data, - print_misc_user_data, - 0, misc_user_data_equal, - misc_user_data_hash, + 0, 0, 0, 0, 0, misc_user_data_description, Lisp_Misc_User_Data); DEFINE_BASIC_LRECORD_IMPLEMENTATION ("magic-eval-data", magic_eval_data, 0, /*dumpable-flag*/ - mark_magic_eval_data, - print_magic_eval_data, 0, - magic_eval_data_equal, - magic_eval_data_hash, + 0, 0, 0, 0, 0, magic_eval_data_description, Lisp_Magic_Eval_Data); DEFINE_BASIC_LRECORD_IMPLEMENTATION ("magic-data", magic_data, 0, /*dumpable-flag*/ - mark_magic_data, print_magic_data, 0, - magic_data_equal, magic_data_hash, + 0, 0, 0, 0, 0, magic_data_description, Lisp_Magic_Data); - - -#else /* not USE_KKCC */ -/* Make sure we lose quickly if we try to use this event */ -static void -deinitialize_event (Lisp_Object ev) -{ - int i; - Lisp_Event *event = XEVENT (ev); - - for (i = 0; i < (int) (sizeof (Lisp_Event) / sizeof (int)); i++) - ((int *) event) [i] = 0xdeadbeef; - event->event_type = dead_event; - event->channel = Qnil; - set_lheader_implementation (&event->lheader, &lrecord_event); - XSET_EVENT_NEXT (ev, Qnil); -} - -/* Set everything to zero or nil so that it's predictable. */ -void -zero_event (Lisp_Event *e) -{ - xzero (*e); - set_lheader_implementation (&e->lheader, &lrecord_event); - e->event_type = empty_event; - e->next = Qnil; - e->channel = Qnil; -} +#endif /* EVENT_DATA_AS_OBJECTS */ static Lisp_Object mark_event (Lisp_Object obj) @@ -742,22 +269,22 @@ switch (event->event_type) { case key_press_event: - mark_object (event->event.key.keysym); + mark_object (EVENT_KEY_KEYSYM (event)); break; case process_event: - mark_object (event->event.process.process); + mark_object (EVENT_PROCESS_PROCESS (event)); break; case timeout_event: - mark_object (event->event.timeout.function); - mark_object (event->event.timeout.object); + mark_object (EVENT_TIMEOUT_FUNCTION (event)); + mark_object (EVENT_TIMEOUT_OBJECT (event)); break; case eval_event: case misc_user_event: - mark_object (event->event.eval.function); - mark_object (event->event.eval.object); + mark_object (EVENT_EVAL_FUNCTION (event)); + mark_object (EVENT_EVAL_OBJECT (event)); break; case magic_eval_event: - mark_object (event->event.magic_eval.object); + mark_object (EVENT_MAGIC_EVAL_OBJECT (event)); break; case button_press_event: case button_release_event: @@ -778,7 +305,7 @@ { DECLARE_EISTRING_MALLOC (ei); write_c_string (printcharfun, str); - format_event_object (ei, XEVENT (obj), 0); + format_event_object (ei, obj, 0); write_eistring (printcharfun, ei); eifree (ei); } @@ -816,21 +343,27 @@ break; } case process_event: - write_fmt_string_lisp (printcharfun, "#event.process.process); + write_fmt_string_lisp (printcharfun, "#event.timeout.object); + write_fmt_string_lisp (printcharfun, "#event.misc.function); - write_fmt_string_lisp (printcharfun, " %S)", 1, XEVENT (obj)->event.misc.object); + write_fmt_string_lisp (printcharfun, "#event.eval.function); - write_fmt_string_lisp (printcharfun, " %S)", 1, XEVENT (obj)->event.eval.object); + write_fmt_string_lisp (printcharfun, "#event.process.process, e2->event.process.process); + return EQ (EVENT_PROCESS_PROCESS (e1), EVENT_PROCESS_PROCESS (e2)); case timeout_event: - return (internal_equal (e1->event.timeout.function, - e2->event.timeout.function, 0) && - internal_equal (e1->event.timeout.object, - e2->event.timeout.object, 0)); + return (internal_equal (EVENT_TIMEOUT_FUNCTION (e1), + EVENT_TIMEOUT_FUNCTION (e2), 0) && + internal_equal (EVENT_TIMEOUT_OBJECT (e1), + EVENT_TIMEOUT_OBJECT (e2), 0)); case key_press_event: - return (EQ (e1->event.key.keysym, e2->event.key.keysym) && - (e1->event.key.modifiers == e2->event.key.modifiers)); + return (EQ (EVENT_KEY_KEYSYM (e1), EVENT_KEY_KEYSYM (e2)) && + (EVENT_KEY_MODIFIERS (e1) == EVENT_KEY_MODIFIERS (e2))); case button_press_event: case button_release_event: - return (e1->event.button.button == e2->event.button.button && - e1->event.button.modifiers == e2->event.button.modifiers); + return (EVENT_BUTTON_BUTTON (e1) == EVENT_BUTTON_BUTTON (e2) && + EVENT_BUTTON_MODIFIERS (e1) == EVENT_BUTTON_MODIFIERS (e2)); case pointer_motion_event: - return (e1->event.motion.x == e2->event.motion.x && - e1->event.motion.y == e2->event.motion.y); + return (EVENT_MOTION_X (e1) == EVENT_MOTION_X (e2) && + EVENT_MOTION_Y (e1) == EVENT_MOTION_Y (e2)); case misc_user_event: - return (internal_equal (e1->event.eval.function, - e2->event.eval.function, 0) && - internal_equal (e1->event.eval.object, - e2->event.eval.object, 0) && - /* is this really needed for equality + return (internal_equal (EVENT_EVAL_FUNCTION (e1), + EVENT_EVAL_FUNCTION (e2), 0) && + internal_equal (EVENT_EVAL_OBJECT (e1), + EVENT_EVAL_OBJECT (e2), 0) && + /* #### is this really needed for equality or is x and y also important? */ - e1->event.misc.button == e2->event.misc.button && - e1->event.misc.modifiers == e2->event.misc.modifiers); + EVENT_MISC_USER_BUTTON (e1) == EVENT_MISC_USER_BUTTON (e2) && + EVENT_MISC_USER_MODIFIERS (e1) == EVENT_MISC_USER_MODIFIERS (e2)); case eval_event: - return (internal_equal (e1->event.eval.function, - e2->event.eval.function, 0) && - internal_equal (e1->event.eval.object, - e2->event.eval.object, 0)); + return (internal_equal (EVENT_EVAL_FUNCTION (e1), + EVENT_EVAL_FUNCTION (e2), 0) && + internal_equal (EVENT_EVAL_OBJECT (e1), + EVENT_EVAL_OBJECT (e2), 0)); case magic_eval_event: - return (e1->event.magic_eval.internal_function == - e2->event.magic_eval.internal_function && - internal_equal (e1->event.magic_eval.object, - e2->event.magic_eval.object, 0)); + return (EVENT_MAGIC_EVAL_INTERNAL_FUNCTION (e1) == + EVENT_MAGIC_EVAL_INTERNAL_FUNCTION (e2) && + internal_equal (EVENT_MAGIC_EVAL_OBJECT (e1), + EVENT_MAGIC_EVAL_OBJECT (e2), 0)); case magic_event: return event_stream_compare_magic_event (e1, e2); @@ -918,36 +451,38 @@ switch (e->event_type) { case process_event: - return HASH2 (hash, LISP_HASH (e->event.process.process)); + return HASH2 (hash, LISP_HASH (EVENT_PROCESS_PROCESS (e))); case timeout_event: - return HASH3 (hash, internal_hash (e->event.timeout.function, depth + 1), - internal_hash (e->event.timeout.object, depth + 1)); + return HASH3 (hash, + internal_hash (EVENT_TIMEOUT_FUNCTION (e), depth + 1), + internal_hash (EVENT_TIMEOUT_OBJECT (e), depth + 1)); case key_press_event: - return HASH3 (hash, LISP_HASH (e->event.key.keysym), - e->event.key.modifiers); + return HASH3 (hash, LISP_HASH (EVENT_KEY_KEYSYM (e)), + EVENT_KEY_MODIFIERS (e)); case button_press_event: case button_release_event: - return HASH3 (hash, e->event.button.button, e->event.button.modifiers); + return HASH3 (hash, EVENT_BUTTON_BUTTON (e), EVENT_BUTTON_MODIFIERS (e)); case pointer_motion_event: - return HASH3 (hash, e->event.motion.x, e->event.motion.y); + return HASH3 (hash, EVENT_MOTION_X (e), EVENT_MOTION_Y (e)); case misc_user_event: - return HASH5 (hash, internal_hash (e->event.misc.function, depth + 1), - internal_hash (e->event.misc.object, depth + 1), - e->event.misc.button, e->event.misc.modifiers); + return HASH5 (hash, + internal_hash (EVENT_MISC_USER_FUNCTION (e), depth + 1), + internal_hash (EVENT_MISC_USER_OBJECT (e), depth + 1), + EVENT_MISC_USER_BUTTON (e), EVENT_MISC_USER_MODIFIERS (e)); case eval_event: - return HASH3 (hash, internal_hash (e->event.eval.function, depth + 1), - internal_hash (e->event.eval.object, depth + 1)); + return HASH3 (hash, internal_hash (EVENT_EVAL_FUNCTION (e), depth + 1), + internal_hash (EVENT_EVAL_OBJECT (e), depth + 1)); case magic_eval_event: return HASH3 (hash, - (Hashcode) e->event.magic_eval.internal_function, - internal_hash (e->event.magic_eval.object, depth + 1)); + (Hashcode) EVENT_MAGIC_EVAL_INTERNAL_FUNCTION (e), + internal_hash (EVENT_MAGIC_EVAL_OBJECT (e), depth + 1)); case magic_event: return HASH2 (hash, event_stream_hash_magic_event (e)); @@ -962,19 +497,12 @@ return 0; /* unreached */ } -#endif /* not USE_KKCC */ - -#ifdef USE_KKCC DEFINE_BASIC_LRECORD_IMPLEMENTATION ("event", event, 0, /*dumpable-flag*/ mark_event, print_event, 0, event_equal, - event_hash, 0/*event_description*/, Lisp_Event); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("event", event, - mark_event, print_event, 0, event_equal, - event_hash, 0, Lisp_Event); -#endif /* not USE_KKCC */ + event_hash, event_description, + Lisp_Event); DEFUN ("make-event", Fmake_event, 0, 2, 0, /* Return a new event of type TYPE, with properties described by PLIST. @@ -1052,11 +580,7 @@ PLIST. In fact, processing PLIST would be wrong, because the sanitizing process would fill in the properties (e.g. CHANNEL), which we don't want in empty events. */ -#ifdef USE_KKCC set_event_type (e, empty_event); -#else /* not USE_KKCC */ - e->event_type = empty_event; -#endif /* not USE_KKCC */ if (!NILP (plist)) invalid_operation ("Cannot set properties of empty event", plist); UNGCPRO; @@ -1064,42 +588,20 @@ } else if (EQ (type, Qkey_press)) { -#ifdef USE_KKCC set_event_type (e, key_press_event); - XSET_KEY_DATA_KEYSYM (EVENT_DATA (e), Qunbound); -#else /* not USE_KKCC */ - e->event_type = key_press_event; - e->event.key.keysym = Qunbound; -#endif /* not USE_KKCC */ + SET_EVENT_KEY_KEYSYM (e, Qunbound); } else if (EQ (type, Qbutton_press)) -#ifdef USE_KKCC set_event_type (e, button_press_event); -#else /* not USE_KKCC */ - e->event_type = button_press_event; -#endif /* not USE_KKCC */ else if (EQ (type, Qbutton_release)) -#ifdef USE_KKCC set_event_type (e, button_release_event); -#else /* not USE_KKCC */ - e->event_type = button_release_event; -#endif /* not USE_KKCC */ else if (EQ (type, Qmotion)) -#ifdef USE_KKCC set_event_type (e, pointer_motion_event); -#else /* not USE_KKCC */ - e->event_type = pointer_motion_event; -#endif /* not USE_KKCC */ else if (EQ (type, Qmisc_user)) { -#ifdef USE_KKCC set_event_type (e, misc_user_event); - XSET_MISC_USER_DATA_FUNCTION (EVENT_DATA (e), Qnil); - XSET_MISC_USER_DATA_OBJECT (EVENT_DATA (e), Qnil); -#else /* not USE_KKCC */ - e->event_type = misc_user_event; - e->event.eval.function = e->event.eval.object = Qnil; -#endif /* not USE_KKCC */ + SET_EVENT_MISC_USER_FUNCTION (e, Qnil); + SET_EVENT_MISC_USER_OBJECT (e, Qnil); } else { @@ -1120,11 +622,7 @@ { if (EQ (keyword, Qchannel)) { -#ifdef USE_KKCC - if (EVENT_TYPE(e) == key_press_event) -#else /* not USE_KKCC */ - if (e->event_type == key_press_event) -#endif /* not USE_KKCC */ + if (EVENT_TYPE (e) == key_press_event) { if (!CONSOLEP (value)) value = wrong_type_argument (Qconsolep, value); @@ -1138,20 +636,12 @@ } else if (EQ (keyword, Qkey)) { -#ifdef USE_KKCC - switch (EVENT_TYPE(e)) -#else /* not USE_KKCC */ - switch (e->event_type) -#endif /* not USE_KKCC */ + switch (EVENT_TYPE (e)) { case key_press_event: if (!SYMBOLP (value) && !CHARP (value)) invalid_argument ("Invalid event key", value); -#ifdef USE_KKCC - XSET_KEY_DATA_KEYSYM (EVENT_DATA(e), value); -#else /* not USE_KKCC */ - e->event.key.keysym = value; -#endif /* not USE_KKCC */ + SET_EVENT_KEY_KEYSYM (e, value); break; default: WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); @@ -1163,26 +653,14 @@ CHECK_NATNUM (value); check_int_range (XINT (value), 0, 7); -#ifdef USE_KKCC - switch (EVENT_TYPE(e)) -#else /* not USE_KKCC */ - switch (e->event_type) -#endif /* not USE_KKCC */ + switch (EVENT_TYPE (e)) { case button_press_event: case button_release_event: -#ifdef USE_KKCC - XSET_BUTTON_DATA_BUTTON (EVENT_DATA (e), XINT (value)); -#else /* not USE_KKCC */ - e->event.button.button = XINT (value); -#endif /* not USE_KKCC */ + SET_EVENT_BUTTON_BUTTON (e, XINT (value)); break; case misc_user_event: -#ifdef USE_KKCC - XSET_MISC_USER_DATA_BUTTON (EVENT_DATA (e), XINT (value)); -#else /* not USE_KKCC */ - e->event.misc.button = XINT (value); -#endif /* not USE_KKCC */ + SET_EVENT_MISC_USER_BUTTON (e, XINT (value)); break; default: WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); @@ -1211,40 +689,20 @@ invalid_constant ("Invalid key modifier", sym); } -#ifdef USE_KKCC - switch (EVENT_TYPE(e)) -#else /* not USE_KKCC */ - switch (e->event_type) -#endif /* not USE_KKCC */ + switch (EVENT_TYPE (e)) { case key_press_event: -#ifdef USE_KKCC - XSET_KEY_DATA_MODIFIERS (EVENT_DATA (e), modifiers); -#else /* not USE_KKCC */ - e->event.key.modifiers = modifiers; -#endif /* not USE_KKCC */ + SET_EVENT_KEY_MODIFIERS (e, modifiers); break; case button_press_event: case button_release_event: -#ifdef USE_KKCC - XSET_BUTTON_DATA_MODIFIERS (EVENT_DATA (e), modifiers); -#else /* not USE_KKCC */ - e->event.button.modifiers = modifiers; -#endif /* not USE_KKCC */ + SET_EVENT_BUTTON_MODIFIERS (e, modifiers); break; case pointer_motion_event: -#ifdef USE_KKCC - XSET_MOTION_DATA_MODIFIERS (EVENT_DATA (e), modifiers); -#else /* not USE_KKCC */ - e->event.motion.modifiers = modifiers; -#endif /* not USE_KKCC */ + SET_EVENT_MOTION_MODIFIERS (e, modifiers); break; case misc_user_event: -#ifdef USE_KKCC - XSET_MISC_USER_DATA_MODIFIERS (EVENT_DATA (e), modifiers); -#else /* not USE_KKCC */ - e->event.misc.modifiers = modifiers; -#endif /* not USE_KKCC */ + SET_EVENT_MISC_USER_MODIFIERS (e, modifiers); break; default: WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); @@ -1253,11 +711,7 @@ } else if (EQ (keyword, Qx)) { -#ifdef USE_KKCC - switch (EVENT_TYPE(e)) -#else /* not USE_KKCC */ - switch (e->event_type) -#endif /* not USE_KKCC */ + switch (EVENT_TYPE (e)) { case pointer_motion_event: case button_press_event: @@ -1275,11 +729,7 @@ } else if (EQ (keyword, Qy)) { -#ifdef USE_KKCC - switch (EVENT_TYPE(e)) -#else /* not USE_KKCC */ - switch (e->event_type) -#endif /* not USE_KKCC */ + switch (EVENT_TYPE (e)) { case pointer_motion_event: case button_press_event: @@ -1297,26 +747,14 @@ else if (EQ (keyword, Qtimestamp)) { CHECK_NATNUM (value); -#ifdef USE_KKCC SET_EVENT_TIMESTAMP (e, XINT (value)); -#else /* not USE_KKCC */ - e->timestamp = XINT (value); -#endif /* not USE_KKCC */ } else if (EQ (keyword, Qfunction)) { -#ifdef USE_KKCC - switch (EVENT_TYPE(e)) -#else /* not USE_KKCC */ - switch (e->event_type) -#endif /* not USE_KKCC */ + switch (EVENT_TYPE (e)) { case misc_user_event: -#ifdef USE_KKCC - XSET_MISC_USER_DATA_FUNCTION (EVENT_DATA (e), value); -#else /* not USE_KKCC */ - e->event.eval.function = value; -#endif /* not USE_KKCC */ + SET_EVENT_MISC_USER_FUNCTION (e, value); break; default: WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); @@ -1325,18 +763,10 @@ } else if (EQ (keyword, Qobject)) { -#ifdef USE_KKCC - switch (EVENT_TYPE(e)) -#else /* not USE_KKCC */ - switch (e->event_type) -#endif /* not USE_KKCC */ + switch (EVENT_TYPE (e)) { case misc_user_event: -#ifdef USE_KKCC - XSET_MISC_USER_DATA_OBJECT (EVENT_DATA (e), value); -#else /* not USE_KKCC */ - e->event.eval.object = value; -#endif /* not USE_KKCC */ + SET_EVENT_MISC_USER_OBJECT (e, value); break; default: WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); @@ -1351,11 +781,7 @@ /* Insert the channel, if missing. */ if (NILP (EVENT_CHANNEL (e))) { -#ifdef USE_KKCC if (EVENT_TYPE (e) == key_press_event) -#else /* not USE_KKCC */ - if (e->event_type == key_press_event) -#endif /* not USE_KKCC */ EVENT_CHANNEL (e) = Vselected_console; else EVENT_CHANNEL (e) = Fselected_frame (Qnil); @@ -1371,80 +797,45 @@ switch (e->event_type) { case pointer_motion_event: -#ifdef USE_KKCC - XSET_MOTION_DATA_X (EVENT_DATA (e), coord_x); - XSET_MOTION_DATA_Y (EVENT_DATA (e), coord_y); -#else /* not USE_KKCC */ - e->event.motion.x = coord_x; - e->event.motion.y = coord_y; -#endif /* not USE_KKCC */ + SET_EVENT_MOTION_X (e, coord_x); + SET_EVENT_MOTION_Y (e, coord_y); break; case button_press_event: case button_release_event: -#ifdef USE_KKCC - XSET_BUTTON_DATA_X (EVENT_DATA (e), coord_x); - XSET_BUTTON_DATA_Y (EVENT_DATA (e), coord_y); -#else /* not USE_KKCC */ - e->event.button.x = coord_x; - e->event.button.y = coord_y; -#endif /* not USE_KKCC */ + SET_EVENT_BUTTON_X (e, coord_x); + SET_EVENT_BUTTON_Y (e, coord_y); break; case misc_user_event: -#ifdef USE_KKCC - XSET_MISC_USER_DATA_X (EVENT_DATA (e), coord_x); - XSET_MISC_USER_DATA_Y (EVENT_DATA (e), coord_y); -#else /* not USE_KKCC */ - e->event.misc.x = coord_x; - e->event.misc.y = coord_y; -#endif /* not USE_KKCC */ + SET_EVENT_MISC_USER_X (e, coord_x); + SET_EVENT_MISC_USER_Y (e, coord_y); break; default: - abort(); + abort (); } } /* Finally, do some more validation. */ -#ifdef USE_KKCC - switch (EVENT_TYPE(e)) -#else /* not USE_KKCC */ - switch (e->event_type) -#endif /* not USE_KKCC */ + switch (EVENT_TYPE (e)) { case key_press_event: -#ifdef USE_KKCC - if (UNBOUNDP (XKEY_DATA_KEYSYM (EVENT_DATA (e)))) -#else /* not USE_KKCC */ - if (UNBOUNDP (e->event.key.keysym)) -#endif /* not USE_KKCC */ + if (UNBOUNDP (EVENT_KEY_KEYSYM (e))) sferror ("A key must be specified to make a keypress event", plist); break; case button_press_event: -#ifdef USE_KKCC - if (!XBUTTON_DATA_BUTTON (EVENT_DATA (e))) -#else /* not USE_KKCC */ - if (!e->event.button.button) -#endif /* not USE_KKCC */ + if (!EVENT_BUTTON_BUTTON (e)) sferror ("A button must be specified to make a button-press event", plist); break; case button_release_event: -#ifdef USE_KKCC - if (!XBUTTON_DATA_BUTTON (EVENT_DATA (e))) -#else /* not USE_KKCC */ - if (!e->event.button.button) -#endif /* not USE_KKCC */ + if (!EVENT_BUTTON_BUTTON (e)) sferror ("A button must be specified to make a button-release event", plist); break; case misc_user_event: -#ifdef USE_KKCC - if (NILP (XMISC_USER_DATA_FUNCTION (EVENT_DATA (e)))) -#else /* not USE_KKCC */ - if (NILP (e->event.misc.function)) -#endif /* not USE_KKCC */ + if (NILP (EVENT_MISC_USER_FUNCTION (e))) sferror ("A function must be specified to make a misc-user event", plist); break; @@ -1456,114 +847,6 @@ return event; } - -#ifdef USE_KKCC - -Lisp_Object -make_key_data (void) -{ - Lisp_Object data = allocate_key_data (); - - XSET_KEY_DATA_KEYSYM (data, Qnil); - XSET_KEY_DATA_MODIFIERS (data, 0); - - return data; -} - -Lisp_Object -make_button_data (void) -{ - Lisp_Object data = allocate_button_data (); - - XSET_BUTTON_DATA_BUTTON (data, 0); - XSET_BUTTON_DATA_MODIFIERS (data, 0); - XSET_BUTTON_DATA_X (data, 0); - XSET_BUTTON_DATA_Y (data, 0); - - return data; -} - -Lisp_Object -make_motion_data (void) -{ - Lisp_Object data = allocate_motion_data (); - - XSET_MOTION_DATA_X (data, 0); - XSET_MOTION_DATA_Y (data, 0); - XSET_MOTION_DATA_MODIFIERS (data, 0); - - return data; -} - -Lisp_Object -make_process_data (void) -{ - Lisp_Object data = allocate_process_data (); - - XSET_PROCESS_DATA_PROCESS (data, Qnil); - - return data; -} - -Lisp_Object -make_timeout_data (void) -{ - Lisp_Object data = allocate_timeout_data (); - - XSET_TIMEOUT_DATA_INTERVAL_ID (data, 0); - XSET_TIMEOUT_DATA_ID_NUMBER(data, 0); - XSET_TIMEOUT_DATA_FUNCTION(data, Qnil); - XSET_TIMEOUT_DATA_OBJECT (data, Qnil); - - return data; -} - -Lisp_Object -make_magic_eval_data (void) -{ - Lisp_Object data = allocate_magic_eval_data (); - - XSET_MAGIC_EVAL_DATA_OBJECT (data, Qnil); - XSET_MAGIC_EVAL_DATA_INTERNAL_FUNOBJ (data, 0); - - return data; -} - -Lisp_Object -make_eval_data (void) -{ - Lisp_Object data = allocate_eval_data (); - - XSET_EVAL_DATA_FUNCTION (data, Qnil); - XSET_EVAL_DATA_OBJECT (data, Qnil); - - return data; -} - -Lisp_Object -make_magic_data (void) -{ - return allocate_magic_data (); -} - -Lisp_Object -make_misc_user_data (void) -{ - Lisp_Object data = allocate_misc_user_data (); - - XSET_MISC_USER_DATA_FUNCTION (data, Qnil); - XSET_MISC_USER_DATA_OBJECT (data, Qnil); - XSET_MISC_USER_DATA_BUTTON (data, 0); - XSET_MISC_USER_DATA_MODIFIERS (data, 0); - XSET_MISC_USER_DATA_X (data, 0); - XSET_MISC_USER_DATA_Y (data, 0); - - return data; -} -#endif /* USE_KKCC */ - - - DEFUN ("deallocate-event", Fdeallocate_event, 1, 1, 0, /* Allow the given event structure to be reused. You MUST NOT use this event object after calling this function with it. @@ -1613,60 +896,6 @@ return Qnil; } -#ifdef USE_KKCC -void -copy_event_data (Lisp_Object dest, Lisp_Object src) -{ - switch (XRECORD_LHEADER (dest)->type) { - case lrecord_type_key_data: - XSET_KEY_DATA_KEYSYM (dest, XKEY_DATA_KEYSYM (src)); - XSET_KEY_DATA_MODIFIERS (dest, XKEY_DATA_MODIFIERS (src)); - break; - case lrecord_type_button_data: - XSET_BUTTON_DATA_BUTTON (dest, XBUTTON_DATA_BUTTON (src)); - XSET_BUTTON_DATA_MODIFIERS (dest, XBUTTON_DATA_MODIFIERS (src)); - XSET_BUTTON_DATA_X (dest, XBUTTON_DATA_X (src)); - XSET_BUTTON_DATA_Y (dest, XBUTTON_DATA_Y (src)); - break; - case lrecord_type_motion_data: - XSET_MOTION_DATA_X (dest, XMOTION_DATA_X (src)); - XSET_MOTION_DATA_Y (dest, XMOTION_DATA_Y (src)); - XSET_MOTION_DATA_MODIFIERS (dest, XMOTION_DATA_MODIFIERS (src)); - break; - case lrecord_type_process_data: - XSET_PROCESS_DATA_PROCESS (dest, XPROCESS_DATA_PROCESS (src)); - break; - case lrecord_type_timeout_data: - XSET_TIMEOUT_DATA_INTERVAL_ID (dest, XTIMEOUT_DATA_INTERVAL_ID (src)); - XSET_TIMEOUT_DATA_ID_NUMBER (dest, XTIMEOUT_DATA_ID_NUMBER (src)); - XSET_TIMEOUT_DATA_FUNCTION (dest, XTIMEOUT_DATA_FUNCTION (src)); - XSET_TIMEOUT_DATA_OBJECT (dest, XTIMEOUT_DATA_OBJECT (src)); - break; - case lrecord_type_eval_data: - XSET_EVAL_DATA_FUNCTION (dest, XEVAL_DATA_FUNCTION (src)); - XSET_EVAL_DATA_OBJECT (dest, XEVAL_DATA_OBJECT (src)); - break; - case lrecord_type_misc_user_data: - XSET_MISC_USER_DATA_FUNCTION (dest, XMISC_USER_DATA_FUNCTION (src)); - XSET_MISC_USER_DATA_OBJECT (dest, XMISC_USER_DATA_OBJECT (src)); - XSET_MISC_USER_DATA_BUTTON (dest, XMISC_USER_DATA_BUTTON (src)); - XSET_MISC_USER_DATA_MODIFIERS (dest, XMISC_USER_DATA_MODIFIERS (src)); - XSET_MISC_USER_DATA_X (dest, XMISC_USER_DATA_X (src)); - XSET_MISC_USER_DATA_Y (dest, XMISC_USER_DATA_Y (src)); - break; - case lrecord_type_magic_eval_data: - XSET_MAGIC_EVAL_DATA_INTERNAL_FUNCTION (dest, XMAGIC_EVAL_DATA_INTERNAL_FUNCTION (src)); - XSET_MAGIC_EVAL_DATA_OBJECT (dest, XMAGIC_EVAL_DATA_OBJECT (src)); - break; - case lrecord_type_magic_data: - XSET_MAGIC_DATA_UNDERLYING (dest, XMAGIC_DATA_UNDERLYING (src)); - break; - default: - break; - } -} -#endif /* USE_KKCC */ - DEFUN ("copy-event", Fcopy_event, 1, 2, 0, /* Make a copy of the event object EVENT1. If a second event argument EVENT2 is given, EVENT1 is copied into @@ -1691,26 +920,16 @@ assert (XEVENT_TYPE (event1) <= last_event_type); assert (XEVENT_TYPE (event2) <= last_event_type); -#ifdef USE_KKCC XSET_EVENT_TYPE (event2, XEVENT_TYPE (event1)); XSET_EVENT_CHANNEL (event2, XEVENT_CHANNEL (event1)); XSET_EVENT_TIMESTAMP (event2, XEVENT_TIMESTAMP (event1)); - copy_event_data (XEVENT_DATA (event2), XEVENT_DATA (event1)); - + +#ifdef EVENT_DATA_AS_OBJECTS + copy_lisp_object (XEVENT_DATA (event2), XEVENT_DATA (event1)); +#else + XEVENT (event2)->event = XEVENT (event1)->event; +#endif return event2; -#else /* not USE_KKCC */ - { - Lisp_Event *ev2 = XEVENT (event2); - Lisp_Event *ev1 = XEVENT (event1); - - ev2->event_type = ev1->event_type; - ev2->channel = ev1->channel; - ev2->timestamp = ev1->timestamp; - ev2->event = ev1->event; - - return event2; - } -#endif /* not USE_KKCC */ } @@ -1806,6 +1025,48 @@ } } +/* Map a function over each event in the chain. If the function returns + non-zero, remove the event just processed. Return the total number of + items removed. + + NOTE: + + If you want a simple mapping over an event chain, with no intention to + add or remove items, just use EVENT_CHAIN_LOOP(). +*/ + +int +map_event_chain_remove (int (*fn) (Lisp_Object ev, void *user_data), + Lisp_Object *head, Lisp_Object *tail, + void *user_data, int flags) +{ + Lisp_Object event; + Lisp_Object previous_event = Qnil; + int count = 0; + + EVENT_CHAIN_LOOP (event, *head) + { + if (fn (event, user_data)) + { + if (NILP (previous_event)) + dequeue_event (head, tail); + else + { + XSET_EVENT_NEXT (previous_event, XEVENT_NEXT (event)); + if (EQ (*tail, event)) + *tail = previous_event; + } + + if (flags & MECR_DEALLOCATE_EVENT) + Fdeallocate_event (event); + count++; + } + else + previous_event = event; + } + return count; +} + /* Return the number of events (possibly 0) on an event chain. */ int @@ -1914,6 +1175,37 @@ } } +/* USE_CONSOLE_META_FLAG is as in `character-to-event'. + DO_BACKSPACE_MAPPING means that if CON is a TTY, and C is a the TTY's + backspace character, the event will have keysym `backspace' instead of + '(control h). It is clearly correct to do this conversion is the + character was just read from a TTY, clearly incorrect inside of + define-key, which must be able to handle all consoles. #### What about + in other circumstances? #### Should the user have access to this flag? + + + #### We need to go through and review all the flags in + character_to_event() and event_to_character() and figure out exactly + under what circumstances they should or should not be set, then go + through and review all callers of character_to_event(), + Fcharacter_to_event(), event_to_character(), and Fevent_to_character() + and check that they are passing the correct flags in for their varied + circumstances. + + #### Some of this garbage, and some of the flags, could go away if we + implemented the suggestion, originally from event-Xt.c: + + #### The way that keysym correspondence to characters should work: + - a Lisp_Event should contain a keysym AND a character slot. + - keybindings are tried with the keysym. If no binding can be found, + and there is a corresponding character, call self-insert-command. + + #### Nuke x-iso8859-1.el. + #### Nuke the Qascii_character property. + #### Nuke Vcharacter_set_property. + + This would apparently solve a lot of different problems. +*/ void character_to_event (Ichar c, Lisp_Event *event, struct console *con, @@ -1921,11 +1213,7 @@ { Lisp_Object k = Qnil; int m = 0; -#ifdef USE_KKCC if (EVENT_TYPE (event) == dead_event) -#else /* not USE_KKCC */ - if (event->event_type == dead_event) -#endif /* not USE_KKCC */ invalid_argument ("character-to-event called with a deallocated event!", Qunbound); #ifndef MULE @@ -1933,6 +1221,9 @@ #endif if (c > 127 && c <= 255) { + /* #### What if the user wanted a Latin-1 char? Perhaps the answer + is what was suggested above. + */ int meta_flag = 1; if (use_console_meta_flag && CONSOLE_TTY_P (con)) meta_flag = TTY_FLAGS (con).meta_key; @@ -1959,7 +1250,7 @@ case 'M': k = QKreturn; m &= ~XEMACS_MOD_CONTROL; break; case '[': k = QKescape; m &= ~XEMACS_MOD_CONTROL; break; default: -#if defined(HAVE_TTY) +#if defined (HAVE_TTY) if (do_backspace_mapping && CHARP (con->tty_erase_char) && c - '@' == XCHAR (con->tty_erase_char)) @@ -1967,34 +1258,26 @@ k = QKbackspace; m &= ~XEMACS_MOD_CONTROL; } -#endif /* defined(HAVE_TTY) && !defined(CYGWIN) */ +#endif /* defined (HAVE_TTY) */ break; } if (c >= 'A' && c <= 'Z') c -= 'A'-'a'; } -#if defined(HAVE_TTY) +#if defined (HAVE_TTY) else if (do_backspace_mapping && CHARP (con->tty_erase_char) && c == XCHAR (con->tty_erase_char)) k = QKbackspace; -#endif /* defined(HAVE_TTY) && !defined(CYGWIN) */ +#endif /* defined (HAVE_TTY) */ else if (c == 127) k = QKdelete; else if (c == ' ') k = QKspace; -#ifdef USE_KKCC set_event_type (event, key_press_event); SET_EVENT_TIMESTAMP_ZERO (event); /* #### */ SET_EVENT_CHANNEL (event, wrap_console (con)); - XSET_KEY_DATA_KEYSYM (EVENT_DATA (event), (!NILP (k) ? k : make_char (c))); - XSET_KEY_DATA_MODIFIERS (EVENT_DATA (event), m); -#else /* not USE_KKCC */ - event->event_type = key_press_event; - event->timestamp = 0; /* #### */ - event->channel = wrap_console (con); - event->event.key.keysym = (!NILP (k) ? k : make_char (c)); - event->event.key.modifiers = m; -#endif /* not USE_KKCC */ + SET_EVENT_KEY_KEYSYM (event, (!NILP (k) ? k : make_char (c))); + SET_EVENT_KEY_MODIFIERS (event, m); } /* This variable controls what character name -> character code mapping @@ -2008,73 +1291,40 @@ Lisp_Object Vcharacter_set_property; Ichar -event_to_character (Lisp_Event *event, +event_to_character (Lisp_Object event, int allow_extra_modifiers, int allow_meta, - int allow_non_ascii) + int map_device_key_names) { Ichar c = 0; Lisp_Object code; -#ifdef USE_KKCC - if (EVENT_TYPE (event) != key_press_event) -#else /* not USE_KKCC */ - if (event->event_type != key_press_event) -#endif /* not USE_KKCC */ - { -#ifdef USE_KKCC - assert (EVENT_TYPE (event) != dead_event); -#else /* not USE_KKCC */ - assert (event->event_type != dead_event); -#endif /* not USE_KKCC */ + if (XEVENT_TYPE (event) != key_press_event) + { + assert (XEVENT_TYPE (event) != dead_event); return -1; } if (!allow_extra_modifiers && -#ifdef USE_KKCC - XKEY_DATA_MODIFIERS (EVENT_DATA (event)) & (XEMACS_MOD_SUPER|XEMACS_MOD_HYPER|XEMACS_MOD_ALT)) -#else /* not USE_KKCC */ - event->event.key.modifiers & (XEMACS_MOD_SUPER|XEMACS_MOD_HYPER|XEMACS_MOD_ALT)) -#endif /* not USE_KKCC */ + XEVENT_KEY_MODIFIERS (event) & (XEMACS_MOD_SUPER|XEMACS_MOD_HYPER|XEMACS_MOD_ALT)) return -1; -#ifdef USE_KKCC - if (CHAR_OR_CHAR_INTP (XKEY_DATA_KEYSYM (EVENT_DATA (event)))) - c = XCHAR_OR_CHAR_INT (XKEY_DATA_KEYSYM (EVENT_DATA (event))); - else if (!SYMBOLP (XKEY_DATA_KEYSYM (EVENT_DATA (event)))) -#else /* not USE_KKCC */ - if (CHAR_OR_CHAR_INTP (event->event.key.keysym)) - c = XCHAR_OR_CHAR_INT (event->event.key.keysym); - else if (!SYMBOLP (event->event.key.keysym)) -#endif /* not USE_KKCC */ + if (CHAR_OR_CHAR_INTP (XEVENT_KEY_KEYSYM (event))) + c = XCHAR_OR_CHAR_INT (XEVENT_KEY_KEYSYM (event)); + else if (!SYMBOLP (XEVENT_KEY_KEYSYM (event))) abort (); - else if (allow_non_ascii && !NILP (Vcharacter_set_property) + else if (map_device_key_names && !NILP (Vcharacter_set_property) /* Allow window-system-specific extensibility of keysym->code mapping */ -#ifdef USE_KKCC - && CHAR_OR_CHAR_INTP (code = Fget (XKEY_DATA_KEYSYM (EVENT_DATA (event)), + && CHAR_OR_CHAR_INTP (code = Fget (XEVENT_KEY_KEYSYM (event), Vcharacter_set_property, Qnil))) -#else /* not USE_KKCC */ - && CHAR_OR_CHAR_INTP (code = Fget (event->event.key.keysym, - Vcharacter_set_property, - Qnil))) -#endif /* not USE_KKCC */ c = XCHAR_OR_CHAR_INT (code); -#ifdef USE_KKCC - else if (CHAR_OR_CHAR_INTP (code = Fget (XKEY_DATA_KEYSYM (EVENT_DATA (event)), + else if (CHAR_OR_CHAR_INTP (code = Fget (XEVENT_KEY_KEYSYM (event), Qascii_character, Qnil))) -#else /* not USE_KKCC */ - else if (CHAR_OR_CHAR_INTP (code = Fget (event->event.key.keysym, - Qascii_character, Qnil))) -#endif /* not USE_KKCC */ c = XCHAR_OR_CHAR_INT (code); else return -1; -#ifdef USE_KKCC - if (XKEY_DATA_MODIFIERS (EVENT_DATA (event)) & XEMACS_MOD_CONTROL) -#else /* not USE_KKCC */ - if (event->event.key.modifiers & XEMACS_MOD_CONTROL) -#endif /* not USE_KKCC */ + if (XEVENT_KEY_MODIFIERS (event) & XEMACS_MOD_CONTROL) { if (c >= 'a' && c <= 'z') c -= ('a' - 'A'); @@ -2092,17 +1342,10 @@ if (! allow_extra_modifiers) return -1; } -#ifdef USE_KKCC - if (XKEY_DATA_MODIFIERS (EVENT_DATA (event)) & XEMACS_MOD_META) -#else /* not USE_KKCC */ - if (event->event.key.modifiers & XEMACS_MOD_META) -#endif /* not USE_KKCC */ + if (XEVENT_KEY_MODIFIERS (event) & XEMACS_MOD_META) { if (! allow_meta) return -1; - if (c & 0200) return -1; /* don't allow M-oslash (overlap) */ -#ifdef MULE - if (c >= 256) return -1; -#endif + if (c >= 128) return -1; /* don't allow M-oslash (overlap) */ c |= 0200; } return c; @@ -2119,21 +1362,24 @@ If the ALLOW-META argument is non-nil, then the Meta modifier will be represented by turning on the high bit of the byte returned; otherwise, nil will be returned for events containing the Meta modifier. -If the ALLOW-NON-ASCII argument is non-nil, then characters which are - present in the prevailing character set (see the `character-set-property' - variable) will be returned as their code in that character set, instead of - the return value being restricted to ASCII. -Note that specifying both ALLOW-META and ALLOW-NON-ASCII is ambiguous, as - both use the high bit; `M-x' and `oslash' will be indistinguishable. +If the MAP-DEVICE-KEY-NAMES argument is non-nil, then named keysyms that + represent printable characters will be converted to that character. This + means, for example, that under X, where a circumflexed lowercase o returns + a key with the name `ocircumflex' rather than the actual character, this + name will be converted to the appropriate character. See + `character-set-property' for some sense of how this works. #### This + should not be exposed and may be removed at some point. +Note that ALLOW-META may cause ambiguity between meta characters and + Latin-1 characters. */ - (event, allow_extra_modifiers, allow_meta, allow_non_ascii)) + (event, allow_extra_modifiers, allow_meta, map_device_key_names)) { Ichar c; CHECK_LIVE_EVENT (event); - c = event_to_character (XEVENT (event), + c = event_to_character (event, !NILP (allow_extra_modifiers), !NILP (allow_meta), - !NILP (allow_non_ascii)); + !NILP (map_device_key_names)); return c < 0 ? Qnil : make_char (c); } @@ -2155,13 +1401,17 @@ defaults to the selected console. If KEY-DESCRIPTION is an integer or character, the high bit may be -interpreted as the meta key. (This is done for backward compatibility -in lots of places.) If USE-CONSOLE-META-FLAG is nil, this will always -be the case. If USE-CONSOLE-META-FLAG is non-nil, the `meta' flag for -CONSOLE affects whether the high bit is interpreted as a meta -key. (See `set-input-mode'.) If you don't want this silly meta -interpretation done, you should pass in a list containing the -character. +interpreted as the meta key. (This is done for backward compatibility in +lots of places -- specifically, because lots of Lisp code uses specs like +?\M-d and "\M-d" in key code, expecting this to work; yet these are in +reality converted directly to 8-bit characters by the Lisp reader.) If +USE-CONSOLE-META-FLAG is nil or CONSOLE is not a TTY, this will always be +the case. If USE-CONSOLE-META-FLAG is non-nil and CONSOLE is a TTY, the +`meta' flag for CONSOLE affects whether the high bit is interpreted as a +meta key. (See `set-input-mode'.) Don't set this flag to non-nil unless +you know what you're doing (more specifically, only if the character came +directly from a TTY, not from the user). If you don't want this silly meta +interpretation done, you should pass in a list containing the character. Beware that character-to-event and event-to-character are not strictly inverse functions, since events contain much more information than the @@ -2227,33 +1477,19 @@ /* Concatenate a string description of EVENT onto the end of BUF. If BRIEF, use short forms for keys, e.g. C- instead of control-. */ -#ifdef USE_KKCC void format_event_object (Eistring *buf, Lisp_Object event, int brief) -#else /* not USE_KKCC */ -void -format_event_object (Eistring *buf, Lisp_Event *event, int brief) -#endif /* not USE_KKCC */ { int mouse_p = 0; int mod = 0; Lisp_Object key; -#ifdef USE_KKCC - switch (EVENT_TYPE (XEVENT(event))) -#else /* not USE_KKCC */ - switch (event->event_type) -#endif /* not USE_KKCC */ + switch (XEVENT_TYPE (event)) { case key_press_event: { -#ifdef USE_KKCC - mod = XKEY_DATA_MODIFIERS (XEVENT_DATA(event)); - key = XKEY_DATA_KEYSYM (XEVENT_DATA(event)); -#else /* not USE_KKCC */ - mod = event->event.key.modifiers; - key = event->event.key.keysym; -#endif /* not USE_KKCC */ + mod = XEVENT_KEY_MODIFIERS (event); + key = XEVENT_KEY_KEYSYM (event); /* Hack. */ if (! brief && CHARP (key) && mod & (XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER | @@ -2273,13 +1509,8 @@ case button_press_event: { mouse_p++; -#ifdef USE_KKCC - mod = XBUTTON_DATA_MODIFIERS (XEVENT_DATA(event)); - key = make_char (XBUTTON_DATA_BUTTON (XEVENT_DATA(event)) + '0'); -#else /* not USE_KKCC */ - mod = event->event.button.modifiers; - key = make_char (event->event.button.button + '0'); -#endif /* not USE_KKCC */ + mod = XEVENT_BUTTON_MODIFIERS (event); + key = make_char (XEVENT_BUTTON_BUTTON (event) + '0'); break; } case magic_event: @@ -2289,11 +1520,7 @@ GCPRO1 (stream); stream = make_resizing_buffer_output_stream (); -#ifdef USE_KKCC - event_stream_format_magic_event (XEVENT(event), stream); -#else /* not USE_KKCC */ - event_stream_format_magic_event (event, stream); -#endif /* not USE_KKCC */ + event_stream_format_magic_event (XEVENT (event), stream); Lstream_flush (XLSTREAM (stream)); eicat_raw (buf, resizing_buffer_stream_ptr (XLSTREAM (stream)), Lstream_byte_count (XLSTREAM (stream))); @@ -2355,6 +1582,51 @@ eicat_c (buf, "up"); } +void +upshift_event (Lisp_Object event) +{ + Lisp_Object keysym = XEVENT_KEY_KEYSYM (event); + Ichar c = 0; + + if (CHAR_OR_CHAR_INTP (keysym) + && ((c = XCHAR_OR_CHAR_INT (keysym)), + c >= 'a' && c <= 'z')) + XSET_EVENT_KEY_KEYSYM (event, make_char (c + 'A' - 'a')); + else + if (!(XEVENT_KEY_MODIFIERS (event) & XEMACS_MOD_SHIFT)) + XSET_EVENT_KEY_MODIFIERS + (event, XEVENT_KEY_MODIFIERS (event) |= XEMACS_MOD_SHIFT); +} + +void +downshift_event (Lisp_Object event) +{ + Lisp_Object keysym = XEVENT_KEY_KEYSYM (event); + Ichar c = 0; + + if (XEVENT_KEY_MODIFIERS (event) & XEMACS_MOD_SHIFT) + XSET_EVENT_KEY_MODIFIERS + (event, XEVENT_KEY_MODIFIERS (event) & ~XEMACS_MOD_SHIFT); + else if (CHAR_OR_CHAR_INTP (keysym) + && ((c = XCHAR_OR_CHAR_INT (keysym)), + c >= 'A' && c <= 'Z')) + XSET_EVENT_KEY_KEYSYM (event, make_char (c + 'a' - 'A')); +} + +int +event_upshifted_p (Lisp_Object event) +{ + Lisp_Object keysym = XEVENT_KEY_KEYSYM (event); + Ichar c = 0; + + if ((XEVENT_KEY_MODIFIERS (event) & XEMACS_MOD_SHIFT) + || (CHAR_OR_CHAR_INTP (keysym) + && ((c = XCHAR_OR_CHAR_INT (keysym)), + c >= 'A' && c <= 'Z'))) + return 1; + else + return 0; +} DEFUN ("eventp", Feventp, 1, 1, 0, /* True if OBJECT is an event object. @@ -2369,13 +1641,8 @@ */ (object)) { -#ifdef USE_KKCC return EVENTP (object) && XEVENT_TYPE (object) != dead_event ? Qt : Qnil; -#else /* not USE_KKCC */ - return EVENTP (object) && XEVENT (object)->event_type != dead_event ? - Qt : Qnil; -#endif /* not USE_KKCC */ } #if 0 /* debugging functions */ @@ -2441,11 +1708,7 @@ (event)) { CHECK_LIVE_EVENT (event); -#ifdef USE_KKCC switch (XEVENT_TYPE (event)) -#else /* not USE_KKCC */ - switch (XEVENT (event)->event_type) -#endif /* not USE_KKCC */ { case key_press_event: return Qkey_press; case button_press_event: return Qbutton_press; @@ -2481,13 +1744,8 @@ /* This junk is so that timestamps don't get to be negative, but contain as many bits as this particular emacs will allow. */ -#ifdef USE_KKCC return make_int (((1L << (VALBITS - 1)) - 1) & XEVENT_TIMESTAMP (event)); -#else /* not USE_KKCC */ - return make_int (((1L << (VALBITS - 1)) - 1) & - XEVENT (event)->timestamp); -#endif /* not USE_KKCC */ } #define TIMESTAMP_HALFSPACE (1L << (VALBITS - 2)) @@ -2512,21 +1770,12 @@ return t1 - t2 < TIMESTAMP_HALFSPACE ? Qnil : Qt; } -#ifdef USE_KKCC #define CHECK_EVENT_TYPE(e,t1,sym) do { \ CHECK_LIVE_EVENT (e); \ if (XEVENT_TYPE (e) != (t1)) \ e = wrong_type_argument (sym,e); \ } while (0) -#else /* not USE_KKCC */ -#define CHECK_EVENT_TYPE(e,t1,sym) do { \ - CHECK_LIVE_EVENT (e); \ - if (XEVENT(e)->event_type != (t1)) \ - e = wrong_type_argument (sym,e); \ -} while (0) -#endif /* not USE_KKCC */ -#ifdef USE_KKCC #define CHECK_EVENT_TYPE2(e,t1,t2,sym) do { \ CHECK_LIVE_EVENT (e); \ { \ @@ -2536,19 +1785,7 @@ e = wrong_type_argument (sym,e); \ } \ } while (0) -#else /* not USE_KKCC */ -#define CHECK_EVENT_TYPE2(e,t1,t2,sym) do { \ - CHECK_LIVE_EVENT (e); \ - { \ - emacs_event_type CET_type = XEVENT (e)->event_type; \ - if (CET_type != (t1) && \ - CET_type != (t2)) \ - e = wrong_type_argument (sym,e); \ - } \ -} while (0) -#endif /* not USE_KKCC */ -#ifdef USE_KKCC #define CHECK_EVENT_TYPE3(e,t1,t2,t3,sym) do { \ CHECK_LIVE_EVENT (e); \ { \ @@ -2559,18 +1796,6 @@ e = wrong_type_argument (sym,e); \ } \ } while (0) -#else /* not USE_KKCC */ -#define CHECK_EVENT_TYPE3(e,t1,t2,t3,sym) do { \ - CHECK_LIVE_EVENT (e); \ - { \ - emacs_event_type CET_type = XEVENT (e)->event_type; \ - if (CET_type != (t1) && \ - CET_type != (t2) && \ - CET_type != (t3)) \ - e = wrong_type_argument (sym,e); \ - } \ -} while (0) -#endif /* not USE_KKCC */ DEFUN ("event-key", Fevent_key, 1, 1, 0, /* Return the Keysym of the key-press event EVENT. @@ -2579,11 +1804,7 @@ (event)) { CHECK_EVENT_TYPE (event, key_press_event, Qkey_press_event_p); -#ifdef USE_KKCC - return XKEY_DATA_KEYSYM (XEVENT_DATA (event)); -#else /* not USE_KKCC */ - return XEVENT (event)->event.key.keysym; -#endif /* not USE_KKCC */ + return XEVENT_KEY_KEYSYM (event); } DEFUN ("event-button", Fevent_button, 1, 1, 0, /* @@ -2591,25 +1812,16 @@ */ (event)) { - CHECK_EVENT_TYPE3 (event, button_press_event, button_release_event, misc_user_event, Qbutton_event_p); #ifdef HAVE_WINDOW_SYSTEM -#ifdef USE_KKCC - if ( XEVENT_TYPE (event) == misc_user_event) - return make_int (XMISC_USER_DATA_BUTTON (XEVENT_DATA (event))); - else - return make_int (XBUTTON_DATA_BUTTON (XEVENT_DATA (event))); -#else /* not USE_KKCC */ - if ( XEVENT (event)->event_type == misc_user_event) - return make_int (XEVENT (event)->event.misc.button); + if (XEVENT_TYPE (event) == misc_user_event) + return make_int (XEVENT_MISC_USER_BUTTON (event)); else - return make_int (XEVENT (event)->event.button.button); -#endif /* not USE_KKCC */ + return make_int (XEVENT_BUTTON_BUTTON (event)); #else /* !HAVE_WINDOW_SYSTEM */ return Qzero; #endif /* !HAVE_WINDOW_SYSTEM */ - } DEFUN ("event-modifier-bits", Fevent_modifier_bits, 1, 1, 0, /* @@ -2621,39 +1833,21 @@ { again: CHECK_LIVE_EVENT (event); -#ifdef USE_KKCC switch (XEVENT_TYPE (event)) { case key_press_event: - return make_int (XKEY_DATA_MODIFIERS (XEVENT_DATA (event))); - case button_press_event: - case button_release_event: - return make_int (XBUTTON_DATA_MODIFIERS (XEVENT_DATA (event))); - case pointer_motion_event: - return make_int (XMOTION_DATA_MODIFIERS (XEVENT_DATA (event))); - case misc_user_event: - return make_int (XMISC_USER_DATA_MODIFIERS (XEVENT_DATA (event))); - default: - event = wrong_type_argument (intern ("key-or-mouse-event-p"), event); - goto again; - } -#else /* not USE_KKCC */ - switch (XEVENT (event)->event_type) - { - case key_press_event: - return make_int (XEVENT (event)->event.key.modifiers); + return make_int (XEVENT_KEY_MODIFIERS (event)); case button_press_event: case button_release_event: - return make_int (XEVENT (event)->event.button.modifiers); + return make_int (XEVENT_BUTTON_MODIFIERS (event)); case pointer_motion_event: - return make_int (XEVENT (event)->event.motion.modifiers); + return make_int (XEVENT_MOTION_MODIFIERS (event)); case misc_user_event: - return make_int (XEVENT (event)->event.misc.modifiers); + return make_int (XEVENT_MISC_USER_MODIFIERS (event)); default: event = wrong_type_argument (intern ("key-or-mouse-event-p"), event); goto again; } -#endif /* not USE_KKCC */ } DEFUN ("event-modifiers", Fevent_modifiers, 1, 1, 0, /* @@ -2726,45 +1920,24 @@ struct window *w; struct frame *f; -#ifdef USE_KKCC if (XEVENT_TYPE (event) == pointer_motion_event) { - *x = XMOTION_DATA_X (XEVENT_DATA (event)); - *y = XMOTION_DATA_Y (XEVENT_DATA (event)); + *x = XEVENT_MOTION_X (event); + *y = XEVENT_MOTION_Y (event); } else if (XEVENT_TYPE (event) == button_press_event || XEVENT_TYPE (event) == button_release_event) { - *x = XBUTTON_DATA_X (XEVENT_DATA (event)); - *y = XBUTTON_DATA_Y (XEVENT_DATA (event)); + *x = XEVENT_BUTTON_X (event); + *y = XEVENT_BUTTON_Y (event); } else if (XEVENT_TYPE (event) == misc_user_event) { - *x = XMISC_USER_DATA_X (XEVENT_DATA (event)); - *y = XMISC_USER_DATA_Y (XEVENT_DATA (event)); - } - else - return 0; -#else /* not USE_KKCC */ - if (XEVENT (event)->event_type == pointer_motion_event) - { - *x = XEVENT (event)->event.motion.x; - *y = XEVENT (event)->event.motion.y; - } - else if (XEVENT (event)->event_type == button_press_event || - XEVENT (event)->event_type == button_release_event) - { - *x = XEVENT (event)->event.button.x; - *y = XEVENT (event)->event.button.y; - } - else if (XEVENT (event)->event_type == misc_user_event) - { - *x = XEVENT (event)->event.misc.x; - *y = XEVENT (event)->event.misc.y; + *x = XEVENT_MISC_USER_X (event); + *y = XEVENT_MISC_USER_Y (event); } else return 0; -#endif /* not USE_KKCC */ f = XFRAME (EVENT_CHANNEL (XEVENT (event))); if (relative) @@ -2901,47 +2074,25 @@ Lisp_Object ret_obj1, ret_obj2; CHECK_LIVE_EVENT (event); -#ifdef USE_KKCC frame = XEVENT_CHANNEL (event); switch (XEVENT_TYPE (event)) { case pointer_motion_event : - pix_x = XMOTION_DATA_X (XEVENT_DATA (event)); - pix_y = XMOTION_DATA_Y (XEVENT_DATA (event)); - break; - case button_press_event : - case button_release_event : - pix_x = XBUTTON_DATA_X (XEVENT_DATA (event)); - pix_y = XBUTTON_DATA_Y (XEVENT_DATA (event)); - break; - case misc_user_event : - pix_x = XMISC_USER_DATA_X (XEVENT_DATA (event)); - pix_y = XMISC_USER_DATA_Y (XEVENT_DATA (event)); - break; - default: - dead_wrong_type_argument (Qmouse_event_p, event); - } -#else /* not USE_KKCC */ - frame = XEVENT (event)->channel; - switch (XEVENT (event)->event_type) - { - case pointer_motion_event : - pix_x = XEVENT (event)->event.motion.x; - pix_y = XEVENT (event)->event.motion.y; + pix_x = XEVENT_MOTION_X (event); + pix_y = XEVENT_MOTION_Y (event); break; case button_press_event : case button_release_event : - pix_x = XEVENT (event)->event.button.x; - pix_y = XEVENT (event)->event.button.y; + pix_x = XEVENT_BUTTON_X (event); + pix_y = XEVENT_BUTTON_Y (event); break; case misc_user_event : - pix_x = XEVENT (event)->event.misc.x; - pix_y = XEVENT (event)->event.misc.y; + pix_x = XEVENT_MISC_USER_X (event); + pix_y = XEVENT_MISC_USER_Y (event); break; default: dead_wrong_type_argument (Qmouse_event_p, event); } -#endif /* not USE_KKCC */ result = pixel_to_glyph_translation (XFRAME (frame), pix_x, pix_y, &ret_x, &ret_y, &ret_obj_x, &ret_obj_y, @@ -3250,13 +2401,8 @@ */ (event)) { -#ifdef USE_KKCC CHECK_EVENT_TYPE (event, process_event, Qprocess_event_p); - return XPROCESS_DATA_PROCESS (XEVENT_DATA (event)); -#else /* not USE_KKCC */ - CHECK_EVENT_TYPE (event, process_event, Qprocess_event_p); - return XEVENT (event)->event.process.process; -#endif /* not USE_KKCC */ + return XEVENT_PROCESS_PROCESS (event); } DEFUN ("event-function", Fevent_function, 1, 1, 0, /* @@ -3267,33 +2413,18 @@ { again: CHECK_LIVE_EVENT (event); -#ifdef USE_KKCC switch (XEVENT_TYPE (event)) { case timeout_event: - return XTIMEOUT_DATA_FUNCTION (XEVENT_DATA (event)); - case misc_user_event: - return XMISC_USER_DATA_FUNCTION (XEVENT_DATA (event)); - case eval_event: - return XEVAL_DATA_FUNCTION (XEVENT_DATA (event)); - default: - event = wrong_type_argument (intern ("timeout-or-eval-event-p"), event); - goto again; - } -#else /* not USE_KKCC */ - switch (XEVENT (event)->event_type) - { - case timeout_event: - return XEVENT (event)->event.timeout.function; + return XEVENT_TIMEOUT_FUNCTION (event); case misc_user_event: - return XEVENT (event)->event.misc.function; + return XEVENT_MISC_USER_FUNCTION (event); case eval_event: - return XEVENT (event)->event.eval.function; + return XEVENT_EVAL_FUNCTION (event); default: event = wrong_type_argument (intern ("timeout-or-eval-event-p"), event); goto again; } -#endif /* not USE_KKCC */ } DEFUN ("event-object", Fevent_object, 1, 1, 0, /* @@ -3304,33 +2435,18 @@ { again: CHECK_LIVE_EVENT (event); -#ifdef USE_KKCC switch (XEVENT_TYPE (event)) { case timeout_event: - return XTIMEOUT_DATA_OBJECT (XEVENT_DATA (event)); - case misc_user_event: - return XMISC_USER_DATA_OBJECT (XEVENT_DATA (event)); - case eval_event: - return XEVAL_DATA_OBJECT (XEVENT_DATA (event)); - default: - event = wrong_type_argument (intern ("timeout-or-eval-event-p"), event); - goto again; - } -#else /* not USE_KKCC */ - switch (XEVENT (event)->event_type) - { - case timeout_event: - return XEVENT (event)->event.timeout.object; + return XEVENT_TIMEOUT_OBJECT (event); case misc_user_event: - return XEVENT (event)->event.misc.object; + return XEVENT_MISC_USER_OBJECT (event); case eval_event: - return XEVENT (event)->event.eval.object; + return XEVENT_EVAL_OBJECT (event); default: event = wrong_type_argument (intern ("timeout-or-eval-event-p"), event); goto again; } -#endif /* not USE_KKCC */ } DEFUN ("event-properties", Fevent_properties, 1, 1, 0, /* @@ -3349,30 +2465,18 @@ props = cons3 (Qtimestamp, Fevent_timestamp (event), props); -#ifdef USE_KKCC switch (EVENT_TYPE (e)) -#else /* not USE_KKCC */ - switch (e->event_type) -#endif /* not USE_KKCC */ { default: abort (); case process_event: -#ifdef USE_KKCC - props = cons3 (Qprocess, XPROCESS_DATA_PROCESS (EVENT_DATA (e)), props); -#else /* not USE_KKCC */ - props = cons3 (Qprocess, e->event.process.process, props); -#endif /* not USE_KKCC */ + props = cons3 (Qprocess, EVENT_PROCESS_PROCESS (e), props); break; case timeout_event: props = cons3 (Qobject, Fevent_object (event), props); props = cons3 (Qfunction, Fevent_function (event), props); -#ifdef USE_KKCC - props = cons3 (Qid, make_int (XTIMEOUT_DATA_ID_NUMBER (EVENT_DATA (e))), props); -#else /* not USE_KKCC */ - props = cons3 (Qid, make_int (e->event.timeout.id_number), props); -#endif /* not USE_KKCC */ + props = cons3 (Qid, make_int (EVENT_TIMEOUT_ID_NUMBER (e)), props); break; case key_press_event: @@ -3432,7 +2536,7 @@ syms_of_events (void) { INIT_LRECORD_IMPLEMENTATION (event); -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS INIT_LRECORD_IMPLEMENTATION (key_data); INIT_LRECORD_IMPLEMENTATION (button_data); INIT_LRECORD_IMPLEMENTATION (motion_data); @@ -3442,7 +2546,7 @@ INIT_LRECORD_IMPLEMENTATION (misc_user_data); INIT_LRECORD_IMPLEMENTATION (magic_eval_data); INIT_LRECORD_IMPLEMENTATION (magic_data); -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ DEFSUBR (Fcharacter_to_event); DEFSUBR (Fevent_to_character); @@ -3520,12 +2624,15 @@ reinit_vars_of_events (); DEFVAR_LISP ("character-set-property", &Vcharacter_set_property /* -A symbol used to look up the 8-bit character of a keysym. -To convert a keysym symbol to an 8-bit code, as when that key is -bound to self-insert-command, we will look up the property that this -variable names on the property list of the keysym-symbol. The window- -system-specific code will set up appropriate properties and set this -variable. +This is used to map e.g. `ocircumflex' to the appropriate character under X. +This value of this variable (a symbol, normally `x-iso8859-1' if not nil) +if used to look up a property on the keysym in question, which should +correspond to a character. + +#### This is way bogus and will be removed soon. + +The conversion between X keysyms and characters is now handled more or less +automatically using XDisplayKeycodes(). */ ); Vcharacter_set_property = Qnil; } Index: src/events.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/events.h,v retrieving revision 1.35 retrieving revision 1.38 diff -u -r1.35 -r1.38 --- src/events.h 1 Aug 2002 08:28:38 -0000 1.35 +++ src/events.h 7 Feb 2003 11:50:53 -0000 1.38 @@ -27,10 +27,6 @@ #include "systime.h" -#ifdef USE_KKCC -#include "opaque.h" -#endif /* USE_KKCC */ - /* There is one object called an event_stream. This object contains callback functions for doing the window-system-dependent operations that XEmacs requires. @@ -69,12 +65,13 @@ event_pending_cb A function which says whether there are events to be read. If called with an argument of 0, then this should say whether calling the next_event_cb will - block. If called with an argument of 1, then this - should say whether there are user-generated events - pending (that is, keypresses or mouse-clicks). This - is used for redisplay optimization, among other - things. On dumb ttys, these two results are the - same, but under a window system, they are not. + block. If called with a non-zero argument, then this + should say whether there are that many user-generated + events pending (that is, keypresses, mouse-clicks, + dialog-box selection events, etc.). (This is used for + redisplay optimization, among other things.) The + difference is that the former includes process events + and timer events, but the latter doesn't. If this function is not sure whether there are events to be read, it *must* return 0. Otherwise various @@ -147,17 +144,17 @@ Stream pairs description ------------------------ - Since there are many possible processes/event loop combinations, the event code - is responsible for creating an appropriate lstream type. The process - implementation does not care about that implementation. - - The Create stream pair function is passed two void* values, which identify - process-dependent 'handles'. The process implementation uses these handles - to communicate with child processes. The function must be prepared to receive - handle types of any process implementation. Since only one process - implementation exists in a particular XEmacs configuration, preprocessing - is a means of compiling in the support for the code which deals with particular - handle types. + Since there are many possible processes/event loop combinations, the + event code is responsible for creating an appropriate lstream type. The + process implementation does not care about that implementation. + + The Create stream pair function is passed two void* values, which + identify process-dependent 'handles'. The process implementation uses + these handles to communicate with child processes. The function must be + prepared to receive handle types of any process implementation. Since + only one process implementation exists in a particular XEmacs + configuration, preprocessing is a means of compiling in the support for + the code which deals with particular handle types. For example, a unixoid type loop, which relies on file descriptors, may be asked to create a pair of streams by a unix-style process implementation. @@ -209,8 +206,8 @@ void (*unselect_console_cb) (struct console *); void (*select_process_cb) (Lisp_Process *, int doin, int doerr); void (*unselect_process_cb) (Lisp_Process *, int doin, int doerr); - void (*quit_p_cb) (void); - void (*force_event_pending) (struct frame* f); + void (*drain_queue_cb) (void); + void (*force_event_pending_cb)(struct frame* f); void (*create_io_streams_cb) (void* /* inhandle*/, void* /*outhandle*/ , void * /* errhandle*/, Lisp_Object* /* instream */, @@ -231,17 +228,17 @@ extern struct event_stream *event_stream; -#ifdef USE_KKCC -Lisp_Object make_key_data (void); -Lisp_Object make_button_data (void); -Lisp_Object make_motion_data (void); -Lisp_Object make_process_data (void); -Lisp_Object make_timeout_data (void); -Lisp_Object make_magic_data (void); -Lisp_Object make_magic_eval_data (void); -Lisp_Object make_eval_data (void); -Lisp_Object make_misc_user_data (void); -#endif /* USE_KKCC */ +#ifdef EVENT_DATA_AS_OBJECTS +#define EVENT_FOO_BAR_1(extractor, field) ((extractor)->field) +#define EVENT_FOO_BAR(e, uptype, downtype, field) EVENT_FOO_BAR_1 (X##uptype##_DATA (EVENT_DATA (e)), field) +#define SET_EVENT_FOO_BAR_1(extractor, field, val) \ +do { (extractor)->field = (val); } while (0) +#define SET_EVENT_FOO_BAR(e, uptype, downtype, field, val) SET_EVENT_FOO_BAR_1 (X##uptype##_DATA (EVENT_DATA (e)), field, val) +#else +#define EVENT_FOO_BAR(e, uptype, downtype, field) ((e)->event.downtype.field) +#define SET_EVENT_FOO_BAR(e, uptype, downtype, field, val) \ +do { (e)->event.downtype.field = (val); } while (0) +#endif typedef enum emacs_event_type { @@ -278,15 +275,11 @@ #endif /* MULE */ -#ifdef USE_KKCC struct Lisp_Key_Data -#else /* not USE_KKCC */ -struct key_data -#endif /* not USE_KKCC */ { -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS struct lrecord_header lheader; -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ /* What keysym this is; a character or a symbol. */ Lisp_Object keysym; /* Modifiers held down when key was pressed: control, meta, etc. @@ -315,36 +308,49 @@ #endif /* MULE */ }; -#ifdef USE_KKCC typedef struct Lisp_Key_Data Lisp_Key_Data; +#define KEY_DATA_KEYSYM(d) ((d)->keysym) +#define KEY_DATA_MODIFIERS(d) ((d)->modifiers) +#define SET_KEY_DATA_KEYSYM(d, k) ((d)->keysym = k) +#define SET_KEY_DATA_MODIFIERS(d, m) ((d)->modifiers = m) + +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_LRECORD (key_data, Lisp_Key_Data); #define XKEY_DATA(x) XRECORD (x, key_data, Lisp_Key_Data) #define wrap_key_data(p) wrap_record (p, key_data) #define KEY_DATAP(x) RECORDP (x, key_data) #define CHECK_KEY_DATA(x) CHECK_RECORD (x, key_data) #define CONCHECK_KEY_DATA(x) CONCHECK_RECORD (x, key_data) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define XKEY_DATA_KEYSYM(d) (XKEY_DATA (d)->keysym) -#define KEY_DATA_KEYSYM(d) ((d)->keysym) -#define XKEY_DATA_MODIFIERS(d) (XKEY_DATA (d)->modifiers) -#define KEY_DATA_MODIFIERS(d) ((d)->modifiers) - -#define XSET_KEY_DATA_KEYSYM(d, k) (XKEY_DATA (d)->keysym = (k)) -#define SET_KEY_DATA_KEYSYM(d, k) ((d)->keysym = k) -#define XSET_KEY_DATA_MODIFIERS(d, m) (XKEY_DATA (d)->modifiers = m) -#define SET_KEY_DATA_MODIFIERS(d, m) ((d)->modifiers = m) -#endif /* USE_KKCC */ +#define EVENT_KEY_KEYSYM(e) EVENT_FOO_BAR (e, KEY, key, keysym) +#define XEVENT_KEY_KEYSYM(e) EVENT_KEY_KEYSYM (XEVENT (e)) +#define SET_EVENT_KEY_KEYSYM(e, val) \ + SET_EVENT_FOO_BAR (e, KEY, key, keysym, val) +#define XSET_EVENT_KEY_KEYSYM(e, val) \ + SET_EVENT_KEY_KEYSYM (XEVENT (e), val) + +#define EVENT_KEY_MODIFIERS(e) EVENT_FOO_BAR (e, KEY, key, modifiers) +#define XEVENT_KEY_MODIFIERS(e) EVENT_KEY_MODIFIERS (XEVENT (e)) +#define SET_EVENT_KEY_MODIFIERS(e, val) \ + SET_EVENT_FOO_BAR (e, KEY, key, modifiers, val) +#define XSET_EVENT_KEY_MODIFIERS(e, val) \ + SET_EVENT_KEY_MODIFIERS (XEVENT (e), val) + +#define EVENT_KEY_ALT_KEYCHARS(e, n) \ + EVENT_FOO_BAR (e, KEY, key, alt_keychars[n]) +#define XEVENT_KEY_ALT_KEYCHARS(e, n) EVENT_KEY_ALT_KEYCHARS (XEVENT (e), n) +#define SET_EVENT_KEY_ALT_KEYCHARS(e, n, val) \ + SET_EVENT_FOO_BAR (e, KEY, key, alt_keychars[n], val) +#define XSET_EVENT_KEY_ALT_KEYCHARS(e, n, val) \ + SET_EVENT_KEY_ALT_KEYCHARS (XEVENT (e), n, val) -#ifdef USE_KKCC struct Lisp_Button_Data -#else /* not USE_KKCC */ -struct button_data -#endif /* not USE_KKCC */ { -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS struct lrecord_header lheader; -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ /* What button went down or up. */ int button; /* Bucky-bits on that button: shift, control, meta, etc. Also @@ -353,91 +359,114 @@ /* Where it was at the button-state-change (in pixels). */ int x, y; }; -#ifdef USE_KKCC typedef struct Lisp_Button_Data Lisp_Button_Data; +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_LRECORD (button_data, Lisp_Button_Data); #define XBUTTON_DATA(x) XRECORD (x, button_data, Lisp_Button_Data) #define wrap_button_data(p) wrap_record (p, button_data) #define BUTTON_DATAP(x) RECORDP (x, button_data) #define CHECK_BUTTON_DATA(x) CHECK_RECORD (x, button_data) #define CONCHECK_BUTTON_DATA(x) CONCHECK_RECORD (x, button_data) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define XBUTTON_DATA_BUTTON(d) (XBUTTON_DATA (d)->button) -#define XBUTTON_DATA_MODIFIERS(d) (XBUTTON_DATA (d)->modifiers) -#define XBUTTON_DATA_X(d) (XBUTTON_DATA (d)->x) -#define XBUTTON_DATA_Y(d) (XBUTTON_DATA (d)->y) - -#define XSET_BUTTON_DATA_BUTTON(d, b) (XBUTTON_DATA (d)->button = (b)) -#define XSET_BUTTON_DATA_MODIFIERS(d, m) (XBUTTON_DATA (d)->modifiers = (m)) -#define XSET_BUTTON_DATA_X(d, new_x) (XBUTTON_DATA (d)->x = (new_x)) -#define XSET_BUTTON_DATA_Y(d, new_y) (XBUTTON_DATA (d)->y = (new_y)) -#endif /* USE_KKCC */ +#define EVENT_BUTTON_BUTTON(e) EVENT_FOO_BAR (e, BUTTON, button, button) +#define XEVENT_BUTTON_BUTTON(e) EVENT_BUTTON_BUTTON (XEVENT (e)) +#define SET_EVENT_BUTTON_BUTTON(e, val) \ + SET_EVENT_FOO_BAR (e, BUTTON, button, button, val) +#define XSET_EVENT_BUTTON_BUTTON(e, val) \ + SET_EVENT_BUTTON_BUTTON (XEVENT (e), val) + +#define EVENT_BUTTON_MODIFIERS(e) EVENT_FOO_BAR (e, BUTTON, button, modifiers) +#define XEVENT_BUTTON_MODIFIERS(e) EVENT_BUTTON_MODIFIERS (XEVENT (e)) +#define SET_EVENT_BUTTON_MODIFIERS(e, val) \ + SET_EVENT_FOO_BAR (e, BUTTON, button, modifiers, val) +#define XSET_EVENT_BUTTON_MODIFIERS(e, val) \ + SET_EVENT_BUTTON_MODIFIERS (XEVENT (e), val) + +#define EVENT_BUTTON_X(e) EVENT_FOO_BAR (e, BUTTON, button, x) +#define XEVENT_BUTTON_X(e) EVENT_BUTTON_X (XEVENT (e)) +#define SET_EVENT_BUTTON_X(e, val) \ + SET_EVENT_FOO_BAR (e, BUTTON, button, x, val) +#define XSET_EVENT_BUTTON_X(e, val) \ + SET_EVENT_BUTTON_X (XEVENT (e), val) + +#define EVENT_BUTTON_Y(e) EVENT_FOO_BAR (e, BUTTON, button, y) +#define XEVENT_BUTTON_Y(e) EVENT_BUTTON_Y (XEVENT (e)) +#define SET_EVENT_BUTTON_Y(e, val) \ + SET_EVENT_FOO_BAR (e, BUTTON, button, y, val) +#define XSET_EVENT_BUTTON_Y(e, val) \ + SET_EVENT_BUTTON_Y (XEVENT (e), val) -#ifdef USE_KKCC struct Lisp_Motion_Data -#else /* not USE_KKCC */ -struct motion_data -#endif /* not USE_KKCC */ { -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS struct lrecord_header lheader; -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ /* Where it was after it moved (in pixels). */ int x, y; /* Bucky-bits down when the motion was detected. */ int modifiers; }; -#ifdef USE_KKCC typedef struct Lisp_Motion_Data Lisp_Motion_Data; +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_LRECORD (motion_data, Lisp_Motion_Data); #define XMOTION_DATA(x) XRECORD (x, motion_data, Lisp_Motion_Data) #define wrap_motion_data(p) wrap_record (p, motion_data) #define MOTION_DATAP(x) RECORDP (x, motion_data) #define CHECK_MOTION_DATA(x) CHECK_RECORD (x, motion_data) #define CONCHECK_MOTION_DATA(x) CONCHECK_RECORD (x, motion_data) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define XMOTION_DATA_X(d) (XMOTION_DATA (d)->x) -#define XMOTION_DATA_Y(d) (XMOTION_DATA (d)->y) -#define XMOTION_DATA_MODIFIERS(d) (XMOTION_DATA (d)->modifiers) - -#define XSET_MOTION_DATA_X(d, new_x) (XMOTION_DATA (d)->x = (new_x)) -#define XSET_MOTION_DATA_Y(d, new_y) (XMOTION_DATA (d)->y = (new_y)) -#define XSET_MOTION_DATA_MODIFIERS(d, m) (XMOTION_DATA (d)->modifiers = (m)) -#endif /* USE_KKCC */ +#define EVENT_MOTION_X(e) EVENT_FOO_BAR (e, MOTION, motion, x) +#define XEVENT_MOTION_X(e) EVENT_MOTION_X (XEVENT (e)) +#define SET_EVENT_MOTION_X(e, val) \ + SET_EVENT_FOO_BAR (e, MOTION, motion, x, val) +#define XSET_EVENT_MOTION_X(e, val) \ + SET_EVENT_MOTION_X (XEVENT (e), val) + +#define EVENT_MOTION_Y(e) EVENT_FOO_BAR (e, MOTION, motion, y) +#define XEVENT_MOTION_Y(e) EVENT_MOTION_Y (XEVENT (e)) +#define SET_EVENT_MOTION_Y(e, val) \ + SET_EVENT_FOO_BAR (e, MOTION, motion, y, val) +#define XSET_EVENT_MOTION_Y(e, val) \ + SET_EVENT_MOTION_Y (XEVENT (e), val) + +#define EVENT_MOTION_MODIFIERS(e) EVENT_FOO_BAR (e, MOTION, motion, modifiers) +#define XEVENT_MOTION_MODIFIERS(e) EVENT_MOTION_MODIFIERS (XEVENT (e)) +#define SET_EVENT_MOTION_MODIFIERS(e, val) \ + SET_EVENT_FOO_BAR (e, MOTION, motion, modifiers, val) +#define XSET_EVENT_MOTION_MODIFIERS(e, val) \ + SET_EVENT_MOTION_MODIFIERS (XEVENT (e), val) -#ifdef USE_KKCC struct Lisp_Process_Data -#else /* not USE_KKCC */ -struct process_data -#endif /* not USE_KKCC */ { -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS struct lrecord_header lheader; -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ /* the XEmacs "process" object in question */ Lisp_Object process; }; -#ifdef USE_KKCC typedef struct Lisp_Process_Data Lisp_Process_Data; +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_LRECORD (process_data, Lisp_Process_Data); #define XPROCESS_DATA(x) XRECORD (x, process_data, Lisp_Process_Data) #define wrap_process_data(p) wrap_record (p, process_data) #define PROCESS_DATAP(x) RECORDP (x, process_data) #define CHECK_PROCESS_DATA(x) CHECK_RECORD (x, process_data) #define CONCHECK_PROCESS_DATA(x) CONCHECK_RECORD (x, process_data) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define XPROCESS_DATA_PROCESS(d) (XPROCESS_DATA (d)->process) -#define XSET_PROCESS_DATA_PROCESS(d, p) (XPROCESS_DATA (d)->process = (p)) -#endif /* USE_KKCC */ +#define EVENT_PROCESS_PROCESS(e) EVENT_FOO_BAR (e, PROCESS, process, process) +#define XEVENT_PROCESS_PROCESS(e) EVENT_PROCESS_PROCESS (XEVENT (e)) +#define SET_EVENT_PROCESS_PROCESS(e, val) \ + SET_EVENT_FOO_BAR (e, PROCESS, process, process, val) +#define XSET_EVENT_PROCESS_PROCESS(e, val) \ + SET_EVENT_PROCESS_PROCESS (XEVENT (e), val) -#ifdef USE_KKCC struct Lisp_Timeout_Data -#else /* not USE_KKCC */ -struct timeout_data -#endif /* not USE_KKCC */ { /* interval_id The ID returned when the associated call to @@ -452,40 +481,54 @@ processed. object The object passed to that function. */ -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS struct lrecord_header lheader; -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ int interval_id; int id_number; Lisp_Object function; Lisp_Object object; }; -#ifdef USE_KKCC typedef struct Lisp_Timeout_Data Lisp_Timeout_Data; +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_LRECORD (timeout_data, Lisp_Timeout_Data); #define XTIMEOUT_DATA(x) XRECORD (x, timeout_data, Lisp_Timeout_Data) #define wrap_timeout_data(p) wrap_record(p, timeout_data) #define TIMEOUT_DATAP(x) RECORDP (x, timeout_data) #define CHECK_TIMEOUT_DATA(x) CHECK_RECORD (x, timeout_data) #define CONCHECK_TIMEOUT_DATA(x) CONCHECK_RECORD (x, timeout_data) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define XTIMEOUT_DATA_INTERVAL_ID(d) XTIMEOUT_DATA (d)->interval_id -#define XTIMEOUT_DATA_ID_NUMBER(d) XTIMEOUT_DATA (d)->id_number -#define XTIMEOUT_DATA_FUNCTION(d) XTIMEOUT_DATA (d)->function -#define XTIMEOUT_DATA_OBJECT(d) XTIMEOUT_DATA (d)->object - -#define XSET_TIMEOUT_DATA_INTERVAL_ID(d, i) XTIMEOUT_DATA (d)->interval_id = (i) -#define XSET_TIMEOUT_DATA_ID_NUMBER(d, n) XTIMEOUT_DATA (d)->id_number = (n) -#define XSET_TIMEOUT_DATA_FUNCTION(d, f) XTIMEOUT_DATA (d)->function = f -#define XSET_TIMEOUT_DATA_OBJECT(d, o) XTIMEOUT_DATA (d)->object = o -#endif /* USE_KKCC */ +#define EVENT_TIMEOUT_INTERVAL_ID(e) EVENT_FOO_BAR (e, TIMEOUT, timeout, interval_id) +#define XEVENT_TIMEOUT_INTERVAL_ID(e) EVENT_TIMEOUT_INTERVAL_ID (XEVENT (e)) +#define SET_EVENT_TIMEOUT_INTERVAL_ID(e, val) \ + SET_EVENT_FOO_BAR (e, TIMEOUT, timeout, interval_id, val) +#define XSET_EVENT_TIMEOUT_INTERVAL_ID(e, val) \ + SET_EVENT_TIMEOUT_INTERVAL_ID (XEVENT (e), val) + +#define EVENT_TIMEOUT_ID_NUMBER(e) EVENT_FOO_BAR (e, TIMEOUT, timeout, id_number) +#define XEVENT_TIMEOUT_ID_NUMBER(e) EVENT_TIMEOUT_ID_NUMBER (XEVENT (e)) +#define SET_EVENT_TIMEOUT_ID_NUMBER(e, val) \ + SET_EVENT_FOO_BAR (e, TIMEOUT, timeout, id_number, val) +#define XSET_EVENT_TIMEOUT_ID_NUMBER(e, val) \ + SET_EVENT_TIMEOUT_ID_NUMBER (XEVENT (e), val) + +#define EVENT_TIMEOUT_FUNCTION(e) EVENT_FOO_BAR (e, TIMEOUT, timeout, function) +#define XEVENT_TIMEOUT_FUNCTION(e) EVENT_TIMEOUT_FUNCTION (XEVENT (e)) +#define SET_EVENT_TIMEOUT_FUNCTION(e, val) \ + SET_EVENT_FOO_BAR (e, TIMEOUT, timeout, function, val) +#define XSET_EVENT_TIMEOUT_FUNCTION(e, val) \ + SET_EVENT_TIMEOUT_FUNCTION (XEVENT (e), val) + +#define EVENT_TIMEOUT_OBJECT(e) EVENT_FOO_BAR (e, TIMEOUT, timeout, object) +#define XEVENT_TIMEOUT_OBJECT(e) EVENT_TIMEOUT_OBJECT (XEVENT (e)) +#define SET_EVENT_TIMEOUT_OBJECT(e, val) \ + SET_EVENT_FOO_BAR (e, TIMEOUT, timeout, object, val) +#define XSET_EVENT_TIMEOUT_OBJECT(e, val) \ + SET_EVENT_TIMEOUT_OBJECT (XEVENT (e), val) -#ifdef USE_KKCC struct Lisp_Eval_Data -#else /* not USE_KKCC */ -struct eval_data -#endif /* not USE_KKCC */ { /* This kind of event is used internally; sometimes the window system interface would like to inform XEmacs of some user action (such as @@ -497,34 +540,38 @@ function An elisp function to call with this event object. object Argument of function. */ -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS struct lrecord_header lheader; -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ Lisp_Object function; Lisp_Object object; }; -#ifdef USE_KKCC typedef struct Lisp_Eval_Data Lisp_Eval_Data; +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_LRECORD (eval_data, Lisp_Eval_Data); #define XEVAL_DATA(x) XRECORD (x, eval_data, Lisp_Eval_Data) #define wrap_eval_data(p) wrap_record(p, eval_data) #define EVAL_DATAP(x) RECORDP (x, eval_data) #define CHECK_EVAL_DATA(x) CHECK_RECORD (x, eval_data) #define CONCHECK_EVAL_DATA(x) CONCHECK_RECORD (x, eval_data) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define XEVAL_DATA_FUNCTION(d) (XEVAL_DATA (d)->function) -#define XEVAL_DATA_OBJECT(d) (XEVAL_DATA (d)->object) - -#define XSET_EVAL_DATA_FUNCTION(d, f) (XEVAL_DATA (d)->function = f) -#define XSET_EVAL_DATA_OBJECT(d, o) (XEVAL_DATA (d)->object = o) -#endif /* USE_KKCC */ +#define EVENT_EVAL_FUNCTION(e) EVENT_FOO_BAR (e, EVAL, eval, function) +#define XEVENT_EVAL_FUNCTION(e) EVENT_EVAL_FUNCTION (XEVENT (e)) +#define SET_EVENT_EVAL_FUNCTION(e, val) \ + SET_EVENT_FOO_BAR (e, EVAL, eval, function, val) +#define XSET_EVENT_EVAL_FUNCTION(e, val) \ + SET_EVENT_EVAL_FUNCTION (XEVENT (e), val) + +#define EVENT_EVAL_OBJECT(e) EVENT_FOO_BAR (e, EVAL, eval, object) +#define XEVENT_EVAL_OBJECT(e) EVENT_EVAL_OBJECT (XEVENT (e)) +#define SET_EVENT_EVAL_OBJECT(e, val) \ + SET_EVENT_FOO_BAR (e, EVAL, eval, object, val) +#define XSET_EVENT_EVAL_OBJECT(e, val) \ + SET_EVENT_EVAL_OBJECT (XEVENT (e), val) -#ifdef USE_KKCC struct Lisp_Misc_User_Data -#else /* not USE_KKCC */ -struct misc_user_data -#endif /* not USE_KKCC */ { /* #### The misc-user type is serious junk. It should be separated out into different events. There's no reason to create @@ -546,48 +593,69 @@ by the XEmacs Drag'n'Drop system. Don't depend on their values for other types of misc_user_events. */ -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS struct lrecord_header lheader; -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ Lisp_Object function; Lisp_Object object; int button; int modifiers; int x, y; }; -#ifdef USE_KKCC typedef struct Lisp_Misc_User_Data Lisp_Misc_User_Data; +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_LRECORD (misc_user_data, Lisp_Misc_User_Data); #define XMISC_USER_DATA(x) XRECORD (x, misc_user_data, Lisp_Misc_User_Data) #define wrap_misc_user_data(p) wrap_record(p, misc_user_data) #define MISC_USER_DATAP(x) RECORDP (x, misc_user_data) #define CHECK_MISC_USER_DATA(x) CHECK_RECORD (x, misc_user_data) #define CONCHECK_MISC_USER_DATA(x) CONCHECK_RECORD (x, misc_user_data) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define XMISC_USER_DATA_FUNCTION(d) (XMISC_USER_DATA (d)->function) -#define XMISC_USER_DATA_OBJECT(d) (XMISC_USER_DATA (d)->object) -#define XMISC_USER_DATA_BUTTON(d) (XMISC_USER_DATA (d)->button) -#define XMISC_USER_DATA_MODIFIERS(d) (XMISC_USER_DATA (d)->modifiers) -#define XMISC_USER_DATA_X(d) (XMISC_USER_DATA (d)->x) -#define XMISC_USER_DATA_Y(d) (XMISC_USER_DATA (d)->y) - -#define XSET_MISC_USER_DATA_FUNCTION(d, f) (XMISC_USER_DATA (d)->function = (f)) -#define XSET_MISC_USER_DATA_OBJECT(d, o) (XMISC_USER_DATA (d)->object = (o)) -#define XSET_MISC_USER_DATA_BUTTON(d, b) (XMISC_USER_DATA (d)->button = (b)) -#define XSET_MISC_USER_DATA_MODIFIERS(d, m) (XMISC_USER_DATA (d)->modifiers = (m)) -#define XSET_MISC_USER_DATA_X(d, new_x) (XMISC_USER_DATA (d)->x = (new_x)) -#define XSET_MISC_USER_DATA_Y(d, new_y) (XMISC_USER_DATA (d)->y = (new_y)) -#endif /* USE_KKCC */ - -#ifdef USE_KKCC -typedef void (*lisp_obj_arg_fun) (Lisp_Object); - +#define EVENT_MISC_USER_FUNCTION(e) EVENT_FOO_BAR (e, MISC_USER, misc_user, function) +#define XEVENT_MISC_USER_FUNCTION(e) EVENT_MISC_USER_FUNCTION (XEVENT (e)) +#define SET_EVENT_MISC_USER_FUNCTION(e, val) \ + SET_EVENT_FOO_BAR (e, MISC_USER, misc_user, function, val) +#define XSET_EVENT_MISC_USER_FUNCTION(e, val) \ + SET_EVENT_MISC_USER_FUNCTION (XEVENT (e), val) + +#define EVENT_MISC_USER_OBJECT(e) EVENT_FOO_BAR (e, MISC_USER, misc_user, object) +#define XEVENT_MISC_USER_OBJECT(e) EVENT_MISC_USER_OBJECT (XEVENT (e)) +#define SET_EVENT_MISC_USER_OBJECT(e, val) \ + SET_EVENT_FOO_BAR (e, MISC_USER, misc_user, object, val) +#define XSET_EVENT_MISC_USER_OBJECT(e, val) \ + SET_EVENT_MISC_USER_OBJECT (XEVENT (e), val) + +#define EVENT_MISC_USER_BUTTON(e) EVENT_FOO_BAR (e, MISC_USER, misc_user, button) +#define XEVENT_MISC_USER_BUTTON(e) EVENT_MISC_USER_BUTTON (XEVENT (e)) +#define SET_EVENT_MISC_USER_BUTTON(e, val) \ + SET_EVENT_FOO_BAR (e, MISC_USER, misc_user, button, val) +#define XSET_EVENT_MISC_USER_BUTTON(e, val) \ + SET_EVENT_MISC_USER_BUTTON (XEVENT (e), val) + +#define EVENT_MISC_USER_MODIFIERS(e) EVENT_FOO_BAR (e, MISC_USER, misc_user, modifiers) +#define XEVENT_MISC_USER_MODIFIERS(e) EVENT_MISC_USER_MODIFIERS (XEVENT (e)) +#define SET_EVENT_MISC_USER_MODIFIERS(e, val) \ + SET_EVENT_FOO_BAR (e, MISC_USER, misc_user, modifiers, val) +#define XSET_EVENT_MISC_USER_MODIFIERS(e, val) \ + SET_EVENT_MISC_USER_MODIFIERS (XEVENT (e), val) + +#define EVENT_MISC_USER_X(e) EVENT_FOO_BAR (e, MISC_USER, misc_user, x) +#define XEVENT_MISC_USER_X(e) EVENT_MISC_USER_X (XEVENT (e)) +#define SET_EVENT_MISC_USER_X(e, val) \ + SET_EVENT_FOO_BAR (e, MISC_USER, misc_user, x, val) +#define XSET_EVENT_MISC_USER_X(e, val) \ + SET_EVENT_MISC_USER_X (XEVENT (e), val) + +#define EVENT_MISC_USER_Y(e) EVENT_FOO_BAR (e, MISC_USER, misc_user, y) +#define XEVENT_MISC_USER_Y(e) EVENT_MISC_USER_Y (XEVENT (e)) +#define SET_EVENT_MISC_USER_Y(e, val) \ + SET_EVENT_FOO_BAR (e, MISC_USER, misc_user, y, val) +#define XSET_EVENT_MISC_USER_Y(e, val) \ + SET_EVENT_MISC_USER_Y (XEVENT (e), val) struct Lisp_Magic_Eval_Data -#else /* not USE_KKCC */ -struct magic_eval_data -#endif /* not USE_KKCC */ { /* This is like an eval event but its contents are not Lisp-accessible. This allows for "internal eval events" that call @@ -602,32 +670,36 @@ object Argument of function. */ -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS struct lrecord_header lheader; -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ void (*internal_function) (Lisp_Object); Lisp_Object object; }; -#ifdef USE_KKCC typedef struct Lisp_Magic_Eval_Data Lisp_Magic_Eval_Data; +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_LRECORD (magic_eval_data, Lisp_Magic_Eval_Data); #define XMAGIC_EVAL_DATA(x) XRECORD (x, magic_eval_data, Lisp_Magic_Eval_Data) #define wrap_magic_eval_data(p) wrap_record(p, magic_eval_data) #define MAGIC_EVAL_DATAP(x) RECORDP (x, magic_eval_data) #define CHECK_MAGIC_EVAL_DATA(x) CHECK_RECORD (x, magic_eval_data) #define CONCHECK_MAGIC_EVAL_DATA(x) CONCHECK_RECORD (x, magic_eval_data) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define XMAGIC_EVAL_DATA_INTERNAL_FUNCTION(d) \ - XMAGIC_EVAL_DATA (d)->internal_function -#define XMAGIC_EVAL_DATA_INTERNAL_FUNOBJ(d) (XMAGIC_EVAL_DATA (d)->internal_function) -#define XMAGIC_EVAL_DATA_OBJECT(d) (XMAGIC_EVAL_DATA (d)->object) - -#define XSET_MAGIC_EVAL_DATA_INTERNAL_FUNCTION(d, f) \ - (XMAGIC_EVAL_DATA (d)->internal_function = f) -#define XSET_MAGIC_EVAL_DATA_INTERNAL_FUNOBJ(d, f) (XMAGIC_EVAL_DATA (d)->internal_function = (f)) -#define XSET_MAGIC_EVAL_DATA_OBJECT(d, o) (XMAGIC_EVAL_DATA (d)->object = (o)) -#endif /* USE_KKCC */ +#define EVENT_MAGIC_EVAL_INTERNAL_FUNCTION(e) EVENT_FOO_BAR (e, MAGIC_EVAL, magic_eval, internal_function) +#define XEVENT_MAGIC_EVAL_INTERNAL_FUNCTION(e) EVENT_MAGIC_EVAL_INTERNAL_FUNCTION (XEVENT (e)) +#define SET_EVENT_MAGIC_EVAL_INTERNAL_FUNCTION(e, val) \ + SET_EVENT_FOO_BAR (e, MAGIC_EVAL, magic_eval, internal_function, val) +#define XSET_EVENT_MAGIC_EVAL_INTERNAL_FUNCTION(e, val) \ + SET_EVENT_MAGIC_EVAL_INTERNAL_FUNCTION (XEVENT (e), val) + +#define EVENT_MAGIC_EVAL_OBJECT(e) EVENT_FOO_BAR (e, MAGIC_EVAL, magic_eval, object) +#define XEVENT_MAGIC_EVAL_OBJECT(e) EVENT_MAGIC_EVAL_OBJECT (XEVENT (e)) +#define SET_EVENT_MAGIC_EVAL_OBJECT(e, val) \ + SET_EVENT_FOO_BAR (e, MAGIC_EVAL, magic_eval, object, val) +#define XSET_EVENT_MAGIC_EVAL_OBJECT(e, val) \ + SET_EVENT_MAGIC_EVAL_OBJECT (XEVENT (e), val) #if defined (HAVE_X_WINDOWS) && defined(emacs) # include @@ -638,10 +710,25 @@ #endif -#ifdef USE_KKCC struct Lisp_Magic_Data { +/* No user-serviceable parts within. This is for things like + KeymapNotify and ExposeRegion events and so on that XEmacs itself + doesn't care about, but which it must do something with for proper + interaction with the window system. + + Magic_events are handled somewhat asynchronously, just like + subprocess filters. However, occasionally a magic_event needs to + be handled synchronously; in that case, the asynchronous handling + of the magic_event will push an eval_event back onto the queue, + which will be handled synchronously later. This is one of the + reasons why eval_events exist; I'm not entirely happy with this + aspect of this event model. +*/ + +#ifdef EVENT_DATA_AS_OBJECTS struct lrecord_header lheader; +#endif /* EVENT_DATA_AS_OBJECTS */ union { #ifdef HAVE_GTK @@ -658,60 +745,48 @@ typedef struct Lisp_Magic_Data Lisp_Magic_Data; +#ifdef EVENT_DATA_AS_OBJECTS DECLARE_LRECORD (magic_data, Lisp_Magic_Data); #define XMAGIC_DATA(x) XRECORD (x, magic_data, Lisp_Magic_Data) #define wrap_magic_data(p) wrap_record(p, magic_data) #define MAGIC_DATAP(x) RECORDP (x, magic_data) #define CHECK_MAGIC_DATA(x) CHECK_RECORD (x, magic_data) #define CONCHECK_MAGIC_DATA(x) CONCHECK_RECORD (x, magic_data) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define XMAGIC_DATA_UNDERLYING(d) (XMAGIC_DATA (d)->underlying) -#define XSET_MAGIC_DATA_UNDERLYING(d, u) (XMAGIC_DATA (d)->underlying = (u)) +#define EVENT_MAGIC_UNDERLYING(e) EVENT_FOO_BAR (e, MAGIC, magic, underlying) +#define XEVENT_MAGIC_UNDERLYING(e) EVENT_MAGIC_UNDERLYING (XEVENT (e)) +#define SET_EVENT_MAGIC_UNDERLYING(e, val) \ + SET_EVENT_FOO_BAR (e, MAGIC, magic, underlying, val) +#define XSET_EVENT_MAGIC_UNDERLYING(e, val) \ + SET_EVENT_MAGIC_UNDERLYING (XEVENT (e), val) #ifdef HAVE_GTK -#define XMAGIC_DATA_GDK_EVENT(d) (XMAGIC_DATA (d)->underlying.gdk_event) -#define XSET_MAGIC_DATA_GDK_EVENT(d, e) (XMAGIC_DATA (d)->underlying.gdk_event = (e)) -#endif /*HAVE_GTK*/ - -#ifdef HAVE_X_WINDOWS -#define XMAGIC_DATA_X_EVENT(d) (XMAGIC_DATA (d)->underlying.x_event) -#define XSET_MAGIC_DATA_X_EVENT(d, e) (XMAGIC_DATA (d)->underlying.x_event = (e)) +#define EVENT_MAGIC_GDK_EVENT(e) EVENT_FOO_BAR (e, MAGIC, magic, underlying.gdk_event) +#define XEVENT_MAGIC_GDK_EVENT(e) EVENT_MAGIC_GDK_EVENT (XEVENT (e)) +#define SET_EVENT_MAGIC_GDK_EVENT(e, val) \ + SET_EVENT_FOO_BAR (e, MAGIC, magic, underlying.gdk_event, val) +#define XSET_EVENT_MAGIC_GDK_EVENT(e, val) \ + SET_EVENT_MAGIC_GDK_EVENT (XEVENT (e), val) #endif -#ifdef HAVE_MS_WINDOWS -#define XMAGIC_DATA_MSWINDOWS_EVENT(d) (XMAGIC_DATA (d)->underlying.mswindows_event) -#define XSET_MAGIC_DATA_MSWINDOWS_EVENT(d, e) (XMAGIC_DATA (d)->underlying.mswindows_event = (e)) -#endif - -#else /* not USE_KKCC */ -union magic_data -{ -/* No user-serviceable parts within. This is for things like - KeymapNotify and ExposeRegion events and so on that XEmacs itself - doesn't care about, but which it must do something with for proper - interaction with the window system. - - Magic_events are handled somewhat asynchronously, just like - subprocess filters. However, occasionally a magic_event needs to - be handled synchronously; in that case, the asynchronous handling - of the magic_event will push an eval_event back onto the queue, - which will be handled synchronously later. This is one of the - reasons why eval_events exist; I'm not entirely happy with this - aspect of this event model. -*/ - -#ifdef HAVE_GTK - GdkEvent underlying_gdk_event; -#endif #ifdef HAVE_X_WINDOWS - XEvent underlying_x_event; +#define EVENT_MAGIC_X_EVENT(e) EVENT_FOO_BAR (e, MAGIC, magic, underlying.x_event) +#define XEVENT_MAGIC_X_EVENT(e) EVENT_MAGIC_X_EVENT (XEVENT (e)) +#define SET_EVENT_MAGIC_X_EVENT(e, val) \ + SET_EVENT_FOO_BAR (e, MAGIC, magic, underlying.x_event, val) +#define XSET_EVENT_MAGIC_X_EVENT(e, val) \ + SET_EVENT_MAGIC_X_EVENT (XEVENT (e), val) #endif + #ifdef HAVE_MS_WINDOWS - int underlying_mswindows_event; +#define EVENT_MAGIC_MSWINDOWS_EVENT(e) EVENT_FOO_BAR (e, MAGIC, magic, underlying.mswindows_event) +#define XEVENT_MAGIC_MSWINDOWS_EVENT(e) EVENT_MAGIC_MSWINDOWS_EVENT (XEVENT (e)) +#define SET_EVENT_MAGIC_MSWINDOWS_EVENT(e, val) \ + SET_EVENT_FOO_BAR (e, MAGIC, magic, underlying.mswindows_event, val) +#define XSET_EVENT_MAGIC_MSWINDOWS_EVENT(e, val) \ + SET_EVENT_MAGIC_MSWINDOWS_EVENT (XEVENT (e), val) #endif -}; -#endif /* not USE_KKCC */ - struct Lisp_Timeout { @@ -784,22 +859,22 @@ server time and real process time; yuck.) */ unsigned int timestamp; -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS Lisp_Object event_data; -#else /* not USE_KKCC */ +#else /* not EVENT_DATA_AS_OBJECTS */ union { - struct key_data key; - struct button_data button; - struct motion_data motion; - struct process_data process; - struct timeout_data timeout; - struct eval_data eval; /* misc_user_event no longer uses this */ - struct misc_user_data misc; /* because it needs position information */ - union magic_data magic; - struct magic_eval_data magic_eval; + Lisp_Key_Data key; + Lisp_Button_Data button; + Lisp_Motion_Data motion; + Lisp_Process_Data process; + Lisp_Timeout_Data timeout; + Lisp_Eval_Data eval; /* misc_user_event no longer uses this */ + Lisp_Misc_User_Data misc_user;/* because it needs position information */ + Lisp_Magic_Data magic; + Lisp_Magic_Eval_Data magic_eval; } event; -#endif /* not USE_KKCC */ +#endif /* not EVENT_DATA_AS_OBJECTS */ }; DECLARE_LRECORD (event, Lisp_Event); @@ -812,26 +887,29 @@ DECLARE_LRECORD (command_builder, struct command_builder); #define EVENT_CHANNEL(a) ((a)->channel) +#define XEVENT_CHANNEL(ev) (XEVENT (ev)->channel) #define EVENT_TYPE(a) ((a)->event_type) #define XEVENT_TYPE(a) (XEVENT (a)->event_type) #define EVENT_NEXT(a) ((a)->next) #define XEVENT_NEXT(e) (XEVENT (e)->next) +#define EVENT_TIMESTAMP(ev) ((ev)->timestamp) +#define XEVENT_TIMESTAMP(ev) EVENT_TIMESTAMP (XEVENT (ev)) -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS #define XEVENT_DATA(ev) (XEVENT (ev)->event_data) #define EVENT_DATA(ev) ((ev)->event_data) -#define XEVENT_CHANNEL(ev) (XEVENT (ev)->channel) -#define EVENT_TIMESTAMP(ev) \ - ((ev)->timestamp) -#define XEVENT_TIMESTAMP(ev) EVENT_TIMESTAMP (XEVENT (ev)) +#define SET_EVENT_DATA(ev, d) \ +do { \ + Lisp_Event *mac_event = (ev); \ + mac_event->event_data = (d); \ +} while (0) +#define XSET_EVENT_DATA(ev, d) SET_EVENT_DATA (XEVENT (ev), d) +#endif /* EVENT_DATA_AS_OBJECTS */ -#define SET_EVENT_TIMESTAMP_ZERO(ev) \ - ((ev)->timestamp = 0) -#define SET_EVENT_TIMESTAMP(ev, t) \ - (ev)->timestamp = (t) +#define SET_EVENT_TIMESTAMP_ZERO(ev) ((ev)->timestamp = 0) +#define SET_EVENT_TIMESTAMP(ev, t) ((ev)->timestamp = (t)) #define XSET_EVENT_TIMESTAMP(ev, t) SET_EVENT_TIMESTAMP (XEVENT (ev), t) - #define SET_EVENT_CHANNEL(ev, c) \ do { \ Lisp_Event *mac_event = (ev); \ @@ -839,66 +917,92 @@ } while (0) #define XSET_EVENT_CHANNEL(ev, c) SET_EVENT_CHANNEL (XEVENT (ev), c) -#define SET_EVENT_DATA(ev, d) \ -do { \ - Lisp_Event *mac_event = (ev); \ - mac_event->event_data = (d); \ -} while (0) -#define XSET_EVENT_DATA(ev, d) SET_EVENT_DATA (XEVENT (ev), d) - -INLINE_HEADER void set_event_type(struct Lisp_Event *event, emacs_event_type t); -INLINE_HEADER void -set_event_type(struct Lisp_Event *event, emacs_event_type t) +DECLARE_INLINE_HEADER ( +void +set_event_type (struct Lisp_Event *event, emacs_event_type t) +) { +#ifdef EVENT_DATA_AS_OBJECTS + switch (EVENT_TYPE (event)) + { + case key_press_event: + free_key_data (event->event_data); + break; + case button_press_event: + case button_release_event: + free_button_data (event->event_data); + break; + case pointer_motion_event: + free_motion_data (event->event_data); + break; + case process_event: + free_process_data (event->event_data); + break; + case timeout_event: + free_timeout_data (event->event_data); + break; + case magic_event: + free_magic_data (event->event_data); + break; + case magic_eval_event: + free_magic_eval_data (event->event_data); + break; + case eval_event: + free_eval_data (event->event_data); + break; + case misc_user_event: + free_misc_user_data (event->event_data); + break; + default: + break; + } +#endif /* EVENT_DATA_AS_OBJECTS */ + event->event_type = t; - switch (t) { - case key_press_event: - event->event_data = make_key_data (); - break; - case button_press_event: - case button_release_event: - event->event_data = make_button_data (); - break; - case pointer_motion_event: - event->event_data = make_motion_data (); - break; - case process_event: - event->event_data = make_process_data (); - break; - case timeout_event: - event->event_data = make_timeout_data (); - break; - case magic_event: - event->event_data = make_magic_data (); - break; - case magic_eval_event: - event->event_data = make_magic_eval_data (); - break; - case eval_event: - event->event_data = make_eval_data (); - break; - case misc_user_event: - event->event_data = make_misc_user_data (); - break; - default: - break; - } +#ifdef EVENT_DATA_AS_OBJECTS + switch (t) + { + case key_press_event: + event->event_data = make_key_data (); + break; + case button_press_event: + case button_release_event: + event->event_data = make_button_data (); + break; + case pointer_motion_event: + event->event_data = make_motion_data (); + break; + case process_event: + event->event_data = make_process_data (); + break; + case timeout_event: + event->event_data = make_timeout_data (); + break; + case magic_event: + event->event_data = make_magic_data (); + break; + case magic_eval_event: + event->event_data = make_magic_eval_data (); + break; + case eval_event: + event->event_data = make_eval_data (); + break; + case misc_user_event: + event->event_data = make_misc_user_data (); + break; + default: + event->event_data = Qnil; + break; + } +#endif /* EVENT_DATA_AS_OBJECTS */ } -#define XSET_EVENT_TYPE(ev, t) set_event_type (XEVENT (ev), t) -#define SET_EVENT_TYPE(ev, t) set_event_type (ev, t) - -#define SET_EVENT_NEXT(ev, n) \ -do { \ - Lisp_Event *mac_event = (ev); \ - mac_event->next = (n); \ -} while (0) +#define SET_EVENT_NEXT(ev, n) do { (ev)->next = (n); } while (0) #define XSET_EVENT_NEXT(ev, n) SET_EVENT_NEXT (XEVENT (ev), n) -#else /* NOT USE_KKCC */ -#define XSET_EVENT_NEXT(e, n) do { (XEVENT (e)->next = (n)); } while (0) -#endif +#define XSET_EVENT_TYPE(ev, t) set_event_type (XEVENT (ev), t) +#define SET_EVENT_TYPE(ev, t) set_event_type (ev, t) #define EVENT_CHAIN_LOOP(event, chain) \ for (event = chain; !NILP (event); event = XEVENT_NEXT (event)) @@ -927,6 +1031,7 @@ EXFUN (Fevent_point, 1); EXFUN (Fevent_window, 1); EXFUN (Fmake_event, 2); +EXFUN (Fnext_command_event, 2); extern Lisp_Object QKbackspace, QKdelete, QKescape, QKlinefeed, QKreturn; extern Lisp_Object QKspace, QKtab, Qmouse_event_p, Vcharacter_set_property; @@ -956,45 +1061,52 @@ #define KEYSYM(x) (intern (x)) /* from events.c */ -#ifdef USE_KKCC void format_event_object (Eistring *buf, Lisp_Object event, int brief); -#else /* not USE_KKCC */ -void format_event_object (Eistring *buf, Lisp_Event *event, int brief); -#endif /* not USE_KKCC */ -#ifdef USE_KKCC -//void format_event_data_object (Eistring *buf, Lisp_Object data, int brief); -void copy_event_data (Lisp_Object dest, Lisp_Object src); -#endif /* USE_KKCC */ +/*void format_event_data_object (Eistring *buf, Lisp_Object data, int brief);*/ void character_to_event (Ichar c, Lisp_Event *event, struct console *con, int use_console_meta_flag, int do_backspace_mapping); void zero_event (Lisp_Event *e); + +#define MECR_DEALLOCATE_EVENT 1 + void deallocate_event_chain (Lisp_Object event); Lisp_Object event_chain_tail (Lisp_Object event); void enqueue_event (Lisp_Object event, Lisp_Object *head, Lisp_Object *tail); Lisp_Object dequeue_event (Lisp_Object *head, Lisp_Object *tail); void enqueue_event_chain (Lisp_Object event_chain, Lisp_Object *head, Lisp_Object *tail); +int map_event_chain_remove (int (*fn) (Lisp_Object ev, void *user_data), + Lisp_Object *head, Lisp_Object *tail, + void *user_data, int flags); int event_chain_count (Lisp_Object event_chain); +Lisp_Object event_chain_find_previous (Lisp_Object event_chain, + Lisp_Object event); +Lisp_Object event_chain_nth (Lisp_Object event_chain, int n); +Lisp_Object copy_event_chain (Lisp_Object event_chain); Lisp_Object transfer_event_chain_pointer (Lisp_Object pointer, Lisp_Object old_chain, Lisp_Object new_chain); + + void nth_of_key_sequence_as_event (Lisp_Object seq, int n, Lisp_Object event); Lisp_Object key_sequence_to_event_chain (Lisp_Object seq); -Lisp_Object event_chain_find_previous (Lisp_Object event_chain, - Lisp_Object event); -Lisp_Object event_chain_nth (Lisp_Object event_chain, int n); -Lisp_Object copy_event_chain (Lisp_Object event_chain); /* True if this is a non-internal event (keyboard press, menu, scrollbar, mouse button) */ int command_event_p (Lisp_Object event); void define_self_inserting_symbol (Lisp_Object, Lisp_Object); -Ichar event_to_character (Lisp_Event *, int, int, int); +Ichar event_to_character (Lisp_Object, int, int, int); struct console *event_console_or_selected (Lisp_Object event); +void upshift_event (Lisp_Object event); +void downshift_event (Lisp_Object event); +int event_upshifted_p (Lisp_Object event); /* from event-stream.c */ +extern Lisp_Object dispatch_event_queue; Lisp_Object allocate_command_builder (Lisp_Object console, int with_echo_buf); +void enqueue_dispatch_event (Lisp_Object event); +Lisp_Object dequeue_dispatch_event (void); void enqueue_magic_eval_event (void (*fun) (Lisp_Object), Lisp_Object object); void event_stream_handle_magic_event (Lisp_Event *event); void event_stream_format_magic_event (Lisp_Event *event, Lisp_Object pstream); @@ -1016,6 +1128,10 @@ Lisp_Object errstream, USID* in_usid, USID* err_usid); +Lisp_Object event_stream_protect_modal_loop (const char *error_string, + Lisp_Object (*bfun) (void *barg), + void *barg, int flags); +void event_stream_drain_queue (void); void event_stream_quit_p (void); void run_pre_idle_hook (void); @@ -1062,7 +1178,7 @@ int in_single_console_state (void); extern int emacs_is_blocking; - +extern int in_modal_loop; extern volatile int sigint_happened; #ifdef HAVE_UNIXOID_EVENT_LOOP @@ -1073,6 +1189,7 @@ void signal_fake_event (void); void drain_signal_event_pipe (void); +void drain_tty_devices (void); extern int fake_event_occurred; @@ -1082,6 +1199,7 @@ int doerr, int *infd, int *errfd); void event_stream_unixoid_unselect_process (Lisp_Process *proc, int doin, int doerr, int *infd, int *errfd); +struct console *find_tty_or_stream_console_from_fd (int fd); int read_event_from_tty_or_stream_desc (Lisp_Event *event, struct console *con); void event_stream_unixoid_create_io_streams (void* inhandle, void* outhandle, @@ -1098,11 +1216,15 @@ USID* in_usid, USID* err_usid); +#endif /* HAVE_UNIXOID_EVENT_LOOP */ + +/* The following is not inside of HAVE_UNIXOID_EVENT_LOOP because of the + possibility of combiling XEmacs with no-MSW, no-X, no-TTY -- + process-unix.c is still compiled. #### Should we still compile + subprocesses with no event loops? */ /* Beware: this evil macro evaluates its arg many times */ #define FD_TO_USID(fd) ((fd)==0 ? (USID)999999 : ((fd)<0 ? USID_DONTHASH : (USID)(fd))) -#endif /* HAVE_UNIXOID_EVENT_LOOP */ - /* Define this if you want the tty event stream to be used when the first console is tty, even if HAVE_X_WINDOWS is defined */ /* #define DEBUG_TTY_EVENT_STREAM */ @@ -1139,20 +1261,17 @@ something that's not part of a possible function key, we have to unread all of those events. */ Lisp_Object last_non_munged_event; - /* One set of values for function-key-map, one for key-translation-map */ - struct munging_key_translation - { - /* First event that can begin a possible function key sequence - (to be translated according to function-key-map). Normally - this is the first event in the chain. However, once we've - translated a sequence through function-key-map, this will point - to the first event after the translated sequence: we don't ever - want to translate any events twice through function-key-map, or - things could get really screwed up (e.g. if the user created a - translation loop). If this is nil, then the next-read event is - the first that can begin a function key sequence. */ - Lisp_Object first_mungeable_event; - } munge_me[2]; + /* One value for function-key-map, one for key-translation-map: + First event that can begin a possible function key sequence + (to be translated according to function-key-map). Normally + this is the first event in the chain. However, once we've + translated a sequence through function-key-map, this will point + to the first event after the translated sequence: we don't ever + want to translate any events twice through function-key-map, or + things could get really screwed up (e.g. if the user created a + translation loop). If this is nil, then the next-read event is + the first that can begin a function key sequence. */ + Lisp_Object first_mungeable_event[2]; Ibyte *echo_buf; Bytecount echo_buf_length; /* size of echo_buf */ Index: src/extents.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/extents.c,v retrieving revision 1.48 retrieving revision 1.50 diff -u -r1.48 -r1.50 --- src/extents.c 8 Oct 2002 05:44:15 -0000 1.48 +++ src/extents.c 13 Feb 2003 09:57:07 -0000 1.50 @@ -1,6 +1,6 @@ /* Copyright (c) 1994, 1995 Free Software Foundation, Inc. Copyright (c) 1995 Sun Microsystems, Inc. - Copyright (c) 1995, 1996, 2000, 2002 Ben Wing. + Copyright (c) 1995, 1996, 2000, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -226,6 +226,7 @@ #include "keymap.h" #include "opaque.h" #include "process.h" +#include "profile.h" #include "redisplay.h" #include "gutter.h" @@ -245,20 +246,47 @@ struct gap_array_marker *next; } Gap_Array_Marker; + /* Holds a "gap array", which is an array of elements with a gap located in it. Insertions and deletions with a high degree of locality are very fast, essentially in constant time. Array positions as used and returned in the gap array functions are independent of the gap. */ +/* Layout of gap array: + + <------ gap ------><---- gapsize ----><----- numels - gap ----> + <---------------------- numels + gapsize ---------------------> + + For marking purposes, we use two extra variables computed from + the others -- the offset to the data past the gap, plus the number + of elements in that data: + + offset_past_gap = elsize * (gap + gapsize) + els_past_gap = numels - gap + + #### The current layout will not cut it for dumping purposes. If we + need to dump one of these structures, we will have to rearrange things + so that the gap array data and other fields are in one single memory + block. Either this is a pointer off of struct gap_array, or it is + struct gap_array itself; in the latter case, the interface below has to + be modified so that functions that change the array pass in a ** rather + than a *, since the pointer may move. +*/ + + typedef struct gap_array { - char *array; - int gap; - int gapsize; - int numels; - int elsize; + Elemcount gap; + Elemcount gapsize; + Elemcount numels; + Bytecount elsize; + /* Redundant numbers computed from the others, for marking purposes */ + Bytecount offset_past_gap; + Elemcount els_past_gap; Gap_Array_Marker *markers; + /* this is a stretchy array */ + char array[1]; } Gap_Array; static Gap_Array_Marker *gap_array_marker_freelist; @@ -402,6 +430,9 @@ #define DE_MUST_BE_ATTACHED 2 Lisp_Object Vlast_highlighted_extent; + +Lisp_Object QSin_map_extents_internal; + Fixnum mouse_highlight_priority; Lisp_Object Qextentp; @@ -487,7 +518,7 @@ static void gap_array_adjust_markers (Gap_Array *ga, Memxpos from, - Memxpos to, int amount) + Memxpos to, Elemcount amount) { Gap_Array_Marker *m; @@ -495,16 +526,22 @@ m->pos = do_marker_adjustment (m->pos, from, to, amount); } +static void +gap_array_recompute_derived_values (Gap_Array *ga) +{ + ga->offset_past_gap = ga->elsize * (ga->gap + ga->gapsize); + ga->els_past_gap = ga->numels - ga->gap; +} + /* Move the gap to array position POS. Parallel to move_gap() in insdel.c but somewhat simplified. */ static void -gap_array_move_gap (Gap_Array *ga, int pos) +gap_array_move_gap (Gap_Array *ga, Elemcount pos) { - int gap = ga->gap; - int gapsize = ga->gapsize; + Elemcount gap = ga->gap; + Elemcount gapsize = ga->gapsize; - assert (ga->array); if (pos < gap) { memmove (GAP_ARRAY_MEMEL_ADDR (ga, pos + gapsize), @@ -522,27 +559,30 @@ (Memxpos) (pos + gapsize), - gapsize); } ga->gap = pos; + + gap_array_recompute_derived_values (ga); } /* Make the gap INCREMENT characters longer. Parallel to make_gap() in - insdel.c. */ + insdel.c. The gap array may be moved, so assign the return value back + to the array pointer. */ -static void -gap_array_make_gap (Gap_Array *ga, int increment) +static Gap_Array * +gap_array_make_gap (Gap_Array *ga, Elemcount increment) { - char *ptr = ga->array; - int real_gap_loc; - int old_gap_size; + Elemcount real_gap_loc; + Elemcount old_gap_size; /* If we have to get more space, get enough to last a while. We use a geometric progression that saves on realloc space. */ increment += 100 + ga->numels / 8; - ptr = (char *) xrealloc (ptr, - (ga->numels + ga->gapsize + increment)*ga->elsize); - if (ptr == 0) + ga = (Gap_Array *) xrealloc (ga, + offsetof (Gap_Array, array) + + (ga->numels + ga->gapsize + increment) * + ga->elsize); + if (ga == 0) memory_full (); - ga->array = ptr; real_gap_loc = ga->gap; old_gap_size = ga->gapsize; @@ -558,6 +598,10 @@ /* Now combine the two into one large gap. */ ga->gapsize += old_gap_size; ga->gap = real_gap_loc; + + gap_array_recompute_derived_values (ga); + + return ga; } /* ------------------------------- */ @@ -565,14 +609,16 @@ /* ------------------------------- */ /* Insert NUMELS elements (pointed to by ELPTR) into the specified - gap array at POS. */ + gap array at POS. The gap array may be moved, so assign the + return value back to the array pointer. */ -static void -gap_array_insert_els (Gap_Array *ga, int pos, void *elptr, int numels) +static Gap_Array * +gap_array_insert_els (Gap_Array *ga, Elemcount pos, void *elptr, + Elemcount numels) { assert (pos >= 0 && pos <= ga->numels); if (ga->gapsize < numels) - gap_array_make_gap (ga, numels - ga->gapsize); + ga = gap_array_make_gap (ga, numels - ga->gapsize); if (pos != ga->gap) gap_array_move_gap (ga, pos); @@ -581,21 +627,23 @@ ga->gapsize -= numels; ga->gap += numels; ga->numels += numels; + gap_array_recompute_derived_values (ga); /* This is the equivalent of insert-before-markers. #### Should only happen if marker is "moves forward at insert" type. */ gap_array_adjust_markers (ga, pos - 1, pos, numels); + return ga; } /* Delete NUMELS elements from the specified gap array, starting at FROM. */ static void -gap_array_delete_els (Gap_Array *ga, int from, int numdel) +gap_array_delete_els (Gap_Array *ga, Elemcount from, Elemcount numdel) { - int to = from + numdel; - int gapsize = ga->gapsize; + Elemcount to = from + numdel; + Elemcount gapsize = ga->gapsize; assert (from >= 0); assert (numdel >= 0); @@ -615,10 +663,11 @@ ga->gapsize += numdel; ga->numels -= numdel; ga->gap = from; + gap_array_recompute_derived_values (ga); } static Gap_Array_Marker * -gap_array_make_marker (Gap_Array *ga, int pos) +gap_array_make_marker (Gap_Array *ga, Elemcount pos) { Gap_Array_Marker *m; @@ -650,7 +699,7 @@ else ga->markers = p->next; m->next = gap_array_marker_freelist; - m->pos = 0xDEADBEEF; /* -559038737 as an int */ + m->pos = 0xDEADBEEF; /* -559038737 base 10 */ gap_array_marker_freelist = m; } @@ -669,7 +718,7 @@ } static void -gap_array_move_marker (Gap_Array *ga, Gap_Array_Marker *m, int pos) +gap_array_move_marker (Gap_Array *ga, Gap_Array_Marker *m, Elemcount pos) { assert (pos >= 0 && pos <= ga->numels); m->pos = GAP_ARRAY_ARRAY_TO_MEMORY_POS (ga, pos); @@ -679,7 +728,7 @@ GAP_ARRAY_MEMORY_TO_ARRAY_POS (ga, (m)->pos) static Gap_Array * -make_gap_array (int elsize) +make_gap_array (Elemcount elsize) { Gap_Array *ga = xnew_and_zero (Gap_Array); ga->elsize = elsize; @@ -689,8 +738,6 @@ static void free_gap_array (Gap_Array *ga) { - if (ga->array) - xfree (ga->array); gap_array_delete_all_markers (ga); xfree (ga); } @@ -713,7 +760,7 @@ */ /* Number of elements in an extent list */ -#define extent_list_num_els(el) GAP_ARRAY_NUM_ELS(el->start) +#define extent_list_num_els(el) GAP_ARRAY_NUM_ELS (el->start) /* Return the position at which EXTENT is located in the specified extent list (in the display order if ENDP is 0, in the e-order otherwise). @@ -815,10 +862,10 @@ pos = extent_list_locate (el, extent, 0, &foundp); assert (!foundp); - gap_array_insert_els (el->start, pos, &extent, 1); + el->start = gap_array_insert_els (el->start, pos, &extent, 1); pos = extent_list_locate (el, extent, 1, &foundp); assert (!foundp); - gap_array_insert_els (el->end, pos, &extent, 1); + el->end = gap_array_insert_els (el->end, pos, &extent, 1); } /* Delete an extent from an extent list. */ @@ -909,8 +956,7 @@ /* Auxiliary extent structure */ /************************************************************************/ -#ifdef USE_KKCC -static const struct lrecord_description extent_auxiliary_description[] ={ +static const struct memory_description extent_auxiliary_description[] ={ { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, begin_glyph) }, { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, end_glyph) }, { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, parent) }, @@ -923,7 +969,6 @@ { XD_LISP_OBJECT, offsetof (struct extent_auxiliary, after_change_functions) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_extent_auxiliary (Lisp_Object obj) { @@ -940,16 +985,11 @@ return data->parent; } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, 0, /*dumpable-flag*/ mark_extent_auxiliary, internal_object_printer, - 0, 0, 0, extent_auxiliary_description, struct extent_auxiliary); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, - mark_extent_auxiliary, internal_object_printer, - 0, 0, 0, 0, struct extent_auxiliary); -#endif /* not USE_KKCC */ + 0, 0, 0, extent_auxiliary_description, + struct extent_auxiliary); void allocate_extent_auxiliary (EXTENT ext) { @@ -993,16 +1033,81 @@ static void free_soe (struct stack_of_extents *soe); static void soe_invalidate (Lisp_Object obj); -#ifdef USE_KKCC -static const struct struct_description extent_list_description = { +extern const struct sized_memory_description gap_array_marker_description; + +static const struct memory_description gap_array_marker_description_1[] = { + { XD_STRUCT_PTR, offsetof (Gap_Array_Marker, next), 1, + &gap_array_marker_description }, + { XD_END } +}; + +const struct sized_memory_description gap_array_marker_description = { + sizeof (Gap_Array_Marker), + gap_array_marker_description_1 +}; + +static const struct memory_description lispobj_gap_array_description_1[] = { + { XD_INT, offsetof (Gap_Array, gap) }, + { XD_INT, offsetof (Gap_Array, offset_past_gap) }, + { XD_INT, offsetof (Gap_Array, els_past_gap) }, + { XD_STRUCT_PTR, offsetof (Gap_Array, markers), 1, + &gap_array_marker_description, XD_FLAG_NO_KKCC }, + { XD_STRUCT_ARRAY, offsetof (Gap_Array, array), XD_INDIRECT (0, 0), + &lisp_object_description }, + { XD_STRUCT_ARRAY, XD_INDIRECT (1, offsetof (Gap_Array, array)), + XD_INDIRECT (2, 0), &lisp_object_description }, + { XD_END } +}; + +static const struct sized_memory_description lispobj_gap_array_description = { + sizeof (Gap_Array), + lispobj_gap_array_description_1 +}; + +extern const struct sized_memory_description extent_list_marker_description; + +static const struct memory_description extent_list_marker_description_1[] = { + { XD_STRUCT_PTR, offsetof (Extent_List_Marker, m), 1, + &gap_array_marker_description }, + { XD_STRUCT_PTR, offsetof (Extent_List_Marker, next), 1, + &extent_list_marker_description }, + { XD_END } +}; + +const struct sized_memory_description extent_list_marker_description = { + sizeof (Extent_List_Marker), + extent_list_marker_description_1 +}; + +static const struct memory_description extent_list_description_1[] = { + { XD_STRUCT_PTR, offsetof (Extent_List, start), 1, &lispobj_gap_array_description }, + { XD_STRUCT_PTR, offsetof (Extent_List, end), 1, &lispobj_gap_array_description, XD_FLAG_NO_KKCC }, + { XD_STRUCT_PTR, offsetof (Extent_List, markers), 1, &extent_list_marker_description, XD_FLAG_NO_KKCC }, + { XD_END } +}; + +static const struct sized_memory_description extent_list_description = { + sizeof (Extent_List), + extent_list_description_1 +}; + +static const struct memory_description stack_of_extents_description_1[] = { + { XD_STRUCT_PTR, offsetof (Stack_Of_Extents, extents), 1, &extent_list_description }, + { XD_END } +}; + +static const struct sized_memory_description stack_of_extents_description = { + sizeof (Stack_Of_Extents), + stack_of_extents_description_1 }; -static const struct lrecord_description extent_info_description [] = { - { XD_STRUCT_PTR, offsetof (struct extent_info, extents), - XD_INDIRECT (0, 0), &extent_list_description }, +static const struct memory_description extent_info_description [] = { + { XD_STRUCT_PTR, offsetof (struct extent_info, extents), 1, + &extent_list_description }, + { XD_STRUCT_PTR, offsetof (struct extent_info, soe), 1, + &stack_of_extents_description, XD_FLAG_NO_KKCC }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_extent_info (Lisp_Object obj) @@ -1054,19 +1159,12 @@ } } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, 0, /*dumpable-flag*/ mark_extent_info, internal_object_printer, finalize_extent_info, 0, 0, - 0 /*extent_info_description*/, + extent_info_description, struct extent_info); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, - mark_extent_info, internal_object_printer, - finalize_extent_info, 0, 0, 0, - struct extent_info); -#endif /* not USE_KKCC */ static Lisp_Object allocate_extent_info (void) @@ -2027,8 +2125,9 @@ Extent_List_Marker *posm = 0; /* marker for extent list, if ME_MIGHT_MODIFY_EXTENTS */ /* count and struct for unwind-protect, if ME_MIGHT_THROW */ - int count = 0; + int count = specpdl_depth (); struct map_extents_struct closure; + PROFILE_DECLARE (); #ifdef ERROR_CHECK_EXTENTS assert (from <= to); @@ -2045,10 +2144,12 @@ } el = buffer_or_string_extent_list (obj); - if (!el || !extent_list_num_els(el)) + if (!el || !extent_list_num_els (el)) return; el = 0; + PROFILE_RECORD_ENTERING_SECTION (QSin_map_extents_internal); + st = buffer_or_string_bytexpos_to_memxpos (obj, from); en = buffer_or_string_bytexpos_to_memxpos (obj, to); @@ -2072,7 +2173,6 @@ /* The mapping function might throw past us so we need to use an unwind_protect() to eliminate the internal extent and range that we use. */ - count = specpdl_depth (); closure.range = range; closure.mkr = 0; record_unwind_protect (map_extents_unwind, @@ -2337,10 +2437,7 @@ /* ---------- Finished looping. ---------- */ } - if (flags & ME_MIGHT_THROW) - /* This deletes the range extent and frees the marker. */ - unbind_to (count); - else + if (!(flags & ME_MIGHT_THROW)) { /* Delete them ourselves */ if (range) @@ -2348,6 +2445,11 @@ if (posm) extent_list_delete_marker (el, posm); } + + /* This deletes the range extent and frees the marker, if ME_MIGHT_THROW. */ + unbind_to (count); + + PROFILE_RECORD_EXITING_SECTION (QSin_map_extents_internal); } /* ------------------------------- */ @@ -3180,7 +3282,7 @@ internal_hash (extent_object (e), depth + 1)); } -static const struct lrecord_description extent_description[] = { +static const struct memory_description extent_description[] = { { XD_LISP_OBJECT, offsetof (struct extent, object) }, { XD_LISP_OBJECT, offsetof (struct extent, flags.face) }, { XD_LISP_OBJECT, offsetof (struct extent, plist) }, @@ -3218,7 +3320,6 @@ return Fextent_properties (obj); } -#ifdef USE_KKCC DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("extent", extent, 1, /*dumpable-flag*/ mark_extent, @@ -3233,21 +3334,6 @@ extent_getprop, extent_putprop, extent_remprop, extent_plist, struct extent); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("extent", extent, - mark_extent, - print_extent, - /* NOTE: If you declare a - finalization method here, - it will NOT be called. - Shaft city. */ - 0, - extent_equal, extent_hash, - extent_description, - extent_getprop, extent_putprop, - extent_remprop, extent_plist, - struct extent); -#endif /* not USE_KKCC */ /************************************************************************/ /* basic extent accessors */ @@ -4398,7 +4484,7 @@ if (EQ (at_flag, Qat)) return EXTENT_AT_AT; invalid_constant ("Invalid AT-FLAG in `extent-at'", at_flag); - RETURN_NOT_REACHED (EXTENT_AT_AFTER) + RETURN_NOT_REACHED (EXTENT_AT_AFTER); } static int @@ -4640,7 +4726,7 @@ while (1) Fsignal (Qbuffer_read_only, (list1 (closure->object))); - RETURN_NOT_REACHED(0) + RETURN_NOT_REACHED(0); } /* Value of Vinhibit_read_only is precomputed and passed in for @@ -5219,7 +5305,7 @@ if (EQ (layout_obj, Qtext)) return GL_TEXT; invalid_constant ("Unknown glyph layout type", layout_obj); - RETURN_NOT_REACHED (GL_TEXT) + RETURN_NOT_REACHED (GL_TEXT); } static Lisp_Object @@ -7230,7 +7316,7 @@ DEFSUBR (Fset_extent_endpoints); DEFSUBR (Fnext_extent); DEFSUBR (Fprevious_extent); -#if DEBUG_XEMACS +#ifdef DEBUG_XEMACS DEFSUBR (Fnext_e_extent); DEFSUBR (Fprevious_e_extent); #endif @@ -7343,4 +7429,7 @@ staticpro (&Vextent_face_reverse_memoize_hash_table); Vextent_face_reverse_memoize_hash_table = make_lisp_hash_table (100, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQ); + + QSin_map_extents_internal = build_msg_string ("(in map-extents-internal)"); + staticpro (&QSin_map_extents_internal); } Index: src/faces.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/faces.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- src/faces.c 29 Jul 2002 09:21:19 -0000 1.39 +++ src/faces.c 12 Jan 2003 11:08:14 -0000 1.40 @@ -257,7 +257,7 @@ return result; } -static const struct lrecord_description face_description[] = { +static const struct memory_description face_description[] = { { XD_LISP_OBJECT, offsetof (Lisp_Face, name) }, { XD_LISP_OBJECT, offsetof (Lisp_Face, doc_string) }, { XD_LISP_OBJECT, offsetof (Lisp_Face, foreground) }, @@ -276,20 +276,13 @@ { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face, 1, /*dumpable-flag*/ mark_face, print_face, 0, face_equal, - face_hash, face_description, face_getprop, + face_hash, face_description, + face_getprop, face_putprop, face_remprop, face_plist, Lisp_Face); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face, - mark_face, print_face, 0, face_equal, - face_hash, face_description, face_getprop, - face_putprop, face_remprop, - face_plist, Lisp_Face); -#endif /* not USE_KKCC */ /************************************************************************/ /* face read syntax */ Index: src/file-coding.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/file-coding.c,v retrieving revision 1.30 retrieving revision 1.32 diff -u -r1.30 -r1.32 --- src/file-coding.c 1 Aug 2002 08:38:48 -0000 1.30 +++ src/file-coding.c 31 Jan 2003 12:02:36 -0000 1.32 @@ -361,22 +361,22 @@ static coding_system_type_entry_dynarr *the_coding_system_type_entry_dynarr; -static const struct lrecord_description cste_description_1[] = { +static const struct memory_description cste_description_1[] = { { XD_STRUCT_PTR, offsetof (coding_system_type_entry, meths), 1, &coding_system_methods_description }, { XD_END } }; -static const struct struct_description cste_description = { +static const struct sized_memory_description cste_description = { sizeof (coding_system_type_entry), cste_description_1 }; -static const struct lrecord_description csted_description_1[] = { +static const struct memory_description csted_description_1[] = { XD_DYNARR_DESC (coding_system_type_entry_dynarr, &cste_description), { XD_END } }; -static const struct struct_description csted_description = { +static const struct sized_memory_description csted_description = { sizeof (coding_system_type_entry_dynarr), csted_description_1 }; @@ -398,32 +398,32 @@ detector_dynarr *all_coding_detectors; -static const struct lrecord_description struct_detector_category_description_1[] +static const struct memory_description struct_detector_category_description_1[] = { { XD_LISP_OBJECT, offsetof (struct detector_category, sym) }, { XD_END } }; -static const struct struct_description struct_detector_category_description = +static const struct sized_memory_description struct_detector_category_description = { sizeof (struct detector_category), struct_detector_category_description_1 }; -static const struct lrecord_description detector_category_dynarr_description_1[] = +static const struct memory_description detector_category_dynarr_description_1[] = { XD_DYNARR_DESC (detector_category_dynarr, &struct_detector_category_description), { XD_END } }; -static const struct struct_description detector_category_dynarr_description = { +static const struct sized_memory_description detector_category_dynarr_description = { sizeof (detector_category_dynarr), detector_category_dynarr_description_1 }; -static const struct lrecord_description struct_detector_description_1[] +static const struct memory_description struct_detector_description_1[] = { { XD_STRUCT_PTR, offsetof (struct detector, cats), 1, @@ -431,19 +431,19 @@ { XD_END } }; -static const struct struct_description struct_detector_description = +static const struct sized_memory_description struct_detector_description = { sizeof (struct detector), struct_detector_description_1 }; -static const struct lrecord_description detector_dynarr_description_1[] = +static const struct memory_description detector_dynarr_description_1[] = { XD_DYNARR_DESC (detector_dynarr, &struct_detector_description), { XD_END } }; -static const struct struct_description detector_dynarr_description = { +static const struct sized_memory_description detector_dynarr_description = { sizeof (detector_dynarr), detector_dynarr_description_1 }; @@ -512,20 +512,12 @@ { Lisp_Coding_System *codesys = XCODING_SYSTEM (obj); - mark_object (CODING_SYSTEM_NAME (codesys)); - mark_object (CODING_SYSTEM_DESCRIPTION (codesys)); - mark_object (CODING_SYSTEM_MNEMONIC (codesys)); - mark_object (CODING_SYSTEM_DOCUMENTATION (codesys)); - mark_object (CODING_SYSTEM_EOL_LF (codesys)); - mark_object (CODING_SYSTEM_EOL_CRLF (codesys)); - mark_object (CODING_SYSTEM_EOL_CR (codesys)); - mark_object (CODING_SYSTEM_SUBSIDIARY_PARENT (codesys)); - mark_object (CODING_SYSTEM_CANONICAL (codesys)); +#define MARKED_SLOT(x) mark_object (codesys->x); +#include "coding-system-slots.h" MAYBE_CODESYSMETH (codesys, mark, (obj)); - mark_object (CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys)); - return CODING_SYSTEM_POST_READ_CONVERSION (codesys); + return Qnil; } static void @@ -583,7 +575,7 @@ return offsetof (Lisp_Coding_System, data) + p->methods->extra_data_size; } -static const struct lrecord_description coding_system_methods_description_1[] +static const struct memory_description coding_system_methods_description_1[] = { { XD_LISP_OBJECT, offsetof (struct coding_system_methods, type) }, @@ -592,36 +584,40 @@ { XD_END } }; -const struct struct_description coding_system_methods_description = { +const struct sized_memory_description coding_system_methods_description = { sizeof (struct coding_system_methods), coding_system_methods_description_1 }; -const struct lrecord_description coding_system_empty_extra_description[] = { - { XD_END } +static const struct sized_memory_description coding_system_extra_description_map[] = +{ + { offsetof (Lisp_Coding_System, methods) }, + { offsetof (struct coding_system_methods, extra_description) }, + { -1 }, }; -static const struct lrecord_description coding_system_description[] = +static const struct memory_description coding_system_description[] = { { XD_STRUCT_PTR, offsetof (Lisp_Coding_System, methods), 1, &coding_system_methods_description }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, name) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, description) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, mnemonic) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, documentation) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, post_read_conversion) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, pre_write_conversion) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, text_file_wrapper) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, auto_eol_wrapper) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, eol[0]) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, eol[1]) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, eol[2]) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, subsidiary_parent) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, canonical) }, - { XD_CODING_SYSTEM_END } +#define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, x) }, +#define MARKED_SLOT_ARRAY(slot, size) \ + { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Coding_System, slot), size }, +#include "coding-system-slots.h" + { XD_STRUCT_ARRAY, offsetof (Lisp_Coding_System, data), 1, + coding_system_extra_description_map }, + { XD_END } +}; + +static const struct memory_description coding_system_empty_extra_description_1[] = +{ + { XD_END } +}; + +const struct sized_memory_description coding_system_empty_extra_description = { + 0, coding_system_empty_extra_description_1 }; -#ifdef USE_KKCC DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("coding-system", coding_system, 1, /*dumpable-flag*/ mark_coding_system, @@ -630,15 +626,6 @@ 0, 0, coding_system_description, sizeof_coding_system, Lisp_Coding_System); -#else /* not USE_KKCC */ -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("coding-system", coding_system, - mark_coding_system, - print_coding_system, - finalize_coding_system, - 0, 0, coding_system_description, - sizeof_coding_system, - Lisp_Coding_System); -#endif /* not USE_KKCC */ /************************************************************************/ /* Creating coding systems */ @@ -962,22 +949,14 @@ { Bytecount total_size = offsetof (Lisp_Coding_System, data) + data_size; Lisp_Coding_System *codesys = - (Lisp_Coding_System *) alloc_lcrecord (total_size, &lrecord_coding_system); + (Lisp_Coding_System *) basic_alloc_lcrecord (total_size, + &lrecord_coding_system); - zero_sized_lcrecord (codesys, total_size); codesys->methods = codesys_meths; - CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = Qnil; - CODING_SYSTEM_POST_READ_CONVERSION (codesys) = Qnil; +#define MARKED_SLOT(x) codesys->x = Qnil; +#include "coding-system-slots.h" + CODING_SYSTEM_EOL_TYPE (codesys) = EOL_LF; - CODING_SYSTEM_EOL_CRLF (codesys) = Qnil; - CODING_SYSTEM_EOL_CR (codesys) = Qnil; - CODING_SYSTEM_EOL_LF (codesys) = Qnil; - CODING_SYSTEM_SUBSIDIARY_PARENT (codesys) = Qnil; - CODING_SYSTEM_CANONICAL (codesys) = Qnil; - CODING_SYSTEM_MNEMONIC (codesys) = Qnil; - CODING_SYSTEM_DOCUMENTATION (codesys) = Qnil; - CODING_SYSTEM_TEXT_FILE_WRAPPER (codesys) = Qnil; - CODING_SYSTEM_AUTO_EOL_WRAPPER (codesys) = Qnil; CODING_SYSTEM_NAME (codesys) = name; MAYBE_CODESYSMETH (codesys, init, (wrap_coding_system (codesys))); @@ -995,7 +974,7 @@ if (EQ (symbol, Qcr)) return EOL_CR; invalid_constant ("Unrecognized eol type", symbol); - RETURN_NOT_REACHED (EOL_AUTODETECT) + RETURN_NOT_REACHED (EOL_AUTODETECT); } static Lisp_Object @@ -1708,7 +1687,7 @@ return aliasee; else invalid_argument ("Symbol is not a coding system alias", alias); - RETURN_NOT_REACHED (Qnil) + RETURN_NOT_REACHED (Qnil); } /* A maphash function, for removing dangling coding system aliases. */ @@ -1989,7 +1968,30 @@ that is at the other end, and data that needs to be persistent across the lifetime of the stream. */ -DEFINE_LSTREAM_IMPLEMENTATION ("coding", coding); +extern const struct sized_memory_description chain_coding_stream_description; +extern const struct sized_memory_description undecided_coding_stream_description; + +static const struct memory_description coding_stream_data_description_1 []= { + { XD_STRUCT_PTR, chain_coding_system, 1, &chain_coding_stream_description}, + { XD_STRUCT_PTR, undecided_coding_system, 1, &undecided_coding_stream_description}, + { XD_END } +}; + +static const struct sized_memory_description coding_stream_data_description = { + sizeof (void *), coding_stream_data_description_1 +}; + +static const struct memory_description coding_lstream_description[] = { + { XD_INT, offsetof (struct coding_stream, type) }, + { XD_LISP_OBJECT, offsetof (struct coding_stream, orig_codesys) }, + { XD_LISP_OBJECT, offsetof (struct coding_stream, codesys) }, + { XD_LISP_OBJECT, offsetof (struct coding_stream, other_end) }, + { XD_UNION, offsetof (struct coding_stream, data), + XD_INDIRECT (0, 0), &coding_stream_data_description }, + { XD_END } +}; + +DEFINE_LSTREAM_IMPLEMENTATION_WITH_DATA ("coding", coding); /* Encoding and decoding are parallel operations, so we create just one stream for both. "Decoding" may involve the extra step of autodetection @@ -2309,9 +2311,12 @@ str->data = 0; } if (XCODING_SYSTEM_METHODS (str->codesys)->coding_data_size) - str->data = - xmalloc_and_zero (XCODING_SYSTEM_METHODS (str->codesys)-> - coding_data_size); + { + str->data = + xmalloc_and_zero (XCODING_SYSTEM_METHODS (str->codesys)-> + coding_data_size); + str->type = XCODING_SYSTEM_METHODS (str->codesys)->enumtype; + } MAYBE_XCODESYSMETH (str->codesys, init_coding_stream, (str)); /* The new coding system may have different ideas regarding whether its ends are characters or bytes. */ @@ -2538,7 +2543,6 @@ /* Chain two or more coding systems together to make a combination coding system. */ -DEFINE_CODING_SYSTEM_TYPE (chain); struct chain_coding_system { @@ -2558,30 +2562,28 @@ int lstream_count; }; -static const struct lrecord_description lo_description_1[] = { - { XD_LISP_OBJECT, 0 }, +static const struct memory_description chain_coding_system_description[] = { + { XD_INT, offsetof (struct chain_coding_system, count) }, + { XD_STRUCT_PTR, offsetof (struct chain_coding_system, chain), + XD_INDIRECT (0, 0), &lisp_object_description }, + { XD_LISP_OBJECT, offsetof (struct chain_coding_system, + canonicalize_after_coding) }, { XD_END } }; -static const struct struct_description lo_description = { - sizeof (Lisp_Object), - lo_description_1 +static const struct memory_description chain_coding_stream_description_1 [] = { + { XD_INT, offsetof (struct chain_coding_stream, lstream_count) }, + { XD_STRUCT_PTR, offsetof (struct chain_coding_stream, lstreams), + XD_INDIRECT (0, 0), &lisp_object_description }, + { XD_END } }; -static const struct lrecord_description chain_coding_system_description[] = { - { XD_INT, - coding_system_data_offset + offsetof (struct chain_coding_system, - count) }, - { XD_STRUCT_PTR, - coding_system_data_offset + offsetof (struct chain_coding_system, - chain), - XD_INDIRECT (0, 0), &lo_description }, - { XD_LISP_OBJECT, - coding_system_data_offset + offsetof (struct chain_coding_system, - canonicalize_after_coding) }, - { XD_END } +const struct sized_memory_description chain_coding_stream_description = { + sizeof (struct chain_coding_stream), chain_coding_stream_description_1 }; +DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (chain); + static Lisp_Object chain_canonicalize (Lisp_Object codesys) { @@ -3024,8 +3026,6 @@ There is one parameter: `subtype', either `cr', `lf', `crlf', or nil. */ -DEFINE_CODING_SYSTEM_TYPE (convert_eol); - struct convert_eol_coding_system { enum eol_type subtype; @@ -3041,11 +3041,13 @@ enum eol_type actual; }; -static const struct lrecord_description +static const struct memory_description convert_eol_coding_system_description[] = { { XD_END } }; +DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (convert_eol); + static void convert_eol_print (Lisp_Object cs, Lisp_Object printcharfun, int escapeflag) { @@ -3283,8 +3285,6 @@ EOL-processed twice. */ -DEFINE_CODING_SYSTEM_TYPE (undecided); - struct undecided_coding_system { int do_eol, do_coding; @@ -3300,14 +3300,24 @@ struct detection_state *st; }; -static const struct lrecord_description - undecided_coding_system_description[] = { - { XD_LISP_OBJECT, - coding_system_data_offset + offsetof (struct undecided_coding_system, - cs) }, +static const struct memory_description undecided_coding_system_description[] = { + { XD_LISP_OBJECT, offsetof (struct undecided_coding_system, cs) }, + { XD_END } +}; + +static const struct memory_description undecided_coding_stream_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct undecided_coding_stream, actual) }, + { XD_STRUCT_ARRAY, offsetof (struct undecided_coding_stream, c), + 1, &chain_coding_stream_description }, { XD_END } }; +const struct sized_memory_description undecided_coding_stream_description = { + sizeof (struct undecided_coding_stream), undecided_coding_stream_description_1 +}; + +DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (undecided); + static void undecided_init (Lisp_Object codesys) { @@ -3359,6 +3369,7 @@ static void undecided_mark_coding_stream (struct coding_stream *str) { + mark_object (CODING_STREAM_TYPE_DATA (str, undecided)->actual); chain_mark_coding_stream_1 (&CODING_STREAM_TYPE_DATA (str, undecided)->c); } @@ -3449,7 +3460,7 @@ } invalid_constant ("Unrecognized coding category", symbol); - RETURN_NOT_REACHED (0) + RETURN_NOT_REACHED (0); } static Lisp_Object @@ -4271,8 +4282,6 @@ /* Gzip methods */ /************************************************************************/ -DEFINE_CODING_SYSTEM_TYPE (gzip); - struct gzip_coding_system { int level; /* 0 through 9, or -1 for default */ @@ -4291,11 +4300,13 @@ return LSTREAM_EOF */ }; -static const struct lrecord_description +static const struct memory_description gzip_coding_system_description[] = { { XD_END } }; +DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (gzip); + enum source_sink_type gzip_conversion_end_type (Lisp_Object codesys) { @@ -4597,14 +4608,6 @@ DEFSYMBOL (Qgzip); #endif - /* WARNING: The existing categories are intimately tied to the function - `coding-system-category' in coding.el. If you change a category, or - change the layout of any coding system associated with a category, you - need to check that function and make sure it's written properly. */ - -#ifdef HAVE_DEFAULT_EOL_DETECTION - Fprovide (intern ("unix-default-eol-detection")); -#endif } void @@ -4640,7 +4643,7 @@ for (i = 0; i < MAX_DETECTOR_CATEGORIES; i++) { coding_category_system[i] = Qnil; - dump_add_root_object (&coding_category_system[i]); + dump_add_root_lisp_object (&coding_category_system[i]); coding_category_by_priority[i] = i; } @@ -4752,6 +4755,15 @@ /* We always have file-coding support */ Fprovide (intern ("file-coding")); + +#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 + change the layout of any coding system associated with a category, you + need to check that function and make sure it's written properly. */ + + Fprovide (intern ("unix-default-eol-detection")); +#endif DEFVAR_LISP ("keyboard-coding-system", &Vkeyboard_coding_system /* Coding system used for TTY keyboard input. Index: src/file-coding.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/file-coding.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- src/file-coding.h 1 Sep 2002 06:41:45 -0000 1.19 +++ src/file-coding.h 12 Jan 2003 11:08:15 -0000 1.20 @@ -162,7 +162,7 @@ struct coding_stream; struct detection_state; -extern const struct struct_description coding_system_methods_description; +extern const struct sized_memory_description coding_system_methods_description; struct coding_system_methods; @@ -187,73 +187,18 @@ struct lcrecord_header header; struct coding_system_methods *methods; - /* Name and description of this coding system. The description - should be suitable for a menu entry. */ - Lisp_Object name; - Lisp_Object description; - - /* Mnemonic string displayed in the modeline when this coding - system is active for a particular buffer. */ - Lisp_Object mnemonic; - - /* Long documentation on the coding system. */ - Lisp_Object documentation; - /* Functions to handle additional conversion after reading or before - writing. #### This mechanism should be replaced by the ability to - simply create new coding system types. */ - Lisp_Object post_read_conversion; - Lisp_Object pre_write_conversion; - - /* If this coding system is not of the correct type for text file - conversion (i.e. decodes byte->char), we wrap it with appropriate - char<->byte converters. This is created dynamically, when it's - needed, and cached here. */ - Lisp_Object text_file_wrapper; - /* If true, this is an internal coding system, which will not show up in coding-system-list unless a special parameter is given to it. */ int internal_p; - /* ------------------------ junk to handle EOL ------------------------- - I had hoped that we could handle this without lots of special-case - code, but it appears not to be the case if we want to maintain - compatibility with the existing way. However, at least with the way - we do things now, we avoid EOL junk in most of the coding system - methods themselves, or in the decode/encode functions. The EOL - special-case code is limited to coding-system creation and to the - convert-eol and undecided coding system types. */ - - /* If this coding system wants autodetection of the EOL type, then at the - appropriate time we wrap this coding system with - convert-eol-autodetect. (We do NOT do this at creation time because - then we end up with multiple convert-eols wrapped into the final - result -- esp. with autodetection using `undecided' -- leading to a - big mess.) We cache the wrapped coding system here. */ - Lisp_Object auto_eol_wrapper; - - /* Eol type requested by user. */ +#define CODING_SYSTEM_SLOT_DECLARATION +#define MARKED_SLOT(x) Lisp_Object x; +#include "coding-system-slots.h" + + /* Eol type requested by user. See comment about EOL junk in + coding-system-slots.h. */ enum eol_type eol_type; - /* Subsidiary coding systems that specify a particular type of EOL - marking, rather than autodetecting it. These will only be non-nil - if (eol_type == EOL_AUTODETECT). These are chains. */ - Lisp_Object eol[3]; - /* If this coding system is a subsidiary, this element points back to its - parent. */ - Lisp_Object subsidiary_parent; - - /* At decoding or encoding time, we use the following coding system, if - it exists, in place of the coding system object. This is how we - handle coding systems with EOL types of CRLF or CR. Formerly, we did - the canonicalization at creation time, returning a chain in place of - the original coding system; but that interferes with - `coding-system-property' and causes other complications. CANONICAL is - used when determining the end types of a coding system. - canonicalize-after-coding also consults CANONICAL (it has to, because - the data in the lstream is based on CANONICAL, not on the original - coding system). */ - Lisp_Object canonical; - /* type-specific extra data attached to a coding_system */ char data[1]; }; @@ -266,11 +211,34 @@ #define CHECK_CODING_SYSTEM(x) CHECK_RECORD (x, coding_system) #define CONCHECK_CODING_SYSTEM(x) CONCHECK_RECORD (x, coding_system) +enum coding_system_variant +{ + no_conversion_coding_system, + convert_eol_coding_system, + undecided_coding_system, + chain_coding_system, + text_file_wrapper_coding_system, + internal_coding_system, + gzip_coding_system, + mswindows_multibyte_to_unicode_coding_system, + mswindows_multibyte_coding_system, + iso2022_coding_system, + ccl_coding_system, + shift_jis_coding_system, + big5_coding_system, + unicode_coding_system, +}; + struct coding_system_methods { Lisp_Object type; Lisp_Object predicate_symbol; + /* Type expressed as an enum, needed for KKCC marking of the + type-specific lstream data; copied into the struct coding_stream. */ + + enum coding_system_variant enumtype; + /* Implementation specific methods: */ /* Init method: Initialize coding-system data. Optional. */ @@ -401,9 +369,8 @@ INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA. */ /* Description of the extra data (struct foo_coding_system) attached to a - coding system, for pdump purposes. NOTE: All offsets must have - coding_system_data_offset added to them! */ - const struct lrecord_description *extra_description; + coding system, for pdump purposes. */ + const struct sized_memory_description *extra_description; /* size of struct foo_coding_system -- extra data associated with the coding system */ int extra_data_size; @@ -445,8 +412,7 @@ /***** Defining new coding-system types *****/ -#define coding_system_data_offset (offsetof (Lisp_Coding_System, data)) -extern const struct lrecord_description coding_system_empty_extra_description[]; +extern const struct sized_memory_description coding_system_empty_extra_description; #ifdef ERROR_CHECK_TYPES #define DECLARE_CODING_SYSTEM_TYPE(type) \ @@ -492,12 +458,21 @@ #define DEFINE_CODING_SYSTEM_TYPE(type) \ struct coding_system_methods * type##_coding_system_methods +#define DEFINE_CODING_SYSTEM_TYPE_WITH_DATA(type) \ +struct coding_system_methods * type##_coding_system_methods; \ +static const struct sized_memory_description \ + type##_coding_system_description_0 = { \ + sizeof (struct type##_coding_system), \ + type##_coding_system_description \ +} + #define INITIALIZE_CODING_SYSTEM_TYPE(ty, pred_sym) do { \ ty##_coding_system_methods = \ xnew_and_zero (struct coding_system_methods); \ ty##_coding_system_methods->type = Q##ty; \ ty##_coding_system_methods->extra_description = \ - coding_system_empty_extra_description; \ + &coding_system_empty_extra_description; \ + ty##_coding_system_methods->enumtype = ty##_coding_system; \ defsymbol_nodump (&ty##_coding_system_methods->predicate_symbol, \ pred_sym); \ add_entry_to_coding_system_type_list (ty##_coding_system_methods); \ @@ -514,11 +489,10 @@ struct foo_coding_system (attached to the coding system) struct foo_coding_stream (per coding process, attached to the struct coding_stream) - const struct foo_coding_system_description[] (pdump description of - struct foo_coding_system) + const struct memory_description foo_coding_system_description[] + (data description of struct foo_coding_system) - NOTE: The description must have coding_system_data_offset added to - all offsets in it! For an example of how to do things, see + For an example of how to do the description, see chain_coding_system_description. */ #define INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA(type, pred_sym) \ @@ -527,7 +501,7 @@ type##_coding_system_methods->extra_data_size = \ sizeof (struct type##_coding_system); \ type##_coding_system_methods->extra_description = \ - type##_coding_system_description; \ + &type##_coding_system_description_0; \ type##_coding_system_methods->coding_data_size = \ sizeof (struct type##_coding_stream); \ } while (0) @@ -868,6 +842,14 @@ struct coding_stream { + /* Enumerated constant listing which type of console this is (TTY, X, + MS-Windows, etc.). This duplicates the method structure in + XCODING_SYSTEM (str->codesys)->methods->type, which formerly was the + only way to determine the coding system type. We need this constant + now for KKCC, so that it can be used in an XD_UNION clause to + determine the Lisp objects in the type-specific data. */ + enum coding_system_variant type; + /* Coding system that governs the conversion. */ Lisp_Object codesys; /* Original coding system, pre-canonicalization. */ Index: src/fileio.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/fileio.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -r1.95 -r1.96 --- src/fileio.c 27 Nov 2002 07:15:12 -0000 1.95 +++ src/fileio.c 12 Jan 2003 11:08:15 -0000 1.96 @@ -1568,7 +1568,7 @@ qxestrncpy (target, o, s - o); target[s - o] = 0; #ifdef WIN32_NATIVE - strupr (target); /* $home == $HOME etc. */ + qxestrupr (target); /* $home == $HOME etc. */ #endif /* WIN32_NATIVE */ /* Get variable value */ @@ -1619,7 +1619,7 @@ qxestrncpy (target, o, s - o); target[s - o] = 0; #ifdef WIN32_NATIVE - strupr (target); /* $home == $HOME etc. */ + qxestrupr (target); /* $home == $HOME etc. */ #endif /* WIN32_NATIVE */ /* Get variable value */ @@ -1663,7 +1663,7 @@ syntax_error_2 ("Substituting nonexistent environment variable", filename, build_intstring (target)); - RETURN_NOT_REACHED (Qnil) + RETURN_NOT_REACHED (Qnil); } /* A slightly faster and more convenient way to get Index: src/floatfns.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/floatfns.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/floatfns.c 12 Nov 2002 18:58:29 -0000 1.15 +++ src/floatfns.c 12 Jan 2003 11:08:15 -0000 1.16 @@ -178,22 +178,15 @@ return (unsigned long) fmod (extract_float (obj), 4e9); } -static const struct lrecord_description float_description[] = { +static const struct memory_description float_description[] = { { XD_END } }; -#ifdef USE_KKCC DEFINE_BASIC_LRECORD_IMPLEMENTATION ("float", float, 1, /*dumpable-flag*/ mark_float, print_float, 0, float_equal, float_hash, float_description, Lisp_Float); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("float", float, - mark_float, print_float, 0, float_equal, - float_hash, float_description, - Lisp_Float); -#endif /* not USE_KKCC */ /* Extract a Lisp number as a `double', or signal an error. */ Index: src/fns.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/fns.c,v retrieving revision 1.52 retrieving revision 1.54 diff -u -r1.52 -r1.54 --- src/fns.c 24 Oct 2002 13:55:49 -0000 1.52 +++ src/fns.c 6 Feb 2003 06:36:03 -0000 1.54 @@ -1,6 +1,6 @@ /* Random utility Lisp functions. Copyright (C) 1985, 86, 87, 93, 94, 95 Free Software Foundation, Inc. - 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. @@ -64,8 +64,6 @@ static int internal_old_equal (Lisp_Object, Lisp_Object, int); Lisp_Object safe_copy_tree (Lisp_Object arg, Lisp_Object vecp, int depth); -int require_prints_loading_message; - static Lisp_Object mark_bit_vector (Lisp_Object obj) { @@ -125,26 +123,20 @@ BIT_VECTOR_LONG_STORAGE (bit_vector_length (v))); } -static const struct lrecord_description bit_vector_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Bit_Vector, next) }, +static const struct memory_description bit_vector_description[] = { { XD_END } }; -#ifdef USE_KKCC -DEFINE_BASIC_LRECORD_SEQUENCE_IMPLEMENTATION ("bit-vector", bit_vector, - 1, /*dumpable-flag*/ - mark_bit_vector, print_bit_vector, 0, - bit_vector_equal, bit_vector_hash, - bit_vector_description, size_bit_vector, - Lisp_Bit_Vector); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_SEQUENCE_IMPLEMENTATION ("bit-vector", bit_vector, - mark_bit_vector, print_bit_vector, 0, - bit_vector_equal, bit_vector_hash, - bit_vector_description, size_bit_vector, - Lisp_Bit_Vector); -#endif /* not USE_KKCC */ +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("bit-vector", bit_vector, + 1, /*dumpable-flag*/ + mark_bit_vector, + print_bit_vector, 0, + bit_vector_equal, + bit_vector_hash, + bit_vector_description, + size_bit_vector, + Lisp_Bit_Vector); DEFUN ("identity", Fidentity, 1, 1, 0, /* @@ -3571,7 +3563,7 @@ Vautoload_queue = Qt; tem = call4 (Qload, NILP (filename) ? Fsymbol_name (feature) : filename, - noerror, require_prints_loading_message ? Qrequire : Qt, Qnil); + noerror, Qrequire, Qnil); /* If load failed entirely, return nil. */ if (NILP (tem)) return unbind_to_1 (speccount, Qnil); @@ -3670,7 +3662,7 @@ while (1) { - Ibyte c; + Ibyte c = 0; if (!ADVANCE_INPUT (c, istream)) break; @@ -4078,11 +4070,6 @@ char c = SEPCHAR; Vpath_separator = make_string ((Ibyte *) &c, 1); } - - DEFVAR_BOOL ("require-prints-loading-message", - &require_prints_loading_message /* -If non-nil, every time a file is loaded by `require' a message is printed. -*/ ); } void Index: src/font-lock.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/font-lock.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/font-lock.c 5 Jun 2002 09:55:43 -0000 1.13 +++ src/font-lock.c 14 Feb 2003 09:50:17 -0000 1.14 @@ -1,7 +1,7 @@ /* Routines to compute the current syntactic context, for font-lock mode. Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -562,7 +562,7 @@ else if (context_cache.context == context_none) { Lisp_Object stringtermobj = - syntax_match (scache->current_syntax_table, c); + syntax_match (scache->syntax_table, c); Ichar stringterm; if (CHARP (stringtermobj)) Index: src/frame-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame-gtk.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/frame-gtk.c 20 Jun 2002 21:18:31 -0000 1.10 +++ src/frame-gtk.c 12 Jan 2003 11:08:15 -0000 1.11 @@ -1,6 +1,6 @@ /* Functions for the X window system. Copyright (C) 1989, 1992-5, 1997 Free Software Foundation, Inc. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2002 Ben Wing. This file is part of XEmacs. @@ -94,6 +94,20 @@ #endif +static const struct memory_description gtk_frame_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap) }, + { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap_mask) }, + { XD_LISP_OBJECT_ARRAY, offsetof (struct gtk_frame, lisp_visible_widgets), + 3 }, + { XD_END } +}; + +extern const struct sized_memory_description gtk_frame_data_description; + +const struct sized_memory_description gtk_frame_data_description = { + sizeof (struct gtk_frame), gtk_frame_data_description_1 +}; + /************************************************************************/ /* helper functions */ @@ -743,7 +757,8 @@ if (!NILP (dtyp) && STRINGP (dtyp)) dnd_typ = gdk_atom_intern (XSTRING_DATA (dtyp), FALSE); - gtk_drag_begin (wid, tl, GDK_ACTION_COPY, lisp_event->event.button.button, NULL); + gtk_drag_begin (wid, tl, GDK_ACTION_COPY, + EVENT_BUTTON_BUTTON (lisp_event), NULL); Vcurrent_drag_object = data; Index: src/frame-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame-impl.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/frame-impl.h 6 Jul 2002 21:05:52 -0000 1.3 +++ src/frame-impl.h 12 Jan 2003 11:08:16 -0000 1.4 @@ -47,6 +47,9 @@ through frame->device->console, but it's faster this way. */ struct console_methods *framemeths; + /* Duplicates framemeths->symbol. See comment in struct console. */ + enum console_variant frametype; + /* Size of text only area of this frame, excluding scrollbars, toolbars and end of line glyphs. The size can be in characters or pixels, depending on units in which window system resizes @@ -109,12 +112,13 @@ display_line_dynarr *current_display_lines[4]; display_line_dynarr *desired_display_lines[4]; - /* A structure of auxiliary data specific to the device type. - struct x_frame is for X window frames; defined in console-x-impl.h */ + /* A structure of auxiliary data specific to the device type. For + example, struct x_frame is for X window frames; defined in + console-x-impl.h. */ void *frame_data; #define FRAME_SLOT_DECLARATION -#define MARKED_SLOT(x) Lisp_Object x +#define MARKED_SLOT(x) Lisp_Object x; #include "frameslots.h" /* Nonzero if frame is currently displayed. Index: src/frame-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame-msw.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- src/frame-msw.c 30 Nov 2002 08:10:25 -0000 1.49 +++ src/frame-msw.c 12 Jan 2003 11:08:16 -0000 1.50 @@ -81,6 +81,23 @@ frame Lisp_Object already protected by Fmake_frame */ Lisp_Object Vmswindows_frame_being_created; +static const struct memory_description mswindows_frame_data_description_1 [] = { +#ifdef HAVE_TOOLBARS + { XD_LISP_OBJECT, offsetof (struct mswindows_frame, toolbar_hash_table) }, +#endif + { XD_LISP_OBJECT, offsetof (struct mswindows_frame, menu_hash_table) }, + { XD_LISP_OBJECT, offsetof (struct mswindows_frame, widget_hash_table1) }, + { XD_LISP_OBJECT, offsetof (struct mswindows_frame, widget_hash_table2) }, + { XD_LISP_OBJECT, offsetof (struct mswindows_frame, widget_hash_table3) }, + { XD_END } +}; + +extern const struct sized_memory_description mswindows_frame_data_description; + +const struct sized_memory_description mswindows_frame_data_description = { + sizeof (struct mswindows_frame), mswindows_frame_data_description_1 +}; + /*---------------------------------------------------------------------*/ /*----- DISPLAY FRAME -----*/ /*---------------------------------------------------------------------*/ Index: src/frame-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame-x.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- src/frame-x.c 2 Oct 2002 09:31:19 -0000 1.58 +++ src/frame-x.c 12 Jan 2003 11:08:16 -0000 1.59 @@ -70,6 +70,18 @@ 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, icon_pixmap) }, + { XD_LISP_OBJECT, offsetof (struct x_frame, icon_pixmap_mask) }, + { XD_END } +}; + +extern const struct sized_memory_description x_frame_data_description; + +const struct sized_memory_description x_frame_data_description = { + sizeof (struct x_frame), x_frame_data_description_1 +}; + EXFUN (Fx_window_id, 1); @@ -1096,31 +1108,31 @@ x_event.xbutton.root = XRootWindow(x_event.xbutton.display, 0); x_event.xbutton.subwindow = 0; x_event.xbutton.time = lisp_event->timestamp; - x_event.xbutton.x = lisp_event->event.button.x; - x_event.xbutton.y = lisp_event->event.button.y; + x_event.xbutton.x = EVENT_BUTTON_X (lisp_event); + x_event.xbutton.y = EVENT_BUTTON_Y (lisp_event); if (Success == XGetWindowAttributes (x_event.xbutton.display, x_event.xbutton.window, &win_attrib)) { - x_event.xbutton.x_root = win_attrib.x + lisp_event->event.button.x; - x_event.xbutton.y_root = win_attrib.y + lisp_event->event.button.y; + x_event.xbutton.x_root = win_attrib.x + EVENT_BUTTON_X (lisp_event); + x_event.xbutton.y_root = win_attrib.y + EVENT_BUTTON_Y (lisp_event); } else { - x_event.xbutton.x_root = lisp_event->event.button.x; /* this is wrong */ - x_event.xbutton.y_root = lisp_event->event.button.y; + x_event.xbutton.x_root = EVENT_BUTTON_X (lisp_event); /* this is wrong */ + x_event.xbutton.y_root = EVENT_BUTTON_Y (lisp_event); } - modifier = lisp_event->event.button.modifiers; + modifier = EVENT_BUTTON_MODIFIERS (lisp_event); if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; - state |= Button1Mask << (lisp_event->event.button.button-1); + state |= Button1Mask << (EVENT_BUTTON_BUTTON (lisp_event)-1); x_event.xbutton.state = state; - x_event.xbutton.button = lisp_event->event.button.button; + x_event.xbutton.button = EVENT_BUTTON_BUTTON (lisp_event); x_event.xkey.same_screen = True; /* convert data strings into a big string */ @@ -1361,32 +1373,32 @@ x_event.xbutton.root = XRootWindow(x_event.xkey.display, 0); x_event.xbutton.subwindow = 0; x_event.xbutton.time = lisp_event->timestamp; - x_event.xbutton.x = lisp_event->event.button.x; - x_event.xbutton.y = lisp_event->event.button.y; + x_event.xbutton.x = EVENT_BUTTON_X (lisp_event); + x_event.xbutton.y = EVENT_BUTTON_Y (lisp_event); if (Success == XGetWindowAttributes (x_event.xbutton.display, x_event.xbutton.window, &win_attrib)) { - x_event.xbutton.x_root = win_attrib.x + lisp_event->event.button.x; - x_event.xbutton.y_root = win_attrib.y + lisp_event->event.button.y; + x_event.xbutton.x_root = win_attrib.x + EVENT_BUTTON_X (lisp_event); + x_event.xbutton.y_root = win_attrib.y + EVENT_BUTTON_Y (lisp_event); } else { - x_event.xbutton.x_root = lisp_event->event.button.x; /* this is wrong */ - x_event.xbutton.y_root = lisp_event->event.button.y; + x_event.xbutton.x_root = EVENT_BUTTON_X (lisp_event); /* this is wrong */ + x_event.xbutton.y_root = EVENT_BUTTON_Y (lisp_event); } - modifier = lisp_event->event.button.modifiers; + modifier = EVENT_BUTTON_MODIFIERS (lisp_event); if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; - state |= Button1Mask << (lisp_event->event.button.button-1); + state |= Button1Mask << (EVENT_BUTTON_BUTTON (lisp_event)-1); x_event.xbutton.state = state; - x_event.xbutton.button = lisp_event->event.button.button; + x_event.xbutton.button = EVENT_BUTTON_BUTTON (lisp_event); x_event.xkey.same_screen = True; DndSetData(dnd_typ, (unsigned char *)dnd_data, dnd_len); Index: src/frame.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- src/frame.c 16 Dec 2002 02:32:54 -0000 1.58 +++ src/frame.c 12 Jan 2003 11:08:16 -0000 1.59 @@ -137,12 +137,85 @@ static Ichar_dynarr *title_string_ichar_dynarr; + +extern const struct sized_memory_description gtk_frame_data_description; +extern const struct sized_memory_description mswindows_frame_data_description; +extern const struct sized_memory_description x_frame_data_description; + +static const struct memory_description frame_data_description_1 []= { +#ifdef HAVE_GTK + { XD_STRUCT_PTR, gtk_console, 1, >k_frame_data_description}, +#endif +#ifdef HAVE_MS_WINDOWS + { XD_STRUCT_PTR, mswindows_console, 1, &mswindows_frame_data_description}, +#endif +#ifdef HAVE_X_WINDOWS + { XD_STRUCT_PTR, x_console, 1, &x_frame_data_description}, +#endif + { XD_END } +}; + +static const struct sized_memory_description frame_data_description = { + sizeof (void *), frame_data_description_1 +}; + +extern const struct sized_memory_description expose_ignore_description; + +static const struct memory_description expose_ignore_description_1 [] = { + { XD_STRUCT_PTR, offsetof (struct expose_ignore, next), + 1, &expose_ignore_description }, + { XD_END } +}; + +const struct sized_memory_description expose_ignore_description = { + sizeof (struct expose_ignore), + expose_ignore_description_1 +}; + +static const struct memory_description display_line_dynarr_pointer_description_1 []= { + { XD_STRUCT_PTR, 0, 1, &display_line_dynarr_description}, + { XD_END } +}; + +static const struct sized_memory_description display_line_dynarr_pointer_description = { + sizeof (display_line_dynarr *), display_line_dynarr_pointer_description_1 +}; + +static const struct memory_description frame_description [] = { + { XD_INT, offsetof (struct frame, frametype) }, +#define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (struct frame, x) }, +#define MARKED_SLOT_ARRAY(slot, size) \ + { XD_LISP_OBJECT_ARRAY, offsetof (struct frame, slot), size }, +#include "frameslots.h" + + { XD_STRUCT_PTR, offsetof (struct frame, subwindow_exposures), + 1, &expose_ignore_description }, + { XD_STRUCT_PTR, offsetof (struct frame, subwindow_exposures_tail), + 1, &expose_ignore_description }, + +#ifdef HAVE_SCROLLBARS + { XD_LISP_OBJECT, offsetof (struct frame, sb_vcache) }, + { XD_LISP_OBJECT, offsetof (struct frame, sb_hcache) }, +#endif /* HAVE_SCROLLBARS */ + + { XD_STRUCT_ARRAY, offsetof (struct frame, current_display_lines), + 4, &display_line_dynarr_pointer_description }, + { XD_STRUCT_ARRAY, offsetof (struct frame, desired_display_lines), + 4, &display_line_dynarr_pointer_description }, + + { XD_STRUCT_PTR, offsetof (struct frame, framemeths), 1, + &console_methods_description }, + { XD_UNION, offsetof (struct frame, frame_data), + XD_INDIRECT (0, 0), &frame_data_description }, + { XD_END } +}; + static Lisp_Object mark_frame (Lisp_Object obj) { struct frame *f = XFRAME (obj); -#define MARKED_SLOT(x) mark_object (f->x) +#define MARKED_SLOT(x) mark_object (f->x); #include "frameslots.h" if (FRAME_LIVE_P (f)) /* device is nil for a dead frame */ @@ -175,23 +248,18 @@ write_fmt_string (printcharfun, " 0x%x>", frm->header.uid); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("frame", frame, 0, /*dumpable-flag*/ - mark_frame, print_frame, 0, 0, 0, 0, + mark_frame, print_frame, 0, 0, 0, + frame_description, struct frame); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("frame", frame, - mark_frame, print_frame, 0, 0, 0, 0, - struct frame); -#endif /* not USE_KKCC */ static void nuke_all_frame_slots (struct frame *f) { zero_lcrecord (f); -#define MARKED_SLOT(x) f->x = Qnil +#define MARKED_SLOT(x) f->x = Qnil; #include "frameslots.h" } @@ -212,6 +280,7 @@ f->device = device; f->framemeths = XDEVICE (device)->devmeths; + f->frametype = get_console_variant (XDEVICE_TYPE (device)); f->buffer_alist = Fcopy_sequence (Vbuffer_alist); root_window = allocate_window (); @@ -584,9 +653,9 @@ if (!UNBOUNDP (symbol_function (XSYMBOL (Qcustom_initialize_frame)))) call1 (Qcustom_initialize_frame, frame); + UNGCPRO; unbind_to (speccount); - UNGCPRO; return frame; } @@ -1749,6 +1818,7 @@ nuke_all_frame_slots (f); f->framemeths = dead_console_methods; + f->frametype = dead_console; note_object_deleted (frame); @@ -1919,17 +1989,10 @@ if (mouse_pixel_position_1 (d, &frame, &intx, &inty)) { Lisp_Object event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, pointer_motion_event); XSET_EVENT_CHANNEL (event, frame); - XSET_MOTION_DATA_X (XEVENT_DATA (event), intx); - XSET_MOTION_DATA_Y (XEVENT_DATA (event), inty); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = pointer_motion_event; - XEVENT (event)->channel = frame; - XEVENT (event)->event.motion.x = intx; - XEVENT (event)->event.motion.y = inty; -#endif /* not USE_KKCC */ + XSET_EVENT_MOTION_X (event, intx); + XSET_EVENT_MOTION_Y (event, inty); return event; } else Index: src/frameslots.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frameslots.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/frameslots.h 4 Feb 2002 15:44:52 -0000 1.7 +++ src/frameslots.h 12 Jan 2003 11:08:16 -0000 1.8 @@ -1,6 +1,6 @@ /* Definitions of marked slots in frames Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1996 Ben Wing. + Copyright (C) 1996, 2002 Ben Wing. This file is part of XEmacs. @@ -30,6 +30,7 @@ definition, you also need to define FRAME_SLOT_DECLARATION. No need to undefine either value; that happens automatically. */ +#ifndef MARKED_SLOT_ARRAY #ifdef FRAME_SLOT_DECLARATION #define MARKED_SLOT_ARRAY(slot, size) MARKED_SLOT(slot[size]) #else @@ -37,13 +38,14 @@ int mslotidx; \ for (mslotidx = 0; mslotidx < size; mslotidx++) \ { \ - MARKED_SLOT (slot[mslotidx]); \ + MARKED_SLOT (slot[mslotidx]) \ } \ } while (0); #endif +#endif /* not MARKED_SLOT_ARRAY */ /* device frame belongs to. */ - MARKED_SLOT (device); + MARKED_SLOT (device) /* Name of this frame: a Lisp string. NOT the same as the frame's title, even though FSF bogusly @@ -51,7 +53,7 @@ and lookup purposes and is something you can count on having a specific value, while the frame's title may vary depending on the user's choice of `frame-title-format'. */ - MARKED_SLOT (name); + MARKED_SLOT (name) /* The frame which should receive keystrokes that occur in this frame, or nil if they should go to the frame itself. This is @@ -64,108 +66,108 @@ to shift from one frame to the other, any redirections to the original frame are shifted to the newly selected frame; if focus_frame is nil, Fselect_frame will leave it alone. */ - MARKED_SLOT (focus_frame); + MARKED_SLOT (focus_frame) /* This frame's root window. Every frame has one. If the frame has only a minibuffer window, this is it. Otherwise, if the frame has a minibuffer window, this is its sibling. */ - MARKED_SLOT (root_window); + MARKED_SLOT (root_window) /* This frame's selected window. Each frame has its own window hierarchy and one of the windows in it is selected within the frame. The selected window of the selected frame is Emacs's selected window. */ - MARKED_SLOT (selected_window); + MARKED_SLOT (selected_window) /* This frame's minibuffer window. Most frames have their own minibuffer windows, but only the selected frame's minibuffer window can actually appear to exist. */ - MARKED_SLOT (minibuffer_window); + MARKED_SLOT (minibuffer_window) /* The most recently selected nonminibuf window. This is used by things like the toolbar code, which doesn't want the toolbar to change when moving to the minibuffer. This will only be a minibuf window if we are a minibuf-only frame. */ - MARKED_SLOT (last_nonminibuf_window); + MARKED_SLOT (last_nonminibuf_window) /* This frame's root window mirror. This structure exactly mirrors the frame's window structure but contains only pointers to the display structures. */ - MARKED_SLOT (root_mirror); + MARKED_SLOT (root_mirror) /* frame property list */ - MARKED_SLOT (plist); + MARKED_SLOT (plist) /* buffer_alist at last redisplay. */ - MARKED_SLOT (old_buffer_alist); + MARKED_SLOT (old_buffer_alist) /* A copy of the global Vbuffer_list, to maintain a per-frame buffer ordering. The Vbuffer_list variable and the buffer_list slot of each frame contain exactly the same data, just in different orders. */ - MARKED_SLOT (buffer_alist); + MARKED_SLOT (buffer_alist) /* Predicate for selecting buffers for other-buffer. */ - MARKED_SLOT (buffer_predicate); + MARKED_SLOT (buffer_predicate) /* The current mouse pointer for the frame. This is set by calling `set-frame-pointer'. */ - MARKED_SLOT (pointer); + MARKED_SLOT (pointer) /* The current icon for the frame. */ - MARKED_SLOT (icon); + MARKED_SLOT (icon) #ifdef HAVE_MENUBARS /* Vector representing the menubar currently displayed. See menubar-x.c. */ - MARKED_SLOT (menubar_data); + MARKED_SLOT (menubar_data) #endif /* specifier values cached in the struct frame: */ #ifdef HAVE_MENUBARS - MARKED_SLOT (menubar_visible_p); + MARKED_SLOT (menubar_visible_p) #endif #ifdef HAVE_SCROLLBARS /* Width and height of the scrollbars. */ - MARKED_SLOT (scrollbar_width); - MARKED_SLOT (scrollbar_height); + MARKED_SLOT (scrollbar_width) + MARKED_SLOT (scrollbar_height) /* Whether the scrollbars are visible */ - MARKED_SLOT (horizontal_scrollbar_visible_p); - MARKED_SLOT (vertical_scrollbar_visible_p); + MARKED_SLOT (horizontal_scrollbar_visible_p) + MARKED_SLOT (vertical_scrollbar_visible_p) /* Scrollbars location */ - MARKED_SLOT (scrollbar_on_left_p); - MARKED_SLOT (scrollbar_on_top_p); + MARKED_SLOT (scrollbar_on_left_p) + MARKED_SLOT (scrollbar_on_top_p) #endif #ifdef HAVE_TOOLBARS /* The following three don't really need to be cached except that we need to know when they've changed. */ - MARKED_SLOT (default_toolbar_width); - MARKED_SLOT (default_toolbar_height); - MARKED_SLOT (default_toolbar_visible_p); - MARKED_SLOT (default_toolbar_border_width); - MARKED_SLOT (toolbar_shadow_thickness); + MARKED_SLOT (default_toolbar_width) + MARKED_SLOT (default_toolbar_height) + MARKED_SLOT (default_toolbar_visible_p) + MARKED_SLOT (default_toolbar_border_width) + MARKED_SLOT (toolbar_shadow_thickness) /* List of toolbar buttons of current toolbars */ - MARKED_SLOT_ARRAY (toolbar_buttons, 4); + MARKED_SLOT_ARRAY (toolbar_buttons, 4) /* Size of the toolbars. The frame-local toolbar space is subtracted before the windows are arranged. Window and buffer local toolbars overlay their windows. */ - MARKED_SLOT_ARRAY (toolbar_size, 4); + MARKED_SLOT_ARRAY (toolbar_size, 4) /* Visibility of the toolbars. This acts as a valve for toolbar_size. */ - MARKED_SLOT_ARRAY (toolbar_visible_p, 4); + MARKED_SLOT_ARRAY (toolbar_visible_p, 4) /* Thickness of the border around the toolbar. */ - MARKED_SLOT_ARRAY (toolbar_border_width, 4); + MARKED_SLOT_ARRAY (toolbar_border_width, 4) #endif /* Cache of subwindow instances for this frame */ - MARKED_SLOT (subwindow_instance_cache); + MARKED_SLOT (subwindow_instance_cache) /* Possible frame-local default for outside margin widths. */ - MARKED_SLOT (left_margin_width); - MARKED_SLOT (right_margin_width); + MARKED_SLOT (left_margin_width) + MARKED_SLOT (right_margin_width) #undef MARKED_SLOT #undef MARKED_SLOT_ARRAY Index: src/free-hook.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/free-hook.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/free-hook.c 29 Mar 2002 04:47:43 -0000 1.9 +++ src/free-hook.c 12 Jan 2003 11:08:16 -0000 1.10 @@ -26,9 +26,9 @@ * Trying to free a pointer not returned by malloc. * Trying to realloc a pointer not returned by malloc. - In addition, every word of every block freed is set to - 0xdeadbeef. This causes many uses of freed storage to be - trapped or recognized. + In addition, every word of every block freed is set to 0xdeadbeef + (-559038737). This causes many uses of freed storage to be trapped or + recognized. When you use this, the storage used by the last FREE_QUEUE_LIMIT calls to free() is not recycled. When you call free for the Nth Index: src/glyphs-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-msw.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- src/glyphs-msw.c 20 Jun 2002 21:18:33 -0000 1.45 +++ src/glyphs-msw.c 12 Jan 2003 11:08:16 -0000 1.46 @@ -2215,7 +2215,7 @@ Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain, - const CIbyte *class, int flags, int exflags) + const CIbyte *class_, int flags, int exflags) { /* this function can call lisp */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -2263,7 +2263,7 @@ gui_error ("window creation failed with code", make_int (GetLastError())); - C_STRING_TO_TSTR (class, classext); + C_STRING_TO_TSTR (class_, classext); if ((wnd = qxeCreateWindowEx (exflags /* | WS_EX_NOPARENTNOTIFY*/, classext, Index: src/glyphs-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-x.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- src/glyphs-x.c 18 Nov 2002 06:52:39 -0000 1.71 +++ src/glyphs-x.c 12 Jan 2003 11:08:16 -0000 1.72 @@ -24,7 +24,7 @@ /* Synched up with: Not in FSF. */ -/* 7-8-00 This file is more or less Mule-ized in my Mule workspace. */ +/* 7-8-00 This file is more or less Mule-ized. */ /* Original author: Jamie Zawinski for 19.8 font-truename stuff added by Jamie Zawinski for 19.10 @@ -187,14 +187,14 @@ vis = DEVICE_X_VISUAL (XDEVICE(device)); depth = DEVICE_X_DEPTH(XDEVICE(device)); - if (vis->class == GrayScale || vis->class == StaticColor || - vis->class == StaticGray) + if (vis->X_CLASSFIELD == GrayScale || vis->X_CLASSFIELD == StaticColor || + vis->X_CLASSFIELD == StaticGray) { /* #### Implement me!!! */ return NULL; } - if (vis->class == PseudoColor) + if (vis->X_CLASSFIELD == PseudoColor) { /* Quantize the image and get a histogram while we're at it. Do this first to save memory */ @@ -222,7 +222,7 @@ } outimg->data = (char *) data; - if (vis->class == PseudoColor) + if (vis->X_CLASSFIELD == PseudoColor) { unsigned long pixarray[256]; int pixcount, n; Index: src/glyphs.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- src/glyphs.c 29 Jul 2002 09:21:20 -0000 1.42 +++ src/glyphs.c 12 Jan 2003 11:08:16 -0000 1.43 @@ -406,7 +406,7 @@ invalid_argument ("Unable to interpret glyph instantiator", data); - RETURN_NOT_REACHED (Qnil) + RETURN_NOT_REACHED (Qnil); } Lisp_Object @@ -834,6 +834,77 @@ Lisp_Object Qimage_instancep; +/* %%#### KKCC: Don't yet handle the equivalent of setting the device field + of image instances w/dead devices to nil. */ + +static const struct memory_description text_image_instance_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct text_image_instance, string) }, + { XD_END } +}; + +static const struct sized_memory_description text_image_instance_description = { + sizeof (struct text_image_instance), text_image_instance_description_1 +}; + +static const struct memory_description pixmap_image_instance_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct pixmap_image_instance, hotspot_x) }, + { XD_LISP_OBJECT, offsetof (struct pixmap_image_instance, hotspot_x) }, + { XD_LISP_OBJECT, offsetof (struct pixmap_image_instance, filename) }, + { XD_LISP_OBJECT, offsetof (struct pixmap_image_instance, mask_filename) }, + { XD_LISP_OBJECT, offsetof (struct pixmap_image_instance, fg) }, + { XD_LISP_OBJECT, offsetof (struct pixmap_image_instance, bg) }, + { XD_LISP_OBJECT, offsetof (struct pixmap_image_instance, auxdata) }, + { XD_END } +}; + +static const struct sized_memory_description pixmap_image_instance_description = { + sizeof (struct pixmap_image_instance), pixmap_image_instance_description_1 +}; + +static const struct memory_description subwindow_image_instance_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct subwindow_image_instance, face) }, + { XD_LISP_OBJECT, offsetof (struct subwindow_image_instance, type) }, + { XD_LISP_OBJECT, offsetof (struct subwindow_image_instance, props) }, + { XD_LISP_OBJECT, offsetof (struct subwindow_image_instance, items) }, + { XD_LISP_OBJECT, offsetof (struct subwindow_image_instance, pending_items) }, + { XD_LISP_OBJECT, offsetof (struct subwindow_image_instance, children) }, + { XD_LISP_OBJECT, offsetof (struct subwindow_image_instance, width) }, + { XD_LISP_OBJECT, offsetof (struct subwindow_image_instance, height) }, + { XD_END } +}; + +static const struct sized_memory_description subwindow_image_instance_description = { + sizeof (struct subwindow_image_instance), subwindow_image_instance_description_1 +}; + +static const struct memory_description image_instance_data_description_1 [] = { + { XD_STRUCT_ARRAY, IMAGE_TEXT, + 1, &text_image_instance_description }, + { XD_STRUCT_ARRAY, IMAGE_MONO_PIXMAP, + 1, &pixmap_image_instance_description }, + { XD_STRUCT_ARRAY, IMAGE_COLOR_PIXMAP, + 1, &pixmap_image_instance_description }, + { XD_STRUCT_ARRAY, IMAGE_WIDGET, + 1, &subwindow_image_instance_description }, + { XD_END } +}; + +static const struct sized_memory_description image_instance_data_description = { + 0, image_instance_data_description_1 +}; + +static const struct memory_description image_instance_description[] = { + { XD_INT, offsetof (struct Lisp_Image_Instance, type) }, + { XD_LISP_OBJECT, offsetof (Lisp_Image_Instance, domain) }, + { XD_LISP_OBJECT, offsetof (Lisp_Image_Instance, device) }, + { XD_LISP_OBJECT, offsetof (Lisp_Image_Instance, name) }, + { XD_LISP_OBJECT, offsetof (Lisp_Image_Instance, parent) }, + { XD_LISP_OBJECT, offsetof (Lisp_Image_Instance, instantiator) }, + { XD_UNION, offsetof (struct Lisp_Image_Instance, u), + XD_INDIRECT (0, 0), &image_instance_data_description }, + { XD_END } +}; + static Lisp_Object mark_image_instance (Lisp_Object obj) { @@ -849,7 +920,7 @@ mark_object (i->name); mark_object (i->instantiator); - /* Is this legal in marking? We may get in the situation where the + /* #### Is this legal in marking? We may get in the situation where the domain has been deleted - making the instance unusable. It seems better to remove the domain so that it can be finalized. */ if (!DOMAIN_LIVE_P (i->domain)) @@ -1229,20 +1300,13 @@ 0)); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("image-instance", image_instance, 0, /*dumpable-flag*/ mark_image_instance, print_image_instance, finalize_image_instance, image_instance_equal, - image_instance_hash, 0, - Lisp_Image_Instance); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("image-instance", image_instance, - mark_image_instance, print_image_instance, - finalize_image_instance, image_instance_equal, - image_instance_hash, 0, + image_instance_hash, + image_instance_description, Lisp_Image_Instance); -#endif /* not USE_KKCC */ static Lisp_Object allocate_image_instance (Lisp_Object governing_domain, Lisp_Object parent, @@ -1252,7 +1316,6 @@ alloc_lcrecord_type (Lisp_Image_Instance, &lrecord_image_instance); Lisp_Object val; - zero_lcrecord (lp); /* It's not possible to simply keep a record of the domain in which the instance was instantiated. This is because caching may mean that the domain becomes invalid but the instance remains @@ -1267,16 +1330,12 @@ lp->device = DOMAIN_DEVICE (governing_domain); lp->type = IMAGE_NOTHING; lp->name = Qnil; - lp->x_offset = 0; - lp->y_offset = 0; lp->width = IMAGE_UNSPECIFIED_GEOMETRY; - lp->margin_width = 0; lp->height = IMAGE_UNSPECIFIED_GEOMETRY; lp->parent = parent; lp->instantiator = instantiator; /* So that layouts get done. */ lp->layout_changed = 1; - lp->initialized = 0; val = wrap_image_instance (lp); MARK_GLYPHS_CHANGED; @@ -3056,7 +3115,13 @@ * Image Specifier Object * ****************************************************************************/ -DEFINE_SPECIFIER_TYPE (image); +static const struct memory_description image_specifier_description[] = { + { XD_LISP_OBJECT, offsetof (struct image_specifier, attachee) }, + { XD_LISP_OBJECT, offsetof (struct image_specifier, attachee_property) }, + { XD_END } +}; + +DEFINE_SPECIFIER_TYPE_WITH_DATA (image); static void image_create (Lisp_Object obj) @@ -3683,7 +3748,7 @@ return result; } -static const struct lrecord_description glyph_description[] = { +static const struct memory_description glyph_description[] = { { XD_LISP_OBJECT, offsetof (Lisp_Glyph, image) }, { XD_LISP_OBJECT, offsetof (Lisp_Glyph, contrib_p) }, { XD_LISP_OBJECT, offsetof (Lisp_Glyph, baseline) }, @@ -3692,22 +3757,14 @@ { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("glyph", glyph, 1, /*dumpable-flag*/ mark_glyph, print_glyph, 0, - glyph_equal, glyph_hash, glyph_description, - glyph_getprop, glyph_putprop, - glyph_remprop, glyph_plist, - Lisp_Glyph); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("glyph", glyph, - mark_glyph, print_glyph, 0, - glyph_equal, glyph_hash, glyph_description, + glyph_equal, glyph_hash, + glyph_description, glyph_getprop, glyph_putprop, glyph_remprop, glyph_plist, Lisp_Glyph); -#endif /* not USE_KKCC */ Lisp_Object allocate_glyph (enum glyph_type type, @@ -4674,10 +4731,9 @@ ERROR_CHECK_IMAGE_INSTANCE (subwindow); - if (!image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) - & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK) - || - !IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii)) + if (!(image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) + & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK)) + || !IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii)) return; #ifdef DEBUG_WIDGETS @@ -4706,8 +4762,8 @@ ERROR_CHECK_IMAGE_INSTANCE (subwindow); - if (!image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) - & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK)) + if (!(image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) + & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK))) return; #ifdef DEBUG_WIDGETS @@ -5119,7 +5175,7 @@ /* Qbuffer defined in general.c. */ /* Qpointer defined above */ - /* Unfortunately, timeout handlers must be lisp functions. This is + /* Unfortunately, timeout handlers must be lisp functions. This is for animated glyphs. */ DEFSYMBOL (Qglyph_animated_timeout_handler); DEFSUBR (Fglyph_animated_timeout_handler); @@ -5128,12 +5184,6 @@ DEFERROR_STANDARD (Qimage_conversion_error, Qconversion_error); } -static const struct lrecord_description image_specifier_description[] = { - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct image_specifier, attachee) }, - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct image_specifier, attachee_property) }, - { XD_END } -}; - void specifier_type_create_image (void) { @@ -5157,49 +5207,49 @@ } -static const struct lrecord_description iike_description_1[] = { +static const struct memory_description iike_description_1[] = { { XD_LISP_OBJECT, offsetof (ii_keyword_entry, keyword) }, { XD_END } }; -static const struct struct_description iike_description = { +static const struct sized_memory_description iike_description = { sizeof (ii_keyword_entry), iike_description_1 }; -static const struct lrecord_description iiked_description_1[] = { +static const struct memory_description iiked_description_1[] = { XD_DYNARR_DESC (ii_keyword_entry_dynarr, &iike_description), { XD_END } }; -static const struct struct_description iiked_description = { +static const struct sized_memory_description iiked_description = { sizeof (ii_keyword_entry_dynarr), iiked_description_1 }; -static const struct lrecord_description iife_description_1[] = { +static const struct memory_description iife_description_1[] = { { XD_LISP_OBJECT, offsetof (image_instantiator_format_entry, symbol) }, { XD_LISP_OBJECT, offsetof (image_instantiator_format_entry, device) }, { XD_STRUCT_PTR, offsetof (image_instantiator_format_entry, meths), 1, &iim_description }, { XD_END } }; -static const struct struct_description iife_description = { +static const struct sized_memory_description iife_description = { sizeof (image_instantiator_format_entry), iife_description_1 }; -static const struct lrecord_description iifed_description_1[] = { +static const struct memory_description iifed_description_1[] = { XD_DYNARR_DESC (image_instantiator_format_entry_dynarr, &iife_description), { XD_END } }; -static const struct struct_description iifed_description = { +static const struct sized_memory_description iifed_description = { sizeof (image_instantiator_format_entry_dynarr), iifed_description_1 }; -static const struct lrecord_description iim_description_1[] = { +static const struct memory_description iim_description_1[] = { { XD_LISP_OBJECT, offsetof (struct image_instantiator_methods, symbol) }, { XD_LISP_OBJECT, offsetof (struct image_instantiator_methods, device) }, { XD_STRUCT_PTR, offsetof (struct image_instantiator_methods, keywords), 1, &iiked_description }, @@ -5207,7 +5257,7 @@ { XD_END } }; -const struct struct_description iim_description = { +const struct sized_memory_description iim_description = { sizeof (struct image_instantiator_methods), iim_description_1 }; Index: src/glyphs.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- src/glyphs.h 18 Nov 2002 06:52:39 -0000 1.34 +++ src/glyphs.h 12 Jan 2003 11:08:16 -0000 1.35 @@ -84,7 +84,7 @@ Dynarr_declare (ii_keyword_entry); } ii_keyword_entry_dynarr; -extern const struct struct_description iim_description; +extern const struct sized_memory_description iim_description; enum image_instance_geometry { @@ -537,6 +537,61 @@ x = wrong_type_argument (Qwidget_image_instance_p, (x)); \ } while (0) +struct text_image_instance +{ + int descent; + Lisp_Object string; +}; + +struct pixmap_image_instance +{ /* used for pointers as well */ + int depth; + int slice, maxslice, timeout; + Lisp_Object hotspot_x, hotspot_y; /* integer or Qnil */ + Lisp_Object filename; /* string or Qnil */ + Lisp_Object mask_filename; /* string or Qnil */ + Lisp_Object fg, bg; /* foreground and background colors, + if this is a colorized mono-pixmap + or a pointer */ + Lisp_Object auxdata; /* list or Qnil: any additional data + to be seen from lisp */ + void* mask; /* mask that can be seen from all windowing systems */ +}; + +struct subwindow_image_instance +{ + void* subwindow; /* specific devices can use this as necessary */ + struct + { /* We need these so we can do without + subwindow_cachel */ + int x, y; + int width, height; + } display_data; + unsigned int being_displayed : 1; /* used to detect when needs + to be unmapped */ + unsigned int v_resize : 1; /* Whether the vsize is allowed to change. */ + unsigned int h_resize : 1; /* Whether the hsize is allowed to change. */ + unsigned int orientation : 1; /* Vertical or horizontal. */ + unsigned int h_justification : 2; /* left, right or center. */ + unsigned int v_justification : 2; /* top, bottom or center. */ + /* Face for colors and font. We specify this here because we + want people to be able to put :face in the instantiator + spec. Using glyph-face is more inconvenient, although more + general. */ + Lisp_Object face; + Lisp_Object type; + Lisp_Object props; /* properties or border*/ + Lisp_Object items; /* a list of displayed gui_items */ + Lisp_Object pending_items; /* gui_items that should be displayed */ + Lisp_Object children; /* a list of children */ + Lisp_Object width; /* dynamic width spec. */ + Lisp_Object height; /* dynamic height spec. */ + /* Change flags to augment dirty. */ + unsigned int face_changed : 1; + unsigned int items_changed : 1; + unsigned int action_occurred : 1; +}; + struct Lisp_Image_Instance { struct lcrecord_header header; @@ -566,58 +621,9 @@ union { - struct - { - int descent; - Lisp_Object string; - } text; - struct - { - int depth; - int slice, maxslice, timeout; - Lisp_Object hotspot_x, hotspot_y; /* integer or Qnil */ - Lisp_Object filename; /* string or Qnil */ - Lisp_Object mask_filename; /* string or Qnil */ - Lisp_Object fg, bg; /* foreground and background colors, - if this is a colorized mono-pixmap - or a pointer */ - Lisp_Object auxdata; /* list or Qnil: any additional data - to be seen from lisp */ - void* mask; /* mask that can be seen from all windowing systems */ - } pixmap; /* used for pointers as well */ - struct - { - void* subwindow; /* specific devices can use this as necessary */ - struct - { /* We need these so we can do without - subwindow_cachel */ - int x, y; - int width, height; - } display_data; - unsigned int being_displayed : 1; /* used to detect when needs - to be unmapped */ - unsigned int v_resize : 1; /* Whether the vsize is allowed to change. */ - unsigned int h_resize : 1; /* Whether the hsize is allowed to change. */ - unsigned int orientation : 1; /* Vertical or horizontal. */ - unsigned int h_justification : 2; /* left, right or center. */ - unsigned int v_justification : 2; /* top, bottom or center. */ - /* Face for colors and font. We specify this here because we - want people to be able to put :face in the instantiator - spec. Using glyph-face is more inconvenient, although more - general. */ - Lisp_Object face; - Lisp_Object type; - Lisp_Object props; /* properties or border*/ - Lisp_Object items; /* a list of displayed gui_items */ - Lisp_Object pending_items; /* gui_items that should be displayed */ - Lisp_Object children; /* a list of children */ - Lisp_Object width; /* dynamic width spec. */ - Lisp_Object height; /* dynamic height spec. */ - /* Change flags to augment dirty. */ - unsigned int face_changed : 1; - unsigned int items_changed : 1; - unsigned int action_occurred : 1; - } subwindow; + struct text_image_instance text; + struct pixmap_image_instance pixmap; /* used for pointers as well */ + struct subwindow_image_instance subwindow; } u; /* console-type- and image-type-specific data */ Index: src/gmalloc.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gmalloc.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/gmalloc.c 13 Mar 2002 08:52:47 -0000 1.16 +++ src/gmalloc.c 12 Jan 2003 11:08:16 -0000 1.17 @@ -78,7 +78,7 @@ #endif /* _MALLOC_INTERNAL. */ -#ifdef __cplusplus +#if defined (__cplusplus) && !defined (emacs) extern "C" { #endif @@ -276,7 +276,7 @@ /* Pick up the current statistics. */ extern struct mstats mstats __P ((void)); -#ifdef __cplusplus +#if defined (__cplusplus) && !defined (emacs) } #endif Index: src/gpmevent.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gpmevent.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/gpmevent.c 29 Jul 2002 09:21:21 -0000 1.16 +++ src/gpmevent.c 12 Jan 2003 11:08:16 -0000 1.17 @@ -158,35 +158,19 @@ { case GPM_DOWN: case GPM_UP: -#ifdef USE_KKCC SET_EVENT_TYPE (event, (ev.type & GPM_DOWN) ? button_press_event : button_release_event); - XSET_BUTTON_DATA_X (EVENT_DATA (event), ev.x); - XSET_BUTTON_DATA_Y (EVENT_DATA (event), ev.y); - XSET_BUTTON_DATA_BUTTON (EVENT_DATA (event), button); - XSET_BUTTON_DATA_MODIFIERS (EVENT_DATA (event), modifiers); -#else /* not USE_KKCC */ - event->event_type = - (ev.type & GPM_DOWN) ? button_press_event : button_release_event; - event->event.button.x = ev.x; - event->event.button.y = ev.y; - event->event.button.button = button; - event->event.button.modifiers = modifiers; -#endif /* not USE_KKCC */ + SET_EVENT_BUTTON_X (event, ev.x); + SET_EVENT_BUTTON_Y (event, ev.y); + SET_EVENT_BUTTON_BUTTON (event, button); + SET_EVENT_BUTTON_MODIFIERS (event, modifiers); break; case GPM_MOVE: case GPM_DRAG: -#ifdef USE_KKCC SET_EVENT_TYPE (event, pointer_motion_event); - XSET_MOTION_DATA_X (EVENT_DATA (event), ev.x); - XSET_MOTION_DATA_Y (EVENT_DATA (event), ev.y); - XSET_MOTION_DATA_MODIFIERS (EVENT_DATA (event), modifiers); -#else /* not USE_KKCC */ - event->event_type = pointer_motion_event; - event->event.motion.x = ev.x; - event->event.motion.y = ev.y; - event->event.motion.modifiers = modifiers; -#endif /* not USE_KKCC */ + SET_EVENT_MOTION_X (event, ev.x); + SET_EVENT_MOTION_Y (event, ev.y); + SET_EVENT_MOTION_MODIFIERS (event, modifiers); default: /* This will never happen */ break; @@ -451,11 +435,7 @@ ** William M. Perry - Nov 9, 1999 */ -#ifdef USE_KKCC - Gpm_DrawPointer (XMOTION_DATA_X (EVENT_DATA (event)),XMOTION_DATA_Y (EVENT_DATA (event)), fd); -#else /* not USE_KKCC */ - Gpm_DrawPointer (event->event.motion.x,event->event.motion.y, fd); -#endif /* not USE_KKCC */ + Gpm_DrawPointer (EVENT_MOTION_X (event),EVENT_MOTION_Y (event), fd); } return; @@ -633,8 +613,8 @@ gpm_event_queue_tail = Qnil; staticpro (&gpm_event_queue); staticpro (&gpm_event_queue_tail); - dump_add_root_object (&gpm_event_queue); - dump_add_root_object (&gpm_event_queue_tail); + dump_add_root_lisp_object (&gpm_event_queue); + dump_add_root_lisp_object (&gpm_event_queue_tail); } void syms_of_gpmevent (void) Index: src/gtk-glue.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gtk-glue.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/gtk-glue.c 23 Jun 2002 09:25:12 -0000 1.4 +++ src/gtk-glue.c 12 Jan 2003 11:08:17 -0000 1.5 @@ -230,36 +230,38 @@ static Lisp_Object gdk_event_to_emacs_event(GdkEvent *ev) { - Lisp_Object emacs_event = Qnil; + Lisp_Object event = Qnil; if (ev) { - emacs_event = Fmake_event (Qnil, Qnil); - if (!gtk_event_to_emacs_event (NULL, ev, XEVENT (emacs_event))) + Lisp_Event *emacs_event; + + event = Fmake_event (Qnil, Qnil); + emacs_event = XEVENT (event); + + if (!gtk_event_to_emacs_event (NULL, ev, emacs_event)) { /* We need to handle a few more cases than the normal event ** loop does. Mainly the double/triple click events. */ if ((ev->type == GDK_2BUTTON_PRESS) || (ev->type == GDK_3BUTTON_PRESS)) { - struct Lisp_Event *le = XEVENT (emacs_event); - - le->event_type = misc_user_event; - le->event.misc.button = ev->button.button; - le->event.misc.modifiers = 0; - le->event.misc.x = ev->button.x; - le->event.misc.y = ev->button.y; + set_event_type (emacs_event, misc_user_event); + SET_EVENT_MISC_USER_BUTTON (emacs_event, ev->button.button); + SET_EVENT_MISC_USER_MODIFIERS (emacs_event, 0); + SET_EVENT_MISC_USER_X (emacs_event, ev->button.x); + SET_EVENT_MISC_USER_Y (emacs_event, ev->button.y); if (ev->type == GDK_2BUTTON_PRESS) - le->event.misc.function = intern ("double-click"); + SET_EVENT_MISC_USER_FUNCTION (emacs_event, intern ("double-click")); else - le->event.misc.function = intern ("triple-click"); + SET_EVENT_MISC_USER_FUNCTION (emacs_event, intern ("triple-click")); } else { - Fdeallocate_event (emacs_event); - emacs_event = Qnil; + Fdeallocate_event (event); + event = Qnil; } } } - return (emacs_event); + return (event); } Index: src/gtk-xemacs.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gtk-xemacs.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/gtk-xemacs.c 23 Jun 2002 09:25:12 -0000 1.7 +++ src/gtk-xemacs.c 12 Jan 2003 11:08:17 -0000 1.8 @@ -65,11 +65,11 @@ static GtkWidgetClass *parent_class; static void -gtk_xemacs_class_init (GtkXEmacsClass *class) +gtk_xemacs_class_init (GtkXEmacsClass *class_) { GtkWidgetClass *widget_class; - widget_class = (GtkWidgetClass*) class; + widget_class = (GtkWidgetClass*) class_; parent_class = (GtkWidgetClass *) gtk_type_class (gtk_fixed_get_type ()); widget_class->size_allocate = gtk_xemacs_size_allocate; Index: src/gui-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gui-msw.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/gui-msw.c 16 Aug 2002 08:15:41 -0000 1.7 +++ src/gui-msw.c 12 Jan 2003 11:08:17 -0000 1.8 @@ -1,5 +1,6 @@ /* mswindows GUI code. (menubars, scrollbars, toolbars, dialogs) Copyright (C) 1998 Andy Piper. + Copyright (C) 2002 Ben Wing. This file is part of XEmacs. @@ -64,21 +65,12 @@ { event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, misc_user_event); XSET_EVENT_CHANNEL (event, frame); XSET_EVENT_TIMESTAMP (event, GetTickCount()); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), Qeval); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), + XSET_EVENT_MISC_USER_FUNCTION (event, Qeval); + XSET_EVENT_MISC_USER_OBJECT (event, list4 (Qfuncall, callback_ex, image_instance, event)); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->channel = frame; - XEVENT (event)->timestamp = GetTickCount (); - XEVENT (event)->event.eval.function = Qeval; - XEVENT (event)->event.eval.object = - list4 (Qfuncall, callback_ex, image_instance, event); -#endif /* not USE_KKCC */ } else if (NILP (callback) || UNBOUNDP (callback)) return Qnil; @@ -89,19 +81,11 @@ event = Fmake_event (Qnil, Qnil); get_gui_callback (callback, &fn, &arg); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, misc_user_event); XSET_EVENT_CHANNEL (event, frame); XSET_EVENT_TIMESTAMP (event, GetTickCount()); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), fn); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), arg); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->channel = frame; - XEVENT (event)->timestamp = GetTickCount (); - XEVENT (event)->event.eval.function = fn; - XEVENT (event)->event.eval.object = arg; -#endif /* not USE_KKCC */ + XSET_EVENT_MISC_USER_FUNCTION (event, fn); + XSET_EVENT_MISC_USER_OBJECT (event, arg); } mswindows_enqueue_dispatch_event (event); @@ -109,6 +93,85 @@ enqueue an update callback to check this. */ enqueue_magic_eval_event (update_widget_instances, frame); return Qt; +} + +/* + * Translate X accelerator syntax to win32 accelerator syntax. + * accel = (Ichar*) to receive the accelerator character + * or NULL to suppress accelerators in the menu or dialog item. + * + * %% is replaced with % + * if accel is NULL: + * %_ is removed. + * if accel is non-NULL: + * %_ is replaced with &. + * The accelerator character is passed back in *accel. + * (If there is no accelerator, it will be added on the first character.) + * + */ + +Lisp_Object +mswindows_translate_menu_or_dialog_item (Lisp_Object item, Ichar *accel) +{ + Bytecount len = XSTRING_LENGTH (item); + Ibyte *it = (Ibyte *) ALLOCA (2 * len + 42), *ptr = it; + + memcpy (ptr, XSTRING_DATA (item), len + 1); + if (accel) + *accel = '\0'; + + /* Escape '&' as '&&' */ + + while ((ptr = (Ibyte *) memchr (ptr, '&', len - (ptr - it))) != NULL) + { + memmove (ptr + 1, ptr, (len - (ptr - it)) + 1); + len++; + ptr += 2; + } + + /* Replace XEmacs accelerator '%_' with Windows accelerator '&' + and `%%' with `%'. */ + ptr = it; + while ((ptr = (Ibyte *) memchr (ptr, '%', len - (ptr - it))) != NULL) + { + if (*(ptr + 1) == '_') + { + if (accel) + { + *ptr = '&'; + if (!*accel) + *accel = DOWNCASE (0, itext_ichar (ptr + 2)); + memmove (ptr + 1, ptr + 2, len - (ptr - it + 2) + 1); + len--; + } + else /* Skip accelerator */ + { + memmove (ptr, ptr + 2, len - (ptr - it + 2) + 1); + len -= 2; + } + } + else if (*(ptr + 1) == '%') + { + memmove (ptr + 1, ptr + 2, len - (ptr - it + 2) + 1); + len--; + ptr++; + } + else /* % on its own - shouldn't happen */ + ptr++; + } + + if (accel && !*accel) + { + /* Force a default accelerator */ + ptr = it; + memmove (ptr + 1, ptr, len + 1); + *accel = DOWNCASE (0, itext_ichar (ptr + 1)); + *ptr = '&'; + + len++; + } + + return make_string (it, len); } void Index: src/gui-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gui-x.c,v retrieving revision 1.29 retrieving revision 1.31 diff -u -r1.29 -r1.31 --- src/gui-x.c 29 Jul 2002 09:21:21 -0000 1.29 +++ src/gui-x.c 6 Feb 2003 06:36:03 -0000 1.31 @@ -1,6 +1,6 @@ /* General GUI code -- X-specific. (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. @@ -63,54 +63,63 @@ } -static int -mark_widget_value_mapper (widget_value *val, void *closure) -{ - Lisp_Object markee; - if (val->call_data) - { - markee = VOID_TO_LISP (val->call_data); - mark_object (markee); - } - - if (val->accel) - { - markee = VOID_TO_LISP (val->accel); - mark_object (markee); - } - return 0; -} - static Lisp_Object mark_popup_data (Lisp_Object obj) { struct popup_data *data = (struct popup_data *) XPOPUP_DATA (obj); - /* Now mark the callbacks and such that are hidden in the lwlib - call-data */ - - if (data->id) - lw_map_widget_values (data->id, mark_widget_value_mapper, 0); - - return data->last_menubar_buffer; + mark_object (data->last_menubar_buffer); + return data->protect_me; } -#ifdef USE_KKCC +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, 0, struct popup_data); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("popup-data", popup_data, - mark_popup_data, internal_object_printer, - 0, 0, 0, 0, struct popup_data); -#endif /* not USE_KKCC */ + 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. */ static Lisp_Object Vpopup_callbacks; +static int +snarf_widget_value_mapper (widget_value *val, void *closure) +{ + struct popup_data *pdata = (struct popup_data *) closure; + + if (val->call_data) + pdata->protect_me = Fcons (VOID_TO_LISP (val->call_data), + pdata->protect_me); + if (val->accel) + pdata->protect_me = Fcons (VOID_TO_LISP (val->accel), + pdata->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. */ + +void +snarf_widget_values_for_gcpro (Lisp_Object popup_data) +{ + struct popup_data *pdata = XPOPUP_DATA (popup_data); + + free_list (pdata->protect_me); + pdata->protect_me = Qnil; + + if (pdata->id) + lw_map_widget_values (pdata->id, snarf_widget_value_mapper, pdata); +} + void gcpro_popup_callbacks (LWLIB_ID id) { @@ -122,17 +131,25 @@ 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); + Vpopup_callbacks = Fcons (Fcons (lid, lpdata), Vpopup_callbacks); } 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; Vpopup_callbacks = delq_no_quit (this, Vpopup_callbacks); } @@ -201,7 +218,7 @@ if (wv->value) xfree (wv->value); if (wv->name) xfree (wv->name); - wv->name = wv->value = wv->key = (char *) 0xDEADBEEF; + wv->name = wv->value = wv->key = (char *) 0xDEADBEEF; /* -559038737 base 10*/ if (wv->contents && (wv->contents != (widget_value*)1)) { @@ -257,17 +274,10 @@ { event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, misc_user_event); XSET_EVENT_CHANNEL (event, frame); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), Qrun_hooks); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), Qmenu_no_selection_hook); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->channel = frame; - XEVENT (event)->event.eval.function = Qrun_hooks; - XEVENT (event)->event.eval.object = Qmenu_no_selection_hook; -#endif /* not USE_KKCC */ + XSET_EVENT_MISC_USER_FUNCTION (event, Qrun_hooks); + XSET_EVENT_MISC_USER_OBJECT (event, Qmenu_no_selection_hook); } else { @@ -285,18 +295,10 @@ { event = Fmake_event (Qnil, Qnil); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, misc_user_event); XSET_EVENT_CHANNEL (event, frame); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), Qeval); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), list4 (Qfuncall, callback_ex, image_instance, event)); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->channel = frame; - XEVENT (event)->event.eval.function = Qeval; - XEVENT (event)->event.eval.object = - list4 (Qfuncall, callback_ex, image_instance, event); -#endif /* not USE_KKCC */ + XSET_EVENT_MISC_USER_FUNCTION (event, Qeval); + XSET_EVENT_MISC_USER_OBJECT (event, list4 (Qfuncall, callback_ex, image_instance, event)); } else if (NILP (callback) || UNBOUNDP (callback)) event = Qnil; @@ -307,17 +309,10 @@ event = Fmake_event (Qnil, Qnil); get_gui_callback (callback, &fn, &arg); -#ifdef USE_KKCC XSET_EVENT_TYPE (event, misc_user_event); XSET_EVENT_CHANNEL (event, frame); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), fn); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), arg); -#else /* not USE_KKCC */ - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->channel = frame; - XEVENT (event)->event.eval.function = fn; - XEVENT (event)->event.eval.object = arg; -#endif /* not USE_KKCC */ + XSET_EVENT_MISC_USER_FUNCTION (event, fn); + XSET_EVENT_MISC_USER_OBJECT (event, arg); } } @@ -330,7 +325,7 @@ DEVICE_X_MOUSE_TIMESTAMP (d) = DEVICE_X_GLOBAL_MOUSE_TIMESTAMP (d); #endif if (!NILP (event)) - enqueue_Xt_dispatch_event (event); + enqueue_dispatch_event (event); /* The result of this evaluation could cause other instances to change so enqueue an update callback to check this. */ if (update_subwindows_p && !NILP (event)) Index: src/gui-x.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gui-x.h,v retrieving revision 1.10 retrieving revision 1.12 diff -u -r1.10 -r1.12 --- src/gui-x.h 5 Jun 2002 09:56:01 -0000 1.10 +++ src/gui-x.h 6 Feb 2003 06:36:03 -0000 1.12 @@ -1,6 +1,6 @@ /* General GUI code -- X-specific header file. Copyright (C) 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1996, 2000 Ben Wing. + Copyright (C) 1996, 2000, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -42,11 +42,16 @@ { 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 values that need to be GCPRO'd. */ + /* 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. */ @@ -64,6 +69,7 @@ #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); Index: src/gui.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gui.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- src/gui.c 29 Jul 2002 09:21:21 -0000 1.24 +++ src/gui.c 12 Jan 2003 11:08:17 -0000 1.25 @@ -199,7 +199,6 @@ Lisp_Gui_Item *lp = alloc_lcrecord_type (Lisp_Gui_Item, &lrecord_gui_item); Lisp_Object val; - zero_lcrecord (lp); val = wrap_gui_item (lp); gui_item_init (val); @@ -549,8 +548,7 @@ return Qnil; } -#ifdef USE_KKCC -static const struct lrecord_description gui_item_description [] = { +static const struct memory_description gui_item_description [] = { { XD_LISP_OBJECT, offsetof (struct Lisp_Gui_Item, name) }, { XD_LISP_OBJECT, offsetof (struct Lisp_Gui_Item, callback) }, { XD_LISP_OBJECT, offsetof (struct Lisp_Gui_Item, callback_ex) }, @@ -566,7 +564,6 @@ { XD_LISP_OBJECT, offsetof (struct Lisp_Gui_Item, value) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_gui_item (Lisp_Object obj) @@ -789,7 +786,6 @@ { } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("gui-item", gui_item, 0, /*dumpable-flag*/ mark_gui_item, print_gui_item, @@ -797,14 +793,6 @@ gui_item_hash, gui_item_description, Lisp_Gui_Item); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("gui-item", gui_item, - mark_gui_item, print_gui_item, - finalize_gui_item, gui_item_equal, - gui_item_hash, - 0, - Lisp_Gui_Item); -#endif /* not USE_KKCC */ DOESNT_RETURN gui_error (const Char_ASCII *reason, Lisp_Object frob) Index: src/gutter.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gutter.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/gutter.c 6 Jul 2002 21:05:52 -0000 1.12 +++ src/gutter.c 12 Jan 2003 11:08:17 -0000 1.13 @@ -734,7 +734,7 @@ if (EQ (position, Qright)) return RIGHT_GUTTER; invalid_constant ("Invalid gutter position", position); - RETURN_NOT_REACHED (TOP_GUTTER) + RETURN_NOT_REACHED (TOP_GUTTER); } DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /* Index: src/hash.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/hash.c,v retrieving revision 1.9 retrieving revision 1.11 diff -u -r1.9 -r1.11 --- src/hash.c 20 Sep 2001 06:29:03 -0000 1.9 +++ src/hash.c 13 Feb 2003 09:57:07 -0000 1.11 @@ -1,5 +1,6 @@ /* Hash tables. Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 2003 Ben Wing. This file is part of XEmacs. @@ -20,11 +21,14 @@ /* Synched up with: Not in FSF. */ +/* Author: Lost in the mists of history. At least back to Lucid 19.3, + circa Sep 1992. */ + #include #include "lisp.h" #include "hash.h" -#define NULL_ENTRY ((void *) 0xdeadbeef) +#define NULL_ENTRY ((void *) 0xdeadbeef) /* -559038737 base 10 */ #define COMFORTABLE_SIZE(size) (21 * (size) / 16) @@ -204,6 +208,15 @@ } xfree (old_harray); +} + +void +pregrow_hash_table_if_necessary (struct hash_table *hash_table, + Elemcount breathing_room) +{ + Elemcount comfortable_size = COMFORTABLE_SIZE (hash_table->fullness); + if (hash_table->size < comfortable_size - breathing_room) + grow_hash_table (hash_table, comfortable_size + 1); } void Index: src/hash.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/hash.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/hash.h 5 May 2002 11:31:46 -0000 1.8 +++ src/hash.h 13 Feb 2003 09:57:07 -0000 1.9 @@ -1,4 +1,5 @@ -/* This file is part of XEmacs. +/* 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 @@ -78,4 +79,10 @@ void map_remhash (remhash_predicate predicate, struct hash_table *hash_table, void *arg); +/* Grow the table if it has less than BREATHING_ROOM elements that can be + added before a resize will be triggered. After the grow, the table can + hold at least BREATHING_ROOM elements (and probably a lot more) before + needing resizing again. */ +void pregrow_hash_table_if_necessary (struct hash_table *hash_table, + Elemcount breathing_room); #endif /* INCLUDED_hash_h_ */ Index: src/indent.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/indent.c,v retrieving revision 1.17 retrieving revision 1.19 diff -u -r1.17 -r1.19 --- src/indent.c 5 Jun 2002 09:56:05 -0000 1.17 +++ src/indent.c 7 Feb 2003 11:50:53 -0000 1.19 @@ -684,7 +684,7 @@ return Dynarr_atp (w->line_start_cache, elt)->start; } - RETURN_NOT_REACHED(0) /* shut up compiler */ + RETURN_NOT_REACHED(0); /* shut up compiler */ } /***************************************************************************** @@ -758,9 +758,15 @@ returned instead of the actual number of lines moved. A motion of zero lines returns the height of the current line. -Note that `vertical-motion' sets WINDOW's buffer's point, not -WINDOW's point. (This differs from FSF Emacs, which buggily always -sets current buffer's point, regardless of WINDOW.) +NOTE NOTE NOTE: GNU Emacs/XEmacs difference. + +What `vertical-motion' actually does is set WINDOW's buffer's point +if WINDOW is the selected window; else, it sets WINDOW's point. +This is unfortunately somewhat tricky to work with, and different +from GNU Emacs, which always uses the current buffer, not WINDOW's +buffer, always sets current buffer's point, and, from the +perspective of this function, temporarily makes WINDOW display +the current buffer if it wasn't already. */ (lines, window, pixels)) { @@ -865,7 +871,7 @@ needed += (remain*lines + abspix-1)/abspix + 3; } - RETURN_NOT_REACHED(0) /* shut up compiler */ + RETURN_NOT_REACHED(0); /* shut up compiler */ } DEFUN ("vertical-motion-pixels", Fvertical_motion_pixels, 1, 3, 0, /* Index: src/input-method-motif.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/input-method-motif.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- src/input-method-motif.c 2 Jul 2002 19:09:27 -0000 1.14 +++ src/input-method-motif.c 12 Jan 2003 11:08:17 -0000 1.15 @@ -73,8 +73,8 @@ default face, rather than foreground and background resources, or that the user can use set-frame-parameters to set xic attributes */ -#define res(name, class, representation, field, default_value) \ - { name, class, representation, sizeof(xim_resources.field), \ +#define res(name, class_, representation, field, default_value) \ + { name, class_, representation, sizeof(xim_resources.field), \ XtOffsetOf(xim_resources_t, field), \ XtRString, (XtPointer) (default_value) } Index: src/input-method-xlib.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/input-method-xlib.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/input-method-xlib.c 20 Jun 2002 21:18:35 -0000 1.17 +++ src/input-method-xlib.c 12 Jan 2003 11:08:17 -0000 1.18 @@ -164,7 +164,7 @@ { struct device *d = (struct device *)client_data; XIM xim; - char *name, *class; + char *name, *class_; XIMCallback ximcallback; Lisp_Object tail; @@ -172,8 +172,8 @@ if ( xim_initted == False ) { xim_initted = True; - XtGetApplicationNameAndClass (dpy, &name, &class); - DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class); + XtGetApplicationNameAndClass (dpy, &name, &class_); + DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class_); /* destroy callback for im */ ximcallback.callback = (XIMProc) IMDestroyCallback; @@ -216,11 +216,11 @@ return; #else /* pre-X11R6 */ Display *dpy = DEVICE_X_DISPLAY (d); - char *name, *class; + char *name, *class_; XIM xim; - XtGetApplicationNameAndClass (dpy, &name, &class); - DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class); + XtGetApplicationNameAndClass (dpy, &name, &class_); + DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class_); if (xim == NULL) { warn_when_safe @@ -283,8 +283,8 @@ xic_vars_t xic_vars; XIC xic; -#define res(name, class, representation, field, default_value) \ - { name, class, representation, sizeof(xic_vars.field), \ +#define res(name, class_, representation, field, default_value) \ + { name, class_, representation, sizeof(xic_vars.field), \ XtOffsetOf(xic_vars_t, field), XtRString, default_value } static XtResource resources[] = Index: src/intl-encap-win32.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/intl-encap-win32.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/intl-encap-win32.c 18 Nov 2002 06:52:39 -0000 1.8 +++ src/intl-encap-win32.c 12 Jan 2003 11:08:17 -0000 1.9 @@ -1495,6 +1495,8 @@ return 0; } +#ifdef HAVE_MS_WINDOWS + static int is_SHBrowseForFolder (HWND hwnd) { @@ -1506,6 +1508,8 @@ return 0; } +#endif /* HAVE_MS_WINDOWS */ + LPITEMIDLIST qxeSHBrowseForFolder (LPBROWSEINFOW lpbi) { @@ -1619,7 +1623,8 @@ retval = SHGetDataFromIDListA (psf, pidl, nFormat, &ansidat, cb); if (retval == NOERROR) - copy_win32_find_dataa_to_win32_find_dataw (&ansidat, pv); + copy_win32_find_dataa_to_win32_find_dataw (&ansidat, + (WIN32_FIND_DATAW *) pv); return retval; } else Index: src/intl-win32.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/intl-win32.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/intl-win32.c 18 Nov 2002 06:52:40 -0000 1.8 +++ src/intl-win32.c 12 Jan 2003 11:08:17 -0000 1.9 @@ -1695,8 +1695,6 @@ /* MS Windows multibyte-to-unicode methods */ /************************************************************************/ -DEFINE_CODING_SYSTEM_TYPE (mswindows_multibyte_to_unicode); - enum mswindows_multibyte_cp_type { MULTIBYTE_ANSI, @@ -1729,11 +1727,13 @@ int cp; }; -static const struct lrecord_description +static const struct memory_description mswindows_multibyte_to_unicode_coding_system_description[] = { { XD_END } }; +DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (mswindows_multibyte_to_unicode); + static void mswindows_multibyte_to_unicode_init (Lisp_Object codesys) { @@ -2083,8 +2083,6 @@ /* MS Windows Multibyte methods */ /************************************************************************/ -DEFINE_CODING_SYSTEM_TYPE (mswindows_multibyte); - struct mswindows_multibyte_coding_system { Lisp_Object code_page; @@ -2096,16 +2094,16 @@ int dummy; }; -static const struct lrecord_description +static const struct memory_description mswindows_multibyte_coding_system_description[] = { { XD_LISP_OBJECT, - coding_system_data_offset + - offsetof (struct mswindows_multibyte_coding_system, code_page) }, + offsetof (struct mswindows_multibyte_coding_system, code_page) }, { XD_LISP_OBJECT, - coding_system_data_offset + - offsetof (struct mswindows_multibyte_coding_system, locale) }, + offsetof (struct mswindows_multibyte_coding_system, locale) }, { XD_END } }; + +DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (mswindows_multibyte); static Bytecount mswindows_multibyte_convert (struct coding_stream *str, Index: src/keymap.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/keymap.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- src/keymap.c 22 Aug 2002 11:31:42 -0000 1.47 +++ src/keymap.c 12 Jan 2003 11:08:17 -0000 1.48 @@ -269,7 +269,7 @@ (long) XINT (Fkeymap_fullness (obj)), keymap->header.uid); } -static const struct lrecord_description keymap_description[] = { +static const struct memory_description keymap_description[] = { { XD_LISP_OBJECT, offsetof (Lisp_Keymap, parents) }, { XD_LISP_OBJECT, offsetof (Lisp_Keymap, prompt) }, { XD_LISP_OBJECT, offsetof (Lisp_Keymap, table) }, @@ -281,18 +281,11 @@ }; /* No need for keymap_equal #### Why not? */ -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("keymap", keymap, 1, /*dumpable-flag*/ mark_keymap, print_keymap, 0, 0, 0, keymap_description, Lisp_Keymap); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("keymap", keymap, - mark_keymap, print_keymap, 0, 0, 0, - keymap_description, - Lisp_Keymap); -#endif /* not USE_KKCC */ /************************************************************************/ /* Traversing keymaps and their parents */ @@ -436,17 +429,10 @@ } static Lisp_Object -#ifdef USE_KKCC make_key_description (const Lisp_Key_Data *key, int prettify) { - Lisp_Object keysym = KEY_DATA_KEYSYM(key); + Lisp_Object keysym = KEY_DATA_KEYSYM (key); int modifiers = KEY_DATA_MODIFIERS (key); -#else /* not USE_KKCC */ -make_key_description (const struct key_data *key, int prettify) -{ - Lisp_Object keysym = key->keysym; - int modifiers = key->modifiers; -#endif /* not USE_KKCC */ if (prettify && CHARP (keysym)) { /* This is a little slow, but (control a) is prettier than (control 65). @@ -470,11 +456,7 @@ static Lisp_Object raw_lookup_key (Lisp_Object keymap, -#ifdef USE_KKCC const Lisp_Key_Data *raw_keys, int raw_keys_count, -#else /* not USE_KKCC */ - const struct key_data *raw_keys, int raw_keys_count, -#endif /* not USE_KKCC */ int keys_so_far, int accept_default); /* Relies on caller to gc-protect args */ @@ -658,20 +640,11 @@ /* Relies on caller to gc-protect keymap, keysym, value */ static void -#ifdef USE_KKCC keymap_store (Lisp_Object keymap, const Lisp_Key_Data *key, -#else /* not USE_KKCC */ -keymap_store (Lisp_Object keymap, const struct key_data *key, -#endif /* not USE_KKCC */ Lisp_Object value) { -#ifdef USE_KKCC Lisp_Object keysym = KEY_DATA_KEYSYM (key); int modifiers = KEY_DATA_MODIFIERS (key); -#else /* not USE_KKCC */ - Lisp_Object keysym = key->keysym; - int modifiers = key->modifiers; -#endif /* not USE_KKCC */ Lisp_Keymap *k = XKEYMAP (keymap); modifiers &= ~(XEMACS_MOD_BUTTON1 | XEMACS_MOD_BUTTON2 | XEMACS_MOD_BUTTON3 @@ -1079,28 +1052,17 @@ if (!NILP (map)) { Lisp_Object idx = Fcdr (object); -#ifdef USE_KKCC Lisp_Key_Data indirection; -#else /* not USE_KKCC */ - struct key_data indirection; -#endif /* not USE_KKCC */ if (CHARP (idx)) { -#ifdef USE_KKCC Lisp_Object event = Fmake_event (Qnil, Qnil); struct gcpro gcpro1; GCPRO1 (event); - XSET_EVENT_TYPE (event, empty_event); character_to_event (XCHAR (idx), XEVENT (event), XCONSOLE (Vselected_console), 0, 0); - indirection = *XKEY_DATA (XEVENT_DATA (event)); -#else /* not USE_KKCC */ - Lisp_Event event; - event.event_type = empty_event; - character_to_event (XCHAR (idx), &event, - XCONSOLE (Vselected_console), 0, 0); - indirection = event.event.key; -#endif /* not USE_KKCC */ + indirection.keysym = XEVENT_KEY_KEYSYM (event); + indirection.modifiers = XEVENT_KEY_MODIFIERS (event); + UNGCPRO; } else if (CONSP (idx)) { @@ -1112,11 +1074,7 @@ else if (SYMBOLP (idx)) { indirection.keysym = idx; -#ifdef USE_KKCC SET_KEY_DATA_MODIFIERS (&indirection, XINT (XCDR (idx))); -#else /* not USE_KKCC */ - indirection.modifiers = 0; -#endif /* not USE_KKCC */ } else { @@ -1142,24 +1100,14 @@ } static Lisp_Object -#ifdef USE_KKCC keymap_lookup_1 (Lisp_Object keymap, const Lisp_Key_Data *key, -#else /* not USE_KKCC */ -keymap_lookup_1 (Lisp_Object keymap, const struct key_data *key, -#endif /* not USE_KKCC */ int accept_default) { /* This function can GC */ -#ifdef USE_KKCC return get_keyelt (keymap_lookup_directly (keymap, KEY_DATA_KEYSYM (key), KEY_DATA_MODIFIERS (key)), accept_default); -#else /* not USE_KKCC */ - return get_keyelt (keymap_lookup_directly (keymap, - key->keysym, key->modifiers), - accept_default); -#endif /* not USE_KKCC */ } @@ -1452,58 +1400,35 @@ */ static void -#ifdef USE_KKCC define_key_parser (Lisp_Object spec, Lisp_Key_Data *returned_value) -#else /* not USE_KKCC */ -define_key_parser (Lisp_Object spec, struct key_data *returned_value) -#endif /* not USE_KKCC */ { if (CHAR_OR_CHAR_INTP (spec)) { -#ifdef USE_KKCC Lisp_Object event = Fmake_event (Qnil, Qnil); struct gcpro gcpro1; GCPRO1 (event); - XSET_EVENT_TYPE (event, empty_event); character_to_event (XCHAR_OR_CHAR_INT (spec), XEVENT (event), XCONSOLE (Vselected_console), 0, 0); - SET_KEY_DATA_KEYSYM (returned_value, XKEY_DATA_KEYSYM (XEVENT_DATA (event))); + SET_KEY_DATA_KEYSYM (returned_value, XEVENT_KEY_KEYSYM (event)); SET_KEY_DATA_MODIFIERS (returned_value, - XKEY_DATA_MODIFIERS (XEVENT_DATA (event))); -#else /* not USE_KKCC */ - Lisp_Event event; - event.event_type = empty_event; - character_to_event (XCHAR_OR_CHAR_INT (spec), &event, - XCONSOLE (Vselected_console), 0, 0); - returned_value->keysym = event.event.key.keysym; - returned_value->modifiers = event.event.key.modifiers; -#endif /* not USE_KKCC */ + XEVENT_KEY_MODIFIERS (event)); + UNGCPRO; } else if (EVENTP (spec)) { -#ifdef USE_KKCC switch (XEVENT_TYPE (spec)) -#else /* not USE_KKCC */ - switch (XEVENT (spec)->event_type) -#endif /* not USE_KKCC */ { case key_press_event: { -#ifdef USE_KKCC - SET_KEY_DATA_KEYSYM (returned_value, XKEY_DATA_KEYSYM (XEVENT_DATA (spec))); - SET_KEY_DATA_MODIFIERS (returned_value, XKEY_DATA_MODIFIERS (XEVENT_DATA (spec))); -#else /* not USE_KKCC */ - returned_value->keysym = XEVENT (spec)->event.key.keysym; - returned_value->modifiers = XEVENT (spec)->event.key.modifiers; -#endif /* not USE_KKCC */ + SET_KEY_DATA_KEYSYM (returned_value, XEVENT_KEY_KEYSYM (spec)); + SET_KEY_DATA_MODIFIERS (returned_value, XEVENT_KEY_MODIFIERS (spec)); break; } case button_press_event: case button_release_event: { -#ifdef USE_KKCC int down = (XEVENT_TYPE (spec) == button_press_event); - switch (XBUTTON_DATA_BUTTON (XEVENT_DATA (spec))) + switch (XEVENT_BUTTON_BUTTON (spec)) { case 1: SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton1 : Qbutton1up)); @@ -1530,30 +1455,7 @@ SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton0 : Qbutton0up)); break; } - SET_KEY_DATA_MODIFIERS (returned_value, XBUTTON_DATA_MODIFIERS (XEVENT_DATA (spec))); -#else /* not USE_KKCC */ - int down = (XEVENT (spec)->event_type == button_press_event); - switch (XEVENT (spec)->event.button.button) - { - case 1: - returned_value->keysym = (down ? Qbutton1 : Qbutton1up); break; - case 2: - returned_value->keysym = (down ? Qbutton2 : Qbutton2up); break; - case 3: - returned_value->keysym = (down ? Qbutton3 : Qbutton3up); break; - case 4: - returned_value->keysym = (down ? Qbutton4 : Qbutton4up); break; - case 5: - returned_value->keysym = (down ? Qbutton5 : Qbutton5up); break; - case 6: - returned_value->keysym = (down ? Qbutton6 : Qbutton6up); break; - case 7: - returned_value->keysym = (down ? Qbutton7 : Qbutton7up); break; - default: - returned_value->keysym = (down ? Qbutton0 : Qbutton0up); break; - } - returned_value->modifiers = XEVENT (spec)->event.button.modifiers; -#endif /* not USE_KKCC */ + SET_KEY_DATA_MODIFIERS (returned_value, XEVENT_BUTTON_MODIFIERS (spec)); break; } default: @@ -1566,13 +1468,8 @@ if (bucky_sym_to_bucky_bit (spec) != 0) invalid_argument ("Key is a modifier name", spec); define_key_check_and_coerce_keysym (spec, &spec, 0); -#ifdef USE_KKCC SET_KEY_DATA_KEYSYM (returned_value, spec); SET_KEY_DATA_MODIFIERS (returned_value, 0); -#else /* not USE_KKCC */ - returned_value->keysym = spec; - returned_value->modifiers = 0; -#endif /* not USE_KKCC */ } else if (CONSP (spec)) { @@ -1607,13 +1504,8 @@ "List must be nil-terminated", spec); define_key_check_and_coerce_keysym (spec, &keysym, modifiers); -#ifdef USE_KKCC SET_KEY_DATA_KEYSYM(returned_value, keysym); SET_KEY_DATA_MODIFIERS (returned_value, modifiers); -#else /* not USE_KKCC */ - returned_value->keysym = keysym; - returned_value->modifiers = modifiers; -#endif /* not USE_KKCC */ } else { @@ -1627,11 +1519,7 @@ key_desc_list_to_event (Lisp_Object list, Lisp_Object event, int allow_menu_events) { -#ifdef USE_KKCC Lisp_Key_Data raw_key; -#else /* not USE_KKCC */ - struct key_data raw_key; -#endif /* not USE_KKCC */ if (allow_menu_events && CONSP (list) && @@ -1646,17 +1534,10 @@ fn = Qcall_interactively; else fn = Qeval; -#ifdef USE_KKCC XSET_EVENT_TYPE (event, misc_user_event); - XSET_EVENT_CHANNEL (event, wrap_frame (selected_frame)); - XSET_MISC_USER_DATA_FUNCTION (XEVENT_DATA (event), fn); - XSET_MISC_USER_DATA_OBJECT (XEVENT_DATA (event), arg); -#else /* not USE_KKCC */ - XEVENT (event)->channel = wrap_frame (selected_frame ()); - XEVENT (event)->event_type = misc_user_event; - XEVENT (event)->event.eval.function = fn; - XEVENT (event)->event.eval.object = arg; -#endif /* not USE_KKCC */ + XSET_EVENT_CHANNEL (event, wrap_frame (selected_frame ())); + XSET_EVENT_MISC_USER_FUNCTION (event, fn); + XSET_EVENT_MISC_USER_OBJECT (event, arg); return; } @@ -1673,28 +1554,21 @@ invalid_operation ("Mouse-clicks can't appear in saved keyboard macros", Qunbound); -#ifdef USE_KKCC XSET_EVENT_CHANNEL (event, Vselected_console); XSET_EVENT_TYPE (event, key_press_event); - XSET_KEY_DATA_KEYSYM (XEVENT_DATA (event), raw_key.keysym); - XSET_KEY_DATA_MODIFIERS (XEVENT_DATA (event), KEY_DATA_MODIFIERS (&raw_key)); -#else /* not USE_KKCC */ - XEVENT (event)->channel = Vselected_console; - XEVENT (event)->event_type = key_press_event; - XEVENT (event)->event.key.keysym = raw_key.keysym; - XEVENT (event)->event.key.modifiers = raw_key.modifiers; -#endif /* not USE_KKCC */ + XSET_EVENT_KEY_KEYSYM (event, raw_key.keysym); + XSET_EVENT_KEY_MODIFIERS (event, KEY_DATA_MODIFIERS (&raw_key)); } int -event_matches_key_specifier_p (Lisp_Event *event, Lisp_Object key_specifier) +event_matches_key_specifier_p (Lisp_Object event, Lisp_Object key_specifier) { Lisp_Object event2 = Qnil; int retval; struct gcpro gcpro1; - if (event->event_type != key_press_event || NILP (key_specifier) || + if (XEVENT_TYPE (event) != key_press_event || NILP (key_specifier) || (INTP (key_specifier) && !CHAR_INTP (key_specifier))) return 0; @@ -1716,25 +1590,22 @@ to compare the ASCII values. */ GCPRO1 (event2); - event2 = Fmake_event (Qnil, Qnil); - Fcharacter_to_event (key_specifier, event2, Qnil, Qnil); + if (EVENTP (key_specifier)) + event2 = Fcopy_event (key_specifier, Qnil); + else + event2 = Fcharacter_to_event (key_specifier, Qnil, Qnil, Qnil); if (XEVENT (event2)->event_type != key_press_event) retval = 0; - else if (CONSOLE_TTY_P (XCONSOLE (EVENT_CHANNEL (event)))) + else if (CONSOLE_TTY_P (XCONSOLE (XEVENT_CHANNEL (event)))) { int ch1, ch2; ch1 = event_to_character (event, 0, 0, 0); - ch2 = event_to_character (XEVENT (event2), 0, 0, 0); + ch2 = event_to_character (event2, 0, 0, 0); retval = (ch1 >= 0 && ch2 >= 0 && ch1 == ch2); } -#ifdef USE_KKCC - else if (EQ (XKEY_DATA_KEYSYM (EVENT_DATA (event)), XKEY_DATA_KEYSYM (XEVENT_DATA (event2))) && - XKEY_DATA_MODIFIERS (EVENT_DATA (event)) == XKEY_DATA_MODIFIERS (XEVENT_DATA (event2))) -#else /* not USE_KKCC */ - else if (EQ (event->event.key.keysym, XEVENT (event2)->event.key.keysym) && - event->event.key.modifiers == XEVENT (event2)->event.key.modifiers) -#endif /* not USE_KKCC */ + else if (EQ (XEVENT_KEY_KEYSYM (event), XEVENT_KEY_KEYSYM (event2)) && + XEVENT_KEY_MODIFIERS (event) == XEVENT_KEY_MODIFIERS (event2)) retval = 1; else retval = 0; @@ -1744,87 +1615,75 @@ } static int -#ifdef USE_KKCC meta_prefix_char_p (const Lisp_Key_Data *key) -#else /* not USE_KKCC */ -meta_prefix_char_p (const struct key_data *key) -#endif /* not USE_KKCC */ { -#ifdef USE_KKCC Lisp_Object event = Fmake_event (Qnil, Qnil); struct gcpro gcpro1; + int retval; + GCPRO1 (event); XSET_EVENT_TYPE (event, key_press_event); XSET_EVENT_CHANNEL (event, Vselected_console); - XSET_KEY_DATA_KEYSYM (XEVENT_DATA (event), KEY_DATA_KEYSYM (key)); - XSET_KEY_DATA_MODIFIERS (XEVENT_DATA (event), KEY_DATA_MODIFIERS (key)); - return event_matches_key_specifier_p (XEVENT(event), Vmeta_prefix_char); -#else /* not USE_KKCC */ - Lisp_Event event; - - event.event_type = key_press_event; - event.channel = Vselected_console; - event.event.key.keysym = key->keysym; - event.event.key.modifiers = key->modifiers; - return event_matches_key_specifier_p (&event, Vmeta_prefix_char); -#endif /* not USE_KKCC */ + XSET_EVENT_KEY_KEYSYM (event, KEY_DATA_KEYSYM (key)); + XSET_EVENT_KEY_MODIFIERS (event, KEY_DATA_MODIFIERS (key)); + retval = event_matches_key_specifier_p (event, Vmeta_prefix_char); + UNGCPRO; + return retval; } DEFUN ("event-matches-key-specifier-p", Fevent_matches_key_specifier_p, 2, 2, 0, /* Return non-nil if EVENT matches KEY-SPECIFIER. This can be useful, e.g., to determine if the user pressed `help-char' or `quit-char'. + +KEY-SPECIFIER can be a character, integer, a symbol, a list of modifiers +and symbols, or an event. + +What this actually happens is this: + +\(1) Return no, if EVENT is not a key press event or if KEY-SPECIFIER is nil + or an integer that cannot be converted to a character. + +\(2) If KEY-SPECIFIER is a character or integer, + (event-to-character EVENT nil nil nil) is called, and the characters are + compared to get the result. The reason for special-casing this and doing + it this way is to ensure that, e.g., a KEY-SPECIFIER of 27 matches both + a key-press `escape' and a key-press `control ['. #### Think about META + argument to event-to-character. + +\(3) If KEY-SPECIFIER is an event, fine; else, convert to an event using + \(character-to-event KEY-SPECIFIER nil nil nil). If EVENT is not on a TTY, + we just compare keysyms and modifiers and return yes if both are equal. + For TTY, we do character-level comparison by converting both to a character + with (event-to-character ... nil nil nil) and comparing the characters. + */ (event, key_specifier)) { CHECK_LIVE_EVENT (event); - return (event_matches_key_specifier_p (XEVENT (event), key_specifier) - ? Qt : Qnil); + return (event_matches_key_specifier_p (event, key_specifier) ? Qt : Qnil); } -#ifdef USE_KKCC -#define MACROLET(k,m) do { \ - SET_KEY_DATA_KEYSYM(returned_value, k); \ - SET_KEY_DATA_MODIFIERS(returned_value, m); \ - RETURN_SANS_WARNINGS; \ -} while (0) -#else /* not USE_KKCC */ -#define MACROLET(k,m) do { \ - returned_value->keysym = (k); \ - returned_value->modifiers = (m); \ - RETURN_SANS_WARNINGS; \ +#define MACROLET(k, m) do { \ + SET_KEY_DATA_KEYSYM (returned_value, k); \ + SET_KEY_DATA_MODIFIERS (returned_value, m); \ + RETURN_SANS_WARNINGS; \ } while (0) -#endif /* not USE_KKCC */ /* ASCII grunge. Given a keysym, return another keysym/modifier pair which could be considered the same key in an ASCII world. Backspace returns ^H, for example. */ static void -#ifdef USE_KKCC define_key_alternate_name (Lisp_Key_Data *key, Lisp_Key_Data *returned_value) -#else /* not USE_KKCC */ -define_key_alternate_name (struct key_data *key, - struct key_data *returned_value) -#endif /* not USE_KKCC */ { -#ifdef USE_KKCC Lisp_Object keysym = KEY_DATA_KEYSYM (key); int modifiers = KEY_DATA_MODIFIERS (key); -#else /* not USE_KKCC */ - Lisp_Object keysym = key->keysym; - int modifiers = key->modifiers; -#endif /* not USE_KKCC */ int modifiers_sans_control = (modifiers & (~XEMACS_MOD_CONTROL)); int modifiers_sans_meta = (modifiers & (~XEMACS_MOD_META)); -#ifdef USE_KKCC SET_KEY_DATA_KEYSYM (returned_value, Qnil); /* By default, no "alternate" key */ SET_KEY_DATA_MODIFIERS (returned_value, 0); -#else /* not USE_KKCC */ - returned_value->keysym = Qnil; /* By default, no "alternate" key */ - returned_value->modifiers = 0; -#endif /* not USE_KKCC */ if (modifiers_sans_meta == XEMACS_MOD_CONTROL) { if (EQ (keysym, QKspace)) @@ -1866,7 +1725,6 @@ #undef MACROLET } - static void ensure_meta_prefix_char_keymapp (Lisp_Object keys, int indx, Lisp_Object keymap) @@ -1875,11 +1733,7 @@ Lisp_Object new_keys; int i; Lisp_Object mpc_binding; -#ifdef USE_KKCC Lisp_Key_Data meta_key; -#else /* not USE_KKCC */ - struct key_data meta_key; -#endif /* not USE_KKCC */ if (NILP (Vmeta_prefix_char) || (INTP (Vmeta_prefix_char) && !CHAR_INTP (Vmeta_prefix_char))) return; @@ -2080,13 +1934,8 @@ while (1) { Lisp_Object c; -#ifdef USE_KKCC Lisp_Key_Data raw_key1; Lisp_Key_Data raw_key2; -#else /* not USE_KKCC */ - struct key_data raw_key1; - struct key_data raw_key2; -#endif /* not USE_KKCC */ if (STRINGP (keys)) c = make_char (string_ichar (keys, idx)); else @@ -2200,11 +2049,7 @@ struct raw_lookup_key_mapper_closure { int remaining; -#ifdef USE_KKCC const Lisp_Key_Data *raw_keys; -#else /* not USE_KKCC */ - const struct key_data *raw_keys; -#endif /* not USE_KKCC */ int raw_keys_count; int keys_so_far; int accept_default; @@ -2215,11 +2060,7 @@ /* Caller should gc-protect args (keymaps may autoload) */ static Lisp_Object raw_lookup_key (Lisp_Object keymap, -#ifdef USE_KKCC const Lisp_Key_Data *raw_keys, int raw_keys_count, -#else /* not USE_KKCC */ - const struct key_data *raw_keys, int raw_keys_count, -#endif /* not USE_KKCC */ int keys_so_far, int accept_default) { /* This function can GC */ @@ -2242,11 +2083,7 @@ int accept_default = c->accept_default; int remaining = c->remaining; int keys_so_far = c->keys_so_far; -#ifdef USE_KKCC const Lisp_Key_Data *raw_keys = c->raw_keys; -#else /* not USE_KKCC */ - const struct key_data *raw_keys = c->raw_keys; -#endif /* not USE_KKCC */ Lisp_Object cmd; if (! meta_prefix_char_p (&(raw_keys[0]))) @@ -2299,11 +2136,7 @@ keys_so_far + 1, accept_default); else if ((raw_keys[1].modifiers & XEMACS_MOD_META) == 0) { -#ifdef USE_KKCC Lisp_Key_Data metified; -#else /* not USE_KKCC */ - struct key_data metified; -#endif /* not USE_KKCC */ metified.keysym = raw_keys[1].keysym; metified.modifiers = raw_keys[1].modifiers | (unsigned char) XEMACS_MOD_META; @@ -2335,13 +2168,8 @@ int accept_default) { /* This function can GC */ -#ifdef USE_KKCC Lisp_Key_Data kkk[20]; Lisp_Key_Data *raw_keys; -#else /* not USE_KKCC */ - struct key_data kkk[20]; - struct key_data *raw_keys; -#endif /* not USE_KKCC */ int i; if (nkeys == 0) @@ -2350,11 +2178,7 @@ if (nkeys < countof (kkk)) raw_keys = kkk; else -#ifdef USE_KKCC raw_keys = alloca_array (Lisp_Key_Data, nkeys); -#else /* not USE_KKCC */ - raw_keys = alloca_array (struct key_data, nkeys); -#endif /* not USE_KKCC */ for (i = 0; i < nkeys; i++) { @@ -2368,19 +2192,11 @@ int accept_default) { /* This function can GC */ -#ifdef USE_KKCC Lisp_Key_Data kkk[20]; -#else /* not USE_KKCC */ - struct key_data kkk[20]; -#endif /* not USE_KKCC */ Lisp_Object event; int nkeys; -#ifdef USE_KKCC Lisp_Key_Data *raw_keys; -#else /* not USE_KKCC */ - struct key_data *raw_keys; -#endif /* not USE_KKCC */ Lisp_Object tem = Qnil; struct gcpro gcpro1, gcpro2; int iii; @@ -2392,11 +2208,7 @@ if (nkeys < countof (kkk)) raw_keys = kkk; else -#ifdef USE_KKCC raw_keys = alloca_array (Lisp_Key_Data, nkeys); -#else /* not USE_KKCC */ - raw_keys = alloca_array (struct key_data, nkeys); -#endif /* not USE_KKCC */ nkeys = 0; EVENT_CHAIN_LOOP (event, event_head) @@ -2445,11 +2257,7 @@ { int length = string_char_length (keys); int i; -#ifdef USE_KKCC Lisp_Key_Data *raw_keys = alloca_array (Lisp_Key_Data, length); -#else /* not USE_KKCC */ - struct key_data *raw_keys = alloca_array (struct key_data, length); -#endif /* not USE_KKCC */ if (length == 0) return Qnil; @@ -3028,11 +2836,7 @@ struct map_keymap_unsorted_closure { -#ifdef USE_KKCC void (*fn) (const Lisp_Key_Data *, Lisp_Object binding, void *arg); -#else /* not USE_KKCC */ - void (*fn) (const struct key_data *, Lisp_Object binding, void *arg); -#endif /* not USE_KKCC */ void *arg; int modifiers; }; @@ -3060,11 +2864,7 @@ } else { -#ifdef USE_KKCC Lisp_Key_Data key; -#else /* not USE_KKCC */ - struct key_data key; -#endif /* not USE_KKCC */ key.keysym = keysym; key.modifiers = modifiers; ((*closure->fn) (&key, value, closure->arg)); @@ -3171,11 +2971,7 @@ static void map_keymap_sorted (Lisp_Object keymap_table, int modifiers, -#ifdef USE_KKCC void (*function) (const Lisp_Key_Data *key, -#else /* not USE_KKCC */ - void (*function) (const struct key_data *key, -#endif /* not USE_KKCC */ Lisp_Object binding, void *map_keymap_sorted_closure), void *map_keymap_sorted_closure) @@ -3208,11 +3004,7 @@ map_keymap_sorted_closure); else { -#ifdef USE_KKCC Lisp_Key_Data k; -#else /* not USE_KKCC */ - struct key_data k; -#endif /* not USE_KKCC */ k.keysym = keysym; k.modifiers = modifiers; ((*function) (&k, binding, map_keymap_sorted_closure)); @@ -3224,11 +3016,7 @@ /* used by Fmap_keymap() */ static void -#ifdef USE_KKCC map_keymap_mapper (const Lisp_Key_Data *key, -#else /* not USE_KKCC */ -map_keymap_mapper (const struct key_data *key, -#endif /* not USE_KKCC */ Lisp_Object binding, void *function) { @@ -3241,11 +3029,7 @@ static void map_keymap (Lisp_Object keymap_table, int sort_first, -#ifdef USE_KKCC void (*function) (const Lisp_Key_Data *key, -#else /* not USE_KKCC */ - void (*function) (const struct key_data *key, -#endif /* not USE_KKCC */ Lisp_Object binding, void *fn_arg), void *fn_arg) @@ -3344,11 +3128,7 @@ Lisp_Object vec; int j; int len; -#ifdef USE_KKCC Lisp_Key_Data key; -#else /* not USE_KKCC */ - struct key_data key; -#endif /* not USE_KKCC */ key.keysym = keysym; key.modifiers = modifiers; @@ -3436,11 +3216,7 @@ NGCPRO1 (p); for (iii = 0; iii < len; iii++) { -#ifdef USE_KKCC Lisp_Key_Data key; -#else /* not USE_KKCC */ - struct key_data key; -#endif /* not USE_KKCC */ define_key_parser (Faref (prefix, make_int (iii)), &key); XVECTOR_DATA (p)[iii] = make_key_description (&key, 1); } @@ -3536,27 +3312,15 @@ if (!EVENTP (key)) { -#ifdef USE_KKCC Lisp_Object event = Fmake_event (Qnil, Qnil); - XSET_EVENT_TYPE (event, empty_event); CHECK_CHAR_COERCE_INT (key); - character_to_event (XCHAR (key), XEVENT(event), + character_to_event (XCHAR (key), XEVENT (event), XCONSOLE (Vselected_console), 0, 1); format_event_object (buf, event, 1); + Fdeallocate_event (event); } else format_event_object (buf, key, 1); -#else /* not USE_KKCC */ - Lisp_Event event; - event.event_type = empty_event; - CHECK_CHAR_COERCE_INT (key); - character_to_event (XCHAR (key), &event, - XCONSOLE (Vselected_console), 0, 1); - format_event_object (buf, &event, 1); - } - else - format_event_object (buf, XEVENT (key), 1); -#endif /* not USE_KKCC */ str = eimake_string (buf); eifree (buf); return str; @@ -3780,11 +3544,7 @@ static Lisp_Object -#ifdef USE_KKCC raw_keys_to_keys (Lisp_Key_Data *keys, int count) -#else /* not USE_KKCC */ -raw_keys_to_keys (struct key_data *keys, int count) -#endif /* not USE_KKCC */ { Lisp_Object result = make_vector (count, Qnil); while (count--) @@ -3794,36 +3554,21 @@ static void -#ifdef USE_KKCC format_raw_keys (Lisp_Key_Data *keys, int count, Eistring *buf) -#else /* not USE_KKCC */ -format_raw_keys (struct key_data *keys, int count, Eistring *buf) -#endif /* not USE_KKCC */ { int i; -#ifdef USE_KKCC Lisp_Object event = Fmake_event (Qnil, Qnil); XSET_EVENT_TYPE (event, key_press_event); XSET_EVENT_CHANNEL (event, Vselected_console); -#else /* not USE_KKCC */ - Lisp_Event event; - event.event_type = key_press_event; - event.channel = Vselected_console; -#endif /* not USE_KKCC */ for (i = 0; i < count; i++) { -#ifdef USE_KKCC - XSET_KEY_DATA_KEYSYM (XEVENT_DATA (event), keys[i].keysym); - XSET_KEY_DATA_MODIFIERS (XEVENT_DATA (event), KEY_DATA_MODIFIERS (&keys[i])); + XSET_EVENT_KEY_KEYSYM (event, keys[i].keysym); + XSET_EVENT_KEY_MODIFIERS (event, KEY_DATA_MODIFIERS (&keys[i])); format_event_object (buf, event, 1); -#else /* not USE_KKCC */ - event.event.key.keysym = keys[i].keysym; - event.event.key.modifiers = keys[i].modifiers; - format_event_object (buf, &event, 1); -#endif /* not USE_KKCC */ if (i < count - 1) eicat_c (buf, " "); } + Fdeallocate_event (event); } @@ -3856,11 +3601,7 @@ int keys_count; int modifiers_so_far; Eistring *target_buffer; -#ifdef USE_KKCC Lisp_Key_Data *keys_so_far; -#else /* not USE_KKCC */ - struct key_data *keys_so_far; -#endif /* not USE_KKCC */ int keys_so_far_total_size; int keys_so_far_malloced; }; @@ -3889,11 +3630,7 @@ Verify that these bindings aren't shadowed by other bindings in the shadow maps. Either nil or number as value from raw_lookup_key() means undefined. */ -#ifdef USE_KKCC Lisp_Key_Data *so_far = c->keys_so_far; -#else /* not USE_KKCC */ - struct key_data *so_far = c->keys_so_far; -#endif /* not USE_KKCC */ for (;;) /* loop over all keys that match */ { @@ -3901,11 +3638,7 @@ int i; so_far [keys_count].keysym = k; -#ifdef USE_KKCC SET_KEY_DATA_MODIFIERS (&so_far [keys_count], modifiers_so_far); -#else /* not USE_KKCC */ - so_far [keys_count].modifiers = modifiers_so_far; -#endif /* not USE_KKCC */ /* now loop over all shadow maps */ for (i = 0; i < c->shadow_count; i++) @@ -3986,18 +3719,10 @@ lower_modifiers = (modifiers_so_far | bucky); else { -#ifdef USE_KKCC Lisp_Key_Data *so_far = c->keys_so_far; -#else /* not USE_KKCC */ - struct key_data *so_far = c->keys_so_far; -#endif /* not USE_KKCC */ lower_modifiers = 0; so_far [lower_keys_count].keysym = key; -#ifdef USE_KKCC SET_KEY_DATA_MODIFIERS (&so_far [lower_keys_count], modifiers_so_far); -#else /* not USE_KKCC */ - so_far [lower_keys_count].modifiers = modifiers_so_far; -#endif /* not USE_KKCC */ lower_keys_count++; } @@ -4006,24 +3731,12 @@ int size = lower_keys_count + 50; if (! c->keys_so_far_malloced) { -#ifdef USE_KKCC Lisp_Key_Data *new = xnew_array (Lisp_Key_Data, size); -#else /* not USE_KKCC */ - struct key_data *new = xnew_array (struct key_data, size); -#endif /* not USE_KKCC */ memcpy ((void *)new, (const void *)c->keys_so_far, -#ifdef USE_KKCC c->keys_so_far_total_size * sizeof (Lisp_Key_Data)); -#else /* not USE_KKCC */ - c->keys_so_far_total_size * sizeof (struct key_data)); -#endif /* not USE_KKCC */ } else -#ifdef USE_KKCC XREALLOC_ARRAY (c->keys_so_far, Lisp_Key_Data, size); -#else /* not USE_KKCC */ - XREALLOC_ARRAY (c->keys_so_far, struct key_data, size); -#endif /* not USE_KKCC */ c->keys_so_far_total_size = size; c->keys_so_far_malloced = 1; @@ -4057,11 +3770,7 @@ /* This function can GC */ Lisp_Object result = Qnil; int i; -#ifdef USE_KKCC Lisp_Key_Data raw[20]; -#else /* not USE_KKCC */ - struct key_data raw[20]; -#endif /* not USE_KKCC */ struct where_is_closure c; c.definition = definition; @@ -4276,11 +3985,7 @@ struct describe_map_shadow_closure { -#ifdef USE_KKCC const Lisp_Key_Data *raw_key; -#else /* not USE_KKCC */ - const struct key_data *raw_key; -#endif /* not USE_KKCC */ Lisp_Object self; }; @@ -4293,15 +3998,9 @@ if (EQ (map, c->self)) return Qzero; /* Not shadowed; terminate search */ -#ifdef USE_KKCC return !NILP (keymap_lookup_directly (map, KEY_DATA_KEYSYM (c->raw_key), KEY_DATA_MODIFIERS (c->raw_key))) -#else /* not USE_KKCC */ - return !NILP (keymap_lookup_directly (map, - c->raw_key->keysym, - c->raw_key->modifiers)) -#endif /* not USE_KKCC */ ? Qt : Qnil; } @@ -4309,35 +4008,21 @@ static Lisp_Object keymap_lookup_inherited_mapper (Lisp_Object km, void *arg) { -#ifdef USE_KKCC Lisp_Key_Data *k = (Lisp_Key_Data *) arg; return keymap_lookup_directly (km, KEY_DATA_KEYSYM (k), KEY_DATA_MODIFIERS (k)); -#else /* not USE_KKCC */ - struct key_data *k = (struct key_data *) arg; - return keymap_lookup_directly (km, k->keysym, k->modifiers); -#endif /* not USE_KKCC */ } static void -#ifdef USE_KKCC describe_map_mapper (const Lisp_Key_Data *key, -#else /* not USE_KKCC */ -describe_map_mapper (const struct key_data *key, -#endif /* not USE_KKCC */ Lisp_Object binding, void *describe_map_closure) { /* This function can GC */ struct describe_map_closure *closure = (struct describe_map_closure *) describe_map_closure; -#ifdef USE_KKCC Lisp_Object keysym = KEY_DATA_KEYSYM (key); int modifiers = KEY_DATA_MODIFIERS (key); -#else /* not USE_KKCC */ - Lisp_Object keysym = key->keysym; - int modifiers = key->modifiers; -#endif /* not USE_KKCC */ /* Don't mention suppressed commands. */ if (SYMBOLP (binding) Index: src/keymap.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/keymap.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/keymap.h 29 Mar 2002 04:48:00 -0000 1.8 +++ src/keymap.h 12 Jan 2003 11:08:18 -0000 1.9 @@ -58,7 +58,7 @@ void key_desc_list_to_event (Lisp_Object list, Lisp_Object event, int allow_menu_events); -int event_matches_key_specifier_p (Lisp_Event *event, +int event_matches_key_specifier_p (Lisp_Object event, Lisp_Object key_specifier); #endif /* INCLUDED_keymap_h_ */ Index: src/lisp.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v retrieving revision 1.91 retrieving revision 1.95 diff -u -r1.91 -r1.95 --- src/lisp.h 27 Nov 2002 07:15:13 -0000 1.91 +++ src/lisp.h 13 Feb 2003 09:57:07 -0000 1.95 @@ -1,7 +1,7 @@ /* Fundamental definitions for XEmacs Lisp interpreter. Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1993-1996 Richard Mlynarik. - 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. @@ -315,7 +315,6 @@ we don't want by creating overloaded versions of them and declaring them private. */ -#undef class #undef this class Bytecount; @@ -742,7 +741,6 @@ { return Bytecount (x - y); } #endif -#define class c_class #define this c_this #endif /* __cplusplus */ @@ -815,7 +813,7 @@ #ifndef DOESNT_RETURN # if defined __GNUC__ # if ((__GNUC__ > 2) || (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)) -# define RETURN_NOT_REACHED(value) +# define RETURN_NOT_REACHED(value) DO_NOTHING # define DOESNT_RETURN void # define DECLARE_DOESNT_RETURN(decl) \ extern void decl __attribute__ ((noreturn)) @@ -843,11 +841,21 @@ /* "statement not reached */ #if defined __SUNPRO_C || defined __USLC__ #define RETURN_SANS_WARNINGS if (1) return -#define RETURN_NOT_REACHED(value) +#define RETURN_NOT_REACHED(value) DO_NOTHING +#endif + +/* More ways to shut up compiler. This works in Fcommand_loop_1(), + where there's an infinite loop in a function returning a Lisp object. +*/ +#if defined (_MSC_VER) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || \ + (defined (DEC_ALPHA) && defined (OSF1)) +#define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS if (0) return Qnil +#else +#define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS DO_NOTHING #endif #ifndef RETURN_NOT_REACHED -#define RETURN_NOT_REACHED(value) return value; +#define RETURN_NOT_REACHED(value) return (value) #endif #ifndef RETURN_SANS_WARNINGS @@ -1873,6 +1881,36 @@ } while (0) +/* Macros for looping over internal alists. + + *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. *** + + ALIST_LOOP_3 loops over an alist, at each iteration setting CAR and CDR + to the car and cdr of the acons. CAR and CDR are automatically + declared. + + ALIST_LOOP_4 is similar to ALIST_LOOP_3 but contains an additional + variable ACONS at the beginning for access to the acons itself.All of + the variables ACONS, CAR and CDR are automatically declared. +*/ + +#define ALIST_LOOP_3(car, cdr, alist) \ +Lisp_Object _al3_acons_##car, car, cdr, _al3_tail_##car; \ + for (_al3_tail_##car = alist; \ + NILP (_al3_tail_##car) ? \ + 0 : (_al3_acons_##car = XCAR (_al3_tail_##car), \ + car = XCAR (_al3_acons_##car), \ + cdr = XCDR (_al3_acons_##car), 1); \ + _al3_tail_##car = XCDR (_al3_tail_##car)) + +#define ALIST_LOOP_4(acons, car, cdr, list) \ +Lisp_Object acons, car, cdr, _al4_tail_##car; \ + for (_al4_tail_##car = list; \ + NILP (_al4_tail_##car) ? \ + 0 : (elt = XCAR (_al4_tail_##car), car = XCAR (elt), \ + cdr = XCDR (elt), 1); \ + _al4_tail_##car = XCDR (tail)) + /* Macros for looping over external alists. *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. *** @@ -2171,9 +2209,6 @@ { struct lcrecord_header header; long size; - /* next is now chained through v->contents[size], terminated by Qzero. - This means that pure vectors don't need a "next" */ - /* struct Lisp_Vector *next; */ Lisp_Object contents[1]; }; typedef struct Lisp_Vector Lisp_Vector; @@ -2209,8 +2244,7 @@ struct Lisp_Bit_Vector { - struct lrecord_header lheader; - Lisp_Object next; + struct lcrecord_header lheader; Elemcount size; unsigned long bits[1]; }; @@ -2236,7 +2270,6 @@ } while (0) #define bit_vector_length(v) ((v)->size) -#define bit_vector_next(v) ((v)->next) DECLARE_INLINE_HEADER ( int @@ -2669,30 +2702,6 @@ int finish_marking_weak_lists (void); void prune_weak_lists (void); -/*-------------------------- lcrecord-list -----------------------------*/ - -struct lcrecord_list -{ - struct lcrecord_header header; - Lisp_Object free; - Elemcount size; - const struct lrecord_implementation *implementation; -}; - -DECLARE_LRECORD (lcrecord_list, struct lcrecord_list); -#define XLCRECORD_LIST(x) XRECORD (x, lcrecord_list, struct lcrecord_list) -#define wrap_lcrecord_list(p) wrap_record (p, lcrecord_list) -#define LCRECORD_LISTP(x) RECORDP (x, lcrecord_list) -/* #define CHECK_LCRECORD_LIST(x) CHECK_RECORD (x, lcrecord_list) - Lcrecord lists should never escape to the Lisp level, so - functions should not be doing this. */ - -Lisp_Object make_lcrecord_list (Elemcount size, - const struct lrecord_implementation - *implementation); -Lisp_Object allocate_managed_lcrecord (Lisp_Object lcrecord_list); -void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord); - /************************************************************************/ /* Definitions related to the format of text and of characters */ @@ -3004,11 +3013,53 @@ extern struct gcpro *gcprolist; +/* #### Catching insufficient gcpro: + + The C++ code below catches GCPRO without UNGCPRO or vice-versa. + Catching cases where there's no GCPRO or UNGCPRO but should be, however, + is much harder, but could be done: + + 1. Lisp_Object becomes a real object. Its creator and destructor need to + figure out whether the object is on the stack (by looking at the range + that `this' is within), and if so, add the pointer to a list of all + stack-based Lisp_Objects. + + 2. The assignment method needs to do reference-counting on actual Lisp + objects -- in particular, we need to know if there are any references + to a Lisp object that are *NOT* from stack-based Lisp_Objects. + + 3. When we get to a point in the code where we might garbage collect -- + i.e. Ffuncall(), Feval(), or Fgarbage_collect() is called -- we look + at our list of stack-based Lisp_Objects, and if there are any that + point to Lisp objects with no non-stack references, see if there are + any gcpros pointing to the object, and if not, set a flag indicating + that the object is "destroyed". (Don't abort yet because the function + might not use the object any more.) + + 4. When we detag a pointer using XFOO(), abort if its "destroyed" flag + is set. + + --ben +*/ + struct gcpro { struct gcpro *next; const Lisp_Object *var; /* Address of first protected variable */ int nvars; /* Number of consecutive protected variables */ +#if defined (__cplusplus) && defined (ERROR_CHECK_GC) + /* Try to catch GCPRO without UNGCPRO, or vice-versa. G++ complains (at + least with sufficient numbers of warnings enabled, i.e. -Weffc++) if a + copy constructor or assignment operator is not defined. */ + gcpro () : next (0), var (0), nvars (0) { } + gcpro (const gcpro& g) : next (g.next), var (g.var), nvars (g.nvars) { } + gcpro& operator= (const gcpro& g) { next = g.next; var = g.var; + nvars = g.nvars; +#undef this + return *this;} +#define this c_this + ~gcpro () { assert (!next); } +#endif /* defined (__cplusplus) && defined (ERROR_CHECK_GC) */ }; /* Normally, you declare variables gcpro1, gcpro2, ... and use the @@ -3135,7 +3186,31 @@ gcpro3.next = &gcpro2, gcpro3.var = array3, gcpro3.nvars = n3, \ gcprolist = &gcpro3 )) -#define UNGCPRO ((void) (gcprolist = gcpro1.next)) +#if defined (__cplusplus) && defined (ERROR_CHECK_GC) +/* We need to reset each gcpro to avoid triggering the assert() in + ~gcpro(). This happens in UNGCPRO and longjmp(). */ +#define UNWIND_GCPRO_TO(val) \ +do \ +{ \ + struct gcpro *__gcpro_stop = (val); \ + /* Try to catch UNGCPRO without GCPRO. We arrange for there to be a \ + sentinel at the end of the gcprolist, so it should never be NULL. */ \ + assert (__gcpro_stop); \ + while (gcprolist != __gcpro_stop) \ + { \ + struct gcpro *__gcpro_next = gcprolist->next; \ + gcprolist->next = 0; \ + gcprolist = __gcpro_next; \ + assert (gcprolist); \ + } \ +} while (0) +#else +#define UNWIND_GCPRO_TO(val) (gcprolist = (val)) +#endif /* defined (__cplusplus) && defined (ERROR_CHECK_GC) */ + +#define UNGCPRO_1(gcpro1) UNWIND_GCPRO_TO (gcpro1.next) + +#define UNGCPRO UNGCPRO_1 (gcpro1) #define NGCPRO1(var1) ((void) ( \ ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \ @@ -3182,7 +3257,7 @@ ngcpro3.next = &ngcpro2, ngcpro3.var = array3, ngcpro3.nvars = n3, \ gcprolist = &ngcpro3 )) -#define NUNGCPRO ((void) (gcprolist = ngcpro1.next)) +#define NUNGCPRO UNGCPRO_1 (ngcpro1) #define NNGCPRO1(var1) ((void) ( \ nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \ @@ -3229,7 +3304,7 @@ nngcpro3.next = &nngcpro2, nngcpro3.var = array3, nngcpro3.nvars = n3, \ gcprolist = &nngcpro3 )) -#define NNUNGCPRO ((void) (gcprolist = nngcpro1.next)) +#define NNUNGCPRO UNGCPRO_1 (nngcpro1) #endif /* ! DEBUG_GCPRO */ @@ -3299,81 +3374,6 @@ /************************************************************************/ -/* Dumping */ -/************************************************************************/ - -/* dump_add_root_struct_ptr (&var, &desc) dumps the structure pointed to by - `var'. This is for a single relocatable pointer located in the data - segment (i.e. the block pointed to is in the heap). */ -#ifdef PDUMP -void dump_add_root_struct_ptr (void *, const struct struct_description *); -#else -#define dump_add_root_struct_ptr(varaddr,descaddr) DO_NOTHING -#endif - -/* dump_add_opaque (&var, size) dumps the opaque static structure `var'. - This is for a static block of memory (in the data segment, not the - heap), with no relocatable pointers in it. */ -#ifdef PDUMP -void dump_add_opaque (const void *, Bytecount); -#else -#define dump_add_opaque(varaddr,size) DO_NOTHING -#endif - -/* dump_add_root_block (&var, &desc) dumps the static structure located at - `var' and described by DESC. This is for a static block of memory (in - the data segment, not the heap), with relocatable pointers in it, as - described by DESC. (#### Not yet implemented) */ -#ifdef PDUMP -void dump_add_root_block (void *ptraddress, - const struct lrecord_description *desc); -#else -#define dump_add_root_block(ptraddress,desc) DO_NOTHING -#endif - -/* Call dump_add_opaque_int (&int_var) to dump `int_var', of type `int'. */ -#ifdef PDUMP -#define dump_add_opaque_int(int_varaddr) do { \ - int *dao_ = (int_varaddr); /* type check */ \ - dump_add_opaque (dao_, sizeof (*dao_)); \ -} while (0) -#else -#define dump_add_opaque_int(int_varaddr) DO_NOTHING -#endif - -/* Call dump_add_opaque_fixnum (&fixnum_var) to dump `fixnum_var', of type `Fixnum'. */ -#ifdef PDUMP -#define dump_add_opaque_fixnum(fixnum_varaddr) do { \ - Fixnum *dao_ = (fixnum_varaddr); /* type check */ \ - dump_add_opaque (dao_, sizeof (*dao_)); \ -} while (0) -#else -#define dump_add_opaque_fixnum(fixnum_varaddr) DO_NOTHING -#endif - -/* Call dump_add_root_object (&var) to ensure that var is properly updated after pdump. */ -#ifdef PDUMP -void dump_add_root_object (Lisp_Object *); -#else -#define dump_add_root_object(varaddr) DO_NOTHING -#endif - -/* Call dump_add_root_object (&var) to ensure that var is properly updated after - pdump. var must point to a linked list of objects out of which - some may not be dumped */ -#ifdef PDUMP -void dump_add_weak_object_chain (Lisp_Object *); -#else -#define dump_add_weak_object_chain(varaddr) DO_NOTHING -#endif - -/* Nonzero means Emacs has already been initialized. - Used during startup to detect startup of dumped Emacs. */ -extern int initialized; - - - -/************************************************************************/ /* Misc definitions */ /************************************************************************/ @@ -3435,6 +3435,7 @@ extern EMACS_INT gc_generation_number[1]; int c_readonly (Lisp_Object); int lisp_readonly (Lisp_Object); +void copy_lisp_object (Lisp_Object dst, Lisp_Object src); Lisp_Object build_intstring (const Ibyte *); Lisp_Object build_string (const CIbyte *); Lisp_Object build_ext_string (const Extbyte *, Lisp_Object); @@ -3449,8 +3450,7 @@ void free_cons (Lisp_Object); void free_list (Lisp_Object); void free_alist (Lisp_Object); -void mark_conses_in_list (Lisp_Object); -void free_marker (Lisp_Marker *); +void free_marker (Lisp_Object); int object_dead_p (Lisp_Object); void mark_object (Lisp_Object obj); int marked_p (Lisp_Object obj); @@ -3465,29 +3465,27 @@ Bytecount malloced_storage_size (void *, Bytecount, struct overhead_stats *); Bytecount fixed_type_block_overhead (Bytecount); #endif -#ifdef PDUMP -void pdump (void); -int pdump_load (const char *); - -extern char *pdump_start, *pdump_end; -#define DUMPEDP(adr) ((((char *)(adr)) < pdump_end) && (((char *)(adr)) >= pdump_start)) -#else -#define DUMPEDP(adr) 0 -#endif - -#ifdef USE_KKCC -Lisp_Object allocate_event (void); -Lisp_Object allocate_key_data (void); -Lisp_Object allocate_button_data (void); -Lisp_Object allocate_motion_data (void); -Lisp_Object allocate_process_data (void); -Lisp_Object allocate_timeout_data (void); -Lisp_Object allocate_magic_data (void); -Lisp_Object allocate_magic_eval_data (void); -Lisp_Object allocate_eval_data (void); -Lisp_Object allocate_misc_user_data (void); -#endif /* USE_KKCC */ +#ifdef EVENT_DATA_AS_OBJECTS +Lisp_Object make_key_data (void); +Lisp_Object make_button_data (void); +Lisp_Object make_motion_data (void); +Lisp_Object make_process_data (void); +Lisp_Object make_timeout_data (void); +Lisp_Object make_magic_data (void); +Lisp_Object make_magic_eval_data (void); +Lisp_Object make_eval_data (void); +Lisp_Object make_misc_user_data (void); +void free_key_data (Lisp_Object); +void free_button_data (Lisp_Object); +void free_motion_data (Lisp_Object); +void free_process_data (Lisp_Object); +void free_timeout_data (Lisp_Object); +void free_magic_data (Lisp_Object); +void free_magic_eval_data (Lisp_Object); +void free_eval_data (Lisp_Object); +void free_misc_user_data (Lisp_Object); +#endif /* EVENT_DATA_AS_OBJECTS */ /* Defined in buffer.c */ Lisp_Object get_truename_buffer (Lisp_Object); @@ -3505,6 +3503,7 @@ int (*mapfun) (struct buffer *buf, void *closure), void *closure); +void cleanup_buffer_undo_lists (void); extern struct buffer *current_buffer; @@ -4037,6 +4036,7 @@ void warn_when_safe_lispobj (Lisp_Object, Lisp_Object, Lisp_Object); void warn_when_safe (Lisp_Object, Lisp_Object, const CIbyte *, ...) PRINTF_ARGS (3, 4); +extern int backtrace_with_internal_sections; /* Defined in event-stream.c */ @@ -4052,7 +4052,7 @@ EXFUN (Fsleep_for, 1); void wait_delaying_user_input (int (*) (void *), void *); -int detect_input_pending (void); +int detect_input_pending (int how_many); void reset_this_command_keys (Lisp_Object, int); Lisp_Object enqueue_misc_user_event (Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object enqueue_misc_user_event_pos (Lisp_Object, Lisp_Object, @@ -4060,7 +4060,6 @@ extern int modifier_keys_are_sticky; /* Defined in event-Xt.c */ -void enqueue_Xt_dispatch_event (Lisp_Object event); void signal_special_Xt_user_event (Lisp_Object, Lisp_Object, Lisp_Object); @@ -4218,6 +4217,7 @@ EXFUN (Frassq, 2); EXFUN (Fremassq, 2); EXFUN (Freplace_list, 2); +EXFUN (Fsafe_length, 1); EXFUN (Fsort, 2); EXFUN (Fstring_equal, 2); EXFUN (Fstring_lessp, 2); @@ -4408,6 +4408,10 @@ /* Lower-level ways to output data: */ void print_internal (Lisp_Object, Lisp_Object, int); void debug_print (Lisp_Object); +void debug_p4 (Lisp_Object obj); +void debug_p3 (Lisp_Object obj); +void debug_short_backtrace (int); +void debug_backtrace (void); /* NOTE: Do not call this with the data of a Lisp_String. Use princ. * Note: stream should be defaulted before calling * (eg Qnil means stdout, not Vstandard_output, etc) */ @@ -4430,6 +4434,7 @@ ...), 1, 2); /* Internal functions: */ +Lisp_Object canonicalize_printcharfun (Lisp_Object printcharfun); void temp_output_buffer_setup (Lisp_Object); void temp_output_buffer_show (Lisp_Object, Lisp_Object); void print_cons (Lisp_Object, Lisp_Object, int); @@ -4455,14 +4460,6 @@ Lisp_Object, Lisp_Object); void float_to_string (char *, double); void internal_object_printer (Lisp_Object, Lisp_Object, int); -void debug_short_backtrace (int); -void debug_backtrace (void); - -/* Defined in profile.c */ -void mark_profiling_info (void); -void profile_increase_call_count (Lisp_Object); -extern int profiling_active; -extern int profiling_redisplay_flag; /* Defined in rangetab.c */ EXFUN (Fclear_range_table, 1); @@ -4879,6 +4876,16 @@ return atoi ((const char *) string); } +DECLARE_INLINE_HEADER (Ibyte *qxestrupr (Ibyte *s)) +{ + return (Ibyte *) strupr ((char *) s); +} + +DECLARE_INLINE_HEADER (Ibyte *qxestrlwr (Ibyte *s)) +{ + return (Ibyte *) strlwr ((char *) s); +} + int qxesprintf (Ibyte *buffer, const CIbyte *format, ...) PRINTF_ARGS (2, 3); @@ -4922,8 +4929,8 @@ Bytebpos byte_end); /* Defined in unicode.c */ -extern const struct struct_description to_unicode_description[]; -extern const struct struct_description from_unicode_description[]; +extern const struct sized_memory_description to_unicode_description; +extern const struct sized_memory_description from_unicode_description; void init_charset_unicode_tables (Lisp_Object charset); void free_charset_unicode_tables (Lisp_Object charset); void recalculate_unicode_precedence (void); Index: src/lread.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lread.c,v retrieving revision 1.60 retrieving revision 1.64 diff -u -r1.60 -r1.64 --- src/lread.c 27 Nov 2002 07:15:13 -0000 1.60 +++ src/lread.c 13 Feb 2003 09:57:07 -0000 1.64 @@ -1,7 +1,7 @@ /* Lisp parsing and input streams. Copyright (C) 1985-1989, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems. - Copyright (C) 1996, 2001, 2002 Ben Wing. + Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -30,9 +30,10 @@ #include "buffer.h" #include "bytecode.h" #include "elhash.h" +#include "file-coding.h" #include "lstream.h" #include "opaque.h" -#include "file-coding.h" +#include "profile.h" #include "sysfile.h" #include "sysfloat.h" @@ -59,8 +60,7 @@ Lisp_Object Qvariable_domain; /* I18N3 */ Lisp_Object Vvalues, Vstandard_input, Vafter_load_alist; Lisp_Object Qcurrent_load_list; -Lisp_Object Qload, Qload_file_name; -Lisp_Object Qfset; +Lisp_Object Qload, Qload_file_name, Qload_internal, Qfset; /* Hash-table that maps directory names to hashes of their contents. */ static Lisp_Object Vlocate_file_hash_table; @@ -213,8 +213,8 @@ /* When errors are signaled, the actual readcharfun should not be used as an argument if it is an lstream, so that lstreams don't escape to the Lisp level. */ -#define READCHARFUN_MAYBE(x) (LSTREAMP (x) \ - ? (build_msg_string ("internal input stream")) \ +#define READCHARFUN_MAYBE(x) (LSTREAMP (x) \ + ? (build_msg_string ("internal input stream")) \ : (x)) @@ -497,32 +497,28 @@ Lisp_Object older = Qnil; Lisp_Object handler = Qnil; Lisp_Object found = Qnil; + Lisp_Object retval; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int reading_elc = 0; int from_require = EQ (nomessage, Qrequire); - int message_p = - NILP (nomessage) || from_require || load_always_display_messages; -/*#ifdef DEBUG_XEMACS*/ - static Lisp_Object last_file_loaded; -/*#endif*/ + int message_p = NILP (nomessage) || load_always_display_messages; struct stat s1, s2; - GCPRO4 (file, newer, older, found); + Ibyte *spaces = alloca_ibytes (load_in_progress * 2 + 10); + int i; + PROFILE_DECLARE (); + GCPRO4 (file, newer, older, found); CHECK_STRING (file); -/*#ifdef DEBUG_XEMACS*/ - if (purify_flag && noninteractive) - { - message_p = 1; - last_file_loaded = file; - } -/*#endif / * DEBUG_XEMACS */ + PROFILE_RECORD_ENTERING_SECTION (Qload_internal); /* If file name is magic, call the handler. */ handler = Ffind_file_name_handler (file, Qload); if (!NILP (handler)) - RETURN_UNGCPRO (call5 (handler, Qload, file, noerror, - nomessage, nosuffix)); + { + retval = call5 (handler, Qload, file, noerror, nomessage, nosuffix); + goto done; + } /* Do this after the handler to avoid the need to gcpro noerror, nomessage and nosuffix. @@ -531,6 +527,15 @@ if (!NILP (used_codesys)) CHECK_SYMBOL (used_codesys); + if (noninteractive) + { + for (i = 0; i < load_in_progress * 2; i++) + spaces[i] = ' '; + spaces[i] = '\0'; + } + else + spaces[0] = '\0'; + /* Avoid weird lossage with null string as arg, since it would try to load a directory as a Lisp file. Unix truly sucks. */ @@ -552,8 +557,8 @@ signal_error (Qfile_error, "Cannot open load file", file); else { - UNGCPRO; - return Qnil; + retval = Qnil; + goto done; } } @@ -621,40 +626,40 @@ if (load_ignore_elc_files) \ { \ if (message_p) \ - message (loading done, \ + message (loading done, spaces, \ XSTRING_DATA (load_show_full_path_in_messages ? \ found : newer)); \ } \ else if (!NILP (older)) \ { \ assert (load_ignore_out_of_date_elc_files); \ - message (loading done " (file %s is out-of-date)", \ + message (loading done " (file %s is out-of-date)", spaces, \ XSTRING_DATA (load_show_full_path_in_messages ? \ found : newer), \ XSTRING_DATA (older)); \ } \ else if (!NILP (newer)) \ - message (loading done " (file %s is newer)", \ + message (loading done " (file %s is newer)", spaces, \ XSTRING_DATA (load_show_full_path_in_messages ? \ found : file), \ XSTRING_DATA (newer)); \ else if (source_only) \ - message (loading done " (file %s.elc does not exist)", \ + message (loading done " (file %s.elc does not exist)", spaces, \ XSTRING_DATA (load_show_full_path_in_messages ? \ found : file), \ XSTRING_DATA (Ffile_name_nondirectory (file))); \ else if (message_p) \ - message (loading done, \ + message (loading done, spaces, \ XSTRING_DATA (load_show_full_path_in_messages ? \ found : file)); \ } while (0) -#define PRINT_LOADING_MESSAGE(done) \ -do { \ - if (from_require) \ - PRINT_LOADING_MESSAGE_1 ("Requiring %s...", done); \ - else \ - PRINT_LOADING_MESSAGE_1 ("Loading %s...", done); \ +#define PRINT_LOADING_MESSAGE(done) \ +do { \ + if (from_require) \ + PRINT_LOADING_MESSAGE_1 ("%sRequiring %s...", done); \ + else \ + PRINT_LOADING_MESSAGE_1 ("%sLoading %s...", done); \ } while (0) PRINT_LOADING_MESSAGE (""); @@ -736,13 +741,7 @@ if (!NILP (Ffile_name_absolute_p (file))) name = Ffile_name_nondirectory (file); - { - struct gcpro ngcpro1; - - NGCPRO1 (name); - tem = Fassoc (name, Vafter_load_alist); - NUNGCPRO; - } + tem = Fassoc (name, Vafter_load_alist); if (!NILP (tem)) { struct gcpro ngcpro1; @@ -755,19 +754,14 @@ } } -/* #ifdef DEBUG_XEMACS */ - if (purify_flag && noninteractive) - { - if (!EQ (last_file_loaded, file)) - message ("Loading %s ...done", XSTRING_DATA (file)); - } -/* #endif / * DEBUG_XEMACS */ - if (!noninteractive) PRINT_LOADING_MESSAGE ("done"); + retval = Qt; +done: + PROFILE_RECORD_EXITING_SECTION (Qload_internal); UNGCPRO; - return Qt; + return retval; } @@ -3031,6 +3025,7 @@ DEFSYMBOL (Qcurrent_load_list); DEFSYMBOL (Qload); DEFSYMBOL (Qload_file_name); + DEFSYMBOL (Qload_internal); DEFSYMBOL (Qfset); #ifdef LISP_BACKQUOTES @@ -3116,7 +3111,7 @@ If this variable is true, then when a `.elc' file is being loaded and the corresponding `.el' is newer, a warning message will be printed. */ ); - load_warn_when_source_newer = 0; + load_warn_when_source_newer = 1; DEFVAR_BOOL ("load-warn-when-source-only", &load_warn_when_source_only /* *Whether `load' should warn when loading a `.el' file instead of an `.elc'. @@ -3221,7 +3216,7 @@ #endif /* So that early-early stuff will work */ - Ffset (Qload, intern ("load-internal")); + Ffset (Qload, Qload_internal); #ifdef FEATUREP_SYNTAX DEFSYMBOL (Qfeaturep); Index: src/lrecord.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lrecord.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- src/lrecord.h 10 Sep 2002 15:27:38 -0000 1.23 +++ src/lrecord.h 12 Jan 2003 11:08:18 -0000 1.24 @@ -40,14 +40,14 @@ of memory called `frob blocks'). These objects have a `struct lrecord_header' at the top, containing only the bits needed to find the lrecord_implementation for the object. There are special - routines in alloc.c to deal with each such object type. + routines in alloc.c to create an object of each such type. Lcrecords are used for less common sorts of objects that don't do their own allocation. Each such object is malloc()ed individually, and the objects are chained together through a `next' pointer. Lcrecords have a `struct lcrecord_header' at the top, which contains a `struct lrecord_header' and a `next' pointer, and are - allocated using alloc_lcrecord(). + allocated using alloc_lcrecord_type() or its variants. Creating a new lcrecord type is fairly easy; just follow the lead of some existing type (e.g. hash tables). Note that you @@ -55,11 +55,14 @@ defaults are provided for many of them. Alternatively, if you're just looking for a way of encapsulating data (which possibly could contain Lisp_Objects in it), you may well be able to use - the opaque type. */ + the opaque type. --ben +*/ struct lrecord_header { - /* index into lrecord_implementations_table[] */ + /* Index into lrecord_implementations_table[]. Objects that have been + explicitly freed using e.g. free_cons() have lrecord_type_free in this + field. */ unsigned int type :8; /* If `mark' is 0 after the GC mark phase, the object will be freed @@ -97,7 +100,7 @@ /* The `next' field is normally used to chain all lcrecords together so that the GC can find (and free) all of them. - `alloc_lcrecord' threads lcrecords together. + `basic_alloc_lcrecord' threads lcrecords together. The `next' field may be used for other purposes as long as some other mechanism is provided for letting the GC do its work. @@ -134,15 +137,15 @@ /* Symbol value magic types come first to make SYMBOL_VALUE_MAGIC_P fast. #### This should be replaced by a symbol_value_magic_p flag in the Lisp_Symbol lrecord_header. */ - lrecord_type_symbol_value_forward, - lrecord_type_symbol_value_varalias, - lrecord_type_symbol_value_lisp_magic, - lrecord_type_symbol_value_buffer_local, + lrecord_type_symbol_value_forward, /* 0 */ + lrecord_type_symbol_value_varalias, /* 1 */ + lrecord_type_symbol_value_lisp_magic, /* 2 */ + lrecord_type_symbol_value_buffer_local, /* 3 */ lrecord_type_max_symbol_value_magic = lrecord_type_symbol_value_buffer_local, - lrecord_type_symbol, - lrecord_type_subr, - lrecord_type_cons, + lrecord_type_symbol, /* 4 */ + lrecord_type_subr, /* 5 */ + lrecord_type_cons, /* 6 */ lrecord_type_vector, lrecord_type_string, lrecord_type_lcrecord_list, @@ -166,7 +169,7 @@ lrecord_type_extent_auxiliary, lrecord_type_marker, lrecord_type_event, -#ifdef USE_KKCC +#ifdef EVENT_DATA_AS_OBJECTS lrecord_type_key_data, lrecord_type_button_data, lrecord_type_motion_data, @@ -176,7 +179,7 @@ lrecord_type_misc_user_data, lrecord_type_magic_eval_data, lrecord_type_magic_data, -#endif /* USE_KKCC */ +#endif /* EVENT_DATA_AS_OBJECTS */ lrecord_type_keymap, lrecord_type_command_builder, lrecord_type_timeout, @@ -233,7 +236,12 @@ because the GC routines will do this). Doing it this way reduces recursion, so the object returned should preferably be the one with the deepest level of Lisp_Object pointers. This function - can be NULL, meaning no GC marking is necessary. */ + can be NULL, meaning no GC marking is necessary. + + NOTE NOTE NOTE: This is not used by KKCC (which uses the data + description below instead), unless the data description is missing. + Yes, this currently means there is logic duplication. Eventually the + mark methods will be removed. */ Lisp_Object (*marker) (Lisp_Object); /* `printer' converts the object to a printed representation. @@ -263,8 +271,8 @@ also NULL. */ unsigned long (*hash) (Lisp_Object, int); - /* External data layout description */ - const struct lrecord_description *description; + /* Data layout description for your object. See long comment below. */ + const struct memory_description *description; /* These functions allow any object type to have builtin property lists that can be manipulated from the lisp level with @@ -275,7 +283,7 @@ Lisp_Object (*plist) (Lisp_Object obj); /* Only one of `static_size' and `size_in_bytes_method' is non-0. - If both are 0, this type is not instantiable by alloc_lcrecord(). */ + If both are 0, this type is not instantiable by basic_alloc_lcrecord(). */ Bytecount static_size; Bytecount (*size_in_bytes_method) (const void *header); @@ -284,9 +292,7 @@ /* A "basic" lrecord is any lrecord that's not an lcrecord, i.e. one that does not have an lcrecord_header at the front and which - is (usually) allocated in frob blocks. We only use this flag for - some consistency checking, and that only when error-checking is - enabled. */ + is (usually) allocated in frob blocks. */ unsigned int basic_p :1; }; @@ -320,37 +326,97 @@ ((void) ((lheader)->lisp_readonly = 1)) #define RECORD_MARKER(lheader) lrecord_markers[(lheader)->type] -#ifdef USE_KKCC #define RECORD_DUMPABLE(lheader) (lrecord_implementations_table[(lheader)->type])->dumpable -#endif /* USE_KKCC */ -/* External description stuff +/* Data description stuff - PLEASE NOTE: Both lrecord_description and struct_description are - badly misnamed. In reality, an lrecord_description is nothing more - than a list of the elements in a block of memory that need - relocating or other special handling, and a struct_description is - no more than an lrecord_description plus the size of the block of - memory. (In fact, a struct_description can now have its size given - as zero, i.e. unspecified, meaning that the last element in the - structure is noted in the list and the size of the block can - therefore be computed from it.) The names stem from the fact - lrecord_descriptions are used to describe lrecords (the size of the - lrecord is elsewhere in its description, attached to its methods, - so it does not need to be given here), while struct_descriptions - are used to describe C structs; but both are used in various - additional ways. Much better terms would be memory_description and - sized_memory_description. + Data layout descriptions describe blocks of memory (in particular, Lisp + objects and other objects on the heap, and global objects with pointers + to such heap objects), including their size and a list of the elements + that need relocating, marking or other special handling. They are + currently used in two places: by pdump [the new, portable dumper] and + KKCC [the new garbage collector]. The two subsystems use the + descriptions in different ways, and as a result some of the descriptions + are appropriate only for one or the other, when it is known that only + that subsystem will use the description. (This is particularly the case + with objects that can't be dumped, because pdump needs more info than + KKCC.) However, properly written descriptions are appropriate for both, + and you should strive to write your descriptions that way, since the + dumpable status of an object may change and new uses for the + descriptions may be created. (An example that comes to mind is a + facility for determining the memory usage of XEmacs data structures -- + like `buffer-memory-usage', `window-memory-usage', etc. but more + general.) + + More specifically: + + Pdump (the portable dumper) needs to write out all objects in heap + space, and later on (in another invocation of XEmacs) load them back + into the heap, relocating all pointers to the heap objects in the global + data space. ("Heap" means anything malloc()ed, including all Lisp + objects, and "global data" means anything declared globally or + `static'.) Pdump, then, needs to be told about the location of all + global pointers to heap objects, all the description of all such + objects, including their size and any pointers to other heap (aka + "relocatable") objects. (Pdump assumes that the heap may occur in + different places in different invocations -- therefore, it is not enough + simply to write out the entire heap and later reload it at the same + location -- but that global data is always in the same place, and hence + pointers to it do not need to be relocated. This assumption holds true + in general for modern operating systems, but would be broken, for + example, in a system without virtual memory, or when dealing with shared + libraries. Also, unlike unexec, pdump does not usually write out or + restore objects in the global data space, and thus they need to be + initialized every time XEmacs is loaded. This is the purpose of the + reinit_*() functions throughout XEmacs. [It's possible, however, to make + pdump restore global data. This must be done, of course, for heap + pointers, but is also done for other values that are not easy to + recompute -- in particular, values established by the Lisp code loaded + at dump time.]) Note that the data type `Lisp_Object' is basically just + a relocatable pointer disguised as a long, and in general pdump treats + the Lisp_Object values and pointers to Lisp objects (e.g. Lisp_Object + vs. `struct frame *') identically. (NOTE: This equivalence depends + crucially on the current "minimal tagbits" implementation of Lisp_Object + pointers.) + + Descriptions are used by pdump in three places: (a) descriptions of Lisp + objects, referenced in the DEFINE_*LRECORD_*IMPLEMENTATION*() call; (b) + descriptions of global objects to be dumped, registered by + dump_add_root_block(); (c) descriptions of global pointers to + non-Lisp_Object heap objects, registered by dump_add_root_struct_ptr(). + The descriptions need to tell pdump which elements of your structure are + Lisp_Objects or structure pointers, plus the descriptions in turn of the + non-Lisp_Object structures pointed to. If these structures are you own + private ones, you will have to write these recursive descriptions + yourself; otherwise, you are reusing a structure already in existence + elsewhere and there is probably already a description for it. + + Pdump does not care about Lisp objects that cannot be dumped (the + dumpable flag to DEFINE_*LRECORD_*IMPLEMENTATION*() is 0). + + KKCC also uses data layout descriptions, but differently. It cares + about all objects, dumpable or not, but specifically only wants to know + about Lisp_Objects in your object and in structures pointed to. Thus, + it doesn't care about things like pointers to structures ot other blocks + of memory with no Lisp Objects in them, which pdump would care a lot + about. + + Technically, then, you could write your description differently + depending on whether your object is dumpable -- the full pdump + description if so, the abbreviated KKCC description if not. In fact, + some descriptions are written this way. This is dangerous, though, + because another use might come along for the data descriptions, that + doesn't care about the dumper flag and makes use of some of the stuff + normally omitted from the "abbreviated" description -- see above. - An lrecord_description is an array of values. (This is actually + A memory_description is an array of values. (This is actually misnamed, in that it does not just describe lrecords, but any blocks of memory.) The first value of each line is a type, the second the offset in the lrecord structure. The third and following elements are parameters; their presence, type and number is type-dependent. - The description ends with a "XD_END", "XD_SPECIFIER_END" or - "XD_CODING_SYSTEM_END" record. + The description ends with an "XD_END" record. The top-level description of an lrecord or lcrecord does not need to describe every element, just the ones that need to be relocated, @@ -358,14 +424,28 @@ structures, whenever the structure size is given, rather than being defaulted by specifying 0 for the size.) - A struct_description is used for describing nested "structures". (Again - a misnomer, since it can be used for any blocks of memory, not just - structures.) It just contains a size for the memory block, a pointer to - an lrecord_description, and (for unions only) a union constant, - described below. The size can be 0, in which case the size will be - determined from the largest offset logically referenced (i.e. last - offset mentioned + size of that object). This is useful for stretchy - arrays. + A sized_memory_description is a memory_description plus the size of the + block of memory. The size field in a sized_memory_description can be + given as zero, i.e. unspecified, meaning that the last element in the + structure is described in the description and the size of the block can + therefore be computed from it. (This is useful for stretchy arrays.) + + memory_descriptions are used to describe lrecords (the size of the + lrecord is elsewhere in its description, attached to its methods, so it + does not need to be given here) and global objects, where the size is an + argument to the call to dump_add_root_block(). + sized_memory_descriptions are used for pointers and arrays in + memory_descriptions and for calls to dump_add_root_struct_ptr(). (#### + It is not obvious why this is so in the latter case. Probably, calls to + dump_add_root_struct_ptr() should use plain memory_descriptions and have + the size be an argument to the call.) + + NOTE: Anywhere that a sized_memory_description occurs inside of a plain + memory_description, a "description map" can be substituted. Rather than + being an actual description, this describes how to find the description + by looking inside of the object being described. This is a convenient + way to describe Lisp objects with subtypes and corresponding + type-specific data. Some example descriptions : @@ -377,7 +457,7 @@ Lisp_Object plist; }; - static const struct lrecord_description cons_description[] = { + static const struct memory_description cons_description[] = { { XD_LISP_OBJECT, offsetof (Lisp_Cons, car) }, { XD_LISP_OBJECT, offsetof (Lisp_Cons, cdr) }, { XD_END } @@ -385,9 +465,9 @@ Which means "two lisp objects starting at the 'car' and 'cdr' elements" - static const struct lrecord_description string_description[] = { + static const struct memory_description string_description[] = { { XD_BYTECOUNT, offsetof (Lisp_String, size) }, - { XD_OPAQUE_DATA_PTR, offsetof (Lisp_String, data), XD_INDIRECT(0, 1) }, + { XD_OPAQUE_DATA_PTR, offsetof (Lisp_String, data), XD_INDIRECT (0, 1) }, { XD_LISP_OBJECT, offsetof (Lisp_String, plist) }, { XD_END } }; @@ -408,32 +488,33 @@ You'd use XD_STRUCT_PTR, something like: - static const struct lrecord_description lo_description_1[] = { - { XD_LISP_OBJECT, 0 }, - { XD_END } - }; - - static const struct struct_description lo_description = { - sizeof (Lisp_Object), - lo_description_1 - }; - - static const struct lrecord_description foo_description[] = { + static const struct memory_description foo_description[] = { ... { XD_INT, offsetof (Lisp_Foo, count) }, { XD_STRUCT_PTR, offsetof (Lisp_Foo, objects), - XD_INDIRECT (0, 0), &lo_description }, + XD_INDIRECT (0, 0), &lisp_object_description }, ... }; + lisp_object_description is declared in alloc.c, like this: + + static const struct memory_description lisp_object_description_1[] = { + { XD_LISP_OBJECT, 0 }, + { XD_END } + }; + + const struct sized_memory_description lisp_object_description = { + sizeof (Lisp_Object), + lisp_object_description_1 + }; Another example of XD_STRUCT_PTR: - typedef struct hentry + typedef struct htentry { Lisp_Object key; Lisp_Object value; - } hentry; + } htentry; struct Lisp_Hash_Table { @@ -446,27 +527,27 @@ Elemcount golden_ratio; hash_table_hash_function_t hash_function; hash_table_test_function_t test_function; - hentry *hentries; + htentry *hentries; enum hash_table_weakness weakness; Lisp_Object next_weak; // Used to chain together all of the weak // hash tables. Don't mark through this. }; - static const struct lrecord_description hentry_description_1[] = { - { XD_LISP_OBJECT, offsetof (hentry, key) }, - { XD_LISP_OBJECT, offsetof (hentry, value) }, + static const struct memory_description htentry_description_1[] = { + { XD_LISP_OBJECT, offsetof (htentry, key) }, + { XD_LISP_OBJECT, offsetof (htentry, value) }, { XD_END } }; - static const struct struct_description hentry_description = { - sizeof (hentry), - hentry_description_1 + static const struct sized_memory_description htentry_description = { + sizeof (htentry), + htentry_description_1 }; - const struct lrecord_description hash_table_description[] = { + const struct memory_description hash_table_description[] = { { XD_ELEMCOUNT, offsetof (Lisp_Hash_Table, size) }, - { XD_STRUCT_PTR, offsetof (Lisp_Hash_Table, hentries), XD_INDIRECT(0, 1), - &hentry_description }, + { XD_STRUCT_PTR, offsetof (Lisp_Hash_Table, hentries), XD_INDIRECT (0, 1), + &htentry_description }, { XD_LO_LINK, offsetof (Lisp_Hash_Table, next_weak) }, { XD_END } }; @@ -475,21 +556,71 @@ the ones that need to be relocated (Lisp_Objects and structures) or that need to be referenced as counts for relocated objects. + A description map looks like this: + + static const struct sized_memory_description specifier_extra_description_map [] = { + { offsetof (Lisp_Specifier, methods) }, + { offsetof (struct specifier_methods, extra_description) }, + { -1 } + }; + + const struct memory_description specifier_description[] = { + ... + { XD_STRUCT_ARRAY, offset (Lisp_Specifier, data), 1, + specifier_extra_description_map }, + ... + { XD_END } + }; + + This would be appropriate for an object that looks like this: + + struct specifier_methods + { + ... + const struct sized_memory_description *extra_description; + ... + }; + + struct Lisp_Specifier + { + struct lcrecord_header header; + struct specifier_methods *methods; + + ... + // type-specific extra data attached to a specifier + max_align_t data[1]; + }; + + The description map means "retrieve a pointer into the object at offset + `offsetof (Lisp_Specifier, methods)' , then in turn retrieve a pointer + into that object at offset `offsetof (struct specifier_methods, + extra_description)', and that is the sized_memory_description to use." + There can be any number of indirections, which can be either into + straight pointers or Lisp_Objects. The way that description maps are + distinguished from normal sized_memory_descriptions is that in the + former, the memory_description pointer is NULL. + + --ben + The existing types : XD_LISP_OBJECT - A Lisp object. This is also the type to use for pointers to other lrecords. + + A Lisp object. This is also the type to use for pointers to other lrecords + (e.g. struct frame *). XD_LISP_OBJECT_ARRAY + An array of Lisp objects or (equivalently) pointers to lrecords. The parameter (i.e. third element) is the count. This would be declared as Lisp_Object foo[666]. For something declared as Lisp_Object *foo, - use XD_STRUCT_PTR, whose description parameter is a struct_description + use XD_STRUCT_PTR, whose description parameter is a sized_memory_description consisting of only XD_LISP_OBJECT and XD_END. XD_LO_LINK + Weak link in a linked list of objects of the same type. This is a link that does NOT generate a GC reference. Thus the pdumper will not automatically add the referenced object to the table of all @@ -501,103 +632,137 @@ object. XD_OPAQUE_PTR + Pointer to undumpable data. Must be NULL when dumping. XD_STRUCT_PTR + Pointer to block of described memory. (This is misnamed: It is NOT necessarily a pointer to a struct foo.) Parameters are number of - contiguous blocks and struct_description. + contiguous blocks and sized_memory_description. XD_STRUCT_ARRAY + Array of blocks of described memory. Parameters are number of - structures and struct_description. This differs from XD_STRUCT_PTR + structures and sized_memory_description. This differs from XD_STRUCT_PTR in that the parameter is declared as struct foo[666] instead of struct *foo. In other words, the block of memory holding the structures is within the containing structure, rather than being elsewhere, with a pointer in the containing structure. + NOTE NOTE NOTE: Be sure that you understand the difference between + XD_STRUCT_PTR and XD_STRUCT_ARRAY: + - struct foo bar[666], i.e. 666 inline struct foos + --> XD_STRUCT_ARRAY, argument 666, pointing to a description of + struct foo + - struct foo *bar, i.e. pointer to a block of 666 struct foos + --> XD_STRUCT_PTR, argument 666, pointing to a description of + struct foo + - struct foo *bar[666], i.e. 666 pointers to separate blocks of struct foos + --> XD_STRUCT_ARRAY, argument 666, pointing to a description of + a single pointer to struct foo; the description is a single + XD_STRUCT_PTR, argument 1, which in turn points to a description + of struct foo. + XD_OPAQUE_DATA_PTR + Pointer to dumpable opaque data. Parameter is the size of the data. Pointed data must be relocatable without changes. XD_UNION - Union of two or more different types of data. Parameters are a - constant which determines which type the data is (this is usually an - XD_INDIRECT, referring to one of the fields in the structure), and - an array of struct_descriptions, whose values are used as follows, - which is *DIFFERENT* from their usage in XD_STRUCT_PTR: the first - field is a constant, which is compared to the first parameter of the - XD_UNION descriptor to determine if this description applies to the - data at the given offset, and the second is a pointer to a *SINGLE* - lrecord_description structure, describing the data being pointed at - when the associated constant matches. You can go ahead and create - an array of lrecord_description structures and put an XD_END on it, - but only the first one is used. If the data being pointed at is a - structure, you *MAY NOT* substitute an array of lrecord_description - structures describing the structure; instead, use a single - lrecord_description structure with an XD_STRUCT_PTR in it, and point - it in turn to the description of the structure. See charset.h for a - description of how to use XD_UNION. (In other words, if the constant - matches, the lrecord_description pointed at will in essence be - substituted for the XD_UNION declaration.) + + Union of two or more different types of data. Parameters are a constant + which determines which type the data is (this is usually an XD_INDIRECT, + referring to one of the fields in the structure), and a "sizing lobby" (a + sized_memory_description, which points to a memory_description and + indicates its size). The size field in the sizing lobby describes the + size of the union field in the object, and the memory_description in it + is referred to as a "union map" and has a special interpretation: The + offset field is replaced by a constant, which is compared to the first + parameter of the XD_UNION descriptor to determine if this description + applies to the union data, and XD_INDIRECT references refer to the + containing object and description. Note that the description applies + "inline" to the union data, like XD_STRUCT_ARRAY and not XD_STRUCT_PTR. + If the union data is a pointer to different types of structures, each + element in the memory_description should be an XD_STRUCT_PTR. See + unicode.c, redisplay.c and objects.c for examples of XD_UNION. + + XD_UNION_DYNAMIC_SIZE + + Same as XD_UNION except that this is used for objects where the size of + the object containing the union varies depending on the particular value + of the union constant. That is, an object with plain XD_UNION typically + has the union declared as `union foo' or as `void *', where an object + with XD_UNION_DYNAMIC_SIZE typically has the union as the last element, + and declared as something like char foo[1]. With plain XD_UNION, the + object is (usually) of fixed size and always contains enough space for + the data associated with all possible union constants, and thus the union + constant can potentially change during the lifetime of the object. With + XD_UNION_DYNAMIC_SIZE, however, the union constant is fixed at the time + of creation of the object, and the size of the object is computed + dynamically at creation time based on the size of the data associated + with the union constant. Currently, the only difference between XD_UNION + and XD_UNION_DYNAMIC_SIZE is how the size of the union data is + calculated, when (a) the structure containing the union has no size + given; (b) the union occurs as the last element in the structure; and (c) + the union has no size given (in the first-level sized_memory_description + pointed to). In this circumstance, the size of XD_UNION comes from the + max size of the data associated with all possible union constants, + whereas the size of XD_UNION_DYNAMIC_SIZE comes from the size of the data + associated with the currently specified (and unchangeable) union + constant. XD_C_STRING + Pointer to a C string. XD_DOC_STRING + Pointer to a doc string (C string if positive, opaque value if negative) XD_INT_RESET - An integer which will be reset to a given value in the dump file. + An integer which will be reset to a given value in the dump file. XD_ELEMCOUNT + Elemcount value. Used for counts. XD_BYTECOUNT + Bytecount value. Used for counts. XD_HASHCODE + Hashcode value. Used for the results of hashing functions. XD_INT + int value. Used for counts. XD_LONG + long value. Used for counts. XD_BYTECOUNT + bytecount value. Used for counts. XD_END - Special type indicating the end of the array. - XD_SPECIFIER_END - Special type indicating the end of the array for a specifier. Extra - description, describing the specifier-type-specific data at the end - of the specifier object, is going to be fetched from the specifier - methods. This should occur exactly once, in the description of the - specifier object, and the dump code knows how to special-case this - by fetching the specifier_methods pointer from the appropriate place - in the memory block (which will, of course, be a struct - Lisp_Specifier), fetching the description of the - specifier-type-specific data from this, and continuing processing - the memory block. - - XD_CODING_SYSTEM_END - Special type indicating the end of the array for a coding system. - Extra description is going to be fetched from the coding system - methods. Works just like XD_SPECIFIER_END. + Special type indicating the end of the array. Special macros: - XD_INDIRECT(line, delta) - Usable where a "count" or "size" is requested. Gives the value of - the element which is at line number 'line' in the description (count - starts at zero) and adds delta to it. + + XD_INDIRECT (line, delta) + Usable where a count, size, offset or union constant is requested. Gives + the value of the element which is at line number 'line' in the + description (count starts at zero) and adds delta to it, which must + (currently) be positive. */ -enum lrecord_description_type +enum memory_description_type { XD_LISP_OBJECT_ARRAY, XD_LISP_OBJECT, @@ -607,6 +772,7 @@ XD_STRUCT_ARRAY, XD_OPAQUE_DATA_PTR, XD_UNION, + XD_UNION_DYNAMIC_SIZE, XD_C_STRING, XD_DOC_STRING, XD_INT_RESET, @@ -615,35 +781,83 @@ XD_HASHCODE, XD_INT, XD_LONG, - XD_END, - XD_SPECIFIER_END, - XD_CODING_SYSTEM_END + XD_END +}; + +enum data_description_entry_flags +{ + /* If set, KKCC does not process this entry. + + (1) One obvious use is with things that pdump saves but which do not get + marked normally -- for example the next and prev fields in a marker. The + marker chain is weak, with its entries removed when they are finalized. + + (2) This can be set on structures not containing any Lisp objects, or (more + usefully) on structures that contain Lisp objects but where the objects + always occur in another structure as well. For example, the extent lists + kept by a buffer keep the extents in two lists, one sorted by the start + of the extent and the other by the end. There's no point in marking + both, since each contains the same objects as the other; but when dumping + (if we were to dump such a structure), when computing memory size, etc., + it's crucial to tag both sides. + */ + XD_FLAG_NO_KKCC = 1, + /* If set, pdump does not process this entry. */ + XD_FLAG_NO_PDUMP = 2, + /* Indicates that this is a "default" entry in a union map. */ + XD_FLAG_UNION_DEFAULT_ENTRY = 4, + /* Indicates that this is a free Lisp object we're marking. + Only relevant for ERROR_CHECK_GC. This occurs when we're marking + 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, +#if 0 + /* Suggestions for other possible flags: */ + + /* Eliminate XD_UNION_DYNAMIC_SIZE and replace it with a flag, like this. */ + XD_FLAG_UNION_DYNAMIC_SIZE = 16, + /* Require that everyone who uses a description map has to flag it, so + that it's easy to tell, when looking through the code, where the + description maps are and who's using them. This might also become + necessary if for some reason the format of the description map is + 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, +#endif }; -struct lrecord_description +struct memory_description { - enum lrecord_description_type type; - int offset; + enum memory_description_type type; + Bytecount offset; EMACS_INT data1; - const struct struct_description *data2; + const struct sized_memory_description *data2; + /* Indicates which subsystems process this entry, plus (potentially) other + flags that apply to this entry. */ + int flags; }; -struct struct_description +struct sized_memory_description { Bytecount size; - const struct lrecord_description *description; + const struct memory_description *description; }; -#define XD_INDIRECT(val, delta) (-1-((val)|(delta<<8))) +extern const struct sized_memory_description lisp_object_description; -#define XD_IS_INDIRECT(code) (code<0) -#define XD_INDIRECT_VAL(code) ((-1-code) & 255) -#define XD_INDIRECT_DELTA(code) (((-1-code)>>8) & 255) +#define XD_INDIRECT(val, delta) (-1 - (Bytecount) ((val) | ((delta) << 8))) -#define XD_DYNARR_DESC(base_type, sub_desc) \ +#define XD_IS_INDIRECT(code) ((code) < 0) +#define XD_INDIRECT_VAL(code) ((-1 - (code)) & 255) +#define XD_INDIRECT_DELTA(code) ((-1 - (code)) >> 8) + +#define XD_DYNARR_DESC(base_type, sub_desc) \ { XD_STRUCT_PTR, offsetof (base_type, base), XD_INDIRECT(1, 0), sub_desc }, \ - { XD_INT, offsetof (base_type, cur) }, \ - { XD_INT_RESET, offsetof (base_type, max), XD_INDIRECT(1, 0) } + { XD_INT, offsetof (base_type, cur) }, \ + { XD_INT_RESET, offsetof (base_type, max), XD_INDIRECT(1, 0) } \ + /* DEFINE_LRECORD_IMPLEMENTATION is for objects with constant size. DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION is for objects whose size varies. @@ -656,7 +870,6 @@ #endif -#ifdef USE_KKCC #define DEFINE_BASIC_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,structtype) \ DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype) @@ -679,7 +892,7 @@ MAKE_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype) #define MAKE_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \ -DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \ +DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \ const struct lrecord_implementation lrecord_##c_name = \ { name, dumpable, marker, printer, nuker, equal, hash, desc, \ getprop, putprop, remprop, plist, size, sizer, \ @@ -698,64 +911,13 @@ MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype) #define MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \ -DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \ +DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \ int lrecord_type_##c_name; \ struct lrecord_implementation lrecord_##c_name = \ { name, dumpable, marker, printer, nuker, equal, hash, desc, \ getprop, putprop, remprop, plist, size, sizer, \ lrecord_type_last_built_in_type, basic_p } -#else /* not USE_KKCC */ - -#define DEFINE_BASIC_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \ -DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype) - -#define DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \ -MAKE_LRECORD_IMPLEMENTATION(name,c_name,0,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof(structtype),0,1,structtype) - -#define DEFINE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \ -DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype) - -#define DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \ -MAKE_LRECORD_IMPLEMENTATION(name,c_name,0,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof (structtype),0,0,structtype) - -#define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \ -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,sizer,structtype) - -#define DEFINE_BASIC_LRECORD_SEQUENCE_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \ -MAKE_LRECORD_IMPLEMENTATION(name,c_name,0,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,sizer,1,structtype) - -#define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \ -MAKE_LRECORD_IMPLEMENTATION(name,c_name,0,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype) - -#define MAKE_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \ -DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \ -const struct lrecord_implementation lrecord_##c_name = \ - { name, dumpable, marker, printer, nuker, equal, hash, desc, \ - getprop, putprop, remprop, plist, size, sizer, \ - lrecord_type_##c_name, basic_p } - -#define DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \ -DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype) - -#define DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \ -MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,0,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof (structtype),0,0,structtype) - -#define DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \ -DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,sizer,structtype) - -#define DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \ -MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,0,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype) - -#define MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \ -DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \ -int lrecord_type_##c_name; \ -struct lrecord_implementation lrecord_##c_name = \ - { name, dumpable, marker, printer, nuker, equal, hash, desc, \ - getprop, putprop, remprop, plist, size, sizer, \ - lrecord_type_last_built_in_type, basic_p } -#endif /* not USE_KKCC */ - extern Lisp_Object (*lrecord_markers[]) (Lisp_Object); #define INIT_LRECORD_IMPLEMENTATION(type) do { \ @@ -809,17 +971,24 @@ 4. Create the methods for your object. Note that technically you don't need any, but you will almost always want at least a mark method. - 5. Define your object with DEFINE_LRECORD_IMPLEMENTATION() or some + 4. Create the data layout description for your object. See + toolbar_button_description below; the comment above in `struct lrecord', + describing the purpose of the descriptions; and comments elsewhere in + this file describing the exact syntax of the description structures. + + 6. Define your object with DEFINE_LRECORD_IMPLEMENTATION() or some variant. - 6. Include the header file in the .c file where you defined the object. + 7. Include the header file in the .c file where you defined the object. - 7. Put a call to INIT_LRECORD_IMPLEMENTATION() for the object in the + 8. Put a call to INIT_LRECORD_IMPLEMENTATION() for the object in the .c file's syms_of_foo() function. - 8. Add a type enum for the object to enum lrecord_type, earlier in this + 9. Add a type enum for the object to enum lrecord_type, earlier in this file. + --ben + An example: ------------------------------ in toolbar.h ----------------------------- @@ -870,9 +1039,24 @@ ... +static const struct memory_description toolbar_button_description [] = { + { XD_LISP_OBJECT, offsetof (struct toolbar_button, next) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, frame) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, up_glyph) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, down_glyph) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, disabled_glyph) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, cap_up_glyph) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, cap_down_glyph) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, cap_disabled_glyph) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, callback) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, enabled_p) }, + { XD_LISP_OBJECT, offsetof (struct toolbar_button, help_string) }, + { XD_END } +}; + static Lisp_Object mark_toolbar_button (Lisp_Object obj) -{ +\{ struct toolbar_button *data = XTOOLBAR_BUTTON (obj); mark_object (data->next); mark_object (data->frame); @@ -891,8 +1075,9 @@ as internal_object_printer instead of 0. ]] DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button, - mark_toolbar_button, 0, - 0, 0, 0, 0, struct toolbar_button); + 0, mark_toolbar_button, 0, 0, 0, 0, + toolbar_button_description, + struct toolbar_button); ... @@ -919,6 +1104,9 @@ ... }; + +--ben + */ /* @@ -1051,21 +1239,117 @@ dead_wrong_type_argument (predicate, x); \ } while (0) +/*-------------------------- lcrecord-list -----------------------------*/ + +struct lcrecord_list +{ + struct lcrecord_header header; + Lisp_Object free; + Elemcount size; + const struct lrecord_implementation *implementation; +}; + +DECLARE_LRECORD (lcrecord_list, struct lcrecord_list); +#define XLCRECORD_LIST(x) XRECORD (x, lcrecord_list, struct lcrecord_list) +#define wrap_lcrecord_list(p) wrap_record (p, lcrecord_list) +#define LCRECORD_LISTP(x) RECORDP (x, lcrecord_list) +/* #define CHECK_LCRECORD_LIST(x) CHECK_RECORD (x, lcrecord_list) + Lcrecord lists should never escape to the Lisp level, so + functions should not be doing this. */ + /* Various ways of allocating lcrecords. All bytes (except lcrecord - header) are zeroed in returned structure. */ + header) are zeroed in returned structure. + + See above for a discussion of the difference between plain lrecords and + lrecords. lcrecords themselves are divided into three types: (1) + auto-managed, (2) hand-managed, and (3) unmanaged. "Managed" refers to + using a special object called an lcrecord-list to keep track of freed + lcrecords, which can freed with free_lcrecord() or the like and later be + recycled when a new lcrecord is required, rather than requiring new + malloc(). Thus, allocation of lcrecords can be very + cheap. (Technically, the lcrecord-list manager could divide up large + chunks of memory and allocate out of that, mimicking what happens with + lrecords. At that point, however, we'd want to rethink the whole + division between lrecords and lcrecords.) + + NOTE: There is a fundamental limitation of lcrecord-lists, which is that + they only handle blocks of a particular, fixed size. Thus, objects that + can be of varying sizes need to do various tricks. These considerations + in particular dictate the various types of management: + + -- "Auto-managed" means that you just go ahead and allocate the lcrecord + whenever you want, using alloc_lcrecord_type(), and the appropriate + lcrecord-list manager is automatically created. To free, you just call + "free_lcrecord()" and the appropriate lcrecord-list manager is + automatically located and called. The limitation here of course is that + all your objects are of the same size. (#### Eventually we should have a + more sophisticated system that tracks the sizes seen and creates one + lcrecord list per size, indexed in a hash table. Usually there are only + a limited number of sizes, so this works well.) + + -- "Hand-managed" exists because we haven't yet written the more + sophisticated scheme for auto-handling different-sized lcrecords, as + described in the end of the last paragraph. In this model, you go ahead + and create the lcrecord-list objects yourself for the sizes you will + need, using make_lcrecord_list(). Then, create lcrecords using + alloc_managed_lcrecord(), passing in the lcrecord-list you created, and + free them with free_managed_lcrecord(). + + -- "Unmanaged" means you simply allocate lcrecords, period. No + lcrecord-lists, no way to free them. This may be suitable when the + lcrecords are variable-sized and (a) you're too lazy to write the code + to hand-manage them, or (b) the objects you create are always or almost + always Lisp-visible, and thus there's no point in freeing them (and it + wouldn't be safe to do so). You just create them with + basic_alloc_lcrecord(), and that's it. + + --ben + + Here is an in-depth look at the steps required to create a allocate an + lcrecord using the hand-managed style. Since this is the most + complicated, you will learn a lot about the other styles as well. In + addition, there is useful general information about what freeing an + lcrecord really entails, and what are the precautions: + + 1) Create an lcrecord-list object using make_lcrecord_list(). This is + often done at initialization. Remember to staticpro_nodump() this + object! The arguments to make_lcrecord_list() are the same as would be + passed to basic_alloc_lcrecord(). + + 2) Instead of calling basic_alloc_lcrecord(), call alloc_managed_lcrecord() + and pass the lcrecord-list earlier created. + + 3) When done with the lcrecord, call free_managed_lcrecord(). The + standard freeing caveats apply: ** make sure there are no pointers to + the object anywhere! ** + + 4) Calling free_managed_lcrecord() is just like kissing the + lcrecord goodbye as if it were garbage-collected. This means: + -- the contents of the freed lcrecord are undefined, and the + contents of something produced by alloc_managed_lcrecord() + are undefined, just like for basic_alloc_lcrecord(). + -- the mark method for the lcrecord's type will *NEVER* be called + on freed lcrecords. + -- the finalize method for the lcrecord's type will be called + at the time that free_managed_lcrecord() is called. + */ -void *alloc_lcrecord (Bytecount size, - const struct lrecord_implementation *); +/* UNMANAGED MODEL: */ +void *basic_alloc_lcrecord (Bytecount size, + const struct lrecord_implementation *); + +/* HAND-MANAGED MODEL: */ +Lisp_Object make_lcrecord_list (Elemcount size, + const struct lrecord_implementation + *implementation); +Lisp_Object alloc_managed_lcrecord (Lisp_Object lcrecord_list); +void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord); +/* AUTO-MANAGED MODEL: */ void *alloc_automanaged_lcrecord (Bytecount size, const struct lrecord_implementation *); - -#define alloc_unmanaged_lcrecord_type(type, lrecord_implementation) \ - ((type *) alloc_lcrecord (sizeof (type), lrecord_implementation)) - #define alloc_lcrecord_type(type, lrecord_implementation) \ ((type *) alloc_automanaged_lcrecord (sizeof (type), lrecord_implementation)) - void free_lcrecord (Lisp_Object rec); @@ -1083,6 +1367,192 @@ memset ((char *) (lcr) + sizeof (struct lcrecord_header), 0, \ (size) - sizeof (struct lcrecord_header)) -#define zero_lcrecord(lcr) zero_sized_lcrecord(lcr, sizeof (*(lcr))) +#define zero_lcrecord(lcr) zero_sized_lcrecord (lcr, sizeof (*(lcr))) + +DECLARE_INLINE_HEADER ( +Bytecount +detagged_lisp_object_size (const struct lrecord_header *h) +) +{ + const struct lrecord_implementation *imp = LHEADER_IMPLEMENTATION (h); + + return (imp->size_in_bytes_method ? + imp->size_in_bytes_method (h) : + imp->static_size); +} + +DECLARE_INLINE_HEADER ( +Bytecount +lisp_object_size (Lisp_Object o) +) +{ + return detagged_lisp_object_size (XRECORD_LHEADER (o)); +} + + +/************************************************************************/ +/* Dumping */ +/************************************************************************/ + +/* dump_add_root_struct_ptr (&var, &desc) dumps the structure pointed to by + `var'. This is for a single relocatable pointer located in the data + segment (i.e. the block pointed to is in the heap). */ +#ifdef PDUMP +void dump_add_root_struct_ptr (void *, const struct sized_memory_description *); +#else +#define dump_add_root_struct_ptr(varaddr,descaddr) DO_NOTHING +#endif + +/* dump_add_opaque (&var, size) dumps the opaque static structure `var'. + This is for a static block of memory (in the data segment, not the + heap), with no relocatable pointers in it. */ +#ifdef PDUMP +#define dump_add_opaque(varaddr,size) dump_add_root_block (varaddr, size, NULL) +#else +#define dump_add_opaque(varaddr,size) DO_NOTHING +#endif + +/* dump_add_root_block (ptr, size, desc) dumps the static structure + located at `var' of size SIZE and described by DESC. This is for a + static block of memory (in the data segment, not the heap), with + relocatable pointers in it. */ +#ifdef PDUMP +void dump_add_root_block (const void *ptraddress, Bytecount size, + const struct memory_description *desc); +#else +#define dump_add_root_block(ptraddress,desc) DO_NOTHING +#endif + +/* Call dump_add_opaque_int (&int_var) to dump `int_var', of type `int'. */ +#ifdef PDUMP +#define dump_add_opaque_int(int_varaddr) do { \ + int *dao_ = (int_varaddr); /* type check */ \ + dump_add_opaque (dao_, sizeof (*dao_)); \ +} while (0) +#else +#define dump_add_opaque_int(int_varaddr) DO_NOTHING +#endif + +/* Call dump_add_opaque_fixnum (&fixnum_var) to dump `fixnum_var', of type + `Fixnum'. */ +#ifdef PDUMP +#define dump_add_opaque_fixnum(fixnum_varaddr) do { \ + Fixnum *dao_ = (fixnum_varaddr); /* type check */ \ + dump_add_opaque (dao_, sizeof (*dao_)); \ +} while (0) +#else +#define dump_add_opaque_fixnum(fixnum_varaddr) DO_NOTHING +#endif + +/* Call dump_add_root_lisp_object (&var) to ensure that var is properly + updated after pdump. */ +#ifdef PDUMP +void dump_add_root_lisp_object (Lisp_Object *); +#else +#define dump_add_root_lisp_object(varaddr) DO_NOTHING +#endif + +/* Call dump_add_weak_lisp_object (&var) to ensure that var is properly + updated after pdump. var must point to a linked list of objects out of + which some may not be dumped */ +#ifdef PDUMP +void dump_add_weak_object_chain (Lisp_Object *); +#else +#define dump_add_weak_object_chain(varaddr) DO_NOTHING +#endif + +/* Nonzero means Emacs has already been initialized. + Used during startup to detect startup of dumped Emacs. */ +extern int initialized; + +#ifdef PDUMP + +void pdump_objects_unmark (void); +void pdump (void); +int pdump_load (const char *argv0); +void pdump_backtrace (void); +extern unsigned int dump_id; +extern char *pdump_start, *pdump_end; + +#define DUMPEDP(adr) ((((char *)(adr)) < pdump_end) && (((char *)(adr)) >= pdump_start)) + +#else +#define DUMPEDP(adr) 0 +#endif + +/***********************************************************************/ +/* data descriptions */ +/***********************************************************************/ + + +#if defined (USE_KKCC) || defined (PDUMP) + +extern int in_pdump; + +EMACS_INT lispdesc_indirect_count_1 (EMACS_INT code, + const struct memory_description *idesc, + const void *idata); +const struct sized_memory_description *lispdesc_indirect_description_1 + (const void *obj, const struct sized_memory_description *sdesc); +Bytecount lispdesc_structure_size (const void *obj, + const struct sized_memory_description * + sdesc); + +DECLARE_INLINE_HEADER ( +EMACS_INT +lispdesc_indirect_count (EMACS_INT code, + const struct memory_description *idesc, + const void *idata) +) +{ + if (XD_IS_INDIRECT (code)) + code = lispdesc_indirect_count_1 (code, idesc, idata); + return code; +} + +DECLARE_INLINE_HEADER ( +const struct sized_memory_description * +lispdesc_indirect_description (const void *obj, + const struct sized_memory_description *sdesc) +) +{ + if (sdesc->description) + return sdesc; + else + return lispdesc_indirect_description_1 (obj, sdesc); +} + + +/* Do standard XD_UNION processing. DESC1 is an entry in DESC, which + describes the entire data structure. Returns NULL (do nothing, nothing + matched), or a new value for DESC1. In the latter case, assign to DESC1 + in your function and goto union_switcheroo. */ + +DECLARE_INLINE_HEADER ( +const struct memory_description * +lispdesc_process_xd_union (const struct memory_description *desc1, + const struct memory_description *desc, + const void *data) +) +{ + int count = 0; + EMACS_INT variant = lispdesc_indirect_count (desc1->data1, desc, + data); + desc1 = + lispdesc_indirect_description (data, desc1->data2)->description; + + for (count = 0; desc1[count].type != XD_END; count++) + { + if ((desc1[count].flags & XD_FLAG_UNION_DEFAULT_ENTRY) || + desc1[count].offset == variant) + { + return &desc1[count]; + } + } + + return NULL; +} + +#endif /* defined (USE_KKCC) || defined (PDUMP) */ #endif /* INCLUDED_lrecord_h_ */ Index: src/lstream.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lstream.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- src/lstream.c 29 Jul 2002 09:21:22 -0000 1.25 +++ src/lstream.c 12 Jan 2003 11:08:18 -0000 1.26 @@ -114,18 +114,47 @@ return aligned_sizeof_lstream (((const Lstream *) header)->imp->size); } -#ifdef USE_KKCC +static const struct memory_description lstream_implementation_description_1[] += { + { XD_END } +}; + +const struct sized_memory_description lstream_implementation_description = { + sizeof (struct lstream_implementation), + lstream_implementation_description_1 +}; + +static const struct sized_memory_description lstream_extra_description_map[] = +{ + { offsetof (Lstream, imp) }, + { offsetof (struct lstream_implementation, extra_description) }, + { -1 }, +}; + +static const struct memory_description lstream_description[] = +{ + { XD_STRUCT_PTR, offsetof (Lstream, imp), 1, + &lstream_implementation_description }, + { XD_STRUCT_ARRAY, offsetof (Lstream, data), 1, + lstream_extra_description_map }, + { XD_END } +}; + +static const struct memory_description lstream_empty_extra_description_1[] = +{ + { XD_END } +}; + +const struct sized_memory_description lstream_empty_extra_description = { + 0, lstream_empty_extra_description_1 +}; + DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("stream", lstream, 0, /*dumpable-flag*/ mark_lstream, print_lstream, - finalize_lstream, 0, 0, 0, + finalize_lstream, 0, 0, + lstream_description, sizeof_lstream, Lstream); -#else /* not USE_KKCC */ -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("stream", lstream, - mark_lstream, print_lstream, - finalize_lstream, 0, 0, 0, - sizeof_lstream, Lstream); -#endif /* not USE_KKCC */ /* Change the buffering of a stream. See lstream.h. By default the @@ -182,7 +211,7 @@ lstream_type_count++; } - p = XLSTREAM (allocate_managed_lcrecord (Vlstream_free_list[i])); + p = XLSTREAM (alloc_managed_lcrecord (Vlstream_free_list[i])); /* Zero it out, except the header. */ memset ((char *) p + sizeof (p->header), '\0', aligned_sizeof_lstream (imp->size) - sizeof (p->header)); @@ -1299,7 +1328,12 @@ Bytecount offset, end; }; -DEFINE_LSTREAM_IMPLEMENTATION ("lisp-string", lisp_string); +static const struct memory_description lisp_string_lstream_description[] = { + { XD_LISP_OBJECT, offsetof (struct lisp_string_stream, obj) }, + { XD_END } +}; + +DEFINE_LSTREAM_IMPLEMENTATION_WITH_DATA ("lisp-string", lisp_string); Lisp_Object make_lisp_string_input_stream (Lisp_Object string, Bytecount offset, @@ -1590,7 +1624,15 @@ int flags; }; -DEFINE_LSTREAM_IMPLEMENTATION ("lisp-buffer", lisp_buffer); +static const struct memory_description lisp_buffer_lstream_description[] = { + { XD_LISP_OBJECT, offsetof (struct lisp_buffer_stream, buffer) }, + { XD_LISP_OBJECT, offsetof (struct lisp_buffer_stream, orig_start) }, + { XD_LISP_OBJECT, offsetof (struct lisp_buffer_stream, start) }, + { XD_LISP_OBJECT, offsetof (struct lisp_buffer_stream, end) }, + { XD_END } +}; + +DEFINE_LSTREAM_IMPLEMENTATION_WITH_DATA ("lisp-buffer", lisp_buffer); static Lisp_Object make_lisp_buffer_stream_1 (struct buffer *buf, Charbpos start, Charbpos end, @@ -1752,6 +1794,7 @@ struct lisp_buffer_stream *str = LISP_BUFFER_STREAM_DATA (XLSTREAM (stream)); + mark_object (str->orig_start); mark_object (str->start); mark_object (str->end); return str->buffer; Index: src/lstream.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lstream.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/lstream.h 5 Jun 2002 09:56:25 -0000 1.17 +++ src/lstream.h 12 Jan 2003 11:08:18 -0000 1.18 @@ -135,6 +135,11 @@ Bytecount size; /* Number of additional bytes to be allocated with this stream. Access this data using Lstream_data(). */ + + /* Description of the extra data (struct foo_lstream) attached to a + coding system. */ + const struct sized_memory_description *extra_description; + /* Read some data from the stream's end and store it into DATA, which can hold SIZE bytes. Return the number of bytes read. A return value of 0 means no bytes can be read at this time. This may @@ -201,7 +206,18 @@ #define DEFINE_LSTREAM_IMPLEMENTATION(name, c_name) \ Lstream_implementation lstream_##c_name[1] = \ - { { (name), sizeof (struct c_name##_stream) } } + { { (name), sizeof (struct c_name##_stream), \ + &lstream_empty_extra_description } } + +#define DEFINE_LSTREAM_IMPLEMENTATION_WITH_DATA(name, c_name) \ + static const struct sized_memory_description c_name##_lstream_description_0 \ + = { \ + sizeof (struct c_name##_stream), \ + c_name##_lstream_description \ + }; \ + Lstream_implementation lstream_##c_name[1] = \ + { { (name), sizeof (struct c_name##_stream), \ + &c_name##_lstream_description_0 } } #define DECLARE_LSTREAM(c_name) \ extern Lstream_implementation lstream_##c_name[] @@ -243,6 +259,8 @@ int flags; max_align_t data[1]; }; + +extern const struct sized_memory_description lstream_empty_extra_description; #define LSTREAM_TYPE_P(lstr, type) \ ((lstr)->imp == lstream_##type) Index: src/make-src-depend =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/make-src-depend,v retrieving revision 1.5 retrieving revision 1.7 diff -u -r1.5 -r1.7 --- src/make-src-depend 12 Apr 2001 18:24:00 -0000 1.5 +++ src/make-src-depend 15 Feb 2003 11:20:40 -0000 1.7 @@ -1,24 +1,29 @@ : #-*- Perl -*- + +### make-src-depend --- update the Makefile dependency information for XEmacs + # Copyright (C) 1998 Free Software Foundation, Inc. -# This file is part of XEmacs. -# -# XEmacs is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2, or (at your option) any -# later version. -# -# XEmacs is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with XEmacs; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +## Author: Martin Buchholz +## Maintainer: XEmacs Development Team + +## This file is part of XEmacs. + +## XEmacs is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. + +## XEmacs is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with XEmacs; see the file COPYING. If not, write to the Free +## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. -# Author: Martin Buchholz eval 'exec perl -w -S $0 ${1+"$@"}' if 0; @@ -29,7 +34,8 @@ Usage: $myName Generates Makefile dependencies for the XEmacs src directory. -The dependencies are written to stdout.\n"; +The dependencies are written to stdout. +"; die $usage if @ARGV; @@ -94,7 +100,16 @@ "; my @LISP_H = ('lisp.h', sort keys %{$uses{'lisp.h'}}); -print "LISP_H=@{[grep (!/lisp-(dis)?union\.h/, @LISP_H)]} \$(LISP_UNION_H)\n"; +print " +#if defined(QUICK_BUILD) +CONFIG_H= +LISP_H= +#else +CONFIG_H=config.h +LISP_H=@{[grep (!/lisp-(dis)?union\.h/, @LISP_H)]} \$(LISP_UNION_H) +#endif + +"; sub PrintDeps { my $file = shift; @@ -103,6 +118,12 @@ delete @{%{$uses{$file}}}{@LISP_H}; $uses{$file}{'$(LISP_H)'} = 1; } + # Note: If both config.h and lisp.h are dependencies, config.h got deleted + # by the last clause. + if (exists $uses{$file}{'config.h'}) { + delete $uses{$file}{'config.h'}; + $uses{$file}{'$(CONFIG_H)'} = 1; + } print "@{[sort keys %{$uses{$file}}]}\n"; } @@ -117,9 +138,12 @@ } PrintPatternDeps ('-msw\\.', "HAVE_MS_WINDOWS"); -PrintPatternDeps ('-x\\.', "HAVE_X_WINDOWS"); +PrintPatternDeps ('-xlike', "HAVE_XLIKE"); +# X-specific files: *-x.c *-x-impl.h xgccache.c balloon_help.c x*.h Emacs*.[ch] +PrintPatternDeps ('-x\\.|xgccache|balloon_help|^Emacs', "HAVE_X_WINDOWS"); PrintPatternDeps ('-tty\\.', "HAVE_TTY"); -PrintPatternDeps ('-gtk\\.', "HAVE_GTK"); +# GTK-specific files: *-gtk.[ch] *-gtk-*.[ch] gtk-*.[ch] emacs-marshals.c emacs-widget-accessors.c glade.c ui-byhand.c +PrintPatternDeps ('gtk|emacs-marshals|emacs-widget-accessors|glade|ui-byhand', "HAVE_GTK"); PrintPatternDeps ('^database', "HAVE_DATABASE"); PrintPatternDeps ('^mule', "MULE"); PrintPatternDeps ('^(?:External|extw-)', "EXTERNAL_WIDGET"); Index: src/marker.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/marker.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/marker.c 29 Jul 2002 09:21:22 -0000 1.12 +++ src/marker.c 12 Jan 2003 11:08:18 -0000 1.13 @@ -96,25 +96,18 @@ return hash; } -static const struct lrecord_description marker_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Marker, next) }, - { XD_LISP_OBJECT, offsetof (Lisp_Marker, prev) }, +static const struct memory_description marker_description[] = { + { XD_LISP_OBJECT, offsetof (Lisp_Marker, next), 0, 0, XD_FLAG_NO_KKCC }, + { XD_LISP_OBJECT, offsetof (Lisp_Marker, prev), 0, 0, XD_FLAG_NO_KKCC }, { XD_LISP_OBJECT, offsetof (Lisp_Marker, buffer) }, { XD_END } }; -#ifdef USE_KKCC DEFINE_BASIC_LRECORD_IMPLEMENTATION ("marker", marker, 1, /*dumpable-flag*/ mark_marker, print_marker, 0, - marker_equal, marker_hash, marker_description, - Lisp_Marker); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("marker", marker, - mark_marker, print_marker, 0, - marker_equal, marker_hash, marker_description, - Lisp_Marker); -#endif /* not USE_KKCC */ + marker_equal, marker_hash, + marker_description, Lisp_Marker); /* Operations on markers. */ @@ -403,7 +396,7 @@ marker = wrong_type_argument (Qinteger_or_marker_p, marker); } - RETURN_NOT_REACHED (Qnil) /* not reached */ + RETURN_NOT_REACHED (Qnil); /* not reached */ } DEFUN ("copy-marker", Fcopy_marker, 1, 2, 0, /* Index: src/mem-limits.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mem-limits.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/mem-limits.h 12 Apr 2001 18:24:01 -0000 1.10 +++ src/mem-limits.h 12 Jan 2003 11:08:18 -0000 1.11 @@ -81,14 +81,7 @@ #endif /* BSD4_2 */ #ifdef emacs -/* The important properties of this type are that 1) it's a pointer, and - 2) arithmetic on it should work as if the size of the object pointed - to has a size of 1. */ -#ifdef __STDC__ typedef void *POINTER; -#else -typedef char *POINTER; -#endif #ifndef CYGWIN typedef unsigned long SIZE; Index: src/menubar-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/menubar-gtk.c,v retrieving revision 1.12 retrieving revision 1.14 diff -u -r1.12 -r1.14 --- src/menubar-gtk.c 23 Jun 2002 09:25:12 -0000 1.12 +++ src/menubar-gtk.c 31 Jan 2003 12:02:37 -0000 1.14 @@ -1,6 +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. This file is part of XEmacs. @@ -868,7 +869,7 @@ } else { - // l->accel_string = ""; + /* l->accel_string = ""; */ } } @@ -1275,7 +1276,7 @@ GTK_SIGNAL_FUNC (popdown_menu_cb), NULL); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - eev ? eev->event.button.button : 0, + eev ? EVENT_BUTTON_BUTTON (eev) : 0, eev ? eev->timestamp : GDK_CURRENT_TIME); } Index: src/menubar-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/menubar-msw.c,v retrieving revision 1.34 retrieving revision 1.37 diff -u -r1.34 -r1.37 --- src/menubar-msw.c 16 Aug 2002 08:15:42 -0000 1.34 +++ src/menubar-msw.c 9 Feb 2003 09:33:48 -0000 1.37 @@ -120,85 +120,6 @@ static HMENU top_level_menu; /* - * Translate X accelerator syntax to win32 accelerator syntax. - * accel = (Ichar*) to receive the accelerator character - * or NULL to suppress accelerators in the menu or dialog item. - * - * %% is replaced with % - * if accel is NULL: - * %_ is removed. - * if accel is non-NULL: - * %_ is replaced with &. - * The accelerator character is passed back in *accel. - * (If there is no accelerator, it will be added on the first character.) - * - */ - -Lisp_Object -mswindows_translate_menu_or_dialog_item (Lisp_Object item, Ichar *accel) -{ - Bytecount len = XSTRING_LENGTH (item); - Ibyte *it = (Ibyte *) ALLOCA (2 * len + 42), *ptr = it; - - memcpy (ptr, XSTRING_DATA (item), len + 1); - if (accel) - *accel = '\0'; - - /* Escape '&' as '&&' */ - - while ((ptr = (Ibyte *) memchr (ptr, '&', len - (ptr - it))) != NULL) - { - memmove (ptr + 1, ptr, (len - (ptr - it)) + 1); - len++; - ptr += 2; - } - - /* Replace XEmacs accelerator '%_' with Windows accelerator '&' - and `%%' with `%'. */ - ptr = it; - while ((ptr = (Ibyte *) memchr (ptr, '%', len - (ptr - it))) != NULL) - { - if (*(ptr + 1) == '_') - { - if (accel) - { - *ptr = '&'; - if (!*accel) - *accel = DOWNCASE (0, itext_ichar (ptr + 2)); - memmove (ptr + 1, ptr + 2, len - (ptr - it + 2) + 1); - len--; - } - else /* Skip accelerator */ - { - memmove (ptr, ptr + 2, len - (ptr - it + 2) + 1); - len -= 2; - } - } - else if (*(ptr + 1) == '%') - { - memmove (ptr + 1, ptr + 2, len - (ptr - it + 2) + 1); - len--; - ptr++; - } - else /* % on its own - shouldn't happen */ - ptr++; - } - - if (accel && !*accel) - { - /* Force a default accelerator */ - ptr = it; - memmove (ptr + 1, ptr, len + 1); - *accel = DOWNCASE (0, itext_ichar (ptr + 1)); - *ptr = '&'; - - len++; - } - - return make_string (it, len); -} - -/* * This returns Windows-style menu item string: * "Left Flush\tRight Flush" */ @@ -793,33 +714,48 @@ /* Message handling proxies */ /*------------------------------------------------------------------------*/ -static HMENU wm_initmenu_menu; -static struct frame *wm_initmenu_frame; +struct handle_wm_initmenu +{ + HMENU menu; + struct frame *frame; +}; static Lisp_Object -unsafe_handle_wm_initmenupopup (Lisp_Object u_n_u_s_e_d) +unsafe_handle_wm_initmenupopup (void *arg) { - return unsafe_handle_wm_initmenupopup_1 (wm_initmenu_menu, wm_initmenu_frame); + struct handle_wm_initmenu *z = (struct handle_wm_initmenu *) arg; + return unsafe_handle_wm_initmenupopup_1 (z->menu, z->frame); } static Lisp_Object -unsafe_handle_wm_initmenu (Lisp_Object u_n_u_s_e_d) +unsafe_handle_wm_initmenu (void *arg) { - return unsafe_handle_wm_initmenu_1 (wm_initmenu_frame); + struct handle_wm_initmenu *z = (struct handle_wm_initmenu *) arg; + return unsafe_handle_wm_initmenu_1 (z->frame); } Lisp_Object mswindows_handle_wm_initmenupopup (HMENU hmenu, struct frame *frm) { - /* We cannot pass hmenu as a lisp object. Use static var */ - wm_initmenu_menu = hmenu; - wm_initmenu_frame = frm; - /* Allow runaway filter code, e.g. custom, to be aborted. We are + struct handle_wm_initmenu z; + int depth = internal_bind_int (&in_menu_callback, 1); + Lisp_Object retval; + + z.menu = hmenu; + z.frame = frm; + + /* [[ Allow runaway filter code, e.g. custom, to be aborted. We are usually called from next_event_internal(), which has turned off - quit checking to read the C-g as an event. */ - return mswindows_protect_modal_loop ("Error during menu handling", - unsafe_handle_wm_initmenupopup, Qnil, - UNINHIBIT_QUIT); + quit checking to read the C-g as an event.]] + + #### This is bogus because by the very act of calling + event_stream_protect_modal_loop(), we disable event retrieval! */ + retval = event_stream_protect_modal_loop ("Error during menu handling", + unsafe_handle_wm_initmenupopup, &z, + UNINHIBIT_QUIT); + unbind_to (depth); + + return retval; } Lisp_Object @@ -828,10 +764,12 @@ /* Handle only frame menubar, ignore if from popup or system menu */ if (GetMenu (FRAME_MSWINDOWS_HANDLE (f)) == hmenu) { - wm_initmenu_frame = f; - return mswindows_protect_modal_loop ("Error during menu handling", - unsafe_handle_wm_initmenu, Qnil, - UNINHIBIT_QUIT); + struct handle_wm_initmenu z; + + z.frame = f; + return event_stream_protect_modal_loop ("Error during menu handling", + unsafe_handle_wm_initmenu, &z, + UNINHIBIT_QUIT); } return Qt; } @@ -888,13 +826,8 @@ /* Default is to put the menu at the point (10, 10) in frame */ if (eev) { -#ifdef USE_KKCC - pt.x = XBUTTON_DATA_X (EVENT_DATA (eev)); - pt.y = XBUTTON_DATA_Y (EVENT_DATA (eev)); -#else /* not USE_KKCC */ - pt.x = eev->event.button.x; - pt.y = eev->event.button.y; -#endif /* not USE_KKCC */ + pt.x = EVENT_BUTTON_X (eev); + pt.y = EVENT_BUTTON_Y (eev); ClientToScreen (FRAME_MSWINDOWS_HANDLE (f), &pt); } else Index: src/menubar-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/menubar-x.c,v retrieving revision 1.35 retrieving revision 1.39 diff -u -r1.35 -r1.39 --- src/menubar-x.c 29 Jul 2002 09:21:23 -0000 1.35 +++ src/menubar-x.c 9 Feb 2003 09:33:48 -0000 1.39 @@ -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) 2000, 2001 ,2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -389,25 +389,26 @@ int filter_p) { struct menu_item_descriptor_to_widget_value midtwv; + int depth = internal_bind_int (&in_menu_callback, 1); + Lisp_Object retval; midtwv.desc = desc; midtwv.menu_type = menu_type; midtwv.deep_p = deep_p; midtwv.filter_p = filter_p; - if (UNBOUNDP - (call_trapping_problems - (Qmenubar, "Error during menu callback", UNINHIBIT_QUIT, 0, - protected_menu_item_descriptor_to_widget_value_1, &midtwv))) + retval = event_stream_protect_modal_loop + ("Error during menu callback", + protected_menu_item_descriptor_to_widget_value_1, &midtwv, + UNINHIBIT_QUIT); + unbind_to (depth); + + if (UNBOUNDP (retval)) return 0; return midtwv.wv; } -#if defined (LWLIB_MENUBARS_LUCID) || (defined LWLIB_MENUBARS_MOTIF) -int in_menu_callback; -#endif - /* The order in which callbacks are run is funny to say the least. It's sometimes tricky to avoid running a callback twice, and to avoid returning prematurely. So, this function returns true @@ -435,7 +436,6 @@ struct device *d = get_device_from_display (XtDisplay (widget)); struct frame *f = x_any_window_to_frame (d, XtWindow (widget)); Lisp_Object frame; - int count; /* set in lwlib to the time stamp associated with the most recent menu operation */ @@ -460,17 +460,8 @@ assert (hack_wv->type == INCREMENTAL_TYPE); submenu_desc = VOID_TO_LISP (hack_wv->call_data); - /* - * #### Fix the menu code so this isn't necessary. - * - * Protect against reentering the menu code otherwise we will - * crash later when the code gets confused at the state - * changes. - */ - count = internal_bind_int (&in_menu_callback, 1); wv = (protected_menu_item_descriptor_to_widget_value (submenu_desc, SUBMENU_TYPE, 1, 0)); - unbind_to (count); if (!wv) { @@ -487,6 +478,10 @@ assert (wv && wv->type == CASCADE_TYPE && wv->contents); replace_widget_value_tree (hack_wv, wv->contents); free_popup_widget_value_tree (wv); + /* 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)); } else if (!POPUP_DATAP (FRAME_MENUBAR_DATA (f))) return; @@ -577,6 +572,7 @@ 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); } @@ -612,6 +608,12 @@ } free_popup_widget_value_tree (data); + /* Buried inside of the lwlib data are pointers to Lisp objects that may + 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)); + XFRAME_MENUBAR_DATA (f)->menubar_contents_up_to_date = deep_p; XFRAME_MENUBAR_DATA (f)->last_menubar_buffer = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer; @@ -672,21 +674,12 @@ { Position shellx, shelly, framex, framey; Arg al [2]; -#ifdef USE_KKCC btn->time = EVENT_TIMESTAMP (eev); - btn->button = XBUTTON_DATA_BUTTON (EVENT_DATA (eev)); - btn->root = RootWindowOfScreen (XtScreen (daddy)); - btn->subwindow = (Window) NULL; - btn->x = XBUTTON_DATA_X (EVENT_DATA (eev)); - btn->y = XBUTTON_DATA_Y (EVENT_DATA (eev)); -#else /* not USE_KKCC */ - btn->time = eev->timestamp; - btn->button = eev->event.button.button; + btn->button = EVENT_BUTTON_BUTTON (eev); btn->root = RootWindowOfScreen (XtScreen (daddy)); btn->subwindow = (Window) NULL; - btn->x = eev->event.button.x; - btn->y = eev->event.button.y; -#endif /* not USE_KKCC */ + btn->x = EVENT_BUTTON_X (eev); + btn->y = EVENT_BUTTON_Y (eev); shellx = shelly = 0; #ifndef HAVE_WMCOMMAND { @@ -1036,7 +1029,7 @@ accel = VOID_TO_LISP (entries->accel); if (entries->name && !NILP (accel)) { - if (event_matches_key_specifier_p (XEVENT (evee), accel)) + if (event_matches_key_specifier_p (evee, accel)) { /* a match! */ @@ -1180,7 +1173,7 @@ t=Vmenu_accelerator_prefix; while (!NILP (t) && !NILP (event0) - && event_matches_key_specifier_p (XEVENT (event0), Fcar (t))) + && event_matches_key_specifier_p (event0, Fcar (t))) { t = Fcdr (t); event0 = XEVENT_NEXT (event0); @@ -1190,7 +1183,7 @@ } else if (NILP (event0)) return Qnil; - else if (event_matches_key_specifier_p (XEVENT (event0), Vmenu_accelerator_prefix)) + else if (event_matches_key_specifier_p (event0, Vmenu_accelerator_prefix)) event0 = XEVENT_NEXT (event0); else return Qnil; @@ -1200,8 +1193,7 @@ static Lisp_Object menu_accelerator_safe_mod_compare (Lisp_Object cons) { - return (event_matches_key_specifier_p (XEVENT (XCAR (cons)), XCDR (cons)) - ? Qt + return (event_matches_key_specifier_p (XCAR (cons), XCDR (cons)) ? Qt : Qnil); } Index: src/menubar.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/menubar.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- src/menubar.c 20 Jun 2002 21:18:37 -0000 1.23 +++ src/menubar.c 9 Feb 2003 09:33:48 -0000 1.24 @@ -59,6 +59,7 @@ Lisp_Object Vblank_menubar; int popup_menu_titles; +int in_menu_callback; Lisp_Object Vmenubar_pointer_glyph; Index: src/menubar.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/menubar.h,v retrieving revision 1.6 retrieving revision 1.8 diff -u -r1.6 -r1.8 --- src/menubar.h 20 Jun 2002 21:18:37 -0000 1.6 +++ src/menubar.h 9 Feb 2003 09:33:48 -0000 1.8 @@ -62,13 +62,12 @@ *builder); Lisp_Object command_builder_operate_menu_accelerator (struct command_builder *builder); - -extern int in_menu_callback; #endif extern int popup_menu_up_p; extern int menubar_show_keybindings; extern int popup_menu_titles; +extern int in_menu_callback; #endif /* HAVE_MENUBARS */ Index: src/mule-charset.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mule-charset.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- src/mule-charset.c 29 Jul 2002 09:21:23 -0000 1.35 +++ src/mule-charset.c 12 Jan 2003 11:08:19 -0000 1.36 @@ -66,12 +66,12 @@ struct charset_lookup *chlook; -static const struct lrecord_description charset_lookup_description_1[] = { +static const struct memory_description charset_lookup_description_1[] = { { XD_LISP_OBJECT_ARRAY, offsetof (struct charset_lookup, charset_by_leading_byte), NUM_LEADING_BYTES+4*128*2 }, { XD_END } }; -static const struct struct_description charset_lookup_description = { +static const struct sized_memory_description charset_lookup_description = { sizeof (struct charset_lookup), charset_lookup_description_1 }; @@ -175,7 +175,9 @@ } } -static const struct lrecord_description charset_description[] = { +static const struct memory_description charset_description[] = { + { XD_INT, offsetof (Lisp_Charset, dimension) }, + { XD_INT, offsetof (Lisp_Charset, from_unicode_levels) }, { XD_LISP_OBJECT, offsetof (Lisp_Charset, name) }, { XD_LISP_OBJECT, offsetof (Lisp_Charset, doc_string) }, { XD_LISP_OBJECT, offsetof (Lisp_Charset, registry) }, @@ -183,29 +185,17 @@ { XD_LISP_OBJECT, offsetof (Lisp_Charset, long_name) }, { XD_LISP_OBJECT, offsetof (Lisp_Charset, reverse_direction_charset) }, { XD_LISP_OBJECT, offsetof (Lisp_Charset, ccl_program) }, -#if 0 - /* #### XD_UNION not yet implemented! pdump version of XEmacs will - not work! */ { XD_UNION, offsetof (Lisp_Charset, to_unicode_table), - XD_INDIRECT (offsetof (Lisp_Charset, dimension), 0), - to_unicode_description }, + XD_INDIRECT (0, 0), &to_unicode_description }, { XD_UNION, offsetof (Lisp_Charset, from_unicode_table), - XD_INDIRECT (offsetof (Lisp_Charset, from_unicode_levels), 0), - from_unicode_description }, -#endif + XD_INDIRECT (1, 0), &from_unicode_description }, { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, 1, /* dumpable flag */ mark_charset, print_charset, finalize_charset, 0, 0, charset_description, Lisp_Charset); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, - mark_charset, print_charset, finalize_charset, - 0, 0, charset_description, Lisp_Charset); -#endif /* not USE_KKCC */ /* Make a new charset. */ /* #### SJT Should generic properties be allowed? */ static Lisp_Object @@ -221,7 +211,6 @@ if (!overwrite) { cs = alloc_lcrecord_type (Lisp_Charset, &lrecord_charset); - zero_lcrecord (cs); obj = wrap_charset (cs); if (final) @@ -836,7 +825,7 @@ return CHARSETP (obj) ? XCHARSET_NAME (obj) : obj; } invalid_constant ("Unrecognized charset property name", prop); - RETURN_NOT_REACHED (Qnil) + RETURN_NOT_REACHED (Qnil); } DEFUN ("charset-id", Fcharset_id, 1, 1, 0, /* Index: src/mule-coding.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mule-coding.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- src/mule-coding.c 1 Sep 2002 06:41:45 -0000 1.28 +++ src/mule-coding.c 12 Jan 2003 11:08:19 -0000 1.29 @@ -660,7 +660,6 @@ /* Any ISO-2022-compliant coding system. Includes JIS, EUC, CTEXT (Compound Text, the encoding of selections in X Windows). See below for a complete description of ISO-2022. */ -DEFINE_CODING_SYSTEM_TYPE (iso2022); /* Flags indicating what we've seen so far when parsing an ISO2022 escape sequence. */ @@ -925,46 +924,43 @@ int current_char_boundary; }; -static const struct lrecord_description ccs_description_1[] = +static const struct memory_description ccs_description_1[] = { { XD_LISP_OBJECT, offsetof (charset_conversion_spec, from_charset) }, { XD_LISP_OBJECT, offsetof (charset_conversion_spec, to_charset) }, { XD_END } }; -static const struct struct_description ccs_description = +static const struct sized_memory_description ccs_description = { sizeof (charset_conversion_spec), ccs_description_1 }; -static const struct lrecord_description ccsd_description_1[] = +static const struct memory_description ccsd_description_1[] = { XD_DYNARR_DESC (charset_conversion_spec_dynarr, &ccs_description), { XD_END } }; -static const struct struct_description ccsd_description = +static const struct sized_memory_description ccsd_description = { sizeof (charset_conversion_spec_dynarr), ccsd_description_1 }; -static const struct lrecord_description iso2022_coding_system_description[] = { - { XD_LISP_OBJECT_ARRAY, - coding_system_data_offset + offsetof (struct iso2022_coding_system, - initial_charset), 4 }, - { XD_STRUCT_PTR, - coding_system_data_offset + offsetof (struct iso2022_coding_system, - input_conv), +static const struct memory_description iso2022_coding_system_description[] = { + { XD_LISP_OBJECT_ARRAY, offsetof (struct iso2022_coding_system, + initial_charset), 4 }, + { XD_STRUCT_PTR, offsetof (struct iso2022_coding_system, input_conv), 1, &ccsd_description }, - { XD_STRUCT_PTR, - coding_system_data_offset + offsetof (struct iso2022_coding_system, - output_conv), + { XD_STRUCT_PTR, offsetof (struct iso2022_coding_system, output_conv), 1, &ccsd_description }, { XD_END } }; +DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (iso2022); + /* The following note taken directly from FSF 21.0.103. */ /* The following note describes the coding system ISO2022 briefly. @@ -2985,7 +2981,6 @@ /************************************************************************/ /* Converter written in CCL. */ -DEFINE_CODING_SYSTEM_TYPE (ccl); struct ccl_coding_system { @@ -3010,15 +3005,13 @@ struct ccl_program ccl; }; -static const struct lrecord_description ccl_coding_system_description[] = { - { XD_LISP_OBJECT, - coding_system_data_offset + offsetof (struct ccl_coding_system, - decode) }, - { XD_LISP_OBJECT, - coding_system_data_offset + offsetof (struct ccl_coding_system, - encode) }, +static const struct memory_description ccl_coding_system_description[] = { + { XD_LISP_OBJECT, offsetof (struct ccl_coding_system, decode) }, + { XD_LISP_OBJECT, offsetof (struct ccl_coding_system, encode) }, { XD_END } }; + +DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (ccl); static void ccl_mark (Lisp_Object codesys) Index: src/nt.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/nt.c,v retrieving revision 1.39 retrieving revision 1.41 diff -u -r1.39 -r1.41 --- src/nt.c 20 Jun 2002 21:18:38 -0000 1.39 +++ src/nt.c 31 Jan 2003 12:02:38 -0000 1.41 @@ -122,7 +122,7 @@ if (!pw) return pw; - if (qxestrcasecmp_i18n (name, pw->pw_name)) + if (qxestrcasecmp_i18n (name, (Ibyte *) pw->pw_name)) return NULL; return pw; @@ -472,7 +472,7 @@ for (i = 0; i < countof (env_vars); i++) { if (!egetenv (env_vars[i]) && - (lpval = nt_get_resource (env_vars[i], &dwType)) != NULL) + (lpval = nt_get_resource ((Ibyte *) env_vars[i], &dwType)) != NULL) { if (dwType == REG_EXPAND_SZ) { @@ -484,14 +484,14 @@ buf = (Extbyte *) ALLOCA (cch * XETCHAR_SIZE); qxeExpandEnvironmentStrings ((Extbyte *) lpval, buf, cch); TSTR_TO_C_STRING (buf, envval); - eputenv (env_vars[i], envval); + eputenv (env_vars[i], (CIbyte *) envval); } else if (dwType == REG_SZ) { Ibyte *envval; TSTR_TO_C_STRING (lpval, envval); - eputenv (env_vars[i], envval); + eputenv (env_vars[i], (CIbyte *) envval); } xfree (lpval); @@ -516,9 +516,9 @@ if (STRINGP (str)) { Ibyte *dat = XSTRING_DATA (str); - if (qxestrncasecmp (dat, "PATH=", 5) == 0) + if (qxestrncasecmp_c (dat, "PATH=", 5) == 0) memcpy (dat, "PATH=", 5); - else if (qxestrncasecmp (dat, "COMSPEC=", 8) == 0) + else if (qxestrncasecmp_c (dat, "COMSPEC=", 8) == 0) memcpy (dat, "COMSPEC=", 8); } } @@ -681,9 +681,12 @@ DWORD maxcomp; DWORD flags; Extbyte type[256 * MAX_XETCHAR_SIZE]; + Extbyte *rootdirext; + + C_STRING_TO_TSTR (root_dir, rootdirext); /* Info is not cached, or is stale. */ - if (!qxeGetVolumeInformation (root_dir, + if (!qxeGetVolumeInformation (rootdirext, name, sizeof (name) / XETCHAR_SIZE, &serialnum, &maxcomp, @@ -772,14 +775,14 @@ removed; it was only for NT 3.1, which we hereby do not support. (NT 3.5 predates Windows 95!) */ -static int -is_exec (const Ibyte *name) +int +mswindows_is_executable (const Ibyte *name) { Ibyte *p = qxestrrchr (name, '.'); - return (p != NULL && (qxestrcasecmp (p, ".exe") == 0 || - qxestrcasecmp (p, ".com") == 0 || - qxestrcasecmp (p, ".bat") == 0 || - qxestrcasecmp (p, ".cmd") == 0)); + return (p != NULL && (qxestrcasecmp_c (p, ".exe") == 0 || + qxestrcasecmp_c (p, ".com") == 0 || + qxestrcasecmp_c (p, ".bat") == 0 || + qxestrcasecmp_c (p, ".cmd") == 0)); } /* Emulate the Unix directory procedures opendir, closedir, @@ -944,11 +947,11 @@ static Ibyte * read_unc_volume (HANDLE henum) { - int count; + DWORD count; int result; Extbyte buf[16384]; Ibyte *ptr; - Bytecount bufsize = sizeof (buf); + DWORD bufsize = sizeof (buf); count = 1; /* #### we should just be querying the size and then allocating the @@ -1030,7 +1033,7 @@ return -1; } } - if ((mode & X_OK) != 0 && !is_exec (path)) + if ((mode & X_OK) != 0 && !mswindows_is_executable (path)) { errno = EACCES; return -1; @@ -1056,6 +1059,7 @@ { HANDLE fileh; int result = -1; + Extbyte *oldext; if (old == NULL || new == NULL) { @@ -1063,8 +1067,8 @@ return -1; } - C_STRING_TO_TSTR (old, old); - fileh = qxeCreateFile (old, 0, 0, NULL, OPEN_EXISTING, + C_STRING_TO_TSTR (old, oldext); + fileh = qxeCreateFile (oldext, 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); if (fileh != INVALID_HANDLE_VALUE) { @@ -1111,7 +1115,7 @@ { /* Should try mapping GetLastError to errno; for now just indicate a general error (eg. links not supported). */ - errno = EINVAL; // perhaps EMLINK? + errno = EINVAL; /* perhaps EMLINK? */ } } @@ -1430,12 +1434,7 @@ else { #if 0 /* no way of knowing the filename */ - Ibyte *p = qxestrrchr (name, '.'); - if (p != NULL && - (qxestrcasecmp (p, ".exe") == 0 || - qxestrcasecmp (p, ".com") == 0 || - qxestrcasecmp (p, ".bat") == 0 || - qxestrcasecmp (p, ".cmd") == 0)) + if (mswindows_is_executable (name)) permission |= _S_IEXEC; #endif } @@ -1666,7 +1665,7 @@ if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) permission |= _S_IEXEC; - else if (is_exec (name)) + else if (mswindows_is_executable (name)) permission |= _S_IEXEC; buf->st_mode |= permission | (permission >> 3) | (permission >> 6); @@ -1880,10 +1879,10 @@ p = qxestrrchr (filename, '.'); /* We can only identify DOS .com programs from the extension. */ - if (p && qxestrcasecmp (p, ".com") == 0) + if (p && qxestrcasecmp_c (p, ".com") == 0) *is_dos_app = TRUE; - else if (p && (qxestrcasecmp (p, ".bat") == 0 || - qxestrcasecmp (p, ".cmd") == 0)) + else if (p && (qxestrcasecmp_c (p, ".bat") == 0 || + qxestrcasecmp_c (p, ".cmd") == 0)) { /* A DOS shell script - it appears that CreateProcess is happy to accept this (somewhat surprisingly); presumably it looks at @@ -2018,7 +2017,7 @@ TSTR_TO_C_STRING (shortname, shortint); MSWINDOWS_NORMALIZE_FILENAME (shortint); - return build_string (shortint); + return build_intstring (shortint); } @@ -2041,7 +2040,7 @@ return Qnil; canon = mswindows_canonicalize_filename (longname); - ret = build_string (canon); + ret = build_intstring (canon); xfree (canon); xfree (longname); return ret; Index: src/objects-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-impl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/objects-impl.h 29 Jul 2002 09:21:23 -0000 1.2 +++ src/objects-impl.h 12 Jan 2003 11:08:19 -0000 1.3 @@ -103,9 +103,8 @@ Lisp_Object name; Lisp_Object device; -#ifdef USE_KKCC + /* See comment in struct console about console variants. */ enum console_variant color_instance_type; -#endif /* USE_KKCC */ /* console-type-specific data */ void *data; @@ -129,9 +128,8 @@ check this and enforce it as a general policy) */ Lisp_Object device; -#ifdef USE_KKCC + /* See comment in struct console about console variants. */ enum console_variant font_instance_type; -#endif /* USE_KKCC */ unsigned short ascent; /* extracted from `font', or made up */ unsigned short descent; Index: src/objects-tty.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-tty.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/objects-tty.c 20 Jun 2002 21:18:39 -0000 1.9 +++ src/objects-tty.c 12 Jan 2003 11:08:19 -0000 1.10 @@ -37,6 +37,24 @@ Lisp_Object Vtty_dynamic_color_bg; #endif +static const struct memory_description tty_color_instance_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct tty_color_instance_data, symbol) }, + { XD_END } +}; + +const struct sized_memory_description tty_color_instance_data_description = { + sizeof (struct tty_color_instance_data), tty_color_instance_data_description_1 +}; + +static const struct memory_description tty_font_instance_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct tty_font_instance_data, charset) }, + { XD_END } +}; + +const struct sized_memory_description tty_font_instance_data_description = { + sizeof (struct tty_font_instance_data), tty_font_instance_data_description_1 +}; + DEFUN ("register-tty-color", Fregister_tty_color, 3, 3, 0, /* Register COLOR as a recognized TTY color. COLOR should be a string. Index: src/objects-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- src/objects-x.c 20 Jun 2002 21:18:40 -0000 1.21 +++ src/objects-x.c 12 Jan 2003 11:08:19 -0000 1.22 @@ -60,7 +60,7 @@ { int status; - if (visual->class == DirectColor || visual->class == TrueColor) + if (visual->X_CLASSFIELD == DirectColor || visual->X_CLASSFIELD == TrueColor) { if (XAllocColor (display, colormap, color_def) != 0) { Index: src/objects.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/objects.c 29 Jul 2002 09:21:23 -0000 1.17 +++ src/objects.c 12 Jan 2003 11:08:19 -0000 1.18 @@ -35,9 +35,9 @@ #include "specifier.h" #include "window.h" -#ifdef USE_KKCC -#include "objects-tty-impl.h" -#endif /* USE_KKCC */ +#ifdef HAVE_TTY +#include "console-tty.h" +#endif /* Objects that are substituted when an instantiation fails. If we leave in the Qunbound value, we will probably get crashes. */ @@ -62,35 +62,25 @@ Lisp_Object Qcolor_instancep; -#ifdef USE_KKCC -static const struct lrecord_description empty_color_instance_data_description [] = { - { XD_END } -}; - -static const struct lrecord_description tty_color_instance_data_description [] = { - { XD_LISP_OBJECT, offsetof (struct tty_color_instance_data, symbol) }, +static const struct memory_description color_instance_data_description_1 []= { +#ifdef HAVE_TTY + { XD_STRUCT_PTR, tty_console, 1, &tty_color_instance_data_description}, +#endif { XD_END } }; -static const struct struct_description color_instance_data_description []= { - { dead_console, empty_color_instance_data_description}, - { tty_console, tty_color_instance_data_description}, - { gtk_console, empty_color_instance_data_description}, - { x_console, empty_color_instance_data_description}, - { mswindows_console, empty_color_instance_data_description}, - { stream_console, empty_color_instance_data_description}, - { XD_END } +static const struct sized_memory_description color_instance_data_description = { + sizeof (void *), color_instance_data_description_1 }; -static const struct lrecord_description color_instance_description[] = { +static const struct memory_description color_instance_description[] = { { XD_INT, offsetof (Lisp_Color_Instance, color_instance_type) }, { XD_LISP_OBJECT, offsetof (Lisp_Color_Instance, name)}, { XD_LISP_OBJECT, offsetof (Lisp_Color_Instance, device)}, - { XD_UNION, offsetof (Lisp_Color_Instance, data), - XD_INDIRECT (0, 0), color_instance_data_description }, + { XD_UNION, offsetof (Lisp_Color_Instance, data), + XD_INDIRECT (0, 0), &color_instance_data_description }, {XD_END} }; -#endif /* USE_KKCC */ static Lisp_Object mark_color_instance (Lisp_Object obj) @@ -156,7 +146,6 @@ LISP_HASH (obj))); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("color-instance", color_instance, 0, /*dumpable-flag*/ mark_color_instance, print_color_instance, @@ -164,13 +153,6 @@ color_instance_hash, color_instance_description, Lisp_Color_Instance); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("color-instance", color_instance, - mark_color_instance, print_color_instance, - finalize_color_instance, color_instance_equal, - color_instance_hash, 0, - Lisp_Color_Instance); -#endif /* not USE_KKCC */ DEFUN ("make-color-instance", Fmake_color_instance, 1, 3, 0, /* Return a new `color-instance' object named NAME (a string). @@ -201,9 +183,7 @@ c->name = name; c->device = device; c->data = 0; -#ifdef USE_KKCC - c->color_instance_type = get_console_variant(XDEVICE_TYPE(c->device)); -#endif /* USE_KKCC */ + c->color_instance_type = get_console_variant (XDEVICE_TYPE (c->device)); retval = MAYBE_INT_DEVMETH (XDEVICE (device), initialize_color_instance, (c, name, device, @@ -278,36 +258,27 @@ static Lisp_Object font_instance_truename_internal (Lisp_Object xfont, Error_Behavior errb); -#ifdef USE_KKCC -static const struct lrecord_description empty_font_instance_data_description [] = { - { XD_END } -}; -static const struct lrecord_description tty_font_instance_data_description [] = { - { XD_LISP_OBJECT, offsetof (struct tty_font_instance_data, charset) }, +static const struct memory_description font_instance_data_description_1 []= { +#ifdef HAVE_TTY + { XD_STRUCT_PTR, tty_console, 1, &tty_font_instance_data_description}, +#endif { XD_END } }; -static const struct struct_description font_instance_data_description []= { - { dead_console, empty_font_instance_data_description}, - { tty_console, tty_font_instance_data_description}, - { gtk_console, empty_font_instance_data_description}, - { x_console, empty_font_instance_data_description}, - { mswindows_console, empty_font_instance_data_description}, - { stream_console, empty_font_instance_data_description}, - { XD_END } +static const struct sized_memory_description font_instance_data_description = { + sizeof (void *), font_instance_data_description_1 }; -static const struct lrecord_description font_instance_description[] = { +static const struct memory_description font_instance_description[] = { { XD_INT, offsetof (Lisp_Font_Instance, font_instance_type) }, { XD_LISP_OBJECT, offsetof (Lisp_Font_Instance, name)}, { XD_LISP_OBJECT, offsetof (Lisp_Font_Instance, truename)}, { XD_LISP_OBJECT, offsetof (Lisp_Font_Instance, device)}, { XD_UNION, offsetof (Lisp_Font_Instance, data), - XD_INDIRECT (0, 0), font_instance_data_description }, - {XD_END} + XD_INDIRECT (0, 0), &font_instance_data_description }, + { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object @@ -372,18 +343,12 @@ depth + 1); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("font-instance", font_instance, 0, /*dumpable-flag*/ mark_font_instance, print_font_instance, finalize_font_instance, font_instance_equal, - font_instance_hash, font_instance_description, Lisp_Font_Instance); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("font-instance", font_instance, - mark_font_instance, print_font_instance, - finalize_font_instance, font_instance_equal, - font_instance_hash, 0, Lisp_Font_Instance); -#endif /* not USE_KKCC */ + font_instance_hash, font_instance_description, + Lisp_Font_Instance); DEFUN ("make-font-instance", Fmake_font_instance, 1, 3, 0, /* @@ -417,9 +382,7 @@ f->device = device; f->data = 0; -#ifdef USE_KKCC - f->font_instance_type = get_console_variant(XDEVICE_TYPE(f->device)); -#endif /* USE_KKCC */ + f->font_instance_type = get_console_variant (XDEVICE_TYPE (f->device)); /* Stick some default values here ... */ f->ascent = f->height = 1; @@ -561,7 +524,14 @@ /**************************************************************************** Color Object ***************************************************************************/ -DEFINE_SPECIFIER_TYPE (color); + +static const struct memory_description color_specifier_description[] = { + { XD_LISP_OBJECT, offsetof (struct color_specifier, face) }, + { XD_LISP_OBJECT, offsetof (struct color_specifier, face_property) }, + { XD_END } +}; + +DEFINE_SPECIFIER_TYPE_WITH_DATA (color); /* Qcolor defined in general.c */ static void @@ -731,7 +701,14 @@ /**************************************************************************** Font Object ***************************************************************************/ -DEFINE_SPECIFIER_TYPE (font); + +static const struct memory_description font_specifier_description[] = { + { XD_LISP_OBJECT, offsetof (struct font_specifier, face) }, + { XD_LISP_OBJECT, offsetof (struct font_specifier, face_property) }, + { XD_END } +}; + +DEFINE_SPECIFIER_TYPE_WITH_DATA (font); /* Qfont defined in general.c */ static void @@ -822,9 +799,9 @@ struct device *d = XDEVICE (device); Lisp_Object instance; Lisp_Object charset = Qnil; +#ifdef MULE int stage = 0; -#ifdef MULE if (!UNBOUNDP (matchspec)) { charset = Fget_charset (XCAR (matchspec)); @@ -842,10 +819,8 @@ Ffont_instance_truename (instantiator), 0, -1, stage)) - return instantiator; -#else - return instantiator; #endif + return instantiator; } instantiator = Ffont_instance_name (instantiator); } @@ -979,7 +954,14 @@ /***************************************************************************** Face Boolean Object ****************************************************************************/ -DEFINE_SPECIFIER_TYPE (face_boolean); + +static const struct memory_description face_boolean_specifier_description[] = { + { XD_LISP_OBJECT, offsetof (struct face_boolean_specifier, face) }, + { XD_LISP_OBJECT, offsetof (struct face_boolean_specifier, face_property) }, + { XD_END } +}; + +DEFINE_SPECIFIER_TYPE_WITH_DATA (face_boolean); Lisp_Object Qface_boolean; static void @@ -1153,24 +1135,6 @@ /* Qcolor, Qfont defined in general.c */ DEFSYMBOL (Qface_boolean); } - -static const struct lrecord_description color_specifier_description[] = { - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct color_specifier, face) }, - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct color_specifier, face_property) }, - { XD_END } -}; - -static const struct lrecord_description font_specifier_description[] = { - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct font_specifier, face) }, - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct font_specifier, face_property) }, - { XD_END } -}; - -static const struct lrecord_description face_boolean_specifier_description[] = { - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct face_boolean_specifier, face) }, - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct face_boolean_specifier, face_property) }, - { XD_END } -}; void specifier_type_create_objects (void) Index: src/opaque.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/opaque.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/opaque.c 29 Jul 2002 09:21:23 -0000 1.15 +++ src/opaque.c 12 Jan 2003 11:08:19 -0000 1.16 @@ -72,7 +72,7 @@ make_opaque (const void *data, Bytecount size) { Lisp_Opaque *p = (Lisp_Opaque *) - alloc_lcrecord (aligned_sizeof_opaque (size), &lrecord_opaque); + basic_alloc_lcrecord (aligned_sizeof_opaque (size), &lrecord_opaque); p->size = size; if (data == OPAQUE_CLEAR) @@ -108,24 +108,16 @@ return memory_hash (XOPAQUE_DATA (obj), XOPAQUE_SIZE (obj)); } -static const struct lrecord_description opaque_description[] = { +static const struct memory_description opaque_description[] = { { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("opaque", opaque, 1, /*dumpable-flag*/ 0, print_opaque, 0, equal_opaque, hash_opaque, opaque_description, sizeof_opaque, Lisp_Opaque); -#else /* not USE_KKCC */ -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("opaque", opaque, - 0, print_opaque, 0, - equal_opaque, hash_opaque, - opaque_description, - sizeof_opaque, Lisp_Opaque); -#endif /* not USE_KKCC */ /* stuff to handle opaque pointers */ @@ -153,23 +145,16 @@ return (unsigned long) XOPAQUE_PTR (obj)->ptr; } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("opaque-ptr", opaque_ptr, 0, /*dumpable-flag*/ 0, print_opaque_ptr, 0, - equal_opaque_ptr, hash_opaque_ptr, 0, - Lisp_Opaque_Ptr); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("opaque-ptr", opaque_ptr, - 0, print_opaque_ptr, 0, - equal_opaque_ptr, hash_opaque_ptr, 0, - Lisp_Opaque_Ptr); -#endif /* not USE_KKCC */ + equal_opaque_ptr, hash_opaque_ptr, + 0, Lisp_Opaque_Ptr); Lisp_Object make_opaque_ptr (void *val) { - Lisp_Object res = allocate_managed_lcrecord (Vopaque_ptr_free_list); + Lisp_Object res = alloc_managed_lcrecord (Vopaque_ptr_free_list); set_opaque_ptr (res, val); return res; } @@ -184,7 +169,7 @@ } void -reinit_opaque_once_early (void) +reinit_opaque_early (void) { Vopaque_ptr_free_list = make_lcrecord_list (sizeof (Lisp_Opaque_Ptr), &lrecord_opaque_ptr); @@ -197,5 +182,5 @@ INIT_LRECORD_IMPLEMENTATION (opaque); INIT_LRECORD_IMPLEMENTATION (opaque_ptr); - reinit_opaque_once_early (); + reinit_opaque_early (); } Index: src/print.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/print.c,v retrieving revision 1.44 retrieving revision 1.46 diff -u -r1.44 -r1.46 --- src/print.c 12 Nov 2002 18:58:31 -0000 1.44 +++ src/print.c 6 Feb 2003 06:36:04 -0000 1.46 @@ -1,6 +1,6 @@ /* Lisp object printing and output streams. Copyright (C) 1985, 1986, 1988, 1992-1995 Free Software Foundation, Inc. - 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. @@ -439,13 +439,13 @@ Vprint_gensym_alist = Qnil; \ } while (0) -static Lisp_Object +Lisp_Object canonicalize_printcharfun (Lisp_Object printcharfun) { if (NILP (printcharfun)) printcharfun = Vstandard_output; - if (EQ (printcharfun, Qt) || NILP (printcharfun)) + if (!noninteractive && (EQ (printcharfun, Qt) || NILP (printcharfun))) printcharfun = Fselected_frame (Qnil); /* print to minibuffer */ return printcharfun; @@ -1376,11 +1376,58 @@ (unsigned long) XPNTR (obj)); } +enum printing_badness +{ + BADNESS_INTEGER_OBJECT, + BADNESS_POINTER_OBJECT, + BADNESS_NO_TYPE +}; + +static void +printing_major_badness (Lisp_Object printcharfun, + Char_ASCII *badness_string, int type, void *val, + enum printing_badness badness) +{ + Ibyte buf[666]; + + switch (badness) + { + case BADNESS_INTEGER_OBJECT: + qxesprintf (buf, "%s %d object %ld", badness_string, type, + (EMACS_INT) val); + break; + + case BADNESS_POINTER_OBJECT: + qxesprintf (buf, "%s %d object %p", badness_string, type, val); + break; + + case BADNESS_NO_TYPE: + qxesprintf (buf, "%s object %p", badness_string, val); + break; + } + + /* Don't abort or signal if called from debug_print() or already + crashing */ + if (!inhibit_non_essential_printing_operations) + { +#ifdef ERROR_CHECK_TYPES + abort (); +#else /* not ERROR_CHECK_TYPES */ + if (print_readably) + signal_ferror (Qinternal_error, "printing %s", buf); +#endif /* not ERROR_CHECK_TYPES */ + } + write_fmt_string (printcharfun, + "#", buf); +} + void print_internal (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { /* This function can GC */ int specdepth; + struct gcpro gcpro1, gcpro2; QUIT; @@ -1389,61 +1436,8 @@ if (gc_in_progress) return; #endif - /* Try to check for a bogus pointer if we're in a situation where it may - be likely. In such cases, crashing is counterproductive. */ - if (inhibit_non_essential_printing_operations || print_unbuffered) - { - if (XTYPE (obj) == Lisp_Type_Record) - { - struct lrecord_header *lheader = XRECORD_LHEADER (obj); - - if (!debug_can_access_memory (lheader, sizeof (*lheader))) - { - write_fmt_string (printcharfun, "#", - lheader); - return; - } - else - { - const struct lrecord_implementation *impl; - - if ((int) lheader->type >= lrecord_type_count) - { - write_fmt_string (printcharfun, - "#", - lheader->type, lheader); - return; - } - - impl = LHEADER_IMPLEMENTATION (lheader); - if (!debug_can_access_memory - (lheader, - (impl->size_in_bytes_method ? - impl->size_in_bytes_method (lheader) : - impl->static_size))) - { - write_fmt_string (printcharfun, - "#", - impl->name, lheader); - return; - } - - if (STRINGP (obj)) - { - Lisp_String *l = (Lisp_String *) lheader; - if (!debug_can_access_memory - (l->data_, l->size_)) - { - write_fmt_string - (printcharfun, - "#", - lheader, l->data_); - return; - } - } - } - } - } + /* Just to be safe ... */ + GCPRO2 (obj, printcharfun); #ifdef I18N3 /* #### Both input and output streams should have a flag associated @@ -1469,6 +1463,7 @@ *buf = '#'; long_to_string (buf + 1, i); write_c_string (printcharfun, buf); + UNGCPRO; return; } } @@ -1558,51 +1553,101 @@ case Lisp_Type_Record: { struct lrecord_header *lheader = XRECORD_LHEADER (obj); - struct gcpro gcpro1, gcpro2; - if (CONSP (obj) || VECTORP(obj)) + /* Try to check for various sorts of bogus pointers if we're in a + situation where it may be likely -- i.e. called from + debug_print() or we're already crashing. In such cases, + (further) crashing is counterproductive. */ + + if (inhibit_non_essential_printing_operations && + !debug_can_access_memory (lheader, sizeof (*lheader))) + { + write_fmt_string (printcharfun, "#", + lheader); + break; + } + + if (CONSP (obj) || VECTORP (obj)) { /* If deeper than spec'd depth, print placeholder. */ if (INTP (Vprint_level) && print_depth > XINT (Vprint_level)) { - GCPRO2 (obj, printcharfun); write_c_string (printcharfun, "..."); - UNGCPRO; break; } } - GCPRO2 (obj, printcharfun); + if (lheader->type == lrecord_type_free) + { + printing_major_badness (printcharfun, "freed lrecord", 0, + lheader, BADNESS_NO_TYPE); + break; + } + else if (lheader->type == lrecord_type_undefined) + { + printing_major_badness (printcharfun, "lrecord_type_undefined", 0, + lheader, BADNESS_NO_TYPE); + break; + } + else if ((int) (lheader->type) >= lrecord_type_count) + { + printing_major_badness (printcharfun, "illegal lrecord type", + (int) (lheader->type), + lheader, BADNESS_POINTER_OBJECT); + break; + } + + /* Further checks for bad memory in critical situations. We don't + normally do these because they may be expensive or weird + (e.g. under Unix we typically have to set a SIGSEGV handler and + try to trigger a seg fault). */ + + if (inhibit_non_essential_printing_operations) + { + if (!debug_can_access_memory + (lheader, detagged_lisp_object_size (lheader))) + { + write_fmt_string (printcharfun, + "#", + LHEADER_IMPLEMENTATION (lheader)->name, + lheader); + break; + } + + if (STRINGP (obj)) + { + Lisp_String *l = (Lisp_String *) lheader; + if (!debug_can_access_memory (l->data_, l->size_)) + { + write_fmt_string + (printcharfun, + "#", + lheader, l->data_); + break; + } + } + } + if (LHEADER_IMPLEMENTATION (lheader)->printer) ((LHEADER_IMPLEMENTATION (lheader)->printer) (obj, printcharfun, escapeflag)); else default_object_printer (obj, printcharfun, escapeflag); - UNGCPRO; break; } default: { -#ifdef ERROR_CHECK_TYPES - abort (); -#else /* not ERROR_CHECK_TYPES */ /* We're in trouble if this happens! */ - if (print_readably) - signal_error (Qinternal_error, "printing illegal data type #o%03o", - make_int (XTYPE (obj))); - write_c_string (printcharfun, "#"); -#endif /* not ERROR_CHECK_TYPES */ + printing_major_badness (printcharfun, "illegal data type", XTYPE (obj), + LISP_TO_VOID (obj), BADNESS_INTEGER_OBJECT); break; } } unbind_to (specdepth); + UNGCPRO; } void @@ -1906,12 +1951,102 @@ } void +debug_p4 (Lisp_Object obj) +{ + inhibit_non_essential_printing_operations = 1; + if (STRINGP (obj)) + debug_out ("\"%s\"", XSTRING_DATA (obj)); + else if (CONSP (obj)) + { + int first = 1; + do { + debug_out (first ? "(" : " "); + first = 0; + debug_p4 (XCAR (obj)); + obj = XCDR (obj); + } while (CONSP (obj)); + if (NILP (obj)) + debug_out (")"); + else + { + debug_out (" . "); + debug_p4 (obj); + debug_out (")"); + } + } + else if (VECTORP (obj)) + { + int size = XVECTOR_LENGTH (obj); + int i; + int first = 1; + + for (i = 0; i < size; i++) + { + debug_out (first ? "[" : " "); + first = 0; + debug_p4 (XVECTOR_DATA (obj)[i]); + debug_out ("]"); + } + } + else if (SYMBOLP (obj)) + { + Lisp_Object name = XSYMBOL_NAME (obj); + if (!STRINGP (name)) + debug_out ("<>"); + else + debug_out ("%s", XSTRING_DATA (name)); + } + else if (INTP (obj)) + { + debug_out ("%ld", XINT (obj)); + } + else if (FLOATP (obj)) + { + debug_out ("%g", XFLOAT_DATA (obj)); + } + else + { + struct lrecord_header *header = + (struct lrecord_header *) XPNTR (obj); + + if (header->type >= lrecord_type_last_built_in_type) + debug_out ("<< bad object type=%d 0x%lx>>", header->type, + (EMACS_INT) header); + else + debug_out ("#<%s 0x%lx>", + LHEADER_IMPLEMENTATION (header)->name, + LHEADER_IMPLEMENTATION (header)->basic_p ? + (EMACS_INT) header : + ((struct lcrecord_header *) header)->uid); + } + + inhibit_non_essential_printing_operations = 0; +} + +void +debug_p3 (Lisp_Object obj) +{ + debug_p4 (obj); + inhibit_non_essential_printing_operations = 1; + debug_out ("\n"); + inhibit_non_essential_printing_operations = 0; +} + +void debug_print (Lisp_Object debug_print_obj) { debug_print_no_newline (debug_print_obj); debug_out ("\n"); } +/* Getting tired of typing debug_print() ... */ +void dp (Lisp_Object debug_print_obj); +void +dp (Lisp_Object debug_print_obj) +{ + debug_print (debug_print_obj); +} + /* Debugging kludge -- unbuffered */ /* This function provided for the benefit of the debugger. */ void @@ -1938,6 +2073,14 @@ stderr_out ("\n"); unbind_to (specdepth); +} + +/* Getting tired of typing debug_backtrace() ... */ +void db (void); +void +db (void) +{ + debug_backtrace (); } void Index: src/process-nt.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process-nt.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- src/process-nt.c 5 Jun 2002 09:56:48 -0000 1.32 +++ src/process-nt.c 12 Jan 2003 11:08:19 -0000 1.33 @@ -751,12 +751,7 @@ /* SHGetFileInfo tends to return ERROR_FILE_NOT_FOUND on most errors. This leads to bogus error message. */ DWORD image_type; - Ibyte *p = qxestrrchr (XSTRING_DATA (program), '.'); - if (p != NULL && - (qxestrcasecmp (p, ".exe") == 0 || - qxestrcasecmp (p, ".com") == 0 || - qxestrcasecmp (p, ".bat") == 0 || - qxestrcasecmp (p, ".cmd") == 0)) + if (mswindows_is_executable (XSTRING_DATA (program))) { Extbyte *progext; LISP_STRING_TO_TSTR (program, progext); @@ -926,11 +921,11 @@ for (i = 0; i < new_length; i++) { - eicat_raw (envout, env[i], strlen (env[i])); - eicat_raw (envout, "\0", 1); + eicat_raw (envout, env[i], qxestrlen (env[i])); + eicat_raw (envout, (Ibyte *) "\0", 1); } - eicat_raw (envout, "\0", 1); + eicat_raw (envout, (Ibyte *) "\0", 1); eito_external (envout, Qmswindows_tstr); proc_env = eiextdata (envout); } @@ -1210,7 +1205,11 @@ /* First check if HOST is already a numeric address */ { - unsigned long inaddr = inet_addr (XSTRING_DATA (host)); + Extbyte *hostext; + unsigned long inaddr; + + LISP_STRING_TO_EXTERNAL (host, hostext, Qmswindows_host_name_encoding); + inaddr = inet_addr (hostext); if (inaddr != INADDR_NONE) { address->sin_addr.s_addr = inaddr; Index: src/process-slots.h =================================================================== RCS file: src/process-slots.h diff -N src/process-slots.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/process-slots.h 12 Jan 2003 11:08:19 -0000 1.1 @@ -0,0 +1,71 @@ +/* Definitions of marked slots in processes + Copyright (C) 1985, 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 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. */ + +/* Synched up with: ????. Split out of procimpl.h. */ + +/* We define the Lisp_Objects in the process structure in a separate file + because there are numerous places we want to iterate over them, such + as when defining them in the structure, initializing them, or marking + them. + + To use, define MARKED_SLOT before including this file. No need to + undefine; that happens automatically. */ + + /* Name of this process */ + MARKED_SLOT (name) + /* List of command arguments that this process was run with */ + MARKED_SLOT (command) + /* (funcall FILTER PROC STRING) (if FILTER is non-nil) + to dispose of a bunch of chars from the process all at once */ + MARKED_SLOT (filter) + /* (funcall FILTER PROC STRING) (if FILTER is non-nil) + to dispose of a bunch of chars from the stderr of process all at once */ + MARKED_SLOT (stderr_filter) + /* (funcall SENTINEL PROCESS) when process state changes */ + MARKED_SLOT (sentinel) + /* Buffer that output or stderr output is going to */ + MARKED_SLOT (buffer) + MARKED_SLOT (stderr_buffer) + /* Marker set to end of last buffer-inserted output from this process */ + MARKED_SLOT (mark) + MARKED_SLOT (stderr_mark) + /* Lisp_Int of subprocess' PID, or a cons of + service/host if this is really a network connection */ + MARKED_SLOT (pid) + + /* Symbol indicating status of process. + This may be a symbol: run, stop, exit, signal */ + MARKED_SLOT (status_symbol) + /* Low level streams used in input and output, connected to child */ + MARKED_SLOT (pipe_instream) + MARKED_SLOT (pipe_outstream) + MARKED_SLOT (pipe_errstream) + /* Data end streams, decoding and encoding pipe_* streams */ + MARKED_SLOT (coding_instream) + MARKED_SLOT (coding_outstream) + MARKED_SLOT (coding_errstream) + + /* Name of subprocess terminal. Only needed for Unix but we put it + here to avoid complications with KKCC, which needs to know about + all of the Lisp objects, including in process-type-specific data. */ + MARKED_SLOT (tty_name) + +#undef MARKED_SLOT Index: src/process-unix.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process-unix.c,v retrieving revision 1.49 retrieving revision 1.51 diff -u -r1.49 -r1.51 --- src/process-unix.c 18 Nov 2002 06:52:41 -0000 1.49 +++ src/process-unix.c 12 Jan 2003 11:08:20 -0000 1.51 @@ -72,7 +72,6 @@ * Implementation-specific data. Pointed to by Lisp_Process->process_data */ -#ifndef USE_KKCC struct unix_process_data { /* Non-0 if this is really a ToolTalk channel. */ @@ -85,12 +84,9 @@ /* Descriptor for the tty which this process is using. -1 if we didn't record it (on some systems, there's no need). */ int subtty; - /* Name of subprocess terminal. */ - Lisp_Object tty_name; /* Non-false if communicating through a pty. */ char pty_flag; }; -#endif /* not USE_KKCC */ #define UNIX_DATA(p) ((struct unix_process_data*) ((p)->process_data)) @@ -475,8 +471,7 @@ h_errno = 0; #endif - TO_EXTERNAL_FORMAT (LISP_STRING, host, C_STRING_ALLOCA, hostext, - Qnative); + LISP_STRING_TO_EXTERNAL (host, hostext, Qunix_host_name_encoding); /* Some systems can't handle SIGIO/SIGALARM in gethostbyname. */ slow_down_interrupts (); @@ -497,12 +492,15 @@ else { IN_ADDR numeric_addr; + Extbyte *hostext; + /* Attempt to interpret host as numeric inet address */ - numeric_addr = inet_addr ((char *) XSTRING_DATA (host)); + LISP_STRING_TO_EXTERNAL (host, hostext, Qunix_host_name_encoding); + numeric_addr = inet_addr (hostext); if (NUMERIC_ADDR_ERROR) { maybe_signal_error (Qio_error, "Unknown host", host, - Qprocess, errb); + Qprocess, errb); return 0; } @@ -810,22 +808,11 @@ { p->process_data = xnew (struct unix_process_data); - UNIX_DATA(p)->connected_via_filedesc_p = 0; - UNIX_DATA(p)->infd = -1; - UNIX_DATA(p)->errfd = -1; - UNIX_DATA(p)->subtty = -1; - UNIX_DATA(p)->tty_name = Qnil; - UNIX_DATA(p)->pty_flag = 0; -} - -/* - * Mark any Lisp objects in Lisp_Process->process_data - */ - -static void -unix_mark_process_data (Lisp_Process *proc) -{ - mark_object (UNIX_DATA(proc)->tty_name); + UNIX_DATA (p)->connected_via_filedesc_p = 0; + UNIX_DATA (p)->infd = -1; + UNIX_DATA (p)->errfd = -1; + UNIX_DATA (p)->subtty = -1; + UNIX_DATA (p)->pty_flag = 0; } /* @@ -1119,6 +1106,7 @@ #endif set_descriptor_non_blocking (inchannel); + set_descriptor_non_blocking (outchannel); if (errchannel >= 0) set_descriptor_non_blocking (errchannel); @@ -1323,7 +1311,7 @@ if (separate_err) retry_close (forkerr); - UNIX_DATA (p)->tty_name = pty_flag ? build_intstring (pty_name) : Qnil; + p->tty_name = pty_flag ? build_intstring (pty_name) : Qnil; /* Notice that SIGCHLD was not blocked. (This is not possible on some systems.) No biggie if SIGCHLD occurs right around the @@ -1340,7 +1328,7 @@ close_descriptor_pair (forkerr, errchannel); errno = save_errno; report_process_error ("Opening pty or pipe", Qunbound); - RETURN_NOT_REACHED (0) + RETURN_NOT_REACHED (0); } } @@ -1641,12 +1629,13 @@ /* If the subtty field of the process data is not filled in, do so now. */ static void -try_to_initialize_subtty (struct unix_process_data *upd) +try_to_initialize_subtty (Lisp_Process *p) { + struct unix_process_data *upd = UNIX_DATA (p); if (upd->pty_flag && (upd->subtty == -1 || ! isatty (upd->subtty)) - && STRINGP (upd->tty_name)) - upd->subtty = qxe_open (XSTRING_DATA (upd->tty_name), O_RDWR, 0); + && STRINGP (p->tty_name)) + upd->subtty = qxe_open (XSTRING_DATA (p->tty_name), O_RDWR, 0); } /* Send signal number SIGNO to PROCESS. @@ -1730,7 +1719,7 @@ */ if (current_group) { - try_to_initialize_subtty (d); + try_to_initialize_subtty (p); #ifdef SIGNALS_VIA_CHARACTERS /* If possible, send signals to the entire pgrp @@ -1802,14 +1791,6 @@ return kill (pid, sigcode); } -/* Return TTY name used to communicate with subprocess. */ - -static Lisp_Object -unix_get_tty_name (Lisp_Process *p) -{ - return UNIX_DATA (p)->tty_name; -} - /* Canonicalize host name HOST, and return its canonical form. The default implementation just takes HOST for a canonical name. */ @@ -2328,7 +2309,6 @@ process_type_create_unix (void) { PROCESS_HAS_METHOD (unix, alloc_process_data); - PROCESS_HAS_METHOD (unix, mark_process_data); #ifdef SIGCHLD PROCESS_HAS_METHOD (unix, init_process); PROCESS_HAS_METHOD (unix, reap_exited_processes); @@ -2345,7 +2325,6 @@ PROCESS_HAS_METHOD (unix, deactivate_process); PROCESS_HAS_METHOD (unix, kill_child_process); PROCESS_HAS_METHOD (unix, kill_process_by_pid); - PROCESS_HAS_METHOD (unix, get_tty_name); #ifdef HAVE_SOCKETS PROCESS_HAS_METHOD (unix, canonicalize_host_name); PROCESS_HAS_METHOD (unix, open_network_stream); Index: src/process.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- src/process.c 29 Jul 2002 09:21:23 -0000 1.61 +++ src/process.c 12 Jan 2003 11:08:20 -0000 1.62 @@ -138,69 +138,19 @@ -#ifdef USE_KKCC -static const struct lrecord_description empty_process_data_description [] = { +static const struct memory_description process_description [] = { +#define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (Lisp_Process, x) }, +#include "process-slots.h" { XD_END } }; -static const struct lrecord_description unix_process_data_description [] = { - { XD_LISP_OBJECT, offsetof (struct unix_process_data, tty_name) }, - { XD_END } -}; - -static const struct struct_description process_data_description []= { - { unix_process, unix_process_data_description}, - { nt_process, empty_process_data_description}, - { XD_END } -}; - -static const struct lrecord_description process_description [] = { - { XD_INT, offsetof (Lisp_Process, process_type) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, name) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, command) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, filter) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, stderr_filter) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, sentinel) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, buffer) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, mark) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, stderr_buffer) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, stderr_mark) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, pid) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, pipe_instream) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, pipe_outstream) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, pipe_errstream) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, coding_instream) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, coding_outstream) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, coding_errstream) }, - { XD_LISP_OBJECT, offsetof (Lisp_Process, status_symbol) }, - { XD_UNION, offsetof (Lisp_Process, process_data), - XD_INDIRECT (0, 0), process_data_description }, - { XD_END } -}; -#endif /* USE_KKCC */ - static Lisp_Object mark_process (Lisp_Object object) { Lisp_Process *process = XPROCESS (object); - MAYBE_PROCMETH (mark_process_data, (process)); - mark_object (process->name); - mark_object (process->command); - mark_object (process->filter); - mark_object (process->stderr_filter); - mark_object (process->sentinel); - mark_object (process->buffer); - mark_object (process->mark); - mark_object (process->stderr_buffer); - mark_object (process->stderr_mark); - mark_object (process->pid); - mark_object (process->pipe_instream); - mark_object (process->pipe_outstream); - mark_object (process->pipe_errstream); - mark_object (process->coding_instream); - mark_object (process->coding_outstream); - mark_object (process->coding_errstream); - return process->status_symbol; +#define MARKED_SLOT(x) mark_object (process->x); +#include "process-slots.h" + return Qnil; } static void @@ -255,16 +205,10 @@ } } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("process", process, 0, /*dumpable-flag*/ mark_process, print_process, finalize_process, 0, 0, process_description, Lisp_Process); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("process", process, - mark_process, print_process, finalize_process, - 0, 0, 0, Lisp_Process); -#endif /* not USE_KKCC */ /************************************************************************/ /* basic process accessors */ @@ -537,6 +481,9 @@ int i; Lisp_Process *p = alloc_lcrecord_type (Lisp_Process, &lrecord_process); +#define MARKED_SLOT(x) p->x = Qnil; +#include "process-slots.h" + /* If name is already in use, modify it until it is unused. */ name1 = name; for (i = 1; ; i++) @@ -551,43 +498,12 @@ name = name1; p->name = name; - p->command = Qnil; - p->filter = Qnil; - p->stderr_filter = Qnil; - p->sentinel = Qnil; - p->buffer = Qnil; p->mark = Fmake_marker (); - p->stderr_buffer = Qnil; p->stderr_mark = Fmake_marker (); - p->pid = Qnil; p->status_symbol = Qrun; - p->exit_code = 0; - p->core_dumped = 0; - p->filter_does_read = 0; - p->kill_without_query = 0; - p->separate_stderr = 0; - p->in_selected = 0; - p->err_selected = 0; - p->tick = 0; - p->update_tick = 0; - p->pipe_instream = Qnil; - p->pipe_outstream = Qnil; - p->pipe_errstream = Qnil; - p->coding_instream = Qnil; - p->coding_outstream = Qnil; - p->coding_errstream = Qnil; - p->process_data = 0; MAYBE_PROCMETH (alloc_process_data, (p)); -#ifdef USE_KKCC -#ifdef HAVE_MS_WINDOWS - p->process_type = nt_process; -#else /*HAVE_MS_WINDOWS*/ - p->process_type = unix_process; -#endif /*HAVE_MS_WINDOWS*/ -#endif /* USE_KKCC */ - val = wrap_process (p); Vprocess_list = Fcons (val, Vprocess_list); @@ -966,8 +882,8 @@ event_stream_select_process (XPROCESS (process), 1, 1); - UNGCPRO; NUNGCPRO; + UNGCPRO; return process; } @@ -1276,7 +1192,7 @@ (process)) { CHECK_PROCESS (process); - return MAYBE_LISP_PROCMETH (get_tty_name, (XPROCESS (process))); + return XPROCESS (process)->tty_name; } DEFUN ("set-process-buffer", Fset_process_buffer, 2, 2, 0, /* @@ -2010,7 +1926,7 @@ #undef handle_signal invalid_constant ("Undefined signal name", signal_); - RETURN_NOT_REACHED (0) + RETURN_NOT_REACHED (0); } } Index: src/process.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- src/process.h 29 Jul 2002 09:21:24 -0000 1.19 +++ src/process.h 12 Jan 2003 11:08:20 -0000 1.20 @@ -39,15 +39,6 @@ /* struct Lisp_Process is defined in procimpl.h; only process-*.c need to know about the guts of it. */ -#ifdef USE_KKCC -enum process_variant -{ - unix_process, - nt_process -}; - -#endif /* USE_KKCC */ - DECLARE_LRECORD (process, Lisp_Process); #define XPROCESS(x) XRECORD (x, process, Lisp_Process) #define wrap_process(p) wrap_record (p, process) Index: src/procimpl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/procimpl.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/procimpl.h 18 Nov 2002 06:52:41 -0000 1.10 +++ src/procimpl.h 12 Jan 2003 11:08:20 -0000 1.11 @@ -19,6 +19,8 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Synched up with: ????. Split out of process.h. */ + /* This file must be only included by the process implementation files: process-unix.c, process-msw.c etc. The Lisp_Process structure and other contents of this file is not exported to the rest of the world */ @@ -36,7 +38,6 @@ struct process_methods { - void (*mark_process_data) (Lisp_Process *proc); void (*print_process_data) (Lisp_Process *proc, Lisp_Object printcharfun); void (*finalize_process_data) (Lisp_Process *proc, int for_disksave); void (*alloc_process_data) (Lisp_Process *p); @@ -66,7 +67,6 @@ int current_group, int nomsg); int (*kill_process_by_pid) (int pid, int sigcode); int (*process_send_eof) (Lisp_Object proc); - Lisp_Object (*get_tty_name) (Lisp_Process *p); void (*deactivate_process) (Lisp_Process *p, USID* in_usid, USID* err_usid); @@ -95,29 +95,6 @@ struct Lisp_Process { struct lcrecord_header header; - /* Name of this process */ - Lisp_Object name; - /* List of command arguments that this process was run with */ - Lisp_Object command; - /* (funcall FILTER PROC STRING) (if FILTER is non-nil) - to dispose of a bunch of chars from the process all at once */ - Lisp_Object filter; - /* (funcall FILTER PROC STRING) (if FILTER is non-nil) - to dispose of a bunch of chars from the stderr of process all at once */ - Lisp_Object stderr_filter; - /* (funcall SENTINEL PROCESS) when process state changes */ - Lisp_Object sentinel; - /* Buffer that output or stderr output is going to */ - Lisp_Object buffer, stderr_buffer; - /* Marker set to end of last buffer-inserted output from this process */ - Lisp_Object mark, stderr_mark; - /* Lisp_Int of subprocess' PID, or a cons of - service/host if this is really a network connection */ - Lisp_Object pid; - - /* Symbol indicating status of process. - This may be a symbol: run, stop, exit, signal */ - Lisp_Object status_symbol; /* Exit code if process has terminated, signal which stopped/interrupted process @@ -140,18 +117,9 @@ int update_tick; /* Non-zero if stderr and stdout are separated. */ char separate_stderr; - /* Low level streams used in input and output, connected to child */ - Lisp_Object pipe_instream; - Lisp_Object pipe_outstream; - Lisp_Object pipe_errstream; - /* Data end streams, decoding and encoding pipe_* streams */ - Lisp_Object coding_instream; - Lisp_Object coding_outstream; - Lisp_Object coding_errstream; - -#ifdef USE_KKCC - enum process_variant process_type; -#endif /* USE_KKCC */ + +#define MARKED_SLOT(x) Lisp_Object x; +#include "process-slots.h" /* Implementation dependent data */ void *process_data; @@ -185,25 +153,5 @@ Lisp_Object relocatable, const Ibyte *nonrelocatable, int start, int len); - -#ifdef USE_KKCC -struct unix_process_data -{ - /* Non-0 if this is really a ToolTalk channel. */ - int connected_via_filedesc_p; - /* Descriptor by which we read from this process. -1 for dead process */ - int infd; - /* Descriptor by which we read stderr from this process. -1 for - dead process */ - int errfd; - /* Descriptor for the tty which this process is using. - -1 if we didn't record it (on some systems, there's no need). */ - int subtty; - /* Name of subprocess terminal. */ - Lisp_Object tty_name; - /* Non-false if communicating through a pty. */ - char pty_flag; -}; -#endif /* USE_KKCC */ #endif /* INCLUDED_procimpl_h_ */ Index: src/profile.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/profile.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/profile.c 27 Nov 2002 07:15:13 -0000 1.15 +++ src/profile.c 13 Feb 2003 09:57:08 -0000 1.16 @@ -1,5 +1,5 @@ /* Why the hell is XEmacs so fucking slow? - Copyright (C) 1996, 2002 Ben Wing. + Copyright (C) 1996, 2002, 2003 Ben Wing. Copyright (C) 1998 Free Software Foundation, Inc. This file is part of XEmacs. @@ -34,129 +34,340 @@ #error Sorry charlie. We need a scalpel and all we have is a lawnmower. #endif -/* We implement our own profiling scheme so that we can determine +#ifdef WIN32_ANY +int mswindows_is_blocking; +#endif + +/* Written by Ben Wing. + + We implement our own profiling scheme so that we can determine things like which Lisp functions are occupying the most time. Any standard OS-provided profiling works on C functions, which is - somewhat useless. + not always that useful -- and inconvenient, since it requires compiling + with profile info and can't be retrieved dynamically, as XEmacs is + running. 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. - - It would be nice to use the Lisp allocation mechanism etc. to keep - track of the profiling information, but we can't because that's not - safe, and trying to make it safe would be much more work than it's - worth. + (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. + + 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 + can't because that's not safe -- updating the timing information happens + inside of a signal handler, so we can't rely on not being in the middle + of Lisp allocation, garbage collection, malloc(), etc. Trying to make + it work would be much more work than it's worth. Instead we use a basic + (non-Lisp) hash table, which will not conflict with garbage collection + or anything else as long as it doesn't try to resize itself. Resizing + itself, however (which happens as a result of a puthash()), could be + deadly. To avoid this, we make sure, at points where it's safe + (e.g. profile_record_about_to_call() -- recording the entry into a + function call), that the table always has some breathing room in it so + that no resizes will occur until at least that many items are added. + This is safe because any new item to be added in the sigprof would + likely have the profile_record_about_to_call() called just before it, + and the breathing room is checked. + + In general: any entry that the sigprof handler puts into the table comes + from a backtrace frame (except "Processing Events at Top Level", and + there's only one of those). Either that backtrace frame was added when + profiling was on (in which case profile_record_about_to_call() was + called and the breathing space updated), or when it was off -- and in + this case, no such frames can have been added since the last time + `start-profile' was called, so when `start-profile' is called we make + sure there is sufficient breathing room to account for all entries + currently on the stack. - Jan 1998: In addition to this, I have added code to remember call + Jan 1998: In addition to timing info, I have added code to remember call counts of Lisp funcalls. The profile_increase_call_count() function is called from Ffuncall(), and serves to add data to Vcall_count_profile_table. This mechanism is much simpler and independent of the SIGPROF-driven one. It uses the Lisp allocation mechanism normally, since it is not called from a handler. It may even be useful to provide a way to turn on only one profiling - mechanism, but I haven't done so yet. --hniksic */ + mechanism, but I haven't done so yet. --hniksic + + Dec 2002: Total overhaul of the interface, making it sane and easier to + use. --ben + + Feb 2003: Lots of rewriting of the internal code. Add GC-consing-usage, + total GC usage, and total timing to the information tracked. Track + profiling overhead and allow the ability to have internal sections + (e.g. internal-external conversion, byte-char conversion) that are + treated like Lisp functions for the purpose of profiling. --ben + + BEWARE: If you are modifying this file, be *very* careful. Correctly + implementing the "total" values is very tricky due to the possibility of + recursion and of functions already on the stack when starting to + profile/still on the stack when stopping. +*/ +/* We use a plain table here because we're recording inside of a signal + handler. */ static struct hash_table *big_profile_table; +Lisp_Object Vtotal_timing_profile_table; Lisp_Object Vcall_count_profile_table; +Lisp_Object Vtotal_gc_usage_profile_table; +Lisp_Object Vgc_usage_profile_table; + +extern int lisp_eval_depth; + +extern EMACS_UINT total_consing; +static volatile EMACS_UINT total_ticks; Fixnum default_profiling_interval; int profiling_active; -/* The normal flag in_display is used as a critical-section flag - and is not set the whole time we're in redisplay. */ -int profiling_redisplay_flag; - -static Lisp_Object QSin_redisplay; -static Lisp_Object QSin_garbage_collection; static Lisp_Object QSprocessing_events_at_top_level; -static Lisp_Object QSunknown; +static Lisp_Object QSunknown, QSprofile_overhead; -static Lisp_Object Qtiming, Qcall_count; +static Lisp_Object Qtiming, Qtotal_timing, Qcall_count; +static Lisp_Object Qgc_usage, Qtotal_gc_usage; -/* We use inside_profiling to prevent the handler from writing to +/* This needs to be >= the total number of defined internal sections, + plus 1 or 2?? Set it extra big just to be ultra-paranoid. */ +#define EXTRA_BREATHING_ROOM 100 + +/* We use profiling_lock to prevent the signal handler from writing to the table while another routine is operating on it. We also set - inside_profiling in case the timeout between signal calls is short + profiling_lock in case the timeout between signal calls is short enough to catch us while we're already in there. */ -static volatile int inside_profiling; +static volatile int profiling_lock; + +/* Whether we're in the process of doing *any* profiling-related stuff. + Used to indicate amount of time spent profiling. */ +static int in_profiling; + +#if 0 /* #### for KKCC, eventually */ + +static const struct memory_description hentry_description_1[] = { + { XD_LISP_OBJECT, offsetof (hentry, key) }, + { XD_END } +}; + +static const struct sized_memory_description hentry_description = { + sizeof (hentry), + hentry_description_1 +}; + +static const struct memory_description plain_hash_table_description_1[] = { + { XD_ELEMCOUNT, offsetof (struct hash_table, size) }, + { XD_STRUCT_PTR, offsetof (struct hash_table, harray), XD_INDIRECT (0, 0), + &hentry_description }, + { XD_END } +}; + +static const struct sized_memory_description plain_hash_table_description = { + sizeof (struct hash_table), + plain_hash_table_description_1 +}; + +#endif /* 0 */ + +static void +create_timing_profile_table (void) +{ + /* The hash code can safely be called from a signal handler except when + it has to grow the hash table. In this case, it calls realloc(), + which is not (in general) re-entrant. The way we deal with this is + documented at the top of this file. */ + if (!big_profile_table) + big_profile_table = make_hash_table (2000); +} static void -create_call_count_profile_table (void) +create_profile_tables (void) { + create_timing_profile_table (); + if (NILP (Vtotal_timing_profile_table)) + Vtotal_timing_profile_table = + make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); if (NILP (Vcall_count_profile_table)) Vcall_count_profile_table = make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); + if (NILP (Vgc_usage_profile_table)) + Vgc_usage_profile_table = + make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); + if (NILP (Vtotal_gc_usage_profile_table)) + Vtotal_gc_usage_profile_table = + make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); } -static void -create_timing_profile_table (void) +static Lisp_Object +current_profile_function (void) { - /* #### The hash code can safely be called from a signal handler - except when it has to grow the hash table. In this case, it calls - realloc(), which is not (in general) re-entrant. We'll just be - sleazy and make the table large enough that it (hopefully) won't - need to be realloc()ed. */ - if (!big_profile_table) - big_profile_table = make_hash_table (10000); + Lisp_Object fun; + struct backtrace *bt = backtrace_list; + + /* 2 because we set in_profiling when we entered the current routine. */ + if (in_profiling >= 2) + return QSprofile_overhead; + + /* Find a function actually being called. Potentially (?) there could be + a number of non-calling funs -- calling foo autoloads, which tries to + call bar, but requires evalling its args first, which calls baz, ... + If profiling was not enabled when the function was called, just treat + the function as actually called, because the info about whether we've + finished the preamble will not have been recorded. */ + for (; bt && !bt->function_being_called; bt = bt->next) + ; + + if (bt) + { + fun = *bt->function; + + if (!SYMBOLP (fun) + && !COMPILED_FUNCTIONP (fun) + && !SUBRP (fun) + && !CONSP (fun) + && !STRINGP (fun)) + fun = QSunknown; + } + else + fun = QSprocessing_events_at_top_level; + return fun; } -/* Increase the value of OBJ in Vcall_count_profile_table hash table. - If the hash table is nil, create it first. */ void -profile_increase_call_count (Lisp_Object obj) +profile_record_consing (EMACS_INT size) { + Lisp_Object fun; Lisp_Object count; - create_call_count_profile_table (); + in_profiling++; + fun = current_profile_function (); + count = Fgethash (fun, Vgc_usage_profile_table, Qzero); + Fputhash (fun, make_int (size + XINT (count)), Vgc_usage_profile_table); + in_profiling--; +} + +void +profile_record_unconsing (EMACS_INT size) +{ + /* If we don't want to record values less than 0, change this; but then + the totals won't be accurate. */ + profile_record_consing (-size); +} + +inline static void +profile_sow_backtrace (struct backtrace *bt) +{ + bt->current_total_timing_val = + XINT (Fgethash (*bt->function, Vtotal_timing_profile_table, Qzero)); + bt->current_total_gc_usage_val = + XINT (Fgethash (*bt->function, Vtotal_gc_usage_profile_table, Qzero)); + bt->function_being_called = 1; + /* Need to think carefully about the exact order of operations here + so that we don't end up with totals being less than function-only + values; */ + bt->total_consing_at_start = total_consing; + /* Order of operation is tricky here because we want the total function + time to be as close as possible to (and absolutely not less than) the + function-only time. From the sigprof-handler's perspective, the + function is "entered" the moment we finish executing the + in_profiling-- statement below, and ends the moment we finish + executing the in_profiling++ statement in + profile_record_just_called(). By recording the tick value as close as + possible to the "in-function" window but not in it, we satisfy the + conditions just mentioned. */ + bt->total_ticks_at_start = total_ticks; +} + +void +profile_record_about_to_call (struct backtrace *bt) +{ + in_profiling++; + profiling_lock = 1; + /* See comments in create_timing_profile_table(). */ + pregrow_hash_table_if_necessary (big_profile_table, EXTRA_BREATHING_ROOM); + profiling_lock = 0; + Fputhash (*bt->function, + make_int (1 + XINT (Fgethash (*bt->function, + Vcall_count_profile_table, + Qzero))), + Vcall_count_profile_table); + /* This may be set if the function was in its preamble at the time that + `start-profiling' was called. If so, we shouldn't reset the values + because we may get inconsistent results, since we have already started + recording ticks and consing for the function. */ + if (!bt->function_being_called) + profile_sow_backtrace (bt); + in_profiling--; +} + +inline static void +profile_reap_backtrace (struct backtrace *bt) +{ + EMACS_UINT ticks; + /* The following statement *MUST* come directly after the preceding one! + See the comment above. */ + ticks = total_ticks; + /* We need to reset the "in-function" flag here. Otherwise the sigprof + handler will record more ticks for the function while the post-amble + is executing, and its value will be > our total value. */ + bt->function_being_called = 0; + Fputhash (*bt->function, + /* This works even when the total_ticks value has overwrapped. + Same for total_consing below. */ + make_int ((EMACS_INT) (ticks - bt->total_ticks_at_start) + + bt->current_total_timing_val), + Vtotal_timing_profile_table); + Fputhash (*bt->function, + make_int ((EMACS_INT) + (total_consing - bt->total_consing_at_start) + + bt->current_total_gc_usage_val), + Vtotal_gc_usage_profile_table); +} - count = Fgethash (obj, Vcall_count_profile_table, Qzero); - if (!INTP (count)) - count = Qzero; - Fputhash (obj, make_int (1 + XINT (count)), Vcall_count_profile_table); +void +profile_record_just_called (struct backtrace *bt) +{ + in_profiling++; + profile_reap_backtrace (bt); + in_profiling--; +} + +/* Called when unwinding the catch stack after a throw or signal, to + note that we are exiting the function. */ +void +profile_record_unwind (struct backtrace *bt) +{ + /* We may have thrown while still in a function's preamble. */ + if (bt->function_being_called) + profile_record_just_called (bt); } static SIGTYPE sigprof_handler (int signo) { +#ifdef WIN32_ANY + /* Windows unfortunately does not have any such thing as setitimer + (ITIMER_PROF, ...), which runs in process time. Everything is real + time. So to get slightly more reasonable results, ignore completely + the times when we're blocking. Same applies, of course, to Cygwin. */ + if (mswindows_is_blocking) + return; +#endif + + in_profiling++; + total_ticks++; + /* Don't do anything if we are shutting down, or are doing a maphash or clrhash on the table. */ - if (!inside_profiling && !preparing_for_armageddon) + if (!profiling_lock && !preparing_for_armageddon) { - Lisp_Object fun; + Lisp_Object fun = current_profile_function (); /* If something below causes an error to be signaled, we'll not correctly reset this flag. But we'll be in worse shape than that anyways, since we'll longjmp back to the last condition case. */ - inside_profiling = 1; - - if (profiling_redisplay_flag) - fun = QSin_redisplay; - else if (gc_in_progress) - fun = QSin_garbage_collection; - else if (backtrace_list) - { - fun = *backtrace_list->function; - - if (!SYMBOLP (fun) - && !COMPILED_FUNCTIONP (fun) - && !SUBRP (fun) - && !CONSP (fun)) - fun = QSunknown; - } - else - fun = QSprocessing_events_at_top_level; + profiling_lock = 1; { - /* #### see comment about memory allocation in start-profiling. - Allocating memory in a signal handler is BAD BAD BAD. - If you are using the non-mmap rel-alloc code, you might - lose because of this. Even worse, if the memory allocation - fails, the `error' generated whacks everything hard. */ long count; const void *vval; @@ -169,34 +380,41 @@ puthash (LISP_TO_VOID (fun), (void *) vval, big_profile_table); } - inside_profiling = 0; + profiling_lock = 0; } + in_profiling--; } -DEFUN ("start-profiling", Fstart_profiling, 0, 1, 0, /* +DEFUN ("start-profiling", Fstart_profiling, 0, 1, "", /* Start profiling, with profile queries every MICROSECS. If MICROSECS is nil or omitted, the value of `default-profiling-interval' is used. Information on function timings and call counts is currently recorded. -You can retrieve the recorded profiling info using `get-profiling-info'. +You can retrieve the recorded profiling info using `get-profiling-info', +or the higher-level function `profile-results'. Starting and stopping profiling does not clear the currently recorded info. Thus you can start and stop as many times as you want and everything -will be properly accumulated. +will be properly accumulated. (To clear, use `clear-profiling-info'.) */ (microsecs)) { /* This function can GC */ int msecs; struct itimerval foo; + int depth; - /* #### The hash code can safely be called from a signal handler - except when it has to grow the hash table. In this case, it calls - realloc(), which is not (in general) re-entrant. We'll just be - sleazy and make the table large enough that it (hopefully) won't - need to be realloc()ed. */ - create_timing_profile_table (); + if (profiling_active) + return Qnil; + depth = internal_bind_int (&in_profiling, 1 + in_profiling); + + create_profile_tables (); + /* See comments at top of file and in create_timing_profile_table(). + We ensure enough breathing room for all entries currently on the + stack. */ + pregrow_hash_table_if_necessary (big_profile_table, + EXTRA_BREATHING_ROOM + lisp_eval_depth); if (NILP (microsecs)) msecs = default_profiling_interval; @@ -209,17 +427,28 @@ msecs = 1000; set_timeout_signal (SIGPROF, sigprof_handler); + { + struct backtrace *bt = backtrace_list; + + /* When we begin profiling, pretend like we just entered all the + functions currently on the stack. When we stop profiling, do the + opposite. This ensures consistent values being recorded for both + function-only and total in such cases. */ + for (; bt; bt = bt->next) + profile_sow_backtrace (bt); + } + profiling_active = 1; + profiling_lock = 0; foo.it_value.tv_sec = 0; foo.it_value.tv_usec = msecs; EMACS_NORMALIZE_TIME (foo.it_value); foo.it_interval = foo.it_value; - profiling_active = 1; - inside_profiling = 0; qxe_setitimer (ITIMER_PROF, &foo, 0); + unbind_to (depth); return Qnil; } -DEFUN ("stop-profiling", Fstop_profiling, 0, 0, 0, /* +DEFUN ("stop-profiling", Fstop_profiling, 0, 0, "", /* Stop profiling. */ ()) @@ -227,12 +456,22 @@ /* This function does not GC */ struct itimerval foo; + if (!profiling_active) + return Qnil; + in_profiling++; foo.it_value.tv_sec = 0; foo.it_value.tv_usec = 0; foo.it_interval = foo.it_value; qxe_setitimer (ITIMER_PROF, &foo, 0); profiling_active = 0; + { + struct backtrace *bt = backtrace_list; + + for (; bt; bt = bt->next) + profile_reap_backtrace (bt); + } set_timeout_signal (SIGPROF, fatal_error_signal); + in_profiling--; return Qnil; } @@ -243,15 +482,24 @@ */ ()) { + in_profiling++; /* This function does not GC */ if (big_profile_table) { - inside_profiling = 1; + profiling_lock = 1; clrhash (big_profile_table); - inside_profiling = 0; + profiling_lock = 0; } + if (!NILP (Vtotal_timing_profile_table)) + Fclrhash (Vtotal_timing_profile_table); if (!NILP (Vcall_count_profile_table)) Fclrhash (Vcall_count_profile_table); + if (!NILP (Vgc_usage_profile_table)) + Fclrhash (Vgc_usage_profile_table); + if (!NILP (Vtotal_gc_usage_profile_table)) + Fclrhash (Vtotal_gc_usage_profile_table); + in_profiling--; + return Qnil; } @@ -278,6 +526,14 @@ return 0; } +static Lisp_Object +copy_hash_table_or_blank (Lisp_Object table) +{ + return !NILP (table) ? Fcopy_hash_table (table) : + make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, + HASH_TABLE_EQ); +} + DEFUN ("get-profiling-info", Fget_profiling_info, 0, 0, 0, /* Return the currently recorded profiling info. The format is a plist of symbols describing type of info recorded and @@ -285,41 +541,67 @@ are recorded `timing' - A hash table of funcallable objects or strings describing internal processing - operations \(redisplay, garbage collection, etc.), along with associated - tick counts (the frequency of ticks is controlled by - `default-profiling-interval' or the argument to `start-profiling'). + A hash table of function descriptions (funcallable objects or strings + describing internal processing operations -- redisplay, garbage + collection, etc.), along with associated tick counts (the frequency of + ticks is controlled by `default-profiling-interval' or the argument to + `start-profiling'). + +`total-timing' + A hash table of function descriptions and associated timing count for + the function and all descendants. `call-count' - A hash table of funcallable objects and associated call counts. + A hash table of function descriptions and associated call counts. + +`gc-usage' + A hash table of function descriptions and associated amount of consing. + +`total-gc-usage' + A hash table of function descriptions and associated amount of consing + in the function and all descendants. */ ()) { /* This function does not GC */ struct get_profiling_info_closure closure; + Lisp_Object retv; + int depth = internal_bind_int (&in_profiling, 1 + in_profiling); + const void *overhead; closure.timing = make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); if (big_profile_table) { - int count = internal_bind_int ((int *) &inside_profiling, 1); + int count = internal_bind_int ((int *) &profiling_lock, 1); maphash (get_profiling_info_timing_maphash, big_profile_table, &closure); + + /* OK, OK ... the total-timing table is not going to have an entry + for profile overhead, and it looks strange for it to come out 0, + so make sure it looks reasonable. */ + if (!gethash (LISP_TO_VOID (QSprofile_overhead), big_profile_table, + &overhead)) + overhead = 0; + Fputhash (QSprofile_overhead, make_int ((EMACS_INT) overhead), + Vtotal_timing_profile_table); + unbind_to (count); } - return list4 (Qtiming, closure.timing, Qcall_count, - !NILP (Vcall_count_profile_table) ? - Fcopy_hash_table (Vcall_count_profile_table) : - make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, - HASH_TABLE_EQ)); + retv = nconc2 (list6 (Qtiming, closure.timing, Qtotal_timing, + copy_hash_table_or_blank (Vtotal_timing_profile_table), + Qcall_count, + copy_hash_table_or_blank (Vcall_count_profile_table)), + list4 (Qgc_usage, + copy_hash_table_or_blank (Vgc_usage_profile_table), + Qtotal_gc_usage, + copy_hash_table_or_blank (Vtotal_gc_usage_profile_table + ))); + unbind_to (depth); + return retv; } -struct set_profiling_info_closure -{ - Lisp_Object timing; -}; - static int set_profiling_info_timing_maphash (Lisp_Object key, Lisp_Object val, @@ -343,9 +625,11 @@ */ (info)) { + int depth; /* This function does not GC */ Fclear_profiling_info (); + depth = internal_bind_int (&in_profiling, 1 + in_profiling); { EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, info) { @@ -353,18 +637,25 @@ { CHECK_HASH_TABLE (value); create_timing_profile_table (); + profiling_lock = 1; elisp_maphash_unsafe (set_profiling_info_timing_maphash, value, NULL); + profiling_lock = 0; } else if (EQ (key, Qcall_count)) - { - Vcall_count_profile_table = Fcopy_hash_table (value); - } + Vcall_count_profile_table = Fcopy_hash_table (value); + else if (EQ (key, Qtotal_timing)) + Vtotal_timing_profile_table = Fcopy_hash_table (value); + else if (EQ (key, Qgc_usage)) + Vgc_usage_profile_table = Fcopy_hash_table (value); + else if (EQ (key, Qtotal_gc_usage)) + Vtotal_gc_usage_profile_table = Fcopy_hash_table (value); else invalid_constant ("Unrecognized profiling-info keyword", key); } } + unbind_to (depth); return Qnil; } @@ -373,10 +664,7 @@ void *void_val, void *void_closure) { - Lisp_Object key; - - key = VOID_TO_LISP (void_key); - mark_object (key); + mark_object (VOID_TO_LISP (void_key)); return 0; } @@ -386,9 +674,9 @@ /* This function does not GC */ if (big_profile_table) { - inside_profiling = 1; + profiling_lock = 1; maphash (mark_profiling_info_maphash, big_profile_table, 0); - inside_profiling = 0; + profiling_lock = 0; } } @@ -426,18 +714,34 @@ staticpro (&Vcall_count_profile_table); Vcall_count_profile_table = Qnil; - inside_profiling = 0; + staticpro (&Vgc_usage_profile_table); + Vgc_usage_profile_table = Qnil; + + staticpro (&Vtotal_gc_usage_profile_table); + Vtotal_gc_usage_profile_table = Qnil; + + staticpro (&Vtotal_timing_profile_table); + Vtotal_timing_profile_table = Qnil; + +#if 0 + /* #### This is supposed to be for KKCC but KKCC doesn't use this stuff + currently. */ + dump_add_root_struct_ptr (&big_profile_table, &plain_hash_table_description); +#endif /* 0 */ + + profiling_lock = 0; - QSin_redisplay = build_msg_string ("(in redisplay)"); - staticpro (&QSin_redisplay); - QSin_garbage_collection = build_msg_string ("(in garbage collection)"); - staticpro (&QSin_garbage_collection); QSunknown = build_msg_string ("(unknown)"); staticpro (&QSunknown); QSprocessing_events_at_top_level = build_msg_string ("(processing events at top level)"); staticpro (&QSprocessing_events_at_top_level); + QSprofile_overhead = build_msg_string ("(profile overhead)"); + staticpro (&QSprofile_overhead); DEFSYMBOL (Qtiming); + DEFSYMBOL (Qtotal_timing); DEFSYMBOL (Qcall_count); + DEFSYMBOL (Qgc_usage); + DEFSYMBOL (Qtotal_gc_usage); } Index: src/profile.h =================================================================== RCS file: src/profile.h diff -N src/profile.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/profile.h 13 Feb 2003 09:57:08 -0000 1.1 @@ -0,0 +1,97 @@ +/* Profiling. + 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. */ + +/* Synched up with: Not in FSF. */ + +/* Authorship: + + Ben Wing: Feb 2003. + */ + +#include "backtrace.h" + +void mark_profiling_info (void); +void profile_record_unwind (struct backtrace *); +void profile_record_about_to_call (struct backtrace *); +void profile_record_just_called (struct backtrace *); +void profile_record_consing (EMACS_INT size); +void profile_record_unconsing (EMACS_INT size); +extern int profiling_active; + +/* We call about_to_call() and just_called() depending on the current + *dynamic* value of profiling_active (which could change as a result of + calling the function) but if we push a backtrace, we must pop it later, + so we need to remember the status of this. */ +#define PROFILE_DECLARE() \ +int do_backtrace = profiling_active || backtrace_with_internal_sections; \ +struct backtrace backtrace + +/* As just mentioned, we rely on the dynamic value of profiling_active. + This ensures correct behavior (e.g. we never modify the profiling info + when profiling is not active) because we seed and reap all functions + currently on the stack when starting and stopping. See + `start-profiling'. */ +#define PROFILE_ENTER_FUNCTION() \ +do \ +{ \ + if (profiling_active) \ + profile_record_about_to_call (&backtrace); \ +} \ +while (0) + +#define PROFILE_EXIT_FUNCTION() \ +do \ +{ \ + if (profiling_active) \ + profile_record_just_called (&backtrace); \ +} \ +while (0) + +/* We are entering a section that we would like to record profile information + about. We put this information into the backtrace list, just like + normal functions do. That is one easy way to make sure that we always + record info on the innermost section or function, whether section or + function. (To do this, we always need some sort of collusion between + profile and eval; this is one way.) */ + +#define PROFILE_RECORD_ENTERING_SECTION(var) \ +do \ +{ \ + if (do_backtrace) \ + { \ + backtrace.function = &var; \ + backtrace.args = NULL; \ + backtrace.nargs = UNEVALLED; \ + backtrace.evalargs = 0; \ + backtrace.pdlcount = specpdl_depth (); \ + backtrace.debug_on_exit = 0; \ + backtrace.function_being_called = 0; \ + PUSH_BACKTRACE (backtrace); \ + } \ + PROFILE_ENTER_FUNCTION (); \ +} while (0) + +#define PROFILE_RECORD_EXITING_SECTION(var) \ +do \ +{ \ + PROFILE_EXIT_FUNCTION (); \ + if (do_backtrace) \ + POP_BACKTRACE (backtrace); \ +} while (0) Index: src/rangetab.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/rangetab.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- src/rangetab.c 29 Jul 2002 09:21:24 -0000 1.14 +++ src/rangetab.c 12 Jan 2003 11:08:20 -0000 1.15 @@ -131,45 +131,37 @@ return hash; } -static const struct lrecord_description rte_description_1[] = { +static const struct memory_description rte_description_1[] = { { XD_LISP_OBJECT, offsetof (range_table_entry, val) }, { XD_END } }; -static const struct struct_description rte_description = { +static const struct sized_memory_description rte_description = { sizeof (range_table_entry), rte_description_1 }; -static const struct lrecord_description rted_description_1[] = { +static const struct memory_description rted_description_1[] = { XD_DYNARR_DESC (range_table_entry_dynarr, &rte_description), { XD_END } }; -static const struct struct_description rted_description = { +static const struct sized_memory_description rted_description = { sizeof (range_table_entry_dynarr), rted_description_1 }; -static const struct lrecord_description range_table_description[] = { +static const struct memory_description range_table_description[] = { { XD_STRUCT_PTR, offsetof (Lisp_Range_Table, entries), 1, &rted_description }, { XD_END } }; -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("range-table", range_table, 1, /*dumpable-flag*/ mark_range_table, print_range_table, 0, range_table_equal, range_table_hash, range_table_description, Lisp_Range_Table); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("range-table", range_table, - mark_range_table, print_range_table, 0, - range_table_equal, range_table_hash, - range_table_description, - Lisp_Range_Table); -#endif /* not USE_KKCC */ /************************************************************************/ /* Range table operations */ Index: src/realpath.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/realpath.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/realpath.c 22 Nov 2002 12:57:11 -0000 1.16 +++ src/realpath.c 12 Jan 2003 11:08:20 -0000 1.17 @@ -94,7 +94,7 @@ int err = 0; const Ibyte *lastname; int count = 0; - const Ibyte *tmp; + const Ibyte *nn; DECLARE_EISTRING (result); assert (*name); @@ -118,8 +118,8 @@ /* Count slashes in unc path */ if (abs_start (name) == 2) - for (tmp = name; *tmp; tmp++) - if (IS_DIRECTORY_SEP (*tmp)) + for (nn = name; *nn; nn++) + if (IS_DIRECTORY_SEP (*nn)) count++; if (count >= 2 && count < 4) Index: src/redisplay-output.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-output.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- src/redisplay-output.c 20 Jun 2002 21:18:42 -0000 1.22 +++ src/redisplay-output.c 9 Feb 2003 09:33:48 -0000 1.23 @@ -1278,7 +1278,9 @@ Potentially subwindows from the area in the box defined by the given parameters. ****************************************************************************/ -void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height) +void +redisplay_unmap_subwindows_maybe (struct frame *f, int x, int y, int width, + int height) { if (!NILP (XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)))) { @@ -1286,8 +1288,9 @@ } } -static void redisplay_unmap_subwindows_except_us (struct frame* f, int x, int y, int width, - int height, Lisp_Object subwindow) +static void +redisplay_unmap_subwindows_except_us (struct frame *f, int x, int y, int width, + int height, Lisp_Object subwindow) { if (!NILP (XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)))) { Index: src/redisplay-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-x.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- src/redisplay-x.c 20 Jun 2002 21:18:42 -0000 1.34 +++ src/redisplay-x.c 12 Jan 2003 11:08:20 -0000 1.35 @@ -307,7 +307,8 @@ static void x_window_output_end (struct window *w) { - XFlush (DEVICE_X_DISPLAY (WINDOW_XDEVICE (w))); + if (!(check_if_pending_expose_event (WINDOW_XDEVICE (w)))) + XFlush (DEVICE_X_DISPLAY (WINDOW_XDEVICE (w))); } /***************************************************************************** @@ -1799,7 +1800,8 @@ { x_redraw_exposed_windows (f->root_window, x, y, width, height); - XFlush (DEVICE_X_DISPLAY (XDEVICE (f->device))); + if (!(check_if_pending_expose_event (FRAME_XDEVICE (f)))) + XFlush (DEVICE_X_DISPLAY (FRAME_XDEVICE (f))); } else MARK_FRAME_CHANGED (f); @@ -1970,7 +1972,8 @@ x_clear_frame_windows (f->root_window); } - XFlush (DEVICE_X_DISPLAY (d)); + if (!(check_if_pending_expose_event (d))) + XFlush (DEVICE_X_DISPLAY (d)); } /* briefly swap the foreground and background colors. Index: src/redisplay.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay.c,v retrieving revision 1.82 retrieving revision 1.86 diff -u -r1.82 -r1.86 --- src/redisplay.c 27 Nov 2002 07:15:14 -0000 1.82 +++ src/redisplay.c 13 Feb 2003 09:57:08 -0000 1.86 @@ -1,7 +1,7 @@ /* Display generation from window structure and buffer text. Copyright (C) 1994, 1995, 1996 Board of Trustees, University of Illinois. Copyright (C) 1995 Free Software Foundation, Inc. - 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) 1996 Chuck Thompson. @@ -69,6 +69,7 @@ #include "menubar.h" #include "objects-impl.h" #include "process.h" +#include "profile.h" #include "redisplay.h" #include "toolbar.h" #include "window-impl.h" @@ -308,18 +309,23 @@ struct display_block *fixup); static void calculate_baseline (pos_data *data); +#ifdef ERROR_CHECK_DISPLAY static void sledgehammer_check_redisplay_structs (void); +#endif /* ERROR_CHECK_DISPLAY */ /* This used to be 10 but 30 seems to give much better performance. */ #define INIT_MAX_PREEMPTS 30 -static int max_preempts; +static Fixnum max_preempts; + +#define QUEUED_EVENTS_REQUIRED_FOR_PREEMPTION 4 #define REDISPLAY_PREEMPTION_CHECK \ ((void) \ (preempted = \ (!disable_preemption && \ ((preemption_count < max_preempts) || !NILP (Vexecuting_macro)) && \ - (!INTERACTIVE || detect_input_pending ())))) + (!INTERACTIVE || \ + detect_input_pending (QUEUED_EVENTS_REQUIRED_FOR_PREEMPTION))))) /* * Redisplay global variables. @@ -483,22 +489,8 @@ /* String to display for the arrow. */ Lisp_Object Voverlay_arrow_string; -Lisp_Object Vwindow_size_change_functions; -Lisp_Object Vwindow_scroll_functions; -Lisp_Object Qredisplay_end_trigger_functions, Vredisplay_end_trigger_functions; - Lisp_Object Qbuffer_list_changed_hook, Vbuffer_list_changed_hook; - -#define INHIBIT_REDISPLAY_HOOKS /* #### Until we've thought about - this more. */ -#ifndef INHIBIT_REDISPLAY_HOOKS -/* #### Chuck says: I think this needs more thought. - Think about this for 19.14. */ -Lisp_Object Vpre_redisplay_hook, Vpost_redisplay_hook; -Lisp_Object Qpre_redisplay_hook, Qpost_redisplay_hook; -#endif /* INHIBIT_REDISPLAY_HOOKS */ - static Fixnum last_display_warning_tick; static Fixnum display_warning_tick; Lisp_Object Qdisplay_warning_buffer; @@ -509,12 +501,122 @@ Lisp_Object Vuse_left_overflow, Vuse_right_overflow; Lisp_Object Vtext_cursor_visible_p; +static Lisp_Object QSin_redisplay; + int column_number_start_at_one; Lisp_Object Qtop_bottom; #define WINDOW_SCROLLED(w) ((w)->hscroll > 0 || (w)->left_xoffset) +static const struct memory_description rune_dglyph_description_1[] = { + { XD_LISP_OBJECT, offsetof (struct rune_dglyph, glyph) }, + { XD_LISP_OBJECT, offsetof (struct rune_dglyph, extent) }, + { XD_END } +}; + +static const struct sized_memory_description rune_dglyph_description = { + sizeof (struct rune_dglyph), rune_dglyph_description_1 +}; + +static const struct memory_description rune_object_description_1[] = { + { XD_STRUCT_ARRAY, RUNE_DGLYPH, 1, &rune_dglyph_description }, + { XD_END } +}; + +static const struct sized_memory_description rune_object_description = { + 0, rune_object_description_1 +}; + +static const struct memory_description rune_description_1[] = { + { XD_INT, offsetof (rune, type) }, + { XD_UNION, offsetof (rune, object), + XD_INDIRECT (0, 0), &rune_object_description }, + { XD_END } +}; + +static const struct sized_memory_description rune_description = { + sizeof (rune), + rune_description_1 +}; + +static const struct memory_description rune_dynarr_description_1[] = { + XD_DYNARR_DESC (rune_dynarr, &rune_description), + { XD_END } +}; + +static const struct sized_memory_description rune_dynarr_description = { + sizeof (rune_dynarr), + rune_dynarr_description_1 +}; + +static const struct memory_description display_block_description_1[] = { + { XD_STRUCT_PTR, offsetof (display_block, runes), + 1, &rune_dynarr_description }, + { XD_END } +}; + +static const struct sized_memory_description display_block_description = { + sizeof (display_block), + display_block_description_1 +}; + +static const struct memory_description display_block_dynarr_description_1[] = { + XD_DYNARR_DESC (display_block_dynarr, &display_block_description), + { XD_END } +}; + +static const struct sized_memory_description display_block_dynarr_description = { + sizeof (display_block_dynarr), + display_block_dynarr_description_1 +}; + +static const struct memory_description glyph_block_description_1[] = { + { XD_LISP_OBJECT, offsetof (glyph_block, glyph) }, + { XD_LISP_OBJECT, offsetof (glyph_block, extent) }, + { XD_END } +}; + +static const struct sized_memory_description glyph_block_description = { + sizeof (glyph_block), + glyph_block_description_1 +}; + +static const struct memory_description glyph_block_dynarr_description_1[] = { + XD_DYNARR_DESC (glyph_block_dynarr, &glyph_block_description), + { XD_END } +}; + +static const struct sized_memory_description glyph_block_dynarr_description = { + sizeof (glyph_block_dynarr), + glyph_block_dynarr_description_1 +}; + +static const struct memory_description display_line_description_1[] = { + { XD_STRUCT_PTR, offsetof (display_line, display_blocks), + 1, &display_block_dynarr_description }, + { XD_STRUCT_PTR, offsetof (display_line, left_glyphs), + 1, &glyph_block_dynarr_description }, + { XD_STRUCT_PTR, offsetof (display_line, right_glyphs), + 1, &glyph_block_dynarr_description }, + { XD_END } +}; + +static const struct sized_memory_description display_line_description = { + sizeof (display_line), + display_line_description_1 +}; + +static const struct memory_description display_line_dynarr_description_1[] = { + XD_DYNARR_DESC (display_line_dynarr, &display_line_description), + { XD_END } +}; + +const struct sized_memory_description display_line_dynarr_description = { + sizeof (display_line_dynarr), + display_line_dynarr_description_1 +}; + /***************************************************************************/ /* */ @@ -6478,47 +6580,8 @@ } } -static int -call_redisplay_end_triggers (struct window *w, void *closure) -{ - Charbpos lrpos = w->last_redisplay_pos; - w->last_redisplay_pos = 0; - if (!NILP (w->buffer) - && !NILP (w->redisplay_end_trigger) - && lrpos > 0) - { - Charbpos pos; - - if (MARKERP (w->redisplay_end_trigger) - && XMARKER (w->redisplay_end_trigger)->buffer != 0) - pos = marker_position (w->redisplay_end_trigger); - else if (INTP (w->redisplay_end_trigger)) - pos = XINT (w->redisplay_end_trigger); - else - { - w->redisplay_end_trigger = Qnil; - return 0; - } - - if (lrpos >= pos) - { - Lisp_Object window = wrap_window (w); - - va_run_hook_with_args_in_buffer_trapping_problems - ("Error in redisplay end trigger", - XBUFFER (w->buffer), - Qredisplay_end_trigger_functions, - 2, window, - w->redisplay_end_trigger, - INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); - w->redisplay_end_trigger = Qnil; - } - } - - return 0; -} - -/* Ensure that all windows on the given frame are correctly displayed. */ +/* Ensure that all windows on the given frame are correctly displayed. + Return non-zero if pre-empted. */ int redisplay_frame (struct frame *f, int preemption_check) @@ -6526,6 +6589,11 @@ struct device *d = XDEVICE (f->device); int depth; + assert (f->init_finished); + + if (FRAME_STREAM_P (f)) /* nothing to do */ + return 0; + if (preemption_check && !DEVICE_IMPL_FLAG (d, XDEVIMPF_DONT_PREEMPT_REDISPLAY)) { @@ -6687,7 +6755,6 @@ /* Allow frame size changes to occur again. */ exit_redisplay_critical_section (depth); - map_windows (f, call_redisplay_end_triggers, 0); return 0; } @@ -6796,10 +6863,9 @@ { Lisp_Object devcons, concons; int size_change_failed = 0; - int count = specpdl_depth (); + PROFILE_DECLARE (); - if (profiling_active) - internal_bind_int (&profiling_redisplay_flag, 1); + PROFILE_RECORD_ENTERING_SECTION (QSin_redisplay); if (asynch_device_change_pending) handle_asynch_device_change (); @@ -6847,10 +6913,11 @@ reset_buffer_changes (); done: - unbind_to (count); #ifdef ERROR_CHECK_DISPLAY sledgehammer_check_redisplay_structs (); #endif /* ERROR_CHECK_DISPLAY */ + + PROFILE_RECORD_EXITING_SECTION (QSin_redisplay); } /* Note: All places in the C code that call redisplay() are prepared @@ -6890,24 +6957,8 @@ INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); last_display_warning_tick = display_warning_tick; } - /* The run_hook_trapping_problems functions are smart enough not - to do any evalling if the hook function is empty, so there - should not be any significant time loss. */ -#ifndef INHIBIT_REDISPLAY_HOOKS - run_hook_trapping_problems - ("Error in pre-redisplay-hook", - Qpre_redisplay_hook, - INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); -#endif /* INHIBIT_REDISPLAY_HOOKS */ redisplay_without_hooks (); - -#ifndef INHIBIT_REDISPLAY_HOOKS - run_hook_trapping_problems - ("Error in post-redisplay-hook", - Qpost_redisplay_hook, - INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); -#endif /* INHIBIT_REDISPLAY_HOOKS */ } Lisp_Object @@ -9074,6 +9125,9 @@ struct device *d = XDEVICE (XCAR (devcons)); Lisp_Object frmcons; + if (DEVICE_STREAM_P (d)) + continue; + DEVICE_FRAME_LOOP (frmcons, d) { struct frame *f = XFRAME (XCAR (frmcons)); @@ -9100,8 +9154,6 @@ redisplay_window (window, 0); exit_redisplay_critical_section (depth); MAYBE_DEVMETH (d, frame_output_end, (f)); - - call_redisplay_end_triggers (XWINDOW (window), 0); } } } @@ -9241,7 +9293,10 @@ */ (frame)) { - redisplay_redraw_cursor (decode_frame (frame), 1); + struct frame *f = decode_frame (frame); + + if (!FRAME_STREAM_P (f)) + redisplay_redraw_cursor (f, 1); return Qnil; } @@ -9451,6 +9506,8 @@ #endif /* MEMORY_USAGE_STATS */ +#ifdef ERROR_CHECK_DISPLAY + static int sledgehammer_check_redisplay_structs_1 (struct window *w, void *closure) { @@ -9480,6 +9537,8 @@ map_windows (0, sledgehammer_check_redisplay_structs_1, NULL); } +#endif /* ERROR_CHECK_DISPLAY */ + /***************************************************************************/ /* */ @@ -9492,7 +9551,6 @@ { disable_preemption = 0; preemption_count = 0; - max_preempts = INIT_MAX_PREEMPTS; #ifndef PDUMP if (!initialized) @@ -9583,13 +9641,8 @@ syms_of_redisplay (void) { DEFSYMBOL (Qcursor_in_echo_area); -#ifndef INHIBIT_REDISPLAY_HOOKS - DEFSYMBOL (Qpre_redisplay_hook); - DEFSYMBOL (Qpost_redisplay_hook); -#endif /* INHIBIT_REDISPLAY_HOOKS */ DEFSYMBOL (Qdisplay_warning_buffer); DEFSYMBOL (Qbar_cursor); - DEFSYMBOL (Qredisplay_end_trigger_functions); DEFSYMBOL (Qtop_bottom); DEFSYMBOL (Qbuffer_list_changed_hook); @@ -9605,6 +9658,8 @@ void vars_of_redisplay (void) { + QSin_redisplay = build_msg_string ("(in redisplay)"); + staticpro (&QSin_redisplay); #if 0 staticpro (&last_arrow_position); @@ -9620,6 +9675,11 @@ */ ); cache_adjustment = 2; + DEFVAR_INT ("maximum-preempts", &max_preempts /* +Maximum number of times redisplay can be preempted by user input. +*/ ); + max_preempts = INIT_MAX_PREEMPTS; + DEFVAR_INT_MAGIC ("pixel-vertical-clip-threshold", &vertical_clip /* Minimum pixel height for clipped bottom display line. A clipped line shorter than this won't be displayed. @@ -9735,18 +9795,6 @@ */ ); Vbar_cursor = Qnil; -#ifndef INHIBIT_REDISPLAY_HOOKS - xxDEFVAR_LISP ("pre-redisplay-hook", &Vpre_redisplay_hook /* -Function or functions to run before every redisplay. -*/ ); - Vpre_redisplay_hook = Qnil; - - xxDEFVAR_LISP ("post-redisplay-hook", &Vpost_redisplay_hook /* -Function or functions to run after every redisplay. -*/ ); - Vpost_redisplay_hook = Qnil; -#endif /* INHIBIT_REDISPLAY_HOOKS */ - DEFVAR_LISP ("buffer-list-changed-hook", &Vbuffer_list_changed_hook /* Function or functions to call when a frame's buffer list has changed. This is called during redisplay, before redisplaying each frame. @@ -9769,32 +9817,6 @@ /* reset to 0 by startup.el after the splash screen has displayed. This way, the warnings don't obliterate the splash screen. */ inhibit_warning_display = 1; - - DEFVAR_LISP ("window-size-change-functions", - &Vwindow_size_change_functions /* -Not currently implemented. -Functions called before redisplay, if window sizes have changed. -The value should be a list of functions that take one argument. -Just before redisplay, for each frame, if any of its windows have changed -size since the last redisplay, or have been split or deleted, -all the functions in the list are called, with the frame as argument. -*/ ); - Vwindow_size_change_functions = Qnil; - - DEFVAR_LISP ("window-scroll-functions", &Vwindow_scroll_functions /* -Not currently implemented. -Functions to call before redisplaying a window with scrolling. -Each function is called with two arguments, the window -and its new display-start position. Note that the value of `window-end' -is not valid when these functions are called. -*/ ); - Vwindow_scroll_functions = Qnil; - - DEFVAR_LISP ("redisplay-end-trigger-functions", - &Vredisplay_end_trigger_functions /* -See `set-window-redisplay-end-trigger'. -*/ ); - Vredisplay_end_trigger_functions = Qnil; DEFVAR_BOOL ("column-number-start-at-one", &column_number_start_at_one /* *Non-nil means column display number starts at 1. Index: src/redisplay.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/redisplay.h 6 Jul 2002 21:05:54 -0000 1.17 +++ src/redisplay.h 12 Jan 2003 11:08:21 -0000 1.18 @@ -98,6 +98,23 @@ #### This should really be made smaller. */ +struct rune_dglyph +{ + Lisp_Object glyph; + Lisp_Object extent; /* extent rune is attached to, if any. + If this is a rune in the modeline + then this might be nil. */ + + int ascent; /* Ascent of this glyph, in pixels. */ + int descent; /* Descent of this glyph, in pixels. */ + int yoffset; /* Offset from line top to reach glyph top */ + int xoffset; /* Number of pixels that need to be + chopped off the left of the glyph. + This has the effect of shifting the + glyph to the left while still clipping + at XPOS. */ +}; + typedef struct rune rune; struct rune { @@ -139,22 +156,7 @@ /* #### Glyphs are rare. Is it really necessary to waste 8 bytes on every rune for that?! */ /* DGLYPH */ - struct - { - Lisp_Object glyph; - Lisp_Object extent; /* extent rune is attached to, if any. - If this is a rune in the modeline - then this might be nil. */ - - int ascent; /* Ascent of this glyph, in pixels. */ - int descent; /* Descent of this glyph, in pixels. */ - int yoffset; /* Offset from line top to reach glyph top */ - int xoffset; /* Number of pixels that need to be - chopped off the left of the glyph. - This has the effect of shifting the - glyph to the left while still clipping - at XPOS. */ - } dglyph; + struct rune_dglyph dglyph; /* CHAR */ struct @@ -648,6 +650,8 @@ /*************************************************************************/ /* redisplay global variables */ /*************************************************************************/ + +extern const struct sized_memory_description display_line_dynarr_description; /* redisplay structure used by various utility routines. */ extern display_line_dynarr *cmotion_display_lines; Index: src/scrollbar.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/scrollbar.c,v retrieving revision 1.26 retrieving revision 1.29 diff -u -r1.26 -r1.29 --- src/scrollbar.c 29 Jul 2002 09:21:24 -0000 1.26 +++ src/scrollbar.c 14 Feb 2003 07:54:29 -0000 1.29 @@ -77,13 +77,11 @@ static void update_scrollbar_instance (struct window *w, int vertical, struct scrollbar_instance *instance); -#ifdef USE_KKCC -static const struct lrecord_description scrollbar_instance_description [] = { +static const struct memory_description scrollbar_instance_description [] = { { XD_LISP_OBJECT, offsetof (struct scrollbar_instance, mirror) }, { XD_LISP_OBJECT, offsetof (struct scrollbar_instance, next) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object @@ -97,19 +95,12 @@ return Qnil; } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("scrollbar-instance", scrollbar_instance, 0, /*dumpable-flag*/ mark_scrollbar_instance, internal_object_printer, 0, 0, 0, scrollbar_instance_description, struct scrollbar_instance); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("scrollbar-instance", scrollbar_instance, - mark_scrollbar_instance, - internal_object_printer, 0, 0, 0, 0, - struct scrollbar_instance); -#endif /* not USE_KKCC */ static void free_scrollbar_instance (struct scrollbar_instance *instance, @@ -210,7 +201,6 @@ alloc_lcrecord_type (struct scrollbar_instance, &lrecord_scrollbar_instance); - zero_lcrecord (instance); MAYBE_DEVMETH (d, create_scrollbar_instance, (f, vertical, instance)); return instance; @@ -986,7 +976,13 @@ Vscrollbar_width = make_magic_specifier (Qnatnum); set_specifier_fallback (Vscrollbar_width, - list1 (Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_WIDTH)))); +#ifdef HAVE_TTY + list2 (Fcons (list1 (Qtty), make_int (0)), + Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_WIDTH))) +#else + list1 (Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_WIDTH))) +#endif + ); set_specifier_caching (Vscrollbar_width, offsetof (struct window, scrollbar_width), vertical_scrollbar_changed_in_window, @@ -1000,7 +996,13 @@ Vscrollbar_height = make_magic_specifier (Qnatnum); set_specifier_fallback (Vscrollbar_height, - list1 (Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_HEIGHT)))); +#ifdef HAVE_TTY + list2 (Fcons (list1 (Qtty), make_int (0)), + Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_HEIGHT))) +#else + list1 (Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_HEIGHT))) +#endif + ); set_specifier_caching (Vscrollbar_height, offsetof (struct window, scrollbar_height), some_window_value_changed, Index: src/specifier.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/specifier.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- src/specifier.c 24 Sep 2002 14:59:25 -0000 1.30 +++ src/specifier.c 12 Jan 2003 11:08:21 -0000 1.31 @@ -63,24 +63,24 @@ static specifier_type_entry_dynarr *the_specifier_type_entry_dynarr; -static const struct lrecord_description ste_description_1[] = { +static const struct memory_description ste_description_1[] = { { XD_LISP_OBJECT, offsetof (specifier_type_entry, symbol) }, { XD_STRUCT_PTR, offsetof (specifier_type_entry, meths), 1, &specifier_methods_description }, { XD_END } }; -static const struct struct_description ste_description = { +static const struct sized_memory_description ste_description = { sizeof (specifier_type_entry), ste_description_1 }; -static const struct lrecord_description sted_description_1[] = { +static const struct memory_description sted_description_1[] = { XD_DYNARR_DESC (specifier_type_entry_dynarr, &ste_description), { XD_END } }; -static const struct struct_description sted_description = { +static const struct sized_memory_description sted_description = { sizeof (specifier_type_entry_dynarr), sted_description_1 }; @@ -368,26 +368,33 @@ : p->methods->extra_data_size); } -static const struct lrecord_description specifier_methods_description_1[] = { +static const struct memory_description specifier_methods_description_1[] = { { XD_LISP_OBJECT, offsetof (struct specifier_methods, predicate_symbol) }, { XD_END } }; -const struct struct_description specifier_methods_description = { +const struct sized_memory_description specifier_methods_description = { sizeof (struct specifier_methods), specifier_methods_description_1 }; -static const struct lrecord_description specifier_caching_description_1[] = { +static const struct memory_description specifier_caching_description_1[] = { { XD_END } }; -static const struct struct_description specifier_caching_description = { +static const struct sized_memory_description specifier_caching_description = { sizeof (struct specifier_caching), specifier_caching_description_1 }; -static const struct lrecord_description specifier_description[] = { +static const struct sized_memory_description specifier_extra_description_map[] += { + { offsetof (Lisp_Specifier, methods) }, + { offsetof (struct specifier_methods, extra_description) }, + { -1 }, +}; + +const struct memory_description specifier_description[] = { { XD_STRUCT_PTR, offsetof (Lisp_Specifier, methods), 1, &specifier_methods_description }, { XD_LO_LINK, offsetof (Lisp_Specifier, next_specifier) }, @@ -400,14 +407,20 @@ &specifier_caching_description }, { XD_LISP_OBJECT, offsetof (Lisp_Specifier, magic_parent) }, { XD_LISP_OBJECT, offsetof (Lisp_Specifier, fallback) }, - { XD_SPECIFIER_END } + { XD_STRUCT_ARRAY, offsetof (Lisp_Specifier, data), 1, + specifier_extra_description_map }, + { XD_END } }; -const struct lrecord_description specifier_empty_extra_description[] = { +static const struct memory_description specifier_empty_extra_description_1[] = +{ { XD_END } }; -#ifdef USE_KKCC +const struct sized_memory_description specifier_empty_extra_description = { + 0, specifier_empty_extra_description_1 +}; + DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier, 1, /*dumpable-flag*/ mark_specifier, print_specifier, @@ -416,15 +429,6 @@ specifier_description, sizeof_specifier, Lisp_Specifier); -#else /* not USE_KKCC */ -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier, - mark_specifier, print_specifier, - finalize_specifier, - specifier_equal, specifier_hash, - specifier_description, - sizeof_specifier, - Lisp_Specifier); -#endif /* not USE_KKCC */ /************************************************************************/ /* Creating specifiers */ @@ -489,7 +493,8 @@ { Lisp_Object specifier; Lisp_Specifier *sp = (Lisp_Specifier *) - alloc_lcrecord (aligned_sizeof_specifier (data_size), &lrecord_specifier); + basic_alloc_lcrecord (aligned_sizeof_specifier (data_size), + &lrecord_specifier); sp->methods = spec_meths; sp->global_specs = Qnil; @@ -734,7 +739,7 @@ invalid_argument ("Invalid specifier locale type", locale_type); - RETURN_NOT_REACHED (LOCALE_GLOBAL) + RETURN_NOT_REACHED (LOCALE_GLOBAL); } Lisp_Object @@ -1354,7 +1359,7 @@ invalid_constant ("Invalid `how-to-add' flag", how_to_add); - RETURN_NOT_REACHED (SPEC_PREPEND) + RETURN_NOT_REACHED (SPEC_PREPEND); } /* Given a specifier object SPEC, return bodily specifier if SPEC is a Index: src/specifier.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/specifier.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/specifier.h 5 May 2002 11:32:28 -0000 1.12 +++ src/specifier.h 12 Jan 2003 11:08:21 -0000 1.13 @@ -83,7 +83,7 @@ same time. */ -extern const struct struct_description specifier_methods_description; +extern const struct sized_memory_description specifier_methods_description; struct specifier_methods { @@ -194,19 +194,20 @@ void (*after_change_method) (Lisp_Object specifier, Lisp_Object locale); - /* Specifier extra data: Specifier objects can have extra data, - specific to the type of specifier, stored at the end of the - object. To have this, a specifier declares a structure of type - `struct TYPE_specifier' containing the data and uses - INITIALIZE_SPECIFIER_TYPE_WITH_DATA instead of - INITIALIZE_SPECIFIER_TYPE. Then, a pointer to the `struct - TYPE_specifier' can be obtained from a specifier object using - SPECIFIER_TYPE_DATA. */ + /* Specifier extra data: Specifier objects can have extra data, specific + to the type of specifier, stored at the end of the object. To have + this, a specifier declares a structure of type `struct TYPE_specifier' + containing the data and uses DEFINE_SPECIFIER_TYPE_WITH_DATA and + INITIALIZE_SPECIFIER_TYPE_WITH_DATA instead of the plain versions. + Then, a pointer to the `struct TYPE_specifier' can be obtained from a + specifier object using SPECIFIER_TYPE_DATA. - /* Pdump description of the extra data; required, and must be named - TYPE_specifier_description. Initialized when + A data description of the extra data must also be provided, in the + form of a memory_description named TYPE_specifier_description. */ + + /* Description of extra data structure; initialized when INITIALIZE_SPECIFIER_TYPE_WITH_DATA is called. */ - const struct lrecord_description *extra_description; + const struct sized_memory_description *extra_description; /* Size of extra data structure; initialized when INITIALIZE_SPECIFIER_TYPE_WITH_DATA is called. */ @@ -276,8 +277,7 @@ /***** Defining new specifier types *****/ -#define specifier_data_offset offsetof (Lisp_Specifier, data) -extern const struct lrecord_description specifier_empty_extra_description[]; +extern const struct sized_memory_description specifier_empty_extra_description; #ifdef ERROR_CHECK_TYPES #define DECLARE_SPECIFIER_TYPE(type) \ @@ -315,11 +315,19 @@ #define DEFINE_SPECIFIER_TYPE(type) \ struct specifier_methods * type##_specifier_methods +#define DEFINE_SPECIFIER_TYPE_WITH_DATA(type) \ +struct specifier_methods * type##_specifier_methods; \ +static const struct sized_memory_description type##_specifier_description_0 \ + = { \ + sizeof (struct type##_specifier), \ + type##_specifier_description \ +} + #define INITIALIZE_SPECIFIER_TYPE(type, obj_name, pred_sym) do { \ type##_specifier_methods = xnew_and_zero (struct specifier_methods); \ type##_specifier_methods->name = obj_name; \ type##_specifier_methods->extra_description = \ - specifier_empty_extra_description; \ + &specifier_empty_extra_description; \ defsymbol_nodump (&type##_specifier_methods->predicate_symbol, pred_sym); \ add_entry_to_specifier_type_list (Q##type, type##_specifier_methods); \ dump_add_root_struct_ptr (&type##_specifier_methods, \ @@ -336,7 +344,7 @@ type##_specifier_methods->extra_data_size = \ sizeof (struct type##_specifier); \ type##_specifier_methods->extra_description = \ - type##_specifier_description; \ + &type##_specifier_description_0; \ } while (0) /* Declare that specifier-type TYPE has method METH; used in Index: src/symbols.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symbols.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- src/symbols.c 18 Nov 2002 06:52:41 -0000 1.42 +++ src/symbols.c 12 Jan 2003 11:08:21 -0000 1.43 @@ -105,7 +105,7 @@ } } -static const struct lrecord_description symbol_description[] = { +static const struct memory_description symbol_description[] = { { XD_LISP_OBJECT, offsetof (Lisp_Symbol, next) }, { XD_LISP_OBJECT, offsetof (Lisp_Symbol, name) }, { XD_LISP_OBJECT, offsetof (Lisp_Symbol, value) }, @@ -136,7 +136,6 @@ return external_remprop (&XSYMBOL (symbol)->plist, property, 0, ERROR_ME); } -#ifdef USE_KKCC DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("symbol", symbol, 1, /*dumpable-flag*/ mark_symbol, print_symbol, @@ -146,16 +145,6 @@ symbol_remprop, Fsymbol_plist, Lisp_Symbol); -#else /* not USE_KKCC */ -DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("symbol", symbol, - mark_symbol, print_symbol, - 0, 0, 0, symbol_description, - symbol_getprop, - symbol_putprop, - symbol_remprop, - Fsymbol_plist, - Lisp_Symbol); -#endif /* not USE_KKCC */ /**********************************************************************/ /* Intern */ @@ -737,11 +726,6 @@ (symbol, newplist)) { CHECK_SYMBOL (symbol); -#if 0 /* Inserted for debugging 6/28/1997 -slb */ - /* Somebody is setting a property list of integer 0, who? */ - /* Not this way apparently. */ - if (EQ(newplist, Qzero)) abort(); -#endif XSYMBOL (symbol)->plist = newplist; return newplist; @@ -941,6 +925,14 @@ to call follow_varalias_pointers to get the actual symbol to operate on. */ +static const struct memory_description symbol_value_buffer_local_description[] = { + { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, default_value) }, + { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_value) }, + { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_buffer) }, + { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_alist_element) }, + { XD_END } +}; + static Lisp_Object mark_symbol_value_buffer_local (Lisp_Object obj) { @@ -958,6 +950,14 @@ return bfwd->current_alist_element; } + +static const struct memory_description symbol_value_lisp_magic_description[] = { + { XD_LISP_OBJECT_ARRAY, offsetof (struct symbol_value_lisp_magic, handler), MAGIC_HANDLER_MAX }, + { XD_LISP_OBJECT_ARRAY, offsetof (struct symbol_value_lisp_magic, harg), MAGIC_HANDLER_MAX }, + { XD_LISP_OBJECT, offsetof (struct symbol_value_lisp_magic, shadowed) }, + { XD_END } +}; + static Lisp_Object mark_symbol_value_lisp_magic (Lisp_Object obj) { @@ -975,6 +975,12 @@ return bfwd->shadowed; } +static const struct memory_description symbol_value_varalias_description[] = { + { XD_LISP_OBJECT, offsetof (struct symbol_value_varalias, aliasee) }, + { XD_LISP_OBJECT, offsetof (struct symbol_value_varalias, shadowed) }, + { XD_END } +}; + static Lisp_Object mark_symbol_value_varalias (Lisp_Object obj) { @@ -999,30 +1005,10 @@ (long) XPNTR (obj)); } -static const struct lrecord_description symbol_value_forward_description[] = { - { XD_END } -}; - -static const struct lrecord_description symbol_value_buffer_local_description[] = { - { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, default_value) }, - { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_value) }, - { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_buffer) }, - { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_alist_element) }, - { XD_END } -}; - -static const struct lrecord_description symbol_value_lisp_magic_description[] = { - { XD_LISP_OBJECT_ARRAY, offsetof (struct symbol_value_lisp_magic, handler), 2*MAGIC_HANDLER_MAX+1 }, +static const struct memory_description symbol_value_forward_description[] = { { XD_END } }; -static const struct lrecord_description symbol_value_varalias_description[] = { - { XD_LISP_OBJECT, offsetof (struct symbol_value_varalias, aliasee) }, - { XD_LISP_OBJECT, offsetof (struct symbol_value_varalias, shadowed) }, - { XD_END } -}; - -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-forward", symbol_value_forward, 1, /*dumpable-flag*/ @@ -1055,36 +1041,6 @@ symbol_value_varalias_description, struct symbol_value_varalias); -#else /* not USE_KKCC */ - -DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-forward", - symbol_value_forward, - 0, - print_symbol_value_magic, 0, 0, 0, - symbol_value_forward_description, - struct symbol_value_forward); - -DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-buffer-local", - symbol_value_buffer_local, - mark_symbol_value_buffer_local, - print_symbol_value_magic, 0, 0, 0, - symbol_value_buffer_local_description, - struct symbol_value_buffer_local); - -DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-lisp-magic", - symbol_value_lisp_magic, - mark_symbol_value_lisp_magic, - print_symbol_value_magic, 0, 0, 0, - symbol_value_lisp_magic_description, - struct symbol_value_lisp_magic); - -DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-varalias", - symbol_value_varalias, - mark_symbol_value_varalias, - print_symbol_value_magic, 0, 0, 0, - symbol_value_varalias_description, - struct symbol_value_varalias); -#endif /* not USE_KKCC */ /* Getting and setting values of symbols */ @@ -2042,7 +1998,7 @@ XCONSOLE (Vselected_console)); } - RETURN_NOT_REACHED (Qnil) /* suppress compiler warning */ + RETURN_NOT_REACHED (Qnil); /* suppress compiler warning */ } DEFUN ("default-boundp", Fdefault_boundp, 1, 1, 0, /* @@ -2236,7 +2192,6 @@ = alloc_lcrecord_type (struct symbol_value_buffer_local, &lrecord_symbol_value_buffer_local); Lisp_Object foo; - zero_lcrecord (&bfwd->magic); bfwd->magic.type = SYMVAL_BUFFER_LOCAL; bfwd->default_value = find_symbol_value (variable); @@ -2344,7 +2299,6 @@ /* Make sure variable is set up to hold per-buffer values */ bfwd = alloc_lcrecord_type (struct symbol_value_buffer_local, &lrecord_symbol_value_buffer_local); - zero_lcrecord (&bfwd->magic); bfwd->magic.type = SYMVAL_SOME_BUFFER_LOCAL; bfwd->current_buffer = Qnil; @@ -2508,7 +2462,7 @@ default: return variable; } - RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */ + RETURN_NOT_REACHED(Qnil); /* suppress compiler warning */ } @@ -2928,7 +2882,7 @@ if (EQ (symbol, Qmake_local)) return MAGIC_HANDLER_MAKE_LOCAL; invalid_constant ("Unrecognized symbol value handler type", symbol); - RETURN_NOT_REACHED (MAGIC_HANDLER_MAX) + RETURN_NOT_REACHED (MAGIC_HANDLER_MAX); } static enum lisp_magic_handler @@ -2962,7 +2916,7 @@ if (abort_if_not_found) abort (); invalid_argument ("Unrecognized symbol-value function", funsym); - RETURN_NOT_REACHED (MAGIC_HANDLER_MAX) + RETURN_NOT_REACHED (MAGIC_HANDLER_MAX); } static int @@ -3064,7 +3018,6 @@ { bfwd = alloc_lcrecord_type (struct symbol_value_lisp_magic, &lrecord_symbol_value_lisp_magic); - zero_lcrecord (&bfwd->magic); bfwd->magic.type = SYMVAL_LISP_MAGIC; for (i = 0; i < MAGIC_HANDLER_MAX; i++) { @@ -3201,7 +3154,6 @@ bfwd = alloc_lcrecord_type (struct symbol_value_varalias, &lrecord_symbol_value_varalias); - zero_lcrecord (&bfwd->magic); bfwd->magic.type = SYMVAL_VARALIAS; bfwd->aliasee = alias; bfwd->shadowed = valcontents; @@ -3303,7 +3255,7 @@ INIT_LRECORD_IMPLEMENTATION (symbol_value_lisp_magic); INIT_LRECORD_IMPLEMENTATION (symbol_value_varalias); - reinit_symbols_once_early (); + reinit_symbols_early (); /* Bootstrapping problem: Qnil isn't set when make_string_nocopy is called the first time. */ @@ -3335,13 +3287,13 @@ XSYMBOL (Qt)->value = Qt; /* Veritas aeterna */ Vquit_flag = Qnil; - dump_add_root_object (&Qnil); - dump_add_root_object (&Qunbound); - dump_add_root_object (&Vquit_flag); + dump_add_root_lisp_object (&Qnil); + dump_add_root_lisp_object (&Qunbound); + dump_add_root_lisp_object (&Vquit_flag); } void -reinit_symbols_once_early (void) +reinit_symbols_early (void) { } Index: src/symsinit.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symsinit.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- src/symsinit.h 4 Jun 2002 06:05:38 -0000 1.45 +++ src/symsinit.h 12 Jan 2003 11:08:21 -0000 1.46 @@ -43,15 +43,15 @@ stuff, call the reinit() routine, and do some more stuff.) */ void init_alloc_once_early (void); -void reinit_alloc_once_early (void); +void reinit_alloc_early (void); void init_symbols_once_early (void); -void reinit_symbols_once_early (void); +void reinit_symbols_early (void); void init_errors_once_early (void); -void reinit_opaque_once_early (void); +void reinit_opaque_early (void); void init_opaque_once_early (void); void init_elhash_once_early (void); void init_eistring_once_early (void); -void reinit_eistring_once_early (void); +void reinit_eistring_early (void); /* Reset the Lisp engine. Called both at dump-time, run-time and run-temacs-time; at dump-time, it's called early, before any of the Index: src/syntax.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/syntax.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/syntax.c 20 Jun 2002 21:18:47 -0000 1.16 +++ src/syntax.c 14 Feb 2003 09:50:17 -0000 1.17 @@ -1,7 +1,7 @@ /* XEmacs routines to deal with syntax tables; also word and list parsing. Copyright (C) 1985-1994 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. @@ -86,6 +86,9 @@ Lisp_Object Vtemp_table_for_use_updating_syntax_tables; +/* A value that is guaranteed not be in a syntax table. */ +Lisp_Object Vbogus_syntax_table_value; + static void syntax_cache_table_was_changed (struct buffer *buf); /* This is the internal form of the parse state used in parse-partial-sexp. */ @@ -271,7 +274,9 @@ cache->object = object; cache->buffer = buffer; cache->no_syntax_table_prop = 1; - cache->current_syntax_table = + cache->syntax_table = + BUFFER_SYNTAX_TABLE (cache->buffer); + cache->mirror_table = BUFFER_MIRROR_SYNTAX_TABLE (cache->buffer); cache->start = Qnil; cache->end = Qnil; @@ -308,6 +313,9 @@ if (!(from >= cache->prev_change && from < cache->next_change)) update_syntax_cache (cache, from, count); } +#ifdef NOT_WORTH_THE_EFFORT + update_mirror_syntax_if_dirty (cache->mirror_table); +#endif /* NOT_WORTH_THE_EFFORT */ return cache; } @@ -317,6 +325,21 @@ return setup_syntax_cache (NULL, wrap_buffer (buffer), buffer, from, count); } +static const struct memory_description syntax_cache_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct syntax_cache, object) }, + { XD_LISP_OBJECT, offsetof (struct syntax_cache, buffer) }, + { XD_LISP_OBJECT, offsetof (struct syntax_cache, syntax_table) }, + { XD_LISP_OBJECT, offsetof (struct syntax_cache, mirror_table) }, + { XD_LISP_OBJECT, offsetof (struct syntax_cache, start) }, + { XD_LISP_OBJECT, offsetof (struct syntax_cache, end) }, + { XD_END } +}; + +const struct sized_memory_description syntax_cache_description = { + sizeof (struct syntax_cache), + syntax_cache_description_1 +}; + void mark_buffer_syntax_cache (struct buffer *buf) { @@ -326,7 +349,8 @@ mark_object (cache->object); if (cache->buffer) mark_object (wrap_buffer (cache->buffer)); - mark_object (cache->current_syntax_table); + mark_object (cache->syntax_table); + mark_object (cache->mirror_table); mark_object (cache->start); mark_object (cache->end); } @@ -351,7 +375,8 @@ cache->object = wrap_buffer (buf); cache->buffer = buf; cache->no_syntax_table_prop = 1; - cache->current_syntax_table = BUFFER_MIRROR_SYNTAX_TABLE (cache->buffer); + cache->syntax_table = BUFFER_SYNTAX_TABLE (cache->buffer); + cache->mirror_table = BUFFER_MIRROR_SYNTAX_TABLE (cache->buffer); cache->start = Fmake_marker (); cache->end = Fmake_marker (); reset_buffer_cache_range (cache, cache->object); @@ -370,8 +395,12 @@ { struct syntax_cache *cache = buf->syntax_cache; if (cache->no_syntax_table_prop) - cache->current_syntax_table = - BUFFER_MIRROR_SYNTAX_TABLE (buf); + { + cache->syntax_table = + BUFFER_SYNTAX_TABLE (buf); + cache->mirror_table = + BUFFER_MIRROR_SYNTAX_TABLE (buf); + } } /* The syntax-table property on the range covered by EXTENT may be changing, @@ -495,9 +524,12 @@ if (!NILP (Fsyntax_table_p (tmp_table))) { cache->use_code = 0; - cache->current_syntax_table = - XCHAR_TABLE (tmp_table)->mirror_table; + cache->syntax_table = tmp_table; + cache->mirror_table = XCHAR_TABLE (tmp_table)->mirror_table; cache->no_syntax_table_prop = 0; +#ifdef NOT_WORTH_THE_EFFORT + update_mirror_syntax_if_dirty (cache->mirror_table); +#endif /* NOT_WORTH_THE_EFFORT */ } else if (CONSP (tmp_table) && INTP (XCAR (tmp_table))) { @@ -509,8 +541,11 @@ { cache->use_code = 0; cache->no_syntax_table_prop = 1; - cache->current_syntax_table = - BUFFER_MIRROR_SYNTAX_TABLE (cache->buffer); + cache->syntax_table = BUFFER_SYNTAX_TABLE (cache->buffer); + cache->mirror_table = BUFFER_MIRROR_SYNTAX_TABLE (cache->buffer); +#ifdef NOT_WORTH_THE_EFFORT + update_mirror_syntax_if_dirty (cache->mirror_table); +#endif /* NOT_WORTH_THE_EFFORT */ } } @@ -1407,7 +1442,7 @@ /* XEmacs change: call syntax_match on character */ Ichar ch = BUF_FETCH_CHAR (buf, from - 1); Lisp_Object stermobj = - syntax_match (scache->current_syntax_table, ch); + syntax_match (scache->syntax_table, ch); if (CHARP (stermobj)) stringterm = XCHAR (stermobj); @@ -1587,7 +1622,7 @@ /* XEmacs change: call syntax_match() on character */ Ichar ch = BUF_FETCH_CHAR (buf, from); Lisp_Object stermobj = - syntax_match (scache->current_syntax_table, ch); + syntax_match (scache->syntax_table, ch); if (CHARP (stermobj)) stringterm = XCHAR (stermobj); @@ -2012,7 +2047,7 @@ /* XEmacs change: call syntax_match() on character */ Ichar ch = BUF_FETCH_CHAR (buf, from - 1); Lisp_Object stermobj = - syntax_match (scache->current_syntax_table, ch); + syntax_match (scache->syntax_table, ch); if (CHARP (stermobj)) state.instring = XCHAR (stermobj); @@ -2181,9 +2216,10 @@ /* Updating of the mirror syntax table. - Each syntax table has a corresponding mirror table in it. - Whenever we make a change to a syntax table, we call - update_syntax_table() on it. + Each syntax table has a corresponding mirror table in it. Whenever we + make a change to a syntax table, we set a dirty flag. When accessing a + value from the mirror table and the table is dirty, we call + update_syntax_table() to clean it up. #### We really only need to map over the changed range. @@ -2208,41 +2244,32 @@ return 0; } -struct cinap -{ - Lisp_Object mirrortab; - Lisp_Object bogus; -}; - static int copy_if_not_already_present (struct chartab_range *range, Lisp_Object table, Lisp_Object val, void *arg) { - struct cinap *a = (struct cinap *) arg; - + Lisp_Object mirrortab = VOID_TO_LISP (arg); if (CONSP (val)) val = XCAR (val); if (SYNTAX_FROM_CODE (XINT (val)) != Sinherit) { Lisp_Object existing = - get_range_char_table (range, a->mirrortab, a->bogus); + updating_mirror_get_range_char_table (range, mirrortab, + Vbogus_syntax_table_value); if (NILP (existing)) /* nothing at all */ - put_char_table (a->mirrortab, range, val); - else if (!EQ (existing, a->bogus)) + put_char_table (mirrortab, range, val); + else if (!EQ (existing, Vbogus_syntax_table_value)) /* full */ ; else { Freset_char_table (Vtemp_table_for_use_updating_syntax_tables); copy_char_table_range - (a->mirrortab, - Vtemp_table_for_use_updating_syntax_tables, - range); - put_char_table (a->mirrortab, range, val); + (mirrortab, Vtemp_table_for_use_updating_syntax_tables, range); + put_char_table (mirrortab, range, val); copy_char_table_range - (Vtemp_table_for_use_updating_syntax_tables, - a->mirrortab, range); + (Vtemp_table_for_use_updating_syntax_tables, mirrortab, range); } } @@ -2255,8 +2282,10 @@ struct chartab_range range; Lisp_Object mirrortab = XCHAR_TABLE (table)->mirror_table; + assert (!XCHAR_TABLE (table)->mirror_table_p); range.type = CHARTAB_RANGE_ALL; Freset_char_table (mirrortab); + /* First, copy the tables values other than inherit into the mirror table. Then, for tables other than the standard syntax table, map over the standard table, copying values into the mirror table only if @@ -2268,19 +2297,11 @@ /* second clause catches bootstrapping problems when initializing the standard syntax table */ if (!EQ (table, Vstandard_syntax_table) && !NILP (Vstandard_syntax_table)) - { - struct cinap cinap; - struct gcpro gcpro1; - cinap.mirrortab = mirrortab; - /* Something that won't be in the table. */ - cinap.bogus = make_float (0.0); - GCPRO1 (cinap.bogus); - map_char_table (Vstandard_syntax_table, &range, - copy_if_not_already_present, &cinap); - UNGCPRO; - } + map_char_table (Vstandard_syntax_table, &range, + copy_if_not_already_present, LISP_TO_VOID (mirrortab)); /* The resetting made the default be Qnil. Put it back to Spunct. */ set_char_table_default (mirrortab, make_int (Spunct)); + XCHAR_TABLE (mirrortab)->dirty = 0; } /* Called from chartab.c when a change is made to a syntax table. @@ -2291,7 +2312,9 @@ void update_syntax_table (Lisp_Object table) { - if (EQ (table, Vstandard_syntax_table)) + Lisp_Object nonmirror = XCHAR_TABLE (table)->mirror_table; + assert (XCHAR_TABLE (table)->mirror_table_p); + if (EQ (nonmirror, Vstandard_syntax_table)) { Lisp_Object syntab; @@ -2300,7 +2323,7 @@ update_just_this_syntax_table (syntab); } else - update_just_this_syntax_table (table); + update_just_this_syntax_table (nonmirror); } @@ -2365,6 +2388,9 @@ words_include_escapes = 0; no_quit_in_re_search = 0; + + Vbogus_syntax_table_value = make_float (0.0); + staticpro (&Vbogus_syntax_table_value); } static void Index: src/syntax.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/syntax.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/syntax.h 5 Jun 2002 09:57:15 -0000 1.10 +++ src/syntax.h 14 Feb 2003 09:50:17 -0000 1.11 @@ -1,6 +1,6 @@ /* Declarations having to do with XEmacs syntax tables. Copyright (C) 1985, 1992, 1993 Free Software Foundation, Inc. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -72,9 +72,43 @@ enum syntaxcode charset_syntax (struct buffer *buf, Lisp_Object charset, int *multi_p_out); +void update_syntax_table (Lisp_Object table); + +DECLARE_INLINE_HEADER ( +void +update_mirror_syntax_if_dirty (Lisp_Object table) +) +{ + if (XCHAR_TABLE (table)->dirty) + update_syntax_table (table); +} + /* Return the syntax code for a particular character and mirror table. */ -#define SYNTAX_CODE(table, c) XINT (get_char_table (c, table)) +DECLARE_INLINE_HEADER ( +enum syntaxcode +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)); +} + +#ifdef NOT_WORTH_THE_EFFORT + +/* Same but skip the dirty check. */ + +DECLARE_INLINE_HEADER ( +enum syntaxcode +SYNTAX_CODE_1 (Lisp_Object table, Ichar c) +) +{ + type_checking_assert (XCHAR_TABLE (table)->mirror_table_p); + return (enum syntaxcode) XINT (get_char_table_1 (c, table)); +} + +#endif /* NOT_WORTH_THE_EFFORT */ #define SYNTAX_FROM_CODE(code) ((enum syntaxcode) ((code) & 0177)) @@ -246,8 +280,6 @@ extern int no_quit_in_re_search; -void update_syntax_table (Lisp_Object table); - /****************************** syntax caches ********************************/ @@ -264,8 +296,8 @@ struct syntax_cache { int use_code; /* Whether to use syntax_code or - current_syntax_table. This is - set depending on whether the + syntax_table. This is set + depending on whether the syntax-table property is a syntax table or a syntax code. */ @@ -286,7 +318,8 @@ OBJECT is a buffer, this will always be the same buffer. */ int syntax_code; /* Syntax code of current char. */ - Lisp_Object current_syntax_table; /* Syntax table for current pos. */ + Lisp_Object syntax_table; /* Syntax table for current pos. */ + Lisp_Object mirror_table; /* Mirror table for this table. */ Lisp_Object start, end; /* Markers to keep track of the known region in a buffer. Formerly we used an internal @@ -300,6 +333,8 @@ change. */ }; +extern const struct sized_memory_description syntax_cache_description; + /* Note that the external interface to the syntax-cache uses charpos's, but intnernally we use bytepos's, for speed. */ @@ -348,7 +383,23 @@ #define SYNTAX_CODE_FROM_CACHE(cache, c) \ ((cache)->use_code ? (cache)->syntax_code \ - : SYNTAX_CODE ((cache)->current_syntax_table, c)) + : SYNTAX_CODE ((cache)->mirror_table, c)) + +#ifdef NOT_WORTH_THE_EFFORT +/* If we really cared about the theoretical performance hit of the dirty + check in SYNTAX_CODE, we could use SYNTAX_CODE_1 and endeavor to always + keep the mirror table clean, e.g. by checking for dirtiness at the time + we set up the syntax cache. There are lots of potential problems, of + course -- incomplete understanding of the possible pathways into the + code, with some that are bypassing the setups, Lisp code being executed + in the meantime that could change things (e.g. QUIT is called in many + functions and could execute arbitrary Lisp very easily), etc. The QUIT + problem is the biggest one, probably, and one of the main reasons it's + probably just not worth it. */ +#define SYNTAX_CODE_FROM_CACHE(cache, c) \ + ((cache)->use_code ? (cache)->syntax_code \ + : SYNTAX_CODE_1 ((cache)->mirror_table, c)) +#endif /***************************** syntax code macros ****************************/ Index: src/sysdep.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdep.c,v retrieving revision 1.65 retrieving revision 1.67 diff -u -r1.65 -r1.67 --- src/sysdep.c 27 Nov 2002 07:15:14 -0000 1.65 +++ src/sysdep.c 7 Feb 2003 21:05:35 -0000 1.67 @@ -596,7 +596,7 @@ if (sh == 0) sh = egetenv ("SHELL"); if (sh == 0) - sh = "sh"; + sh = (Ibyte *) "sh"; C_STRING_TO_EXTERNAL (sh, shext, Qfile_name); @@ -1539,12 +1539,12 @@ #endif if (CONSOLE_TTY_DATA (con)->controlling_terminal) { - tty.main.c_cc[VINTR] = - CONSOLE_QUIT_CHAR (con); /* C-g (usually) gives SIGINT */ + tty.main.c_cc[VINTR] = /* C-g (usually) gives SIGINT */ + event_to_character (CONSOLE_QUIT_EVENT (con), 0, 1, 0); /* Set up C-g for both SIGQUIT and SIGINT. We don't know which we will get, but we handle both alike so which one it really gives us does not matter. */ - tty.main.c_cc[VQUIT] = CONSOLE_QUIT_CHAR (con); + tty.main.c_cc[VQUIT] = tty.main.c_cc[VINTR]; } else { @@ -1634,7 +1634,7 @@ /* Note: if not using CBREAK mode, it makes no difference how we set this */ tty.tchars = new_tchars; - tty.tchars.t_intrc = CONSOLE_QUIT_CHAR (con); + tty.tchars.t_intrc = event_to_character (CONSOLE_QUIT_EVENT (con), 0, 1, 0); if (TTY_FLAGS (con).flow_control) { tty.tchars.t_startc = '\021'; @@ -3329,6 +3329,7 @@ return ctime_static; } + /************************************************************************/ /* Emulation of missing functions from wchar.h */ /************************************************************************/ @@ -3343,6 +3344,38 @@ ; return p - s; +} +#endif + +/************************************************************************/ +/* Emulation of missing functions from string.h */ +/************************************************************************/ + +#ifndef HAVE_STRLWR +char * +strlwr (char *s) +{ + REGISTER char *c; + + for (c = s; *c; c++) + { + *c = tolower (*c); + } + return s; +} +#endif + +#ifndef HAVE_STRUPR +char * +strupr (char *s) +{ + REGISTER char *c; + + for (c = s; *c; c++) + { + *c = toupper (*c); + } + return s; } #endif Index: src/sysdll.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdll.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/sysdll.c 24 Jun 2002 22:00:25 -0000 1.9 +++ src/sysdll.c 7 Feb 2003 21:40:23 -0000 1.10 @@ -24,6 +24,7 @@ #endif #include +#include "lisp.h" #include "sysdll.h" /* This whole file is conditional upon HAVE_SHLIB */ Index: src/syswindows.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/syswindows.h,v retrieving revision 1.17 retrieving revision 1.19 diff -u -r1.17 -r1.19 --- src/syswindows.h 18 Nov 2002 06:52:41 -0000 1.17 +++ src/syswindows.h 15 Feb 2003 11:20:40 -0000 1.19 @@ -151,6 +151,12 @@ #ifdef CYGWIN_HEADERS +#include /* for version info */ + +#if __W32API_MAJOR_VERSION > 2 || (__W32API_MAJOR_VERSION == 2 && __W32API_MINOR_VERSION >= 2) +#define W32API_2_2 +#endif + /* Various brokennesses in various versions of Cygwin */ /* windows.h defines. */ @@ -356,6 +362,8 @@ WCHAR szDisplay[64]; } NMDATETIMEFORMATW, FAR * LPNMDATETIMEFORMATW; +#ifndef W32API_2_2 + typedef struct tagNMTTDISPIFNOA { NMHDR hdr; @@ -380,6 +388,8 @@ #endif } NMTTDISPINFOW, FAR *LPNMTTDISPINFOW; +#endif /* not W32API_2_2 */ + #endif /* (_WIN32_IE >= 0x0400) */ /* shlobj.h defines */ @@ -1070,8 +1080,9 @@ int mswindows_stat (const Ibyte *path, struct stat *buf); int mswindows_fstat (int desc, struct stat *buf); time_t mswindows_convert_time (FILETIME ft); -void mswindows_executable_type (const Ibyte * filename, int * is_dos_app, - int * is_cygnus_app); +int mswindows_is_executable (const Ibyte *filename); +void mswindows_executable_type (const Ibyte *filename, int *is_dos_app, + int *is_cygnus_app); Ibyte *mswindows_getdcwd (int drivelet); /* in process-nt.c */ Index: src/text.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.c,v retrieving revision 1.12 retrieving revision 1.14 diff -u -r1.12 -r1.14 --- src/text.c 5 Jun 2002 09:57:22 -0000 1.12 +++ src/text.c 13 Feb 2003 09:57:08 -0000 1.14 @@ -1,6 +1,6 @@ /* Buffer manipulation primitives for XEmacs. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing. Copyright (C) 1999 Martin Buchholz. This file is part of XEmacs. @@ -32,6 +32,7 @@ #include "charset.h" #include "file-coding.h" #include "lstream.h" +#include "profile.h" /************************************************************************/ @@ -40,19 +41,71 @@ /* ========================================================================== - 1. Character Sets + 1. Intro to Characters, Character Sets, and Encodings ========================================================================== - A character set (or "charset") is an ordered set of characters. - A character (which is, BTW, a surprisingly complex concept) is, in a written representation of text, the most basic written unit that has a meaning of its own. It's comparable to a phoneme when analyzing words - in spoken speech. Just like with a phoneme (which is an abstract - concept, and is represented in actual spoken speech by one or more - allophones, ...&&#### finish this., a character is actually an abstract - concept + in spoken speech (for example, the sound of `t' in English, which in + fact has different pronunciations in different words -- aspirated in + `time', unaspirated in `stop', unreleased or even pronounced as a + glottal stop in `button', etc. -- but logically is a single concept). + Like a phoneme, a character is an abstract concept defined by its + *meaning*. The character `lowercase f', for example, can always be used + to represent the first letter in the word `fill', regardless of whether + it's drawn upright or italic, whether the `fi' combination is drawn as a + single ligature, whether there are serifs on the bottom of the vertical + stroke, etc. (These different appearances of a single character are + often called "graphs" or "glyphs".) Our concern when representing text + is on representing the abstract characters, and not on their exact + appearance. + + A character set (or "charset"), as we define it, is a set of characters, + each with an associated number (or set of numbers -- see below), called + a "code point". It's important to understand that a character is not + defined by any number attached to it, but by its meaning. For example, + ASCII and EBCDIC are two charsets containing exactly the same characters + (lowercase and uppercase letters, numbers 0 through 9, particular + punctuation marks) but with different numberings. The `comma' character + in ASCII and EBCDIC, for instance, is the same character despite having + a different numbering. Conversely, when comparing ASCII and JIS-Roman, + which look the same except that the latter has a yen sign substituted + for the backslash, we would say that the backslash and yen sign are + *not* the same characters, despite having the same number (95) and + despite the fact that all other characters are present in both charsets, + with the same numbering. ASCII and JIS-Roman, then, do *not* have + exactly the same characters in them (ASCII has a backslash character but + no yen-sign character, and vice-versa for JIS-Roman), unlike ASCII and + EBCDIC, even though the numberings in ASCII and JIS-Roman are closer. + + It's also important to distinguish between charsets and encodings. For + a simple charset like ASCII, there is only one encoding normally used -- + each character is represented by a single byte, with the same value as + its code point. For more complicated charsets, however, things are not + so obvious. Unicode version 2, for example, is a large charset with + thousands of characters, each indexed by a 16-bit number, often + represented in hex, e.g. 0x05D0 for the Hebrew letter "aleph". One + obvious encoding uses two bytes per character (actually two encodings, + depending on which of the two possible byte orderings is chosen). This + encoding is convenient for internal processing of Unicode text; however, + it's incompatible with ASCII, so a different encoding, e.g. UTF-8, is + usually used for external text, for example files or e-mail. UTF-8 + represents Unicode characters with one to three bytes (often extended to + six bytes to handle characters with up to 31-bit indices). Unicode + characters 00 to 7F (identical with ASCII) are directly represented with + one byte, and other characters with two or more bytes, each in the range + 80 to FF. + + In general, a single encoding may be able to represent more than one + charset. + + See also man/lispref/mule.texi. + ========================================================================== + 2. Character Sets + ========================================================================== + A particular character in a charset is indexed using one or more "position codes", which are non-negative integers. The number of position codes needed to identify a particular @@ -131,7 +184,7 @@ This is a bit ad-hoc but gets the job done. ========================================================================== - 2. Encodings + 3. Encodings ========================================================================== An "encoding" is a way of numerically representing @@ -212,7 +265,7 @@ Initially, Printing-ASCII is invoked. ========================================================================== - 3. Internal Mule Encodings + 4. Internal Mule Encodings ========================================================================== In XEmacs/Mule, each character set is assigned a unique number, @@ -336,7 +389,7 @@ of the search string and &&#### finish this. ========================================================================== - 4. Buffer Positions and Other Typedefs + 5. Buffer Positions and Other Typedefs ========================================================================== A. Buffer Positions @@ -383,7 +436,7 @@ B. Other Typedefs Ichar: - ------- + ------ This typedef represents a single Emacs character, which can be ASCII, ISO-8859, or some extended character, as would typically be used for Kanji. Note that the representation of a character @@ -405,7 +458,7 @@ the standard 8-bit representation of ASCII/ISO-8859-1. Ibyte: - -------- + ------ The data in a buffer or string is logically made up of Ibyte objects, where a Ibyte takes up the same amount of space as a char. (It is declared differently, though, to catch invalid @@ -428,8 +481,8 @@ within the string, you need merely use standard searching routines. - array of char: - -------------- + Extbyte: + -------- Strings that go in or out of Emacs are in "external format", typedef'ed as an array of char or a char *. There is more than one external format (JIS, EUC, etc.) but they all @@ -515,26 +568,27 @@ case. #### unfinished ========================================================================== - 5. Miscellaneous + 6. Miscellaneous ========================================================================== A. Unicode Support - Adding Unicode support is very desirable. Unicode will likely be a - very common representation in the future, and thus we should - represent Unicode characters using three bytes instead of four. - This means we need to find leading bytes for Unicode. Given that - there are 65,536 characters in Unicode and we can attach 96x96 = - 9,216 characters per leading byte, we need eight leading bytes for - Unicode. We currently have four free (0x9A - 0x9D), and with a - little bit of rearranging we can get five: ASCII doesn't really - need to take up a leading byte. (We could just as well use 0x7F, - with a little change to the functions that assume that 0x80 is the - lowest leading byte.) This means we still need to dump three - leading bytes and move them into private space. The CNS charsets - are good candidates since they are rarely used, and - JAPANESE_JISX0208_1978 is becoming less and less used and could - also be dumped. + Unicode support is very desirable. Currrently we know how to handle + externally-encoded Unicode data in various encodings -- UTF-16, UTF-8, + etc. However, we really need to represent Unicode characters internally + as-is, rather than converting to some language-specific character set. + For efficiency, we should represent Unicode characters using 3 bytes + rather than 4. This means we need to find leading bytes for Unicode. + Given that there are 65,536 characters in Unicode and we can attach + 96x96 = 9,216 characters per leading byte, we need eight leading bytes + for Unicode. We currently have four free (0x9A - 0x9D), and with a + little bit of rearranging we can get five: ASCII doesn't really need to + take up a leading byte. (We could just as well use 0x7F, with a little + change to the functions that assume that 0x80 is the lowest leading + byte.) This means we still need to dump three leading bytes and move + them into private space. The CNS charsets are good candidates since + they are rarely used, and JAPANESE_JISX0208_1978 is becoming less and + less used and could also be dumped. B. Composite Characters @@ -624,6 +678,9 @@ #endif /* MULE */ +Lisp_Object QSin_char_byte_conversion; +Lisp_Object QSin_internal_external_conversion; + /************************************************************************/ /* qxestr***() functions */ @@ -1599,6 +1656,7 @@ Bytebpos retval; int diff_so_far; int add_to_cache = 0; + PROFILE_DECLARE (); /* Check for some cached positions, for speed. */ if (x == BUF_PT (buf)) @@ -1608,6 +1666,8 @@ if (x == BUF_BEGV (buf)) return BYTE_BUF_BEGV (buf); + PROFILE_RECORD_ENTERING_SECTION (QSin_char_byte_conversion); + bufmin = buf->text->mule_bufmin; bufmax = buf->text->mule_bufmax; bytmin = buf->text->mule_bytmin; @@ -1858,6 +1918,8 @@ buf->text->mule_bytebpos_cache[replace_loc] = retval; } + PROFILE_RECORD_EXITING_SECTION (QSin_char_byte_conversion); + return retval; } @@ -1876,6 +1938,7 @@ Charbpos retval; int diff_so_far; int add_to_cache = 0; + PROFILE_DECLARE (); /* Check for some cached positions, for speed. */ if (x == BYTE_BUF_PT (buf)) @@ -1885,6 +1948,8 @@ if (x == BYTE_BUF_BEGV (buf)) return BUF_BEGV (buf); + PROFILE_RECORD_ENTERING_SECTION (QSin_char_byte_conversion); + bufmin = buf->text->mule_bufmin; bufmax = buf->text->mule_bufmax; bytmin = buf->text->mule_bytmin; @@ -2135,6 +2200,8 @@ buf->text->mule_bytebpos_cache[replace_loc] = x; } + PROFILE_RECORD_EXITING_SECTION (QSin_char_byte_conversion); + return retval; } @@ -2759,8 +2826,13 @@ /* It's guaranteed that many callers are not prepared for GC here, esp. given that this code conversion occurs in many very hidden places. */ - int count = begin_gc_forbidden (); + int count; Extbyte_dynarr *conversion_out_dynarr; + PROFILE_DECLARE (); + + PROFILE_RECORD_ENTERING_SECTION (QSin_internal_external_conversion); + + count = begin_gc_forbidden (); type_checking_assert (((source_type == DFC_TYPE_DATA) || @@ -2867,7 +2939,6 @@ int delete_count; Lisp_Object instream, outstream; Lstream *reader, *writer; - struct gcpro gcpro1, gcpro2; #ifdef HAVE_WIN32_CODING_SYSTEMS the_hard_way: @@ -2903,30 +2974,33 @@ reader = XLSTREAM (instream); writer = XLSTREAM (outstream); /* decoding_stream will gc-protect outstream */ - GCPRO2 (instream, outstream); + { + struct gcpro gcpro1, gcpro2; + GCPRO2 (instream, outstream); - while (1) - { - Bytecount size_in_bytes; - char tempbuf[1024]; /* some random amount */ + while (1) + { + Bytecount size_in_bytes; + char tempbuf[1024]; /* some random amount */ - size_in_bytes = Lstream_read (reader, tempbuf, sizeof (tempbuf)); + size_in_bytes = Lstream_read (reader, tempbuf, sizeof (tempbuf)); - if (size_in_bytes == 0) - break; - else if (size_in_bytes < 0) - signal_error (Qtext_conversion_error, - "Error converting to external format", Qunbound); - - if (Lstream_write (writer, tempbuf, size_in_bytes) < 0) - signal_error (Qtext_conversion_error, - "Error converting to external format", Qunbound); - } + if (size_in_bytes == 0) + break; + else if (size_in_bytes < 0) + signal_error (Qtext_conversion_error, + "Error converting to external format", Qunbound); + + if (Lstream_write (writer, tempbuf, size_in_bytes) < 0) + signal_error (Qtext_conversion_error, + "Error converting to external format", Qunbound); + } - /* Closing writer will close any stream at the other end of writer. */ - Lstream_close (writer); - Lstream_close (reader); - UNGCPRO; + /* Closing writer will close any stream at the other end of writer. */ + Lstream_close (writer); + Lstream_close (reader); + UNGCPRO; + } /* The idea is that this function will create no garbage. */ while (delete_count) @@ -2943,6 +3017,8 @@ Dynarr_add (conversion_out_dynarr, '\0'); sink->data.ptr = Dynarr_atp (conversion_out_dynarr, 0); } + + PROFILE_RECORD_EXITING_SECTION (QSin_internal_external_conversion); } void @@ -2955,8 +3031,13 @@ /* It's guaranteed that many callers are not prepared for GC here, esp. given that this code conversion occurs in many very hidden places. */ - int count = begin_gc_forbidden (); + int count; Ibyte_dynarr *conversion_in_dynarr; + PROFILE_DECLARE (); + + PROFILE_RECORD_ENTERING_SECTION (QSin_internal_external_conversion); + + count = begin_gc_forbidden (); type_checking_assert ((source_type == DFC_TYPE_DATA || @@ -3008,7 +3089,8 @@ #endif } #ifdef HAVE_WIN32_CODING_SYSTEMS - /* Optimize the common case involving Unicode where only ASCII/Latin-1 is involved */ + /* Optimize the common case involving Unicode where only ASCII/Latin-1 is + involved */ else if (source_type != DFC_TYPE_LISP_LSTREAM && sink_type != DFC_TYPE_LISP_LSTREAM && dfc_coding_system_is_unicode (coding_system)) @@ -3056,7 +3138,6 @@ int delete_count; Lisp_Object instream, outstream; Lstream *reader, *writer; - struct gcpro gcpro1, gcpro2; #ifdef HAVE_WIN32_CODING_SYSTEMS the_hard_way: @@ -3087,31 +3168,34 @@ reader = XLSTREAM (instream); writer = XLSTREAM (outstream); - /* outstream will gc-protect its sink stream, if necessary */ - GCPRO2 (instream, outstream); + { + struct gcpro gcpro1, gcpro2; + /* outstream will gc-protect its sink stream, if necessary */ + GCPRO2 (instream, outstream); - while (1) - { - Bytecount size_in_bytes; - char tempbuf[1024]; /* some random amount */ + while (1) + { + Bytecount size_in_bytes; + char tempbuf[1024]; /* some random amount */ - size_in_bytes = Lstream_read (reader, tempbuf, sizeof (tempbuf)); + size_in_bytes = Lstream_read (reader, tempbuf, sizeof (tempbuf)); - if (size_in_bytes == 0) - break; - else if (size_in_bytes < 0) - signal_error (Qtext_conversion_error, - "Error converting to internal format", Qunbound); - - if (Lstream_write (writer, tempbuf, size_in_bytes) < 0) - signal_error (Qtext_conversion_error, - "Error converting to internal format", Qunbound); - } + if (size_in_bytes == 0) + break; + else if (size_in_bytes < 0) + signal_error (Qtext_conversion_error, + "Error converting to internal format", Qunbound); + + if (Lstream_write (writer, tempbuf, size_in_bytes) < 0) + signal_error (Qtext_conversion_error, + "Error converting to internal format", Qunbound); + } - /* Closing writer will close any stream at the other end of writer. */ - Lstream_close (writer); - Lstream_close (reader); - UNGCPRO; + /* Closing writer will close any stream at the other end of writer. */ + Lstream_close (writer); + Lstream_close (reader); + UNGCPRO; + } /* The idea is that this function will create no garbage. */ while (delete_count) @@ -3131,6 +3215,8 @@ Dynarr_add (conversion_in_dynarr, '\0'); sink->data.ptr = Dynarr_atp (conversion_in_dynarr, 0); } + + PROFILE_RECORD_EXITING_SECTION (QSin_internal_external_conversion); } @@ -3616,7 +3702,7 @@ /************************************************************************/ void -reinit_eistring_once_early (void) +reinit_eistring_early (void) { the_eistring_malloc_zero_init = the_eistring_zero_init; the_eistring_malloc_zero_init.mallocp_ = 1; @@ -3625,7 +3711,7 @@ void init_eistring_once_early (void) { - reinit_eistring_once_early (); + reinit_eistring_early (); } void @@ -3655,7 +3741,6 @@ conversion_out_dynarr_list = Dynarr_new2 (Extbyte_dynarr_dynarr, Extbyte_dynarr *); - /* #### Olivier, why does this need to be reinitted? */ for (i = 0; i <= MAX_BYTEBPOS_GAP_SIZE_3; i++) three_to_one_table[i] = i / 3; } @@ -3664,6 +3749,12 @@ vars_of_text (void) { reinit_vars_of_text (); + + QSin_char_byte_conversion = build_msg_string ("(in char-byte conversion)"); + staticpro (&QSin_char_byte_conversion); + QSin_internal_external_conversion = + build_msg_string ("(in internal-external conversion)"); + staticpro (&QSin_internal_external_conversion); #ifdef ENABLE_COMPOSITE_CHARS /* #### not dumped properly */ Index: src/text.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.h,v retrieving revision 1.11 retrieving revision 1.13 diff -u -r1.11 -r1.13 --- src/text.h 9 Jul 2002 11:58:12 -0000 1.11 +++ src/text.h 5 Feb 2003 06:20:51 -0000 1.13 @@ -36,7 +36,13 @@ #ifdef HAVE_WCHAR_H #include #else -size_t wcslen(const wchar_t *); +size_t wcslen (const wchar_t *); +#endif +#ifndef HAVE_STRLWR +char *strlwr (char *); +#endif +#ifndef HAVE_STRUPR +char *strupr (char *); #endif /* ---------------------------------------------------------------------- */ @@ -453,27 +459,27 @@ (ptr) += rep_bytes_by_first_byte (* (ptr)); \ } while (0) -#define INC_IBYTEPTR_FMT(ptr, fmt) \ -do { \ - Internal_Format __icf_fmt = (fmt); \ - switch (__icf_fmt) \ - { \ - case FORMAT_DEFAULT: \ - INC_IBYTEPTR (ptr); \ - break; \ - case FORMAT_16_BIT_FIXED: \ - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_16_BIT)); \ - (ptr) += 2; \ - break; \ - case FORMAT_32_BIT_FIXED: \ - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_32_BIT)); \ - (ptr) += 4; \ - break; \ - default: \ - text_checking_assert (fmt == FORMAT_8_BIT_FIXED); \ - (ptr)++; \ - break; \ - } \ +#define INC_IBYTEPTR_FMT(ptr, fmt) \ +do { \ + Internal_Format __icf_fmt = (fmt); \ + switch (__icf_fmt) \ + { \ + case FORMAT_DEFAULT: \ + INC_IBYTEPTR (ptr); \ + break; \ + case FORMAT_16_BIT_FIXED: \ + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_16_BIT)); \ + (ptr) += 2; \ + break; \ + case FORMAT_32_BIT_FIXED: \ + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_32_BIT)); \ + (ptr) += 4; \ + break; \ + default: \ + text_checking_assert (fmt == FORMAT_8_BIT_FIXED); \ + (ptr)++; \ + break; \ + } \ } while (0) /* Given a itext (assumed to point at the beginning of a character or at @@ -498,27 +504,27 @@ } while (0) #endif /* ERROR_CHECK_TEXT */ -#define DEC_IBYTEPTR_FMT(ptr, fmt) \ -do { \ - Internal_Format __icf_fmt = (fmt); \ - switch (__icf_fmt) \ - { \ - case FORMAT_DEFAULT: \ - DEC_IBYTEPTR (ptr); \ - break; \ - case FORMAT_16_BIT_FIXED: \ - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_16_BIT)); \ - (ptr) -= 2; \ - break; \ - case FORMAT_32_BIT_FIXED: \ - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_32_BIT)); \ - (ptr) -= 4; \ - break; \ - default: \ - text_checking_assert (fmt == FORMAT_8_BIT_FIXED); \ - (ptr)--; \ - break; \ - } \ +#define DEC_IBYTEPTR_FMT(ptr, fmt) \ +do { \ + Internal_Format __icf_fmt = (fmt); \ + switch (__icf_fmt) \ + { \ + case FORMAT_DEFAULT: \ + DEC_IBYTEPTR (ptr); \ + break; \ + case FORMAT_16_BIT_FIXED: \ + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_16_BIT)); \ + (ptr) -= 2; \ + break; \ + case FORMAT_32_BIT_FIXED: \ + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_32_BIT)); \ + (ptr) -= 4; \ + break; \ + default: \ + text_checking_assert (fmt == FORMAT_8_BIT_FIXED); \ + (ptr)--; \ + break; \ + } \ } while (0) #ifdef MULE @@ -675,10 +681,10 @@ case FORMAT_DEFAULT: return bytecount_to_charcount (ptr, len); case FORMAT_16_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_16_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_16_BIT)); return (Charcount) (len << 1); case FORMAT_32_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_32_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_32_BIT)); return (Charcount) (len << 2); default: text_checking_assert (fmt == FORMAT_8_BIT_FIXED); @@ -701,12 +707,12 @@ case FORMAT_DEFAULT: return charcount_to_bytecount (ptr, len); case FORMAT_16_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_16_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_16_BIT)); text_checking_assert (!(len & 1)); return (Bytecount) (len >> 1); case FORMAT_32_BIT_FIXED: text_checking_assert (!(len & 3)); - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_32_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_32_BIT)); return (Bytecount) (len >> 2); default: text_checking_assert (fmt == FORMAT_8_BIT_FIXED); @@ -749,10 +755,10 @@ case FORMAT_DEFAULT: return itext_ichar_len (ptr); case FORMAT_16_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_16_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_16_BIT)); return 2; case FORMAT_32_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_32_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_32_BIT)); return 4; default: text_checking_assert (fmt == FORMAT_8_BIT_FIXED); @@ -831,10 +837,10 @@ case FORMAT_DEFAULT: return itext_ichar (ptr); case FORMAT_16_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_16_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_16_BIT)); return raw_16_bit_fixed_to_ichar (* (UINT_16_BIT *) ptr, object); case FORMAT_32_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_32_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_32_BIT)); return raw_32_bit_fixed_to_ichar (* (UINT_32_BIT *) ptr, object); default: text_checking_assert (fmt == FORMAT_8_BIT_FIXED); @@ -861,10 +867,10 @@ case FORMAT_DEFAULT: return (Ichar) *ptr; case FORMAT_16_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_16_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_16_BIT)); return raw_16_bit_fixed_to_ichar (* (UINT_16_BIT *) ptr, object); case FORMAT_32_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_32_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_32_BIT)); return raw_32_bit_fixed_to_ichar (* (UINT_32_BIT *) ptr, object); default: text_checking_assert (fmt == FORMAT_8_BIT_FIXED); @@ -886,10 +892,10 @@ case FORMAT_DEFAULT: return (Raw_Ichar) itext_ichar (ptr); case FORMAT_16_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_16_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_16_BIT)); return (Raw_Ichar) (* (UINT_16_BIT *) ptr); case FORMAT_32_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_32_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_32_BIT)); return (Raw_Ichar) (* (UINT_32_BIT *) ptr); default: text_checking_assert (fmt == FORMAT_8_BIT_FIXED); @@ -928,11 +934,11 @@ return set_itext_ichar (ptr, x); case FORMAT_16_BIT_FIXED: text_checking_assert (ichar_16_bit_fixed_p (x, object)); - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_16_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_16_BIT)); * (UINT_16_BIT *) ptr = ichar_to_raw_16_bit_fixed (x, object); return 2; case FORMAT_32_BIT_FIXED: - text_checking_assert (ptr == ALIGN_PTR (ptr, UINT_32_BIT)); + text_checking_assert ((void *) ptr == ALIGN_PTR (ptr, UINT_32_BIT)); * (UINT_32_BIT *) ptr = ichar_to_raw_32_bit_fixed (x, object); return 4; default: Index: src/toolbar-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/toolbar-msw.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- src/toolbar-msw.c 30 Nov 2002 08:10:26 -0000 1.21 +++ src/toolbar-msw.c 31 Jan 2003 12:02:37 -0000 1.22 @@ -45,7 +45,7 @@ #include "console-msw-impl.h" #include "glyphs-msw.h" -// #include "objects-msw.h" +/* #include "objects-msw.h" */ #define TOOLBAR_ITEM_ID_MIN 0x4000 #define TOOLBAR_ITEM_ID_MAX 0x7FFF Index: src/toolbar.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/toolbar.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- src/toolbar.c 29 Jul 2002 09:21:25 -0000 1.28 +++ src/toolbar.c 12 Jan 2003 11:08:22 -0000 1.29 @@ -56,8 +56,7 @@ Lisp_Object Qinit_toolbar_from_resources; -#ifdef USE_KKCC -static const struct lrecord_description toolbar_button_description [] = { +static const struct memory_description toolbar_button_description [] = { { XD_LISP_OBJECT, offsetof (struct toolbar_button, next) }, { XD_LISP_OBJECT, offsetof (struct toolbar_button, frame) }, { XD_LISP_OBJECT, offsetof (struct toolbar_button, up_glyph) }, @@ -71,7 +70,6 @@ { XD_LISP_OBJECT, offsetof (struct toolbar_button, help_string) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_toolbar_button (Lisp_Object obj) @@ -90,17 +88,11 @@ return data->help_string; } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button, 0, /*dumpable-flag*/ mark_toolbar_button, 0, 0, 0, 0, toolbar_button_description, struct toolbar_button); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button, - mark_toolbar_button, 0, 0, 0, 0, 0, - struct toolbar_button); -#endif /* not USE_KKCC */ DEFUN ("toolbar-button-p", Ftoolbar_button_p, 1, 1, 0, /* Return non-nil if OBJECT is a toolbar button. @@ -247,7 +239,7 @@ if (EQ (position, Qright)) return RIGHT_TOOLBAR; invalid_constant ("Invalid toolbar position", position); - RETURN_NOT_REACHED (TOP_TOOLBAR) + RETURN_NOT_REACHED (TOP_TOOLBAR); } DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, 1, 1, 0, /* Index: src/tooltalk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/tooltalk.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- src/tooltalk.c 12 Aug 2002 08:00:06 -0000 1.30 +++ src/tooltalk.c 12 Jan 2003 11:08:22 -0000 1.31 @@ -152,13 +152,11 @@ Tt_message m; }; -#ifdef USE_KKCC -static const struct lrecord_description tooltalk_message_description [] = { +static const struct memory_description tooltalk_message_description [] = { { XD_LISP_OBJECT, offsetof (struct Lisp_Tooltalk_Message, callback) }, { XD_LISP_OBJECT, offsetof (struct Lisp_Tooltalk_Message, plist_sym) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_tooltalk_message (Lisp_Object obj) @@ -181,19 +179,12 @@ (long) (p->m), p->header.uid); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-message", tooltalk_message, 0, /*dumpable-flag*/ mark_tooltalk_message, print_tooltalk_message, 0, 0, 0, tooltalk_message_description, Lisp_Tooltalk_Message); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-message", tooltalk_message, - mark_tooltalk_message, print_tooltalk_message, - 0, 0, 0, 0, - Lisp_Tooltalk_Message); -#endif /* not USE_KKCC */ static Lisp_Object make_tooltalk_message (Tt_message m) @@ -239,13 +230,11 @@ Tt_pattern p; }; -#ifdef USE_KKCC -static const struct lrecord_description tooltalk_pattern_description [] = { +static const struct memory_description tooltalk_pattern_description [] = { { XD_LISP_OBJECT, offsetof (struct Lisp_Tooltalk_Pattern, callback) }, { XD_LISP_OBJECT, offsetof (struct Lisp_Tooltalk_Pattern, plist_sym) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_tooltalk_pattern (Lisp_Object obj) @@ -268,19 +257,12 @@ (long) (p->p), p->header.uid); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-pattern", tooltalk_pattern, 0, /*dumpable-flag*/ mark_tooltalk_pattern, print_tooltalk_pattern, 0, 0, 0, tooltalk_pattern_description, Lisp_Tooltalk_Pattern); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-pattern", tooltalk_pattern, - mark_tooltalk_pattern, print_tooltalk_pattern, - 0, 0, 0, 0, - Lisp_Tooltalk_Pattern); -#endif /* not USE_KKCC */ static Lisp_Object make_tooltalk_pattern (Tt_pattern p) Index: src/ui-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ui-gtk.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- src/ui-gtk.c 12 Aug 2002 08:00:07 -0000 1.11 +++ src/ui-gtk.c 12 Jan 2003 11:08:22 -0000 1.12 @@ -298,12 +298,10 @@ return (data); } -#ifdef USE_KKCC -static const struct lrecord_description ffi_data_description [] = { - { XD_LISP_OBJECT, offsetof (struct emacs_ffi_data, function_name) }, +static const struct memory_description ffi_data_description [] = { + { XD_LISP_OBJECT, offsetof (emacs_ffi_data, function_name) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_ffi_data (Lisp_Object obj) @@ -326,17 +324,11 @@ write_fmt_string (printcharfun, " %p>", (void *)XFFI (obj)->function_ptr); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("ffi", emacs_ffi, 0, /*dumpable-flag*/ mark_ffi_data, ffi_object_printer, 0, 0, 0, ffi_data_description, emacs_ffi_data); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("ffi", emacs_ffi, - mark_ffi_data, ffi_object_printer, - 0, 0, 0, NULL, emacs_ffi_data); -#endif /* not USE_KKCC */ typedef GtkObject * (*__OBJECT_fn) (); typedef gint (*__INT_fn) (); @@ -900,12 +892,10 @@ return (1); } -#ifdef USE_KKCC -static const struct lrecord_description gtk_object_data_description [] = { - { XD_LISP_OBJECT, offsetof (struct emacs_gtk_object_data, plist) }, +static const struct memory_description gtk_object_data_description [] = { + { XD_LISP_OBJECT, offsetof (emacs_gtk_object_data, plist) }, { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_gtk_object_data (Lisp_Object obj) @@ -933,34 +923,19 @@ } } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("GtkObject", emacs_gtk_object, 0, /*dumpable-flag*/ - mark_gtk_object_data, /* marker function */ - emacs_gtk_object_printer, /* print function */ - emacs_gtk_object_finalizer, /* finalizer */ - 0, /* equality */ - 0, /* hash */ - gtk_object_data_description, /* desc */ - object_getprop, /* get prop */ - object_putprop, /* put prop */ - 0, /* rem prop */ - 0, /* plist */ - emacs_gtk_object_data); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("GtkObject", emacs_gtk_object, - mark_gtk_object_data, /* marker function */ - emacs_gtk_object_printer, /* print function */ - emacs_gtk_object_finalizer, /* finalizer */ + mark_gtk_object_data, + emacs_gtk_object_printer, + emacs_gtk_object_finalizer, 0, /* equality */ 0, /* hash */ - NULL, /* desc */ - object_getprop, /* get prop */ - object_putprop, /* put prop */ + gtk_object_data_description, + object_getprop, + object_putprop, 0, /* rem prop */ 0, /* plist */ emacs_gtk_object_data); -#endif /* not USE_KKCC */ static emacs_gtk_object_data * allocate_emacs_gtk_object_data (void) @@ -1111,11 +1086,9 @@ /* GTK_TYPE_BOXED wrapper for Emacs lisp */ -#ifdef USE_KKCC -static const struct lrecord_description emacs_gtk_boxed_description [] = { +static const struct memory_description emacs_gtk_boxed_description [] = { { XD_END } }; -#endif /* USE_KKCC */ static void emacs_gtk_boxed_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) @@ -1145,34 +1118,19 @@ return (HASH2 ((unsigned long)data->object, data->object_type)); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("GtkBoxed", emacs_gtk_boxed, 0, /*dumpable-flag*/ 0, /* marker function */ - emacs_gtk_boxed_printer, /* print function */ - 0, /* nuker */ - emacs_gtk_boxed_equality, /* equality */ - emacs_gtk_boxed_hash, /* hash */ - emacs_gtk_boxed_description, /* desc */ - 0, /* get prop */ - 0, /* put prop */ - 0, /* rem prop */ - 0, /* plist */ - emacs_gtk_boxed_data); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("GtkBoxed", emacs_gtk_boxed, - 0, /* marker function */ - emacs_gtk_boxed_printer, /* print function */ + emacs_gtk_boxed_printer, 0, /* nuker */ - emacs_gtk_boxed_equality, /* equality */ - emacs_gtk_boxed_hash, /* hash */ - NULL, /* desc */ + emacs_gtk_boxed_equality, + emacs_gtk_boxed_hash, + emacs_gtk_boxed_description, 0, /* get prop */ 0, /* put prop */ 0, /* rem prop */ 0, /* plist */ emacs_gtk_boxed_data); -#endif /* not USE_KKCC */ /* Currently defined GTK_TYPE_BOXED structures are: GtkAccelGroup - Index: src/unexcw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unexcw.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/unexcw.c 18 Nov 2002 06:52:41 -0000 1.12 +++ src/unexcw.c 10 Jan 2003 14:12:41 -0000 1.13 @@ -47,6 +47,7 @@ #include #endif +#define STACK_SIZE 0x800000 #define ALLOC_UNIT 0xFFFF #define ALLOC_MASK ~((unsigned long) (ALLOC_UNIT)) #define ALIGN_ALLOC(addr) \ @@ -302,6 +303,9 @@ printf ("warning: new data size is < approx\n"); f_ohdr.dsize=new_data_size; f_ohdr.bsize=BSS_PAD_SIZE; + /* Prevent stack overflow with regexp usage. */ + f_ohdr.SizeOfStackReserve = STACK_SIZE; + if (write (a_new, &f_ohdr, sizeof (f_ohdr)) != sizeof (f_ohdr)) PERROR ("failed to write optional header"); /* write text as is */ Index: src/unexnt.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unexnt.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/unexnt.c 5 Jun 2002 09:57:30 -0000 1.15 +++ src/unexnt.c 12 Jan 2003 11:08:22 -0000 1.16 @@ -1,5 +1,6 @@ /* unexec for XEmacs on Windows NT. Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 2002 Ben Wing. This file is part of XEmacs. @@ -108,16 +109,18 @@ code supplied by NT (primarily because that code relies upon malloc ()). */ /* ********************** - Hackers please remember, this _start() thingy is *not* called neither - when dumping portably, nor when running from temacs! Do not put + Hackers please remember, this _start() thingy is *not* called either + when dumping portably, or when running from temacs! Do not put significant XEmacs initialization here! ********************** */ -void +EXTERN_C void mainCRTStartup (void); + +EXTERN_C int _start (void); + +int _start (void) { - extern void mainCRTStartup (void); - /* Cache system info, e.g., the NT page size. */ cache_system_info (); /* Set OS type, so that tchar stuff below works */ @@ -172,6 +175,7 @@ #endif mainCRTStartup (); + return 0; /* not reached? */ } /* Dump out .data and .bss sections into a new executable. */ @@ -190,13 +194,13 @@ ".exe" extension...patch them up if they don't. */ qxestrcpy (in_filename, old_name); ptr = in_filename + qxestrlen (in_filename) - 4; - if (qxestrcmp (ptr, ".exe")) - qxestrcat (in_filename, ".exe"); + if (qxestrcmp_c (ptr, ".exe")) + qxestrcat_c (in_filename, ".exe"); qxestrcpy (out_filename, new_name); ptr = out_filename + qxestrlen (out_filename) - 4; - if (qxestrcmp (ptr, ".exe")) - qxestrcat (out_filename, ".exe"); + if (qxestrcmp_c (ptr, ".exe")) + qxestrcat_c (out_filename, ".exe"); stdout_out ("Dumping from %s\n", in_filename); stdout_out (" to %s\n", out_filename); @@ -359,7 +363,7 @@ for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) { #ifndef DUMP_SEPARATE_SECTION - if (!strcmp (section->Name, ".bss")) + if (!qxestrcmp_c (section->Name, ".bss")) { extern int my_ebss; /* From lastfile.c */ @@ -369,9 +373,9 @@ bss_size = (UChar_Binary*) &my_ebss - (UChar_Binary*) bss_start; } - if (!strcmp (section->Name, ".data")) + if (!qxestrcmp_c (section->Name, ".data")) #else - if (!strcmp (section->Name, "xdata")) + if (!qxestrcmp_c (section->Name, "xdata")) #endif { extern Char_Binary my_edata[]; /* From lastfile.c */ Index: src/unicode.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unicode.c,v retrieving revision 1.12 retrieving revision 1.15 diff -u -r1.12 -r1.15 --- src/unicode.c 1 Sep 2002 06:41:45 -0000 1.12 +++ src/unicode.c 13 Feb 2003 09:57:08 -0000 1.15 @@ -1,5 +1,5 @@ /* Code to handle Unicode conversion. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -173,108 +173,92 @@ static short ***from_unicode_blank_3; static short ****from_unicode_blank_4; -#if 0 - -static const struct lrecord_description to_unicode_level_0_desc[] = { +static const struct memory_description to_unicode_level_0_desc_1[] = { { XD_END } }; -static const struct struct_description to_unicode_level_0_ptr_desc = { - sizeof (int), to_unicode_level_0_desc +static const struct sized_memory_description to_unicode_level_0_desc = { + sizeof (int), to_unicode_level_0_desc_1 }; -static const struct lrecord_description to_unicode_level_1_desc[] = { - { XD_STRUCT_PTR, 0, 96, &to_unicode_level_0_ptr_desc }, +static const struct memory_description to_unicode_level_1_desc_1[] = { + { XD_STRUCT_PTR, 0, 96, &to_unicode_level_0_desc }, { XD_END } }; -static const struct struct_description to_unicode_level_1_ptr_desc = { - 0, to_unicode_level_1_desc +static const struct sized_memory_description to_unicode_level_1_desc = { + sizeof (void *), to_unicode_level_1_desc_1 }; -static const struct lrecord_description to_unicode_level_2_desc[] = { - { XD_STRUCT_PTR, 0, 96, &to_unicode_level_1_ptr_desc }, +static const struct memory_description to_unicode_description_1[] = { + { XD_STRUCT_PTR, 1, 96, &to_unicode_level_0_desc }, + { XD_STRUCT_PTR, 2, 96, &to_unicode_level_1_desc }, { XD_END } }; /* Not static because each charset has a set of to and from tables and needs to describe them to pdump. */ -const struct struct_description to_unicode_description[] = { - { 1, to_unicode_level_1_desc }, - { 2, to_unicode_level_2_desc }, - { XD_END } +const struct sized_memory_description to_unicode_description = { + sizeof (void *), to_unicode_description_1 }; -static const struct lrecord_description from_unicode_level_0_desc[] = { +static const struct memory_description from_unicode_level_0_desc_1[] = { { XD_END } }; -static const struct struct_description from_unicode_level_0_ptr_desc = { - sizeof (short), from_unicode_level_0_desc +static const struct sized_memory_description from_unicode_level_0_desc = { + sizeof (short), from_unicode_level_0_desc_1 }; -static const struct lrecord_description from_unicode_level_1_desc[] = { - { XD_STRUCT_PTR, 0, 256, &from_unicode_level_0_ptr_desc }, +static const struct memory_description from_unicode_level_1_desc_1[] = { + { XD_STRUCT_PTR, 0, 256, &from_unicode_level_0_desc }, { XD_END } }; -static const struct struct_description from_unicode_level_1_ptr_desc = { - 0, from_unicode_level_1_desc +static const struct sized_memory_description from_unicode_level_1_desc = { + sizeof (void *), from_unicode_level_1_desc_1 }; -static const struct lrecord_description from_unicode_level_2_desc[] = { - { XD_STRUCT_PTR, 0, 256, &from_unicode_level_1_ptr_desc }, +static const struct memory_description from_unicode_level_2_desc_1[] = { + { XD_STRUCT_PTR, 0, 256, &from_unicode_level_1_desc }, { XD_END } }; -static const struct struct_description from_unicode_level_2_ptr_desc = { - 0, from_unicode_level_2_desc +static const struct sized_memory_description from_unicode_level_2_desc = { + sizeof (void *), from_unicode_level_2_desc_1 }; -static const struct lrecord_description from_unicode_level_3_desc[] = { - { XD_STRUCT_PTR, 0, 256, &from_unicode_level_2_ptr_desc }, +static const struct memory_description from_unicode_level_3_desc_1[] = { + { XD_STRUCT_PTR, 0, 256, &from_unicode_level_2_desc }, { XD_END } }; -static const struct struct_description from_unicode_level_3_ptr_desc = { - 0, from_unicode_level_3_desc +static const struct sized_memory_description from_unicode_level_3_desc = { + sizeof (void *), from_unicode_level_3_desc_1 }; -static const struct lrecord_description from_unicode_level_4_desc[] = { - { XD_STRUCT_PTR, 0, 256, &from_unicode_level_3_ptr_desc }, +static const struct memory_description from_unicode_description_1[] = { + { XD_STRUCT_PTR, 1, 256, &from_unicode_level_0_desc }, + { XD_STRUCT_PTR, 2, 256, &from_unicode_level_1_desc }, + { XD_STRUCT_PTR, 3, 256, &from_unicode_level_2_desc }, + { XD_STRUCT_PTR, 4, 256, &from_unicode_level_3_desc }, { XD_END } }; /* Not static because each charset has a set of to and from tables and needs to describe them to pdump. */ -const struct struct_description from_unicode_description[] = { - { 1, from_unicode_level_1_desc }, - { 2, from_unicode_level_2_desc }, - { 3, from_unicode_level_3_desc }, - { 4, from_unicode_level_4_desc }, - { XD_END } +const struct sized_memory_description from_unicode_description = { + sizeof (void *), from_unicode_description_1 }; -#endif /* 0 */ - static Lisp_Object_dynarr *unicode_precedence_dynarr; -static const struct lrecord_description lo_description_1[] = { - { XD_LISP_OBJECT, 0 }, +static const struct memory_description lod_description_1[] = { + XD_DYNARR_DESC (Lisp_Object_dynarr, &lisp_object_description), { XD_END } }; -static const struct struct_description lo_description = { - sizeof (Lisp_Object), - lo_description_1 -}; - -static const struct lrecord_description lod_description_1[] = { - XD_DYNARR_DESC (Lisp_Object_dynarr, &lo_description), - { XD_END } -}; - -static const struct struct_description lisp_object_dynarr_description = { +static const struct sized_memory_description lisp_object_dynarr_description = { sizeof (Lisp_Object_dynarr), lod_description_1 }; @@ -1463,7 +1447,6 @@ /************************************************************************/ /* ISO 10646 UTF-16, UCS-4, UTF-8, UTF-7, etc. */ -DEFINE_CODING_SYSTEM_TYPE (unicode); enum unicode_type { @@ -1504,10 +1487,12 @@ int wrote_bom; }; -static const struct lrecord_description unicode_coding_system_description[] = { +static const struct memory_description unicode_coding_system_description[] = { { XD_END } }; +DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (unicode); + /* Decode a UCS-2 or UCS-4 character into a buffer. If the lookup fails, use (U+3013) of JIS X 0208, which means correct character is not found, instead. @@ -1980,6 +1965,8 @@ int byteno; int prev_char; int text, rev_text; + int sep, rev_sep; + int num_ascii; }; static void @@ -2009,12 +1996,19 @@ && (prevc == '\r' || prevc == '\n' || (prevc >= 0x20 && prevc <= 0x7E))) data->rev_text++; + /* #### 0x2028 is LINE SEPARATOR and 0x2029 is PARAGRAPH SEPARATOR. + I used to count these in text and rev_text but that is very bad, + as 0x2028 is also space + left-paren in ASCII, which is extremely + common. So, what do we do with these? */ if (prevc == 0x20 && (c == 0x28 || c == 0x29)) - data->text++; + data->sep++; if (c == 0x20 && (prevc == 0x28 || prevc == 0x29)) - data->rev_text++; + data->rev_sep++; } + if ((c >= ' ' && c <= '~') || c == '\n' || c == '\r' || c == '\t' || + c == '\f' || c == '\v') + data->num_ascii++; data->byteno++; data->prev_char = c; } @@ -2078,7 +2072,20 @@ DET_RESULT (st, utf_16_little_endian) = DET_SOMEWHAT_LIKELY; } else - SET_DET_RESULTS (st, utf_16, DET_AS_LIKELY_AS_UNLIKELY); + { + /* #### FUCKME! There should really be an ASCII detector. This + would rule out the need to have this built-in here as + well. --ben */ + int pct_ascii = data->byteno ? (100 * data->num_ascii) / data->byteno + : 100; + + if (pct_ascii > 90) + SET_DET_RESULTS (st, utf_16, DET_QUITE_IMPROBABLE); + else if (pct_ascii > 75) + SET_DET_RESULTS (st, utf_16, DET_SOMEWHAT_UNLIKELY); + else + SET_DET_RESULTS (st, utf_16, DET_AS_LIKELY_AS_UNLIKELY); + } } } @@ -2087,7 +2094,16 @@ int byteno; int first_byte; int second_byte; + int prev_byte; int in_utf_8_byte; + int recent_utf_8_sequence; + int seen_bogus_utf8; + int seen_really_bogus_utf8; + int seen_2byte_sequence; + int seen_longer_sequence; + int seen_iso2022_esc; + int seen_iso_shift; + int seen_utf_bom:1; }; static void @@ -2111,23 +2127,17 @@ if (data->first_byte == 0xef && data->second_byte == 0xbb && c == 0xbf) - { - SET_DET_RESULTS (st, utf_8, DET_NEARLY_IMPOSSIBLE); - DET_RESULT (st, utf_8_bom) = DET_NEAR_CERTAINTY; - return; - } + data->seen_utf_bom = 1; break; } switch (data->in_utf_8_byte) { case 0: - if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO) - { - SET_DET_RESULTS (st, utf_8, DET_NEARLY_IMPOSSIBLE); - DET_RESULT (st, utf_8) = DET_SOMEWHAT_UNLIKELY; - return; - } + if (data->prev_byte == ISO_CODE_ESC && c >= 0x28 && c <= 0x2F) + data->seen_iso2022_esc++; + else if (c == ISO_CODE_SI || c == ISO_CODE_SO) + data->seen_iso_shift++; else if (c >= 0xfc) data->in_utf_8_byte = 5; else if (c >= 0xf8) @@ -2139,26 +2149,64 @@ else if (c >= 0xc0) data->in_utf_8_byte = 1; else if (c >= 0x80) - { - SET_DET_RESULTS (st, utf_8, DET_NEARLY_IMPOSSIBLE); - DET_RESULT (st, utf_8) = DET_SOMEWHAT_UNLIKELY; - return; - } + data->seen_bogus_utf8++; + if (data->in_utf_8_byte > 0) + data->recent_utf_8_sequence = data->in_utf_8_byte; break; default: if ((c & 0xc0) != 0x80) + data->seen_really_bogus_utf8++; + else { - SET_DET_RESULTS (st, utf_8, DET_NEARLY_IMPOSSIBLE); - DET_RESULT (st, utf_8) = DET_SOMEWHAT_UNLIKELY; - return; + data->in_utf_8_byte--; + if (data->in_utf_8_byte == 0) + { + if (data->recent_utf_8_sequence == 1) + data->seen_2byte_sequence++; + else + { + assert (data->recent_utf_8_sequence >= 2); + data->seen_longer_sequence++; + } + } } - else - data->in_utf_8_byte--; } data->byteno++; + data->prev_byte = c; + } + + /* either BOM or no BOM, but not both */ + SET_DET_RESULTS (st, utf_8, DET_NEARLY_IMPOSSIBLE); + + + if (data->seen_utf_bom) + DET_RESULT (st, utf_8_bom) = DET_NEAR_CERTAINTY; + else + { + if (data->seen_really_bogus_utf8 || + data->seen_bogus_utf8 >= 2) + ; /* bogus */ + else if (data->seen_bogus_utf8) + DET_RESULT (st, utf_8) = DET_SOMEWHAT_UNLIKELY; + else if ((data->seen_longer_sequence >= 5 || + data->seen_2byte_sequence >= 10) && + (!(data->seen_iso2022_esc + data->seen_iso_shift) || + (data->seen_longer_sequence * 2 + data->seen_2byte_sequence) / + (data->seen_iso2022_esc + data->seen_iso_shift) >= 10)) + /* heuristics, heuristics, we love heuristics */ + DET_RESULT (st, utf_8) = DET_QUITE_PROBABLE; + else if (data->seen_iso2022_esc || + data->seen_iso_shift >= 3) + DET_RESULT (st, utf_8) = DET_SOMEWHAT_UNLIKELY; + else if (data->seen_longer_sequence || + data->seen_2byte_sequence) + DET_RESULT (st, utf_8) = DET_SOMEWHAT_LIKELY; + else if (data->seen_iso_shift) + DET_RESULT (st, utf_8) = DET_SOMEWHAT_UNLIKELY; + else + DET_RESULT (st, utf_8) = DET_AS_LIKELY_AS_UNLIKELY; } - SET_DET_RESULTS (st, utf_8, DET_SOMEWHAT_LIKELY); } static void @@ -2351,15 +2399,5 @@ unicode_precedence_dynarr = Dynarr_new (Lisp_Object); dump_add_root_struct_ptr (&unicode_precedence_dynarr, &lisp_object_dynarr_description); -#if 0 - dump_add_root_thing (&to_unicode_blank_1, to_unicode_level_1_desc); - dump_add_root_thing (&to_unicode_blank_2, to_unicode_level_2_desc); - - dump_add_root_thing (&from_unicode_blank_1, from_unicode_level_1_desc); - dump_add_root_thing (&from_unicode_blank_2, from_unicode_level_2_desc); - dump_add_root_thing (&from_unicode_blank_3, from_unicode_level_3_desc); - dump_add_root_thing (&from_unicode_blank_4, from_unicode_level_4_desc); -#endif - #endif /* MULE */ } Index: src/window.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/window.c,v retrieving revision 1.70 retrieving revision 1.73 diff -u -r1.70 -r1.73 --- src/window.c 16 Dec 2002 02:32:54 -0000 1.70 +++ src/window.c 9 Feb 2003 09:33:48 -0000 1.73 @@ -147,10 +147,106 @@ } while (0) -#define MARK_DISP_VARIABLE(field) \ - mark_object (window->field[CURRENT_DISP]); \ - mark_object (window->field[DESIRED_DISP]); \ - mark_object (window->field[CMOTION_DISP]); + +static const struct memory_description int_description_1[] = { + { XD_END } +}; + +static const struct sized_memory_description int_description = { + sizeof (int), + int_description_1 +}; + +static const struct memory_description int_dynarr_description_1[] = { + XD_DYNARR_DESC (int_dynarr, &int_description), + { XD_END } +}; + +static const struct sized_memory_description int_dynarr_description = { + sizeof (int_dynarr), + int_dynarr_description_1 +}; + +static const struct memory_description face_cachel_description_1[] = { + { XD_STRUCT_PTR, offsetof (face_cachel, merged_faces), + 1, &int_dynarr_description }, + { XD_LISP_OBJECT, offsetof (face_cachel, face) }, + { XD_LISP_OBJECT, offsetof (face_cachel, foreground) }, + { XD_LISP_OBJECT, offsetof (face_cachel, background) }, + { XD_LISP_OBJECT_ARRAY, offsetof (face_cachel, font), NUM_LEADING_BYTES }, + { XD_LISP_OBJECT, offsetof (face_cachel, display_table) }, + { XD_LISP_OBJECT, offsetof (face_cachel, background_pixmap) }, + { XD_END } +}; + +static const struct sized_memory_description face_cachel_description = { + sizeof (face_cachel), + face_cachel_description_1 +}; + +static const struct memory_description face_cachel_dynarr_description_1[] = { + XD_DYNARR_DESC (face_cachel_dynarr, &face_cachel_description), + { XD_END } +}; + +static const struct sized_memory_description face_cachel_dynarr_description = { + sizeof (face_cachel_dynarr), + face_cachel_dynarr_description_1 +}; + +static const struct memory_description glyph_cachel_description_1[] = { + { XD_LISP_OBJECT, offsetof (glyph_cachel, glyph) }, + { XD_END } +}; + +static const struct sized_memory_description glyph_cachel_description = { + sizeof (glyph_cachel), + glyph_cachel_description_1 +}; + +static const struct memory_description glyph_cachel_dynarr_description_1[] = { + XD_DYNARR_DESC (glyph_cachel_dynarr, &glyph_cachel_description), + { XD_END } +}; + +static const struct sized_memory_description glyph_cachel_dynarr_description = { + sizeof (glyph_cachel_dynarr), + glyph_cachel_dynarr_description_1 +}; + +static const struct memory_description line_start_cache_description_1[] = { + { XD_END } +}; + +static const struct sized_memory_description line_start_cache_description = { + sizeof (line_start_cache), + line_start_cache_description_1 +}; + +static const struct memory_description line_start_cache_dynarr_description_1[] = { + XD_DYNARR_DESC (line_start_cache_dynarr, &line_start_cache_description), + { XD_END } +}; + +static const struct sized_memory_description line_start_cache_dynarr_description = { + sizeof (line_start_cache_dynarr), + line_start_cache_dynarr_description_1 +}; + +static const struct memory_description window_description [] = { +#define WINDOW_SLOT(slot) { XD_LISP_OBJECT, offsetof (struct window, slot) }, +#define WINDOW_SLOT_ARRAY(slot, size) \ + { XD_LISP_OBJECT_ARRAY, offsetof (struct window, slot), size }, +#include "winslots.h" + + { XD_STRUCT_PTR, offsetof (struct window, face_cachels), + 1, &face_cachel_dynarr_description }, + { XD_STRUCT_PTR, offsetof (struct window, glyph_cachels), + 1, &glyph_cachel_dynarr_description }, + { XD_STRUCT_PTR, offsetof (struct window, line_start_cache), + 1, &line_start_cache_dynarr_description }, + { XD_END } +}; static Lisp_Object mark_window (Lisp_Object obj) @@ -225,16 +321,10 @@ return make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQ); } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("window", window, 0, /*dumpable-flag*/ mark_window, print_window, finalize_window, - 0, 0, 0, struct window); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("window", window, - mark_window, print_window, finalize_window, - 0, 0, 0, struct window); -#endif /* not USE_KKCC */ + 0, 0, window_description, struct window); #define INIT_DISP_VARIABLE(field, initialization) \ p->field[CURRENT_DISP] = initialization; \ @@ -253,13 +343,8 @@ Lisp_Object allocate_window (void) { - Lisp_Object val; struct window *p = alloc_lcrecord_type (struct window, &lrecord_window); - - zero_lcrecord (p); - val = wrap_window (p); - - p->dead = 0; + Lisp_Object val = wrap_window (p); #define WINDOW_SLOT(slot) p->slot = Qnil; #include "winslots.h" @@ -280,14 +365,6 @@ p->subwindow_instance_cache = make_image_instance_cache_hash_table (); p->line_cache_last_updated = Qzero; - INIT_DISP_VARIABLE (last_point_x, 0); - INIT_DISP_VARIABLE (last_point_y, 0); - INIT_DISP_VARIABLE (window_end_pos, 0); - - p->gutter_extent_modiff[0] = 0; - p->gutter_extent_modiff[1] = 0; - p->gutter_extent_modiff[2] = 0; - p->gutter_extent_modiff[3] = 0; p->windows_changed = 1; p->shadow_thickness_changed = 1; @@ -336,11 +413,28 @@ because neither structure is created very often (only when windows are created or deleted). --ben */ -#ifdef USE_KKCC -static const struct lrecord_description window_mirror_description [] = { +static const struct memory_description window_mirror_description [] = { + { XD_LISP_OBJECT, offsetof (struct window_mirror, frame) }, + { XD_LISP_OBJECT, offsetof (struct window_mirror, next) }, + { XD_LISP_OBJECT, offsetof (struct window_mirror, hchild) }, + { XD_LISP_OBJECT, offsetof (struct window_mirror, vchild) }, + + { XD_STRUCT_PTR, offsetof (struct window_mirror, current_display_lines), + 1, &display_line_dynarr_description }, + { XD_STRUCT_PTR, offsetof (struct window_mirror, desired_display_lines), + 1, &display_line_dynarr_description }, + + { XD_LISP_OBJECT, offsetof (struct window_mirror, buffer) }, + +#ifdef HAVE_SCROLLBARS + { XD_LISP_OBJECT, offsetof (struct window_mirror, + scrollbar_vertical_instance) }, + { XD_LISP_OBJECT, offsetof (struct window_mirror, + scrollbar_horizontal_instance) }, +#endif /* HAVE_SCROLLBARS */ + { XD_END } }; -#endif /* USE_KKCC */ static Lisp_Object mark_window_mirror (Lisp_Object obj) @@ -374,16 +468,11 @@ return Qnil; } -#ifdef USE_KKCC DEFINE_LRECORD_IMPLEMENTATION ("window-mirror", window_mirror, 0, /*dumpable-flag*/ mark_window_mirror, internal_object_printer, - 0, 0, 0, 0/*window_mirror_description*/, struct window_mirror); -#else /* not USE_KKCC */ -DEFINE_LRECORD_IMPLEMENTATION ("window-mirror", window_mirror, - mark_window_mirror, internal_object_printer, - 0, 0, 0, 0, struct window_mirror); -#endif /* not USE_KKCC */ + 0, 0, 0, window_mirror_description, + struct window_mirror); /* Create a new window mirror structure and associated redisplay structs. */ @@ -392,7 +481,6 @@ { struct window_mirror *t = alloc_lcrecord_type (struct window_mirror, &lrecord_window_mirror); - zero_lcrecord (t); t->frame = f; t->current_display_lines = Dynarr_new (display_line); @@ -420,7 +508,7 @@ if (!mir) mir = new_window_mirror (XFRAME (XWINDOW (win)->frame)); - mir->next = update_mirror_internal (XWINDOW (win)->next, mir->next); + mir->next = update_mirror_internal (XWINDOW (win)->next, mir->next); mir->hchild = update_mirror_internal (XWINDOW (win)->hchild, mir->hchild); mir->vchild = update_mirror_internal (XWINDOW (win)->vchild, mir->vchild); @@ -1540,7 +1628,7 @@ needed += ((hlimit - height)*(nelt - elt) + height-1)/height + 3; } - RETURN_NOT_REACHED(make_int (0)) /* shut up compiler */ + RETURN_NOT_REACHED(make_int (0)); /* shut up compiler */ } DEFUN ("window-width", Fwindow_width, 0, 1, 0, /* @@ -1651,34 +1739,6 @@ return ncol; } -#if 0 /* bogus FSF crock */ - -DEFUN ("window-redisplay-end-trigger", - Fwindow_redisplay_end_trigger, 0, 1, 0, /* -Return WINDOW's redisplay end trigger value. -See `set-window-redisplay-end-trigger' for more information. -*/ - (window)) -{ - return decode_window (window)->redisplay_end_trigger; -} - -DEFUN ("set-window-redisplay-end-trigger", - Fset_window_redisplay_end_trigger, 2, 2, 0, /* -Set WINDOW's redisplay end trigger value to VALUE. -VALUE should be a buffer position (typically a marker) or nil. -If it is a buffer position, then if redisplay in WINDOW reaches a position -beyond VALUE, the functions in `redisplay-end-trigger-functions' are called -with two arguments: WINDOW, and the end trigger value. -Afterwards the end-trigger value is reset to nil. -*/ - (window, value)) -{ - return (decode_window (window)->redisplay_end_trigger = value); -} - -#endif /* 0 */ - DEFUN ("window-pixel-edges", Fwindow_pixel_edges, 0, 1, 0, /* Return a list of the pixel edge coordinates of WINDOW. The returned list is of the form (LEFT TOP RIGHT BOTTOM), @@ -2062,6 +2122,20 @@ note_object_deleted (wrap_window (w)); } +/* Check if window contains pwindow. */ + +static int +contains_window (Lisp_Object window, Lisp_Object pwindow) +{ + while (!NILP (pwindow)) + { + if (EQ (window, pwindow)) + return 1; + pwindow = XWINDOW (pwindow)->parent; + } + return 0; +} + DEFUN ("delete-window", Fdelete_window, 0, 2, "", /* Remove WINDOW from the display. Default is selected window. If window is the only one on its frame, the frame is deleted as well. @@ -2138,35 +2212,27 @@ So, we check by scanning all the ancestors of the frame's selected window and comparing each one with WINDOW. */ - { - Lisp_Object pwindow; - - pwindow = FRAME_SELECTED_WINDOW (f); - - while (!NILP (pwindow)) - { - if (EQ (window, pwindow)) - break; - pwindow = XWINDOW (pwindow)->parent; - } + if (contains_window (window, FRAME_SELECTED_WINDOW (f))) + { + Lisp_Object alternative; + alternative = Fnext_window (window, Qlambda, Qnil, Qnil); + + /* #### */ + /* If we're about to delete the selected window on the + selected frame, then we should use Fselect_window to select + the new window. On the other hand, if we're about to + delete the selected window on any other frame, we shouldn't do + anything but set the frame's selected_window slot. */ + if (EQ (frame, Fselected_frame (Qnil))) + Fselect_window (alternative, Qnil); + else + set_frame_selected_window (f, alternative); + } - if (EQ (window, pwindow)) - { - /* OK, we found it. */ - Lisp_Object alternative; - alternative = Fnext_window (window, Qlambda, Qnil, Qnil); - - /* If we're about to delete the selected window on the - selected frame, then we should use Fselect_window to select - the new window. On the other hand, if we're about to - delete the selected window on any other frame, we shouldn't do - anything but set the frame's selected_window slot. */ - if (EQ (frame, Fselected_frame (Qnil))) - Fselect_window (alternative, Qnil); - else - set_frame_selected_window (f, alternative); - } - } + /* Some display parameters (gutter display specifically) depend on + FRAME_LAST_NONMINIBUF (f) to be set to a live window. Ensure that. */ + if (contains_window (window, FRAME_LAST_NONMINIBUF_WINDOW (f))) + f->last_nonminibuf_window = Fnext_window (window, Qlambda, Qnil, Qnil); /* w->buffer is nil in a non-leaf window; in this case, get rid of the markers we maintain that point into that buffer. */ @@ -3106,11 +3172,15 @@ (window)) { struct window *w = decode_window (window); - struct buffer *b = XBUFFER (w->buffer); + struct buffer *b; Charbpos start_pos; int old_top = WINDOW_TOP (w); + if (NILP (WINDOW_BUFFER (w))) + invalid_operation ("Can't delete other windows of combination", window); + window = wrap_window (w); + b = XBUFFER (WINDOW_BUFFER (w)); if (MINI_WINDOW_P (w) && old_top > 0) invalid_operation ("Can't expand minibuffer to full frame", Qunbound); @@ -5306,10 +5376,6 @@ DEFSUBR (Fset_window_hscroll); DEFSUBR (Fmodeline_hscroll); DEFSUBR (Fset_modeline_hscroll); -#if 0 /* bogus FSF crock */ - DEFSUBR (Fwindow_redisplay_end_trigger); - DEFSUBR (Fset_window_redisplay_end_trigger); -#endif DEFSUBR (Fwindow_pixel_edges); DEFSUBR (Fwindow_text_area_pixel_edges); DEFSUBR (Fwindow_point); Index: src/winslots.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/winslots.h,v retrieving revision 1.9 retrieving revision 1.11 diff -u -r1.9 -r1.11 --- src/winslots.h 16 May 2002 13:30:32 -0000 1.9 +++ src/winslots.h 9 Feb 2003 09:33:48 -0000 1.11 @@ -42,34 +42,45 @@ either EQ or EQUAL_WRAPPED (i.e. Feq() or Fequal()). WINDOW_SAVED_SLOT_ARRAY is the same for an array of Lisp_Objects. - Callers should define WINDOW_SLOT (with a terminating semicolon if - not blank), and WINDOW_SAVED_SLOT if different; otherwise the - latter will be defined using WINDOW_SLOT. Callers do not define - the _ARRAY versions. Instead, they either do or do not define - WINDOW_SLOT_DECLARATION. It should be defined in the definition of - a struct and not elsewhere. + Callers should define WINDOW_SLOT (with a terminating semicolon if not + blank), and WINDOW_SAVED_SLOT if different; otherwise the latter will be + defined using WINDOW_SLOT. Callers should also either (a) do nothing + else (which defines WINDOW_SLOT_ARRAY using a for() loop, appropriate + for normal code), define WINDOW_SLOT_DECLARATION (which defines + WINDOW_SLOT_ARRAY using WINDOW_SLOT (slot[size]), appropriate for a + struct definition), or define WINDOW_SLOT_ARRAY themselves. In the + first two cases, WINDOW_SAVED_SLOT_ARRAY will be defined in the same + fashion, using WINDOW_SAVED_SLOT. In the last case, if + WINDOW_SAVED_SLOT is defined, the caller must provide an appropriate + definition of WINDOW_SAVED_SLOT_ARRAY; otherwise, it will be defined + using WINDOW_SLOT_ARRAY. Callers do not need to undefine these definitions; it is done automatically. */ -#ifndef WINDOW_SAVED_SLOT -#define WINDOW_SAVED_SLOT(slot, compare) WINDOW_SLOT (slot) -#endif - -#ifdef WINDOW_SLOT_DECLARATION -#define WINDOW_SLOT_ARRAY(slot, size) WINDOW_SLOT (slot[size]) -#define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) \ +#ifdef WINDOW_SLOT_ARRAY +# ifndef WINDOW_SAVED_SLOT_ARRAY +# ifdef WINDOW_SAVED_SLOT +# error must define WINDOW_SAVED_SLOT_ARRAY if WINDOW_SAVED_SLOT and WINDOW_SLOT_ARRAY are defined +# else +# define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) \ + WINDOW_SLOT_ARRAY (slot, size) +# endif /* WINDOW_SAVED_SLOT */ +# endif /* not WINDOW_SAVED_SLOT_ARRAY */ +#elif defined (WINDOW_SLOT_DECLARATION) /* not WINDOW_SLOT_ARRAY */ +# define WINDOW_SLOT_ARRAY(slot, size) WINDOW_SLOT (slot[size]) +# define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) \ WINDOW_SAVED_SLOT (slot[size], compare) -#else -#define WINDOW_SLOT_ARRAY(slot, size) do { \ +#else /* not WINDOW_SLOT_DECLARATION, not WINDOW_SLOT_ARRAY */ +# define WINDOW_SLOT_ARRAY(slot, size) do { \ int wsaidx; \ for (wsaidx = 0; wsaidx < size; wsaidx++) \ { \ WINDOW_SLOT (slot[wsaidx]); \ } \ } while (0); -#define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) do { \ +# define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) do { \ int wsaidx; \ for (wsaidx = 0; wsaidx < size; wsaidx++) \ { \ @@ -78,6 +89,10 @@ } while (0); #endif /* WINDOW_SLOT_DECLARATION */ +#ifndef WINDOW_SAVED_SLOT +#define WINDOW_SAVED_SLOT(slot, compare) WINDOW_SLOT (slot) +#endif + #define EQUAL_WRAPPED(x,y) internal_equal ((x), (y), 0) @@ -148,10 +163,6 @@ WINDOW_SLOT (subwindow_instance_cache) WINDOW_SLOT (line_cache_last_updated) - - /* If redisplay in this window goes beyond this buffer position, - must run the redisplay-end-trigger-functions. */ - WINDOW_SLOT (redisplay_end_trigger) /*** Non-specifier vars of window and window config ***/ Index: src/xintrinsicp.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/xintrinsicp.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/xintrinsicp.h 12 Apr 2001 18:24:30 -0000 1.2 +++ src/xintrinsicp.h 14 Feb 2003 07:38:30 -0000 1.3 @@ -26,4 +26,8 @@ #include #include /* apparently some IntrinsicP.h don't have this */ +#ifndef XtExposeNoRegion +#define XtExposeNoRegion 0 +#endif + #endif /* INCLUDED_xintrinsicp_h_ */ Index: src/s/cygwin.sc =================================================================== RCS file: src/s/cygwin.sc diff -N src/s/cygwin.sc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/s/cygwin.sc 15 Jan 2003 08:46:22 -0000 1.2 @@ -0,0 +1,112 @@ +/* Default linker script, for normal executables */ +OUTPUT_FORMAT(pei-i386) +SEARCH_DIR("/usr/i686-pc-cygwin/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/lib/w32api"); +ENTRY(_mainCRTStartup) +SECTIONS +{ + .text __image_base__ + __section_alignment__ : + { + *(.init) + *(.text) + *(SORT(.text$*)) + *(.glue_7t) + *(.glue_7) + ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; + LONG (-1); *(SORT(.ctors.*)); *(.ctors); *(.ctor); LONG (0); + ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; + LONG (-1); *(SORT(.dtors.*)); *(.dtors); *(.dtor); LONG (0); + *(.fini) + /* ??? Why is .gcc_exc here? */ + *(.gcc_exc) + etext = .; + *(.gcc_except_table) + } + /* The Cygwin32 library uses a section to avoid copying certain data + on fork. This used to be named ".data". The linker used + to include this between __data_start__ and __data_end__, but that + breaks building the cygwin32 dll. Instead, we name the section + ".data_cygwin_nocopy" and explictly include it after __data_end__. */ + .data BLOCK(__section_alignment__) : + { + __data_start__ = . ; + *(.data) + *(.data2) + *(SORT(.data$*)) + __data_end__ = . ; + *(.data_cygwin_nocopy) + } + .bss BLOCK(__section_alignment__) : + { + __bss_start__ = . ; + *(.bss) + *(COMMON) + __bss_end__ = . ; + } + .rdata BLOCK(__section_alignment__) : + { + *(.rdata) + *(SORT(.rdata$*)) + *(.eh_frame) + ___RUNTIME_PSEUDO_RELOC_LIST__ = .; + __RUNTIME_PSEUDO_RELOC_LIST__ = .; + *(.rdata_runtime_pseudo_reloc) + ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .; + __RUNTIME_PSEUDO_RELOC_LIST_END__ = .; + } + .pdata BLOCK(__section_alignment__) : + { + *(.pdata) + } + .edata BLOCK(__section_alignment__) : + { + *(.edata) + } + /DISCARD/ : + { + *(.debug$S) + *(.debug$T) + *(.debug$F) + *(.drectve) + } + .idata BLOCK(__section_alignment__) : + { + /* This cannot currently be handled with grouped sections. + See pe.em:sort_sections. */ + SORT(*)(.idata$2) + SORT(*)(.idata$3) + /* These zeroes mark the end of the import list. */ + LONG (0); LONG (0); LONG (0); LONG (0); LONG (0); + SORT(*)(.idata$4) + SORT(*)(.idata$5) + SORT(*)(.idata$6) + SORT(*)(.idata$7) + } + .CRT BLOCK(__section_alignment__) : + { + *(SORT(.CRT$*)) + } + .endjunk BLOCK(__section_alignment__) : + { + /* end is deprecated, don't use it */ + end = .; + _end = .; + __end__ = .; + } + .rsrc BLOCK(__section_alignment__) : + { + *(.rsrc) + *(SORT(.rsrc$*)) + } + .reloc BLOCK(__section_alignment__) : + { + *(.reloc) + } + .stab BLOCK(__section_alignment__) (NOLOAD) : + { + [ .stab ] + } + .stabstr BLOCK(__section_alignment__) (NOLOAD) : + { + [ .stabstr ] + } +} Index: src/s/darwin.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/s/darwin.h,v retrieving revision 1.1 retrieving revision 1.3 diff -u -r1.1 -r1.3 Index: src/s/windowsnt.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/s/windowsnt.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- src/s/windowsnt.h 18 Nov 2002 06:52:46 -0000 1.27 +++ src/s/windowsnt.h 5 Feb 2003 06:20:54 -0000 1.28 @@ -167,6 +167,8 @@ #define HAVE_RMDIR #define HAVE_SELECT #define HAVE_STRERROR +#define HAVE_STRLWR +#define HAVE_STRUPR #define HAVE_SOCKETS @@ -248,14 +250,12 @@ extern void __cdecl decl PRINTF_ARGS(str,idx) #endif /* MSVC 6.0 */ -/* MSVC warnings no-no crap. When adding one to this section, - 1. Think twice +/* MSVC warnings no-no crap. When adding one to this section, + 1. Think twice. 2. Insert textual description of the warning. - 3. Think twice. Undo still works */ + 3. Think again. Undo still works. */ #if (_MSC_VER >= 800) -/* 'expression' : signed/unsigned mismatch */ -/* #pragma warning ( disable : 4018 ) */ /* unnamed type definition in parentheses (Martin added a pedantically correct definition of ALIGNOF, which generates temporary anonymous structures, and MSVC complains) */ Index: tests/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/ChangeLog,v retrieving revision 1.25 retrieving revision 1.28 diff -u -r1.25 -r1.28 --- tests/ChangeLog 5 Jan 2003 05:13:45 -0000 1.25 +++ tests/ChangeLog 16 Feb 2003 06:13:41 -0000 1.28 @@ -1,3 +1,26 @@ +2003-02-16 Steve Youngs + + * XEmacs 21.5.11 "cabbage" is released. + +2003-01-19 Stephen J. Turnbull + + * sigpipe.c: New file. Crashes 21.1 but not 21.4 or 21.5 (I + think). Thanks to Richard Mlynarik . + +2003-01-17 Stephen J. Turnbull + + * automated/test-harness.el (test-harness-from-buffer): Move + success rate report to end of line where it's easier to see. + +2003-01-09 Stephen J. Turnbull + + * automated/mule-tests.el: Test cases for charset-in-* functions. + +2003-01-06 Stephen J. Turnbull + + * automated/regexp-tests.el (stale match data): Stale match data + persists after failed match. Thanks to . + 2003-01-04 Steve Youngs * XEmacs 21.5.10 "burdock" is released. Index: tests/sigpipe.c =================================================================== RCS file: tests/sigpipe.c diff -N tests/sigpipe.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tests/sigpipe.c 23 Jan 2003 11:24:08 -0000 1.1 @@ -0,0 +1,59 @@ +/* code is all from loser.c and loser.el by Mly + +Copyright (C) 2002 Richard Mlynarik + +This is part of XEmacs + +Compile this file. Run it in the background giving it a command line +argument PORT which is a positive integer 1024 < PORT < 32768 (avoid the +numbers assigned in /etc/services). + +Then start up a fresh (you're going to crash) XEmacs. Execute the following + +(defun lose (port) + (interactive "nUrk: ") + (require 'comint) + (while t + (condition-case e + (let* ((name "*lose*") + (b (get-buffer-create name))) + (switch-to-buffer b) + (comint-mode) + (comint-exec b name (cons "127.0.0.1" port) nil '()) + (process-send-string (get-buffer-process b) "\377\373\001") + (process-send-string (get-buffer-process b) "\377\373\001")) + (error (message "URK: %s" e)) (sit-for 1)))) + +Then M-x lose RET PORT RET and you lose big (in XEmacs 21.1, anyway). +Note: the error messages are proper functioning. What should eventually +happen after a number of SIGPIPEs is that you get a SIGSEGV and life is +bad and XEmacs is dead. +*/ + +#include + +int +main (int argc, char **argv) +{ + struct sockaddr_in junk; + int s; + + memset (&junk, 0, sizeof (junk)); + + junk.sin_family = AF_INET; + junk.sin_addr.s_addr = htonl (INADDR_ANY); /* un*x sucks */ + junk.sin_port = htons (atoi (argv[1])); /* un*x blows */ + + s = socket (PF_INET, SOCK_STREAM, 0); + + bind (s, (struct sockaddr *)&junk, sizeof (junk)); + + listen (s, 1); + + for (;;) + { + int loser = accept (s, NULL, 0); + close (loser); + } +} + Index: tests/automated/mule-tests.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/mule-tests.el,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- tests/automated/mule-tests.el 23 Jun 2002 06:53:49 -0000 1.5 +++ tests/automated/mule-tests.el 9 Jan 2003 12:49:43 -0000 1.6 @@ -327,4 +327,27 @@ (Assert (eq scaron (unicode-to-char code '(latin-iso8859-2)))))) (Check-Error wrong-type-argument (set-unicode-conversion scaron -10000))) + + ;;--------------------------------------------------------------- + ;; Test charset-in-* functions + ;;--------------------------------------------------------------- + (with-temp-buffer + (insert-file-contents (locate-data-file "HELLO")) + ;; #### 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)))) ) Index: tests/automated/regexp-tests.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/regexp-tests.el,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- tests/automated/regexp-tests.el 27 Dec 2002 06:15:01 -0000 1.5 +++ tests/automated/regexp-tests.el 9 Jan 2003 12:49:43 -0000 1.6 @@ -279,3 +279,18 @@ (Assert (not (string-match "@[A]" (string ?@ ch1)))) (Assert (eq (string-match "@[^A]" (string ?@ ch1)) 0)) (Assert (not (string-match "@?A" (string ?@ ch1)))))) + +;; More stale match data tests. +;; Thanks to . +(Assert (not (progn (string-match "a" "a") + (string-match "b" "a") + (match-string 0 "a")))) +(Assert (not (progn (string-match "a" "a") + (string-match "b" "a") + (match-string 1 "a")))) +(Assert (not (progn (string-match "\\(a\\)" "a") + (string-match "\\(b\\)" "a") + (match-string 0 "a")))) +(Assert (not (progn (string-match "\\(a\\)" "a") + (string-match "\\(b\\)" "a") + (match-string 1 "a")))) Index: tests/automated/test-harness.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/test-harness.el,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- tests/automated/test-harness.el 27 Dec 2002 06:13:18 -0000 1.8 +++ tests/automated/test-harness.el 23 Jan 2003 11:24:13 -0000 1.9 @@ -322,7 +322,7 @@ (basename (file-name-nondirectory filename)) (summary-msg (if (> total 0) - (format "%s: %d of %d (%d%%) tests successful." + (format "%s: %d of %d tests successful (%d%%)." basename passes total (/ (* 100 passes) total)) (format "%s: No tests run" basename))) (reasons ""))