# HG changeset patch # User cvs # Date 1186997702 -7200 # Node ID abe6d1db359e804505ed4a7029cbf60ff71ccf96 # Parent 72a7cfa4a488940163c1de9c4ed773a2264904fe Import from CVS: tag r21-2-36 diff -r 72a7cfa4a488 -r abe6d1db359e .cvsignore --- a/.cvsignore Mon Aug 13 11:33:40 2007 +0200 +++ b/.cvsignore Mon Aug 13 11:35:02 2007 +0200 @@ -10,3 +10,4 @@ xemacs-packages mule-packages site-packages +gmon.out diff -r 72a7cfa4a488 -r abe6d1db359e CHANGES-beta --- a/CHANGES-beta Mon Aug 13 11:33:40 2007 +0200 +++ b/CHANGES-beta Mon Aug 13 11:35:02 2007 +0200 @@ -1,3 +1,123 @@ +to 21.2.36 "Notus" +-- Fix build problems on AIX 4.3 -- Martin Buchholz +-- Fix build problems on HP-UX 10.20 -- Alexandre Oliva and Martin Buchholz +-- Fix build problems on SunOS 4.1.4 -- Martin Buchholz +-- Fix build problems on IA64/Linux -- Martin Buchholz +-- Fix build problems on Alpha/Linux -- Steve Baur +-- Fix build problems on Unixware -- Martin Buchholz +-- Support pty input lines longer than 512 bytes on HP-UX 10.20. -- Martin Buchholz +-- `equal' of hash tables is now the same as `eq'. -- Martin Buchholz +-- ucs fixes - Daiki Ueno +-- Lots of little doc fixes. -- Martin Buchholz +-- Process-signaling code rewritten -- Martin Buchholz +-- pty allocation code rewritten -- Martin Buchholz +-- The byte compiler generates more efficient code -- Martin Buchholz +-- build-report fixes -- Adrian Aichner +-- next-window/next-frame functions rewritten -- Martin Buchholz +-- Windows fixes -- Jonathan Harris +-- Multiple info buffer support -- Golubev I. N. +-- regex crash fixes -- Yoshiki Hayashi +-- Widget/windows fixes -- Andy Piper +-- structured lisp errors -- Ben Wing +-- allow modules to define their own lisp object types -- Andrew Begel + +to 21.2.35 "Nike" +-- You now again build XEmacs in a directory containing a predefined + CPP symbol -- Martin Buchholz +-- Minor fixes for Postgres integration -- Martin Buchholz +-- Many fixes for DEC OSF 4.0 -- Martin Buchholz +-- More C++ compilation support (for quality control) -- Martin Buchholz +-- XEmacs can now be built with XFree86 4.0 -- Martin Buchholz +-- Fix lots of byte-compiler warnings -- Martin Buchholz +-- Many documentation fixes -- Adrian Aichner +-- support for S390 has been added -- Andreas Jaeger, Martin Schwidefsky +-- clean up Windows includes/defines -- Ben Wing +-- numerous configure/GCC-warning fixes -- Martin Buchholz +-- generalize selection support to arbitrary types -- Alastair Houghton +-- MS Windows printer improvements -- Kirill Katsnelson +-- MinGW fixes -- Craig Lanning +-- NT process fixes -- Mixe Alexander, Adrian Aichner +-- new key-value weak hashtable type -- Andy Piper/Olivier Galibert +-- migrate .emacs to .xemacs/init.el -- Mike Sperber +-- new file compat.el for cleaner compatibility functions -- Ben Wing + +to 21.2.34 "Molpe" +-- Lots of changes to GUI, Windows, font-lock code, Ben Wing +-- Lots of changes to GUI, Windows code, Andy Piper +-- Various fixes, Karl Hegbloom +-- User manual documentation updates, Yoshiki Hayashi +-- Dumping fixes, Yoshiki Hayashi +-- Define C-x BS to backward-kill-sentence, Yoshiki Hayashi + +to 21.2.33 "Melpomene" +-- Yet more progress gauge and gutter redisplay fixes from Andy Piper +-- glyph error checking from Andy Piper +-- Proper implementation of string glyphs makes them Mule safe (IKEYAMA Tomonori) +-- Bug fixes from the usual suspects +-- --with-clash-detection now defaults to `yes', at least for betas. +-- Autoconf support for detecting how to #include header files + with names containing preprocessor constants, Didier Verna. +-- LDAP documentation updated, Oscar Figueiredo. +-- clash-detection code cleaned and audited, Yoshiki and Martin +-- Fix hangs on DEC OSF 4.0 when (process-send-string) sends strings + longer than 252 bytes. +-- Fix non-ANSI macro hacking to allow compilation by Irix native compiler. +-- redisplay fixes, IKEYAMA Tomonori +-- Code cleaning, Mike Alexander +-- Pdump + Windows support, Mike Alexander +-- Sound code cleanup, Jan Vroonhof +-- yes-or-no-p-dialog-box no longer gives unpredictable results with + focus follows mouse, Martin Buchholz + +to 21.2.32 "Kastor & Polydeukes" +-- Internal Postgres RDBMS support from Steve Baur +-- Improve gutter useability +-- Fix window geometry with gutters +-- Fix async updates so that they only occur when necessary +-- Gutter documentation from Stephen Turnbull +-- redisplay-gutter-area fixes from Andy Piper +-- pdump file in MS-Windows executable from Mike Alexander +-- Miscellaneous fixes from Andy Piper +-- Windows and menubar changes from Ben Wing +-- dumper changes from Olivier Galibert + +to 21.2.31 "Iris" +-- Make XEmacs work on Windows again. + +to 21.2.30 "Hygeia" +-- Make (find-tag-other-window) always use other window, + even if tag is found in buffer of current window, Samuel Mikes +-- Make configure complain about broken compiler versions (Jan Vroonhof, Yoshiki Hayashi, Bill Perry) +-- `write-region' now deals properly with non-ASCII file names, Martin Buchholz +-- `file-truename' now respects file-name-coding-system, Martin Buchholz +-- arm configure support fixed. +-- non-ASCII string handling performance boost, Martin Buchholz +-- Garbage collector performance boost, Martin Buchholz +-- Lisp engine performance boost, Martin Buchholz +-- New ldap API (Oscar Figueiredo) +-- (- 0) is now optimized to 0, not (-), Martin Buchholz +-- More gutter tabs fixes, Andy Piper + +to 21.2.29 "Hestia" +-- Fix compile errors on pre-X11R6 systems, introduced in 21.2.28. +-- Fix autodetection of Berkeley DB on Linux Glibc 2 systems. + (but more work needed) +-- Allow non-symbols (anything compared with `eq') in object plists. +-- Cleanup of property frobbing code. +-- Various AIX 4 fixes, including port of PDUMP. +-- Unconditionally define _POSIX_C_SOURCE, _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED. +-- MS-Windows redisplay and font fixes from Jonathan Harris. +-- various fixes from Craig Lanning, Daiki Ueno. +-- Asynchronous widget updates from Andy Piper. +-- More widget fixes from Andy Piper. +-- Don't use rel_alloc on glibc systems, including Linux +-- Upgrade etags.c to version 13.44, Francesco Potorti +-- etags does a better job of finding the exact match first, Kyle Jones +-- Portable dumper now described in Internals manual, Olivier and Martin +-- Object Plist documentation in lispref updated, Martin Buchholz +-- Just use standard `const' everywhere, instead of CONST +-- More pdump changes, Olivier Galibert + to 21.2.28 "Hermes" -- Add configure support for NetWinders, Sean MacLennan -- Make the "Load .emacs" menu item work again, Kirill Katsnelson @@ -32,6 +152,8 @@ to 21.2.27 "Hera" -- Dynamic layout for widgets from Andy Piper +-- Vertical tab widgets for MS-Windows from Andy Piper +-- pdump fixes for MS-Windows from Big K -- config.sub, config.guess major upgrade, Marcus Thiessel -- gdbinit renamed to .gdbinit -- dbxrc renamed to .dbxrc @@ -102,6 +224,7 @@ -- 10% faster redisplay from Jan Vroonhof -- Fixes from Jeff Miller, Alexandre Oliva and Yoshiki Hayashi -- "If you've got problems, read PROBLEMS!" from Robert Pluim +-- Completely revamped GPM support from William Perry -- Lstream code now uses size_t, ssize_t consistently, Martin Buchholz -- Fix `make install' if prefix != exec_prefix, Martin Buchholz -- Fix compile warnings and C++ compilation, Martin Buchholz diff -r 72a7cfa4a488 -r abe6d1db359e ChangeLog --- a/ChangeLog Mon Aug 13 11:33:40 2007 +0200 +++ b/ChangeLog Mon Aug 13 11:35:02 2007 +0200 @@ -1,8 +1,437 @@ +2000-10-04 Martin Buchholz + + * XEmacs 21.2.36 is released. + +2000-08-29 Robert Pluim + + * etc/NEWS: fix reference to progress-feedback-use-echo-area + +2000-09-27 Martin Buchholz + + * configure.in: Big signal/process handling overhaul. + Autoconfiscate lots of functions and headers: + getpt _getpt grantpt unlockpt ptsname killpg tcgetpgrp + openpty pty.h libutil.h sys/stropts.h sys/strtio.h isastream + +2000-09-20 Martin Buchholz + + * etc/xemacs.1: Spelling fixes. Remove stuff that doesn't belong. + +2000-09-19 Martin Buchholz + + * *: Spelling mega-patch + +2000-09-16 Martin Buchholz + + * configure.in: Remove strcasecmp. + + * etc/Emacs.ad: Remove Energize from comments. + +2000-09-16 Martin Buchholz + + * configure.in: Add -Kalloca to $c_switch_system when using + Unixware native compiler (if necessary). + +2000-09-15 Martin Buchholz + + * configure.in: Prevent spurious "No" in configure output when not + using gcc. Oh, and it's "no", not "No". Oh, and it's "yes", not "Yes". + +2000-09-14 Martin Buchholz + + * configure.in: Save 2 sed process invocations per Makefile. + +2000-08-22 SL Baur + + * configure.in (after_morecore_hook_exists): Don't add /usr/shlib + to link path if compiling on Alpha/Linux. + +2000-09-01 Martin Buchholz + + * Makefile.in.in (depend): cd to the correct directory. + +2000-08-31 Martin Buchholz + + * configure.in: with_widgets is incompatible with X11 R4. + + * configure.in: Make Balloon Help conditional on finding shape.h + +2000-08-02 Stephen J. Turnbull + + * etc/Emacs.ad: Document usage of FontSet resource for menubar. + +2000-08-09 Vin Shelton + + * configure.in: Check for UNIX98 PTYs. Patch from Florian Weimer + . + +2000-07-31 Yoshiki Hayashi + + * configure.usage: Remove lockdir document. + +2000-07-31 Martin Buchholz + + * configure.in: + Make knowledge of machine and opsys optional. + Make existence of s&m files optional. + Rely on configure alone if s&m files not found. + + * configure.in: + Use only configure-time tests to detect getloadavg(). + Don't check for kstat.h if we have getloadavg(). + Check for sys/loadavg.h if we have getloadavg(). + +2000-07-15 Ben Wing + + * Makefile.in.in (configure): + all-elcs target now uses update-elc-2.el not update-elc.sh + +2000-07-19 Martin Buchholz + + * XEmacs 21.2.35 is released. + +2000-07-13 Martin Buchholz + + * configure.in: --with-menubars=yes should not be an error. + + * configure.in: "compiling in support for Athena" message was + sometimes lying. + +2000-07-12 Martin Buchholz + + * configure.in: Rewrite xmkmf symbol detection to avoid + redefinition of symbols we've already defined. + Also, handle xmkmf symbols with values other than 1. + +2000-07-12 Martin Buchholz + + * configure.in: + Make sure Unix98 socklen_t is defined. + Use ANSI C mode `-std1' with DEC C instead of `-std'. + +2000-07-09 Martin Buchholz + + * configure.in: + Replace SMART_INCLUDE with a dumber, but more reliable method. +2000-07-10 Martin Buchholz + + * modules/zlib/Makefile: + * modules/sample/Makefile: + * modules/ldap/Makefile: + * modules/base64/Makefile: + * Makefile.in.in: + rm -f ==> $(RM) + define SHELL=/bin/sh + +2000-07-09 Martin Buchholz + + * configure.in: PostgreSQL rewrite. + - Don't look for postgreSQL in /usr/local. + - Simplify detection code. + - Don't use SMART_INCLUDE. + - Don't autodetect if --with-postgresql=no. + +2000-07-08 Ben Wing + + * configure.usage: addl doc for graphics libs, with-msw. + +2000-07-09 Martin Buchholz + + * configure.in: sh builtin `test' uses `=', not `=='. + +2000-07-08 Ben Wing + + * configure.in: add -lcomdlg32 for cygwin. + +2000-07-05 Craig Lanning + + * aclocal.m4 (can_build_shared): + First pass at module support for cygwin and mingw. + + * configure: + * configure (xe_check_libs): + * configure (acfindx): + * configure (ac_x_includes): + * configure (ac_x_libraries): + * configure (ac_cv_lib_dnet_dnet_ntoa): + * configure (xe_msg_checking): + * configure (xe_runpath_dir): + * configure (xetest): + * configure (ac_err): + * configure (ac_safe): + * configure (with_xmu): + * configure (bitmapdir): + * configure (with_xauth): + * configure (libs_xauth): + * configure (with_cde): + * configure (with_ldap): + * configure (with_ldap_krbdes): + * configure (save_c_switch_site): + * configure (with_postgresql): + * configure (with_xface): + * configure (with_jpeg): + * configure (with_png): + * configure (with_tiff): + * configure (athena_lib): + * configure (have_motif): + * configure (all_widgets): + * configure (with_xim): + * configure (with_xfs): + * configure (with_wnn): + * configure (with_canna): + * configure (extra_objs): + * configure (ac_cv_c_inline): + * configure (have_esd_config): + * configure (c_switch_site): + * configure (with_ncurses): + * configure (with_gpm): + * configure (xealias): + * configure (xehost_os): + * configure (can_build_shared): + * configure (xcldf): + * configure (LTLD): + * configure (ld_dynamic_link_flags): + * configure (Mail): + * configure.in: + * configure.in (after_morecore_hook_exists): + * configure.in (xetest): + * configure.in (emacs_cv_localtime_cache): + * configure.in (Mail): + * configure.in: + Clean up configure support for cygwin and mingw. + +2000-06-27 Darryl Okahata + + * PROBLEMS: Document broken native audio for recent patches and + releases of HP-UX. + +2000-06-10 Ben Wing + + * Makefile.in.in (install-arch-dep): + WINDOWSNT -> WIN32_NATIVE. + __CYGWIN32__ -> CYGWIN. + +2000-06-01 Andreas Jaeger + + * configure.in: Recognize s390. + + * config.guess: New version from GNU config archive. + * config.sub: Likewise. + +2000-05-28 Martin Buchholz + + * XEmacs 21.2.34 is released. + +2000-05-15 Yoshiki Hayashi + + * configure.in: + Do not define DOUG_LEA_MALLOC when using other malloc scheme. + Remove unused variable use_minimal_tagbits. + +2000-05-02 Yoshiki Hayashi + + * configure.in: Remove lockdir. + +2000-04-15 Andy Piper + + * etc/Emacs.ad: add select-start() back into text translations. + +2000-05-01 Martin Buchholz + + * XEmacs 21.2.33 is released. + +2000-04-27 Katsumi Yamaoka + + * configure.in: Use ORDINARY_LD instead of "\$(ORDINARY_LD)" for + the value of LD. + +2000-04-26 Ben Wing + + * configure.in: add support for --quick-build. Remove --no-doc-file, + subsumed. + +2000-04-19 Martin Buchholz + + * configure.in: + * src/config.h.in: + Rewrite SMART_INCLUDE implementation to actually work. + Be paranoid - Avoid use of spaces in these macro definitions. + Leave alloca() definition at start of compilation unit, + as AIX requests. + Rename SMART_INCLUDE_MACRO to SMART_INCLUDE_INDIRECTIONS. + +2000-04-13 Yoshiki Hayashi + + * configure.in: Enable clash-detection by default. + * configure.usage: Update documentation. + +2000-04-06 Andy Piper + + * configure.in: fix typo. + +2000-04-12 Andy Piper + + * etc/Emacs.ad: give the gui-element face the same font as the + menubar and popups. Add translations for text widgets. + +2000-04-03 Yoshiki Hayashi + + * configure.in : Fix printing error check warning even if + it is not compiled in. + +2000-02-19 Jan Vroonhof + + * xemacs/configure.in: Do a normal link when compiling with + --pdump. Don't try compiling an unexec object file. + +2000-03-27 Didier Verna + + * configure.in: reorganize the output by topic. + New configure test to define the proper SMART_INCLUDE macro. + + * configure.usage: slightly rearanged some options. + +2000-03-25 Didier Verna + + * configure.in: rename `foo_h_path' to `foo_h_file' for variables + representing real headers and not directories. This applies to + `db_h_path', `curses_h_path', `term_h_path', `tt_c_h_path' and + `soundcard_h_path'. + +2000-03-21 Didier Verna + + * configure.in: try to find postgresql headers at different places + and define POSTGRES_H_PATH as appropriate. + +2000-03-22 Andy Piper + + * config.h.in: add ERROR_CHECK_GLYPHS. + + * configure.in: add error_check_glyphs. + +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-15 Olivier Galibert + + * configure.in: Add dumper.o object when pdumping. + +2000-02-20 Olivier Galibert + + * Makefile.in.in: Add pdump install support + + * configure.in: Add EMACS_PROGNAME config.h variable. + +2000-03-10 SL Baur + + * configure.usage: document --with-postgresql flag. + +2000-03-06 SL Baur + + * configure.in: add autodetection of PostgreSQL runtime libraries + +2000-03-09 Yoshiki Hayashi + + * aclocal.m4 (XE_SHLIB_STUFF): Define ld_shlibs to yes + when C compiler can produce shared libraries. + +2000-03-01 Didier Verna + + * etc/NEWS: update the rect.el entry. + +2000-02-26 Martin Buchholz + + * configure.in: Unconditionally define SHELL, to allow working + with (unreleased) autoconf 2.14.1, found on Mandrake 7.0 systems. + +2000-02-23 Martin Buchholz + + * XEmacs 21.2.31 is released. + +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-20 Martin Buchholz + + * configure.in: Enforce use of autoconf version >= 2.13. + + * configure.in: Fix OS release test on Solaris. + +2000-02-19 Marcus Thiessel + + * PROBLEMS: Update email address. Describe more HP Motif errors. + +2000-02-19 Jan Vroonhof + + * configure.in: Split Solaris version test in two parts. In the + Bourne shell the "-a" operator does NOT short-circuit. + +1999-12-15 Jan Vroonhof + + * (configure.in): Autodetect broken gcc versions. Patch from WM + Perry with tiny tweaks by Yoshiki Hayashi and yours truly. + +2000-02-17 Martin Buchholz + + * configure.in: Autodetect sys/param.h. Reorganize + AC_CHECK_HEADERS call. + * src/config.h.in: Add HAVE_SYS_PARAM_H. + +2000-02-16 Martin Buchholz + + * configure.in: Test for arm simply using arm* instead of arm-* + +2000-01-05 Yoshiki Hayashi + + * etc/TUTORIAL.ja: Synch with English version. + +2000-02-16 Martin Buchholz + + * XEmacs 21.2.29 is released. + +2000-02-16 Martin Buchholz + + * configure.in: Don't use rel_alloc if malloc() calls mmap(). + Discover this by looking for M_MMAP_THRESHOLD. + + * configure.in: Don't define POSIX_C_SOURCE on Solaris, due to + bugs in (at least) Solaris 2.5 headers. + +2000-01-29 Craig Lanning + + * configure.in: Fix detection of XPM on systems without X11. + +2000-02-11 Martin Buchholz + + * configure.in: + * src/config.h.in: + Define _POSIX_C_SOURCE, _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, + but only on tested Operating systems - Linux && SunOS >= 5.5. + +2000-02-09 Valdis Kletnieks + + * aclocal.m4: Support dlls on aix[34]. + +2000-02-09 Martin Buchholz + + * .cvsignore: Ignore gmon.out + +2000-02-08 Martin Buchholz + + * configure.in: Sync Berkeley db autodetection with src/database.c + +2000-02-07 Martin Buchholz + + * configure.in: check for XConvertCase. + 2000-02-07 Martin Buchholz * XEmacs 21.2.28 is released. 2000-01-27 URA Hiroshi + * configure.in: added getaddrinfo and getnameinfo to AC_FUNC. 2000-01-26 Martin Buchholz @@ -70,7 +499,7 @@ 2000-01-08 Martin Buchholz - * configure.in: + * configure.in: - Allow find-tag to work in the build directory. - rename src/gdbinit to src/.gdbinit, so that gdb can find it. - Less verbose messages when creating .sbinit, .gdbinit, TAGS. @@ -116,7 +545,7 @@ 1999-12-13 Martin Buchholz - * configure.in: + * configure.in: * configure.usage: - Autodetect NAS. Change Docs accordingly. @@ -172,7 +601,7 @@ 1999-11-26 Martin Buchholz - * configure.in: + * configure.in: Add configure support for Unix 98 type ssize_t. 1999-11-27 Martin Buchholz @@ -187,7 +616,7 @@ * INSTALL: Update configure option. 1999-10-12 Alexandre Oliva - + * configure.in (native_sound_lib, *-sgi-*): Check for audio.h. (LIBS): Check for libCsup. @@ -205,7 +634,7 @@ 1999-11-17 Martin Buchholz - * Makefile.in.in (install-arch-dep): + * Makefile.in.in (install-arch-dep): Fix `make install' if prefix != exec_prefix. 1999-11-15 Martin Buchholz @@ -275,7 +704,7 @@ 1999-09-19 Michael Sperber [Mr. Preprocessor] * configure.in (EMACS_CONFIGURATION): Use $configuration, not - $canonical, so that installation paths and dynamic path setup will + $canonical, so that installation paths and dynamic path setup will stay in synch. 1999-09-20 Andy Piper @@ -289,9 +718,9 @@ 1999-08-27 Jan Vroonhof - * modules/zlib/Makefile (distclean): - * modules/ldap/Makefile (distclean): - * modules/sample/Makefile (distclean): + * modules/zlib/Makefile (distclean): + * modules/ldap/Makefile (distclean): + * modules/sample/Makefile (distclean): * modules/base64/Makefile (distclean): new target * Makefile.in.in (top_distclean): Add package directories @@ -302,10 +731,10 @@ * configure.in: Warn, but otherwise ignore, obsolete arguments. 1999-08-20 Olivier Galibert - + * configure.in: Add --pdump option. * configure.usage: Ditto. - + 1999-08-04 Andy Piper * configure.in: report widget usage correctly. beef up setting. @@ -342,10 +771,10 @@ 1999-07-23 Jan Vroonhof - * etc/custom/example-themes/example-theme.el: - * etc/custom/example-themes/europe-theme.el: + * etc/custom/example-themes/example-theme.el: + * etc/custom/example-themes/europe-theme.el: * etc/custom/example-themes/ex-custom-file: Some simple examples - illustrating the custom theme support. + illustrating the custom theme support. 1999-07-17 MORIOKA Tomohiko @@ -397,7 +826,7 @@ 1999-06-25 Michael Sperber [Mr. Preprocessor] * configure.in (with_prefix): Added --with-prefix, defaults to - yes, to control whether the value of --prefix is compiled into the + yes, to control whether the value of --prefix is compiled into the binary. 1999-07-03 Andy Piper @@ -476,7 +905,7 @@ 1999-05-31 SL Baur * configure.in (CPP): Don't check for include subdirectories in - site-prefix directories. This check loses in valid configurations + site-prefix directories. This check loses in valid configurations like /usr/jp in TurboLinux. Conditionally add include directory to site switches. @@ -495,7 +924,7 @@ 1999-05-06 Hrvoje Niksic - * aclocal.m4 (ld_dynamic_link_flags): Change -Bexport to -Bdynamic + * aclocal.m4 (ld_dynamic_link_flags): Change -Bexport to -Bdynamic for Solaris. 1999-05-03 Hrvoje Niksic @@ -565,7 +994,7 @@ 1999-01-05 Gunnar Evermann - * PROBLEMS: Document crashes on SPARC with gcc 2.8.1. + * PROBLEMS: Document crashes on SPARC with gcc 2.8.1. 1999-03-01 XEmacs Build Bot @@ -586,29 +1015,29 @@ 1999-02-10 Martin Buchholz - * configure.in: + * configure.in: - Fixup xfs comments and redundant option checking - * configure.in: - * INSTALL: + * configure.in: + * INSTALL: * lisp/paths.el: - improved automounter tmp directory support. - support 4 (!) empirically discovered automounter conventions 1999-02-10 Martin Buchholz - * lwlib/lwlib.h: - - redo CONST hacking to deal with X11 R4, which was + * lwlib/lwlib.h: + - redo CONST hacking to deal with X11 R4, which was broken in a previous patch. 1999-02-10 Martin Buchholz - * configure.in: + * configure.in: - irix uses -rpath 1999-02-10 Martin Buchholz - * configure.in: + * configure.in: - Check for XOpenIM before using xim=xlib - only use XmIm if $have_motif = yes @@ -643,10 +1072,10 @@ * configure.in: remove -O3 prevention on cygwin - current versions cope ok now. remove dll prevention on cygwin - the new module code checks correctly. - + 1999-01-10 J. Kean Johnston - * configure.in: Added moduledir as the path where loadable modules + * configure.in: Added moduledir as the path where loadable modules are stored. Added --with-site-modules and --moduledir options. - Ensure the SCO OpenServer compiles with --dynamic by default - Check for dlfcn.h for dynamic loader @@ -1361,7 +1790,7 @@ * XEmacs 21.0-beta33 is released. -1998-03-26 Didier Verna +1998-03-26 Didier Verna * configure.in, Makefile.in: Removed infopath_user_defined---we always want to propagate it. @@ -1706,7 +2135,7 @@ * etc/FTP: Update address of what was formerly ftp.ibp.fr. -1998-01-08 Didier Verna +1998-01-08 Didier Verna * configure.in: Get rid of INFOPATH for configure time. * configure.usage (Usage): Ditto. @@ -2022,7 +2451,7 @@ ChangeLog, README, Todo, paths.h, config.h, inc/*, runemacs.c, xemacs.mak. -1997-11-05 Didier Verna +1997-11-05 Didier Verna * configure.in: Added the --site-prefixes options for the configure script. You give a colon or space separated list of prefixes, and @@ -3943,5 +4372,3 @@ Thu Dec 5 11:56:05 1996 Joseph J Nuspl * configure.in (LIBS): Fix typo in dialog box test. - - diff -r 72a7cfa4a488 -r abe6d1db359e INSTALL --- a/INSTALL Mon Aug 13 11:33:40 2007 +0200 +++ b/INSTALL Mon Aug 13 11:35:02 2007 +0200 @@ -2,8 +2,6 @@ Copyright (c) 1994, 1995, 1996 Board of Trustees, University of Illinois Copyright (c) 1994-1999 Free Software Foundation, Inc. -Synched up with: FSF 19.30. - Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and permission notice are preserved, @@ -18,20 +16,24 @@ of the Free Software Foundation are approved by the Foundation. -BUILDING AND INSTALLATION (Unix and Cygwin, see the file nt/README -for instructions on building under Microsoft Windows): +BUILDING AND INSTALLATION FOR UNIX AND CYGWIN + +(for Microsoft Windows, see nt/README also.) + +PREREQUISITES +============= -1) Make sure your system has enough swapping space allocated to handle - a program whose pure code is 900k bytes and whose data area is at - least 400k and can reach 8Mb or more. Note that a typical XEmacs - build is much bigger. If the swapping space is - insufficient, you will get an error in the command `temacs -batch - -l loadup dump', found in `./src/Makefile.in.in', or possibly when - running the final dumped XEmacs. +Make sure your system has enough swapping space allocated to handle a +program whose pure code is 900k bytes and whose data area is at least +400k and can reach 8Mb or more. Note that a typical XEmacs build is +much bigger. If the swapping space is insufficient, you will get an +error in the command `temacs -batch -l loadup dump', found in +`./src/Makefile.in.in', or possibly when running the final dumped +XEmacs. - Verify that your users have a high enough stack limit. On some - systems such as OpenBSD and OSF/Tru64 the default is 2MB which is - too low. See 'PROBLEMS' for details. +Verify that your users have a high enough stack limit. On some systems +such as OpenBSD and OSF/Tru64 the default is 2MB which is too low. See +'PROBLEMS' for details. Building XEmacs requires about 100 Mb of disk space (including the XEmacs sources). Once installed, XEmacs occupies between 20 and 100 Mb @@ -44,8 +46,10 @@ the documentation yourself, you will need at least version 1.68 of makeinfo (GNU texinfo-3.11). +ADD-ON LIBRARIES +================ -2) Decide on what other software packages you would like to use with +Decide on what other software packages you would like to use with XEmacs, but are not yet available on your system. On some systems, Motif and CDE are optional additions. On Solaris, the SUNWaudmo package enables native sound support. There are also a number of free @@ -72,37 +76,19 @@ these variables as needed assuming your libraries are organised as a typical /usr tree. -3) [N.B. Most of this section can be done during or after the -compilation of the core source code, but is present early to catch -your attention.] +PACKAGE SYSTEM +============== -Decide what Initial Lisp you need with XEmacs. XEmacs is -distributed separately from most of its runtime environment. This is -done to make it easier for administrators to tune an installation for -what the local users need. Note that while XEmacs will compile and -install without any packages present at least some additional lisp -packages are needed to bring XEmacs up to "normal" editor -functionality. Installation and upgrading of the packages can be done -almost automatically when from inside XEmacs when it has been compiled -and installed. - -More information and suggestions for which packages to install see the -file README.packages. - -IMPORTANT! The file README.packages contain information vital to have -a fully working XEmacs. This information was not included in this file -only because it is too large for this terse INSTALL. Please read +The file README.packages contain information vital to have a fully +working XEmacs. This information was not included in this file only +because it is too large for this terse INSTALL. Please read README.packages now! -By default, packages will be searched for in the path - -~/.xemacs::$prefix/lib/xemacs-${version}/mule-packages:$prefix/lib/xemacs/mule-packages:$prefix/lib/xemacs-${version}/xemacs-packages:$prefix/lib/xemacs/xemacs-packages +CONFIGURATION OPTIONS +===================== -This may be changed by specifying a different value with the ---package-path configuration option. - -4) In the top level directory of the XEmacs distribution, run the - program `configure' as follows: +In the top level directory of the XEmacs distribution, run the +program `configure' as follows: ./configure [CONFIGURATION-NAME] [--OPTION[=VALUE]] ... @@ -176,13 +162,9 @@ The `--dynamic' option specifies that configure should try to link emacs dynamically rather than statically. -The `--const-is-losing' option is for use if you have trouble -compiling due to the `const' storage class in C. This is defined by -default. Most users should have no need to change this. - You can build XEmacs for several different machine types from a single source directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. Make separate +supports the `VPATH' variable, such as GNU `make'. Create separate build directories for the different configuration types, and in each one, run the XEmacs `configure' script. `configure' looks for the Emacs source code in the directory that `configure' is in. @@ -206,12 +188,17 @@ EXECDIR/lib/xemacs-VERSION/CONFIGURATION-NAME. EXECDIR/bin should be a directory that is normally in users' PATHs. -For example, the command - - ./configure mips-dec-ultrix --with-x11=yes - -configures XEmacs to build for a DECstation running Ultrix, with -support for the X11 window system. +If you specify --prefix (or any of the other installation directory +options), they will get compiled into the xemacs executable so it will +be able to find its various associated file. However, XEmacs has +quite elaborate logic to find out the locations of these directories +dynamically. Sometimes, it is desirable *not* to compile these +directories into the executable so you can move the XEmacs +installation around (as whole) at will. This is true for binary kits, +for instance. Therefore, you can specify --without-prefix on the +configure command line to prevent the installation prefix to become +part of the generated executable; everything else will continue to +work as usual. The `--with-menubars=TYPE' option allows you to specify which X toolkit you wish to use for the menubar. The valid options are @@ -305,7 +292,7 @@ of the relocating allocator. Turning on --rel-alloc will allow XEmacs to return unused memory to the operating system, thereby reducing its memory footprint. However, it may make XEmacs runs more slowly, -especially if your system's `mmap' implemntation is missing or +especially if your system's `mmap' implementation is missing or inefficient. Generally, it's best to go with the default configuration for your system. You can tweak this based on how you use XEmacs, and the memory and cpu resources available on your system. @@ -333,7 +320,7 @@ contains the results of the compile and link tests used by configure. The `--with-mule' option enables (MUlti-Lingual Emacs) support, needed -to suport non-Latin-1 (including Asian) languages. The Mule support +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: @@ -383,24 +370,35 @@ `--with-xim', `--with-canna' and `--with-wnn' as your system supports. +MAIL LOCKING +============ + +Find out what the preferred method for locking mail spool files is in +your environment. Presently, XEmacs supports lockf, flock, and dot +locking. Specify the locking method via the --mail-locking=METHOD +option to configure. Valid values for METHOD are --mail-locking are +`lockf', `flock', and `dot'. + +RUNNING CONFIGURE +================= + `configure' doesn't do any compilation or installation itself. It just creates the files that influence those things: `./src/config.h', and all the Makefile's in the build tree. -The `--with-pop', `--with-hesiod', and `--with-kerberos' options are used -in conjunction with movemail. As of XEmacs 20.1, movemail is identical -to the one used in Emacs. - When it is done, `configure' prints a description of what it did and creates a shell script `config.status' which, when run, recreates the same configuration. If `configure' exits with an error after disturbing the status quo, it removes `config.status'. -5) Look at `./lisp/paths.el'; if some of those values are not right -for your system, set up the file `./lisp/site-init.el' with XEmacs -Lisp code to override them; it is not a good idea to edit paths.el -itself. YOU MUST USE THE LISP FUNCTION `setq' TO ASSIGN VALUES, -rather than `defvar', as used by `./lisp/paths.el'. For example, +AUXILIARY PATHS +=============== + +Look at `./lisp/paths.el'; if some of those values are not right for +your system, set up the file `./lisp/site-init.el' with XEmacs Lisp +code to override them; it is not a good idea to edit paths.el itself. +YOU MUST USE THE LISP FUNCTION `setq' TO ASSIGN VALUES, rather than +`defvar', as used by `./lisp/paths.el'. For example, (setq news-inews-program "/usr/bin/inews") @@ -419,17 +417,16 @@ XEmacs cannot detect, you may need to change the value of `directory-abbrev-alist'. -6) Put into `./lisp/site-init.el' or `./lisp/site-load.el' any Emacs -Lisp code you want XEmacs to load before it is dumped out. Use +SITE-SPECIFIC STARTUP CODE +========================== + +Put into `./lisp/site-init.el' or `./lisp/site-load.el' any Emacs Lisp +code you want XEmacs to load before it is dumped out. Use site-load.el for additional libraries if you arrange for their documentation strings to be in the lib-src/DOC file (see src/Makefile.in.in if you wish to figure out how to do that). For all else, use site-init.el. -If you set load-path to a different value in site-init.el or -site-load.el, XEmacs will use *precisely* that value when it starts up -again. If you do this, you are on your own! - Note that, on some systems, the code you place in site-init.el must not use expand-file-name or any other function which may look something up in the system's password and user information database. @@ -438,12 +435,18 @@ The `site-*.el' files are nonexistent in the distribution. You do not need to create them if you have nothing to put in them. -7) Refer to the file `./etc/TERMS' for information on fields you may +TERMCAP CONFIGURATION +===================== + +Refer to the file `./etc/TERMS' for information on fields you may wish to add to various termcap entries. The files `./etc/termcap.ucb' and `./etc/termcap.dat' may already contain appropriately-modified entries. -8) Run `make' in the top directory of the XEmacs distribution to finish +RUNNING MAKE +============ + +Run `make' in the top directory of the XEmacs distribution to finish building XEmacs in the standard way. The final executable file is named `src/emacs'. You can execute this file "in place" without copying it, if you wish; then it automatically uses the sibling @@ -515,27 +518,7 @@ If these directories are not what you want, you can specify where to install XEmacs's libraries and data files or where XEmacs should search for its lisp files by giving values for `make' variables as part of -the command. See the section below called `MAKE VARIABLES' for more -information on this. - -Using GNU Make allows for simultaneous builds with and without the ---srcdir option. - -9) If your system uses lock files to interlock access to mailer inbox -files, then you might need to make the movemail program setuid or -setgid to enable it to write the lock files. We believe this is safe. -The setuid/setgid bits need not be set on any other XEmacs-related -executables. - -10) You are done with the hard part! You can remove executables and -object files from the build directory by typing `make clean'. To also -remove the files that `configure' created (so you can compile XEmacs -for a different configuration), type `make distclean'. - -11) You should now go to the XEmacs web page at http://www.xemacs.org/ -and decide what additional Lisp support you wish to have. - -MAKE VARIABLES +the command. You can change where the build process installs XEmacs and its data files by specifying values for `make' variables as part of the `make' @@ -647,7 +630,7 @@ (where VERSION and CONFIGURATION-NAME are as described above). `docdir' indicates where to put Lisp documentation strings that XEmacs - refers to as it runs. It defaults the value of `archlibdir' + refers to as it runs. It defaults to the value of `archlibdir' (see above). `moduledir' indicates where XEmacs installs and expects to find @@ -656,8 +639,8 @@ `/usr/local/lib/xemacs-VERSION/CONFIGURATION-NAME/modules' (where VERSION and CONFIGURATION-NAME are as described above). By their very nature, dynamic loadable modules are architecture- - dependant, and care should be taken not to set this directory - to a system- or architecture-independant directory. + dependent, and care should be taken not to set this directory + to a system- or architecture-independent directory. Remember that you must specify any variable values you need each time you run `make' in the top directory. If you run `make' once to build @@ -671,126 +654,33 @@ Makefiles for the subdirectories, so you don't have to specify them when running make in the subdirectories. - -CONFIGURATION BY HAND - -Instead of running the `configure' program, you have to perform the -following steps. - -1) Copy `./src/config.h.in' to `./src/config.h'. +Using GNU Make allows for simultaneous builds with and without the +--srcdir option. -2) Consult `./etc/MACHINES' to see what configuration name you should -use for your system. Look at the code of the `configure' script to -see which operating system and architecture description files from -`src/s' and `src/m' should be used for that configuration name. Edit -`src/config.h', and change the two `#include' directives to include -the appropriate system and architecture description files. - -3) Edit `./src/config.h' to set the right options for your system. If -you need to override any of the definitions in the s/*.h and m/*.h -files for your system and machine, do so by editing config.h, not by -changing the s/*.h and m/*.h files. Occasionally you may need to -redefine parameters used in `./lib-src/movemail.c'. +MAIL-LOCKING POST-INSTALLATION +============================== -4) If you're going to use the make utility to build XEmacs, you will -still need to run `configure' first, giving the appropriate values for -the variables in the sections entitled "Things `configure' Might Edit" -and "Where To Install Things." Note that you may only need to change -the variables `prefix' and `exec_prefix', since the rest of the -variables have reasonable defaults based on them. For each Makefile -variable of this type, there is a corresponding configure option; for -example, to change the location of the lock directory, you might use - - ./configure --lockdir=/nfs/xemacslock - -The `configure' script is built from `configure.in' by the `autoconf' -program. However, since XEmacs has configuration requirements that -autoconf can't meet, `configure.in' uses a marriage of custom-baked -configuration code and autoconf macros. New versions of autoconf -could very well break this arrangement, so it may be wise to avoid -rebuilding `configure' from `configure.in' when possible. - - -BUILDING XEMACS BY HAND - -Once XEmacs is configured, running `make' in the top directory performs -the following steps. - -1) Run `make src/paths.h' in the top directory. This produces -`./src/paths.h' from the template file `./src/paths.h.in', changing -the paths to the values specified in `./Makefile'. - -2) Cd to `./lib-src' and run `make'. This creates executables named -`ctags' and `etags' and `wakeup' and `make-docfile' and `digest-doc' -and `test-distrib'. And others. - -3) Cd to `./src' and Run `make'. This refers to files in the `./lisp' -and `./lib-src' subdirectories using names `../lisp' and -`../lib-src'. +If your system uses dot-locking to interlock access to mailer inbox +files, then you might need to make the movemail program setuid or +setgid to enable it to write the lock files. We believe this is safe. +The setuid/setgid bits need not be set on any other XEmacs-related +executables. -This creates a file `./src/xemacs' which is the runnable XEmacs, -assigning it a new build version number by incrementing the build -version stored in `./lisp/version.el'. - -It also creates a file in `./lib-src' whose name is `DOC' followed by -the current XEmacs version. This file contains documentation strings -for all the functions in XEmacs. Each time you run make to make a new -xemacs, a new DOC file with a new name is made. You must keep the DOC -file for an XEmacs version as long as you keep using that XEmacs -version. - - -INSTALLATION BY HAND - -The steps below are done by running `make install' in the main -directory of the XEmacs distribution. - -1) Copy `./lisp' and its subdirectories, `./etc', and the executables -in `./lib-src' to their final destinations, as selected in `./src/paths.h'. +CLEANING UP +========== -Strictly speaking, not all of the executables in `./lib-src' need be copied. -- The programs `cvtmail', `emacsserver', `env', `fakemail', `hexl', - `movemail', `timer', `vcdiff', `wakeup', and `yow' are used by - XEmacs; they do need to be copied. -- The programs `etags', `ctags', `emacsclient', `b2m', `rcs2log', - `gnuclient', `gnudoit', and `gnuattach' are intended to be run - by users; they are handled below. -- The programs `make-docfile' and `test-distrib' were - used in building XEmacs, and are not needed any more. -- The programs `digest-doc' and `sorted-doc' convert a `DOC' file into - a file for users to read. There is no important reason to move them. - -2) Copy the files in `./info' to the place specified in -`./lisp/site-init.el' or `./lisp/paths.el'. Note that if the -destination directory already contains a file named `dir', you -probably don't want to replace it with the `dir' file in the XEmacs -distribution. Instead, you should make sure that the existing `dir' -file contains an appropriate menu entry for the XEmacs info. +You are done with the hard part! You can remove executables and +object files from the build directory by typing `make clean'. To also +remove the files that `configure' created (so you can compile XEmacs +for a different configuration), type `make distclean'. -3) Create a directory for XEmacs to use for clash detection, named as -indicated by the PATH_LOCK macro in `./src/paths.h'. - -4) Copy `./src/xemacs' to `/usr/local/bin', or to some other directory -in users' search paths. `./src/xemacs' has an alternate name -`./src/emacs-EMACSVERSION'; you may wish to make a symbolic link named -`/usr/local/bin/xemacs' pointing to that alternate name, as an easy way -of installing different versions. - -You can delete `./src/temacs'. +READ README.packages +==================== -5) Copy the programs `b2m', `emacsclient', `ctags', `etags', `rcs2log', -`gnuclient', `gnudoit', and `gnuattach' from `./lib-src' to -`/usr/local/bin'. These programs are intended for users to run. - -6) Copy the man pages in `./etc' for xemacs, ctags, etags, and gnuserv -into the appropriate man directories. - -7) The files in the `./src' subdirectory, except for `xemacs', are not -used by XEmacs once it is built. The source would be handy for -debugging. - +Do it! PROBLEMS +======== The most likely problem is that you forgot to read and follow the directions in README.packages. You can not have a working XEmacs @@ -798,7 +688,3 @@ See the file PROBLEMS in this directory for a list of various problems sometimes encountered, and what to do about them. - - -If all else fails, please see etc/InstallGuide courtesy -of Jonathan Seth Hayward. diff -r 72a7cfa4a488 -r abe6d1db359e Makefile.in.in --- a/Makefile.in.in Mon Aug 13 11:33:40 2007 +0200 +++ b/Makefile.in.in Mon Aug 13 11:35:02 2007 +0200 @@ -283,23 +283,42 @@ ${srcdir}/lib-src/config.values.in : ${srcdir}/configure cd ${srcdir} && $(SHELL) lib-src/config.values.sh -depend ${srcdir}/src/depend : - cd ${srcdir}/src && $(RECURSIVE_MAKE) depend +depend ${srcdir}/src/depend: + cd ./src && $(RECURSIVE_MAKE) depend ## Build XEmacs and recompile out-of-date and missing .elc files along ## the way. all-elc all-elcs: lib-src lwlib dump-elcs src - MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' $(SHELL) ${srcdir}/lib-src/update-elc.sh + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -l update-elc-2.el -f batch-update-elc-2 lisp ## Sub-target for all-elc. dump-elc dump-elcs: ${GENERATED_HEADERS} FRC.dump-elcs cd ./src && $(RECURSIVE_MAKE) dump-elcs -autoloads: src - MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' $(SHELL) ${srcdir}/lib-src/update-autoloads.sh +autoloads: lisp/auto-autoloads.el lisp/custom-load.el -custom-loads: - MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' $(SHELL) ${srcdir}/lib-src/update-custom.sh +FRC.lisp.auto.autoloads.el: +lisp/auto-autoloads.el: FRC.lisp.auto.autoloads.el + $(RM) lisp/auto-autoloads.el + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -l autoload -f batch-update-directory lisp + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -f batch-byte-compile lisp/auto-autoloads.el + @$(RM) lisp/auto-autoloads.el~ +#ifdef MULE + $(RM) lisp/mule/auto-autoloads.el + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -l autoload -f batch-update-directory lisp/mule + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -f batch-byte-compile lisp/mule/auto-autoloads.el + @$(RM) lisp/mule/auto-autoloads.el~ +#endif + +FRC.lisp.custom.load.el: +lisp/custom-load.el: FRC.lisp.custom.load.el + ${blddir}/src/${PROGNAME} -batch -vanilla -l cus-dep \ + -f Custom-make-dependencies lisp finder: src @echo "Building finder database ..." @@ -418,18 +437,21 @@ for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; \ do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \ else true; fi -#ifdef WINDOWSNT +#ifdef PDUMP + ${INSTALL_DATA} src/${PROGNAME}.dmp ${bindir}/${PROGNAME}-${version}-`src/${PROGNAME} -sd`.dmp +#endif +#ifdef WIN32_NATIVE ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME} -chmod 0755 ${bindir}/${PROGNAME} #else ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version} -chmod 0755 ${bindir}/${PROGNAME}-${version} -# ifdef __CYGWIN32__ +# ifdef CYGWIN cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${PROGNAME} # else cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME} -# endif /* __CYGWIN32__ */ -#endif /* WINDOWSNT */ +# endif /* CYGWIN */ +#endif /* WIN32_NATIVE */ if test "${prefix}" != "${exec_prefix}"; then \ $(MAKEPATH) ${exec_prefix}/lib/${instvardir}; \ for dir in \ diff -r 72a7cfa4a488 -r abe6d1db359e PROBLEMS --- a/PROBLEMS Mon Aug 13 11:33:40 2007 +0200 +++ b/PROBLEMS Mon Aug 13 11:35:02 2007 +0200 @@ -144,9 +144,15 @@ ** AIX *** On AIX 4.3, you must specify --with-dialogs=athena with configure -*** The libXt shipped with AIX 4.3 is broken. This causes xemacs -nw - to fail in various ways. The solution is to build against stock - X11R6. +*** The libXt shipped with AIX 4.3 up to 4.3.2 is broken. This causes + xemacs -nw to fail in various ways. The official APAR is this: + +APAR NUMBER: RESOLVED AS: PROGRAM ERROR + +ABSTRACT: +: LIBXT.A INCORRECT HANDLING OF EXCEPTIONS IN XTAPPADDINPUT + + The solution is to install X11.base.lib at version >=4.3.2.5. *** On AIX, you get this compiler error message: @@ -394,21 +400,22 @@ *** On HP-UX, problems with make -Marcus Thiessel +Marcus Thiessel Some releases of XEmacs (e.g. 20.4) require GNU make to build successfully. You don't need GNU make when building 21.x. *** On HP-UX 9.05 XEmacs won't compile or coredump during the build. -Marcus Thiessel +Marcus Thiessel 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. +*** On HP-UX 11.0 XEmacs causes excessive X11 errors when running. + (also appears on AIX as reported in comp.emacs.xemacs) -Marcus Thiessel +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 @@ -424,6 +431,19 @@ 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 a curve. Here is what Robert Lipe says: @@ -503,7 +523,7 @@ This is usually because xmkmf is not in your path or because you are using the default cygwin shell. The default cygwin shell (/bin/sh.exe) -is ash which appears to work in most circumstances but has some wierd +is ash which appears to work in most circumstances but has some weird failure modes. I recommend replacing sh.exe with bash.exe, this will mean configure is slower but more reliable. @@ -1025,7 +1045,7 @@ Or you could set TERMCAP only when you set TERM--which should not happen in a non-login shell. -*** The popup menu appears at the buttom/right of my screen. +*** The popup menu appears at the bottom/right of my screen. You probably have something like the following in your ~/.Xdefaults @@ -1407,7 +1427,7 @@ launched. Forcing a static link of libc.a alone by adding /usr/lib/libc.a at the end of the link line solves this. Note that my 9.07 build of 19.14b17 and my (old) build of 19.13 both exhibit - the same behaviour. I've tried various hpux patches to no avail. If + the same behavior. I've tried various hpux patches to no avail. If this problem cannot be solved before the release date, binary kits for HP *must* be linked statically against libc, otherwise this problem will show up. (This is directed at whoever will volunteer @@ -1438,6 +1458,60 @@ add mod2 = Mode_switch EOF + +*** XEmacs dumps core at startup when native audio is used. Native +audio does not work with recent versions of HP-UX. + +Under HP-UX 10.20 and later (e.g., HP-UX 11.XX), with native audio +enabled, the dumped XEmacs binary ("xemacs") core dumps at startup if +recent versions of the libAlib.sl audio shared library is used. Note +that "temacs" will run, but "xemacs" will dump core. This, of course, +causes the XEmacs build to fail. If GNU malloc is enabled, a stack +trace will show XEmacs to have crashed in the "first" call to malloc(). + +This bug currently exists in all versions of XEmacs, when the undump +mechanism is used. It is not known if using the experimental portable +dumper will allow native audio to work. + +**** Cause: + +Recent versions of the HP-UX 10.20 (and later) audio shared library (in +/opt/audio/lib), pulls in the libdce shared library, which pulls in a +thread (libcma) library. This prevents the HP-UX undump() routine (in +unexhp9k800.c) from properly working. What's happening is that some +initialization routines are being called in the libcma library, *BEFORE* +main() is called, and these initialization routines are calling +malloc(). Unfortunately, in order for the undumper to work, XEmacs must +adjust (move upwards) the sbrk() value *BEFORE* the first call to +malloc(); if malloc() is called before XEmacs has properly adjusted sbrk +(which is what is happening), dumped memory that is being used by +XEmacs, is improperly re-allocated for use by malloc() and the dumped +memory is corrupted. This causes XEmacs to die an horrible death. + +It is believed that versions of the audio library past December 1998 +will trigger this problem. Under HP-UX 10.20, you probably have to +install audio library patches to encounter this. It's probable that +recent "fresh, out-of-the-box" HP-UX 11.XX workstations also have this +problem. For HP-UX 10.20, it's believed that audio patch PHSS_17121 (or +a superceeding one, like PHSS_17554, PHSS_17971, PHSS_18777, PHSS_21481, +or PHSS_21662, etc.) will trigger this. + +To check if your audio library will cause problems for XEmacs, run +"chatr /opt/audio/lib/libAlib.sl". If "libdce" appears in the displayed +shared library list, XEmacs will probably encounter problems if audio is +enabled. + +**** Workaround: + +Don't enable native audio. Re-run configure without native audio +support. + +If your site supports it, try using NAS (Network Audio Support). + +Try using the experimental portable dumper. It may work, or it may +not. + + *** `Pid xxx killed due to text modification or page I/O error' On HP-UX, you can get that error when the Emacs executable is on an NFS diff -r 72a7cfa4a488 -r abe6d1db359e aclocal.m4 --- a/aclocal.m4 Mon Aug 13 11:33:40 2007 +0200 +++ b/aclocal.m4 Mon Aug 13 11:35:02 2007 +0200 @@ -92,7 +92,7 @@ # PIC is the default for these OSes. ;; - os2*) + aix3* | aix4* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) @@ -101,6 +101,9 @@ # like `-m68040'. dll_cflags='-m68020 -resident32 -malways-restore-a4' ;; + *cygwin* | *mingw* ) + # PIC is the default + ;; *) dll_cflags='-fPIC' ;; @@ -170,7 +173,7 @@ if test -n "$dll_cflags"; then AC_MSG_RESULT([${dll_cflags}]) - + # Check to make sure the dll_cflags actually works. AC_MSG_CHECKING([if PIC flag ${dll_cflags} really works]) save_CFLAGS="$CFLAGS" @@ -197,13 +200,13 @@ dnl I believe that libtool is incorrect in trying to drive the linker dnl directly. This can cause considerable problems if the module you are dnl compiling has C++ or other static initializers. If we use ld directly, -dnl we dont end up with the crt stuff being linked in, and we dont end up +dnl we don't end up with the crt stuff being linked in, and we don't end up dnl with any .init or .fini sections (or the moral equivalent thereof). -dnl gcc takes great care to do this propperly when invoked in -shared -dnl mode, and we really do want this behaviour. Perhaps the libtool folks +dnl gcc takes great care to do this properly when invoked in -shared +dnl mode, and we really do want this behavior. Perhaps the libtool folks dnl are not aware that any SVR4 based dynamic loader will automatically dnl execute code in the .init section before dlopen() returns. This is -dnl vital, as the module may have been compiled to rely on that behaviour. +dnl vital, as the module may have been compiled to rely on that behavior. dnl dnl So, having said all of that, we diverge from libtool significantly dnl here. We want to try and use the C compiler as much as possible. Only @@ -216,7 +219,7 @@ dnl gcc uses, which can be the internal collect2 that comes with gcc. dnl If the user ever changes their compiler version, the paths will no dnl longer be correct, and ellcc will break. This is clearly unacceptable. -dnl By using the compiler driver on the path, we dont have this problem. +dnl By using the compiler driver on the path, we don't have this problem. dnl If that is not clear, consider that gcc -print-prog-name=ld can dnl produce something along the lines of: dnl /usr/local/lib/gcc-lib/OS-NAME/GCC-VERSION/ld @@ -228,7 +231,7 @@ dnl shared objects, we try that. Only if all of that fails do we revert dnl back to the libtool ld trickery. dnl -dnl We dont do ANY of this if we can't produce shared objects. +dnl We don't do ANY of this if we can't produce shared objects. dnl if test "$can_build_shared" = "yes"; then cc_produces_so=no @@ -386,6 +389,7 @@ dll_ld=$CC dll_ldflags=$xcldf can_build_shared=yes + ld_shlibs=yes else # OK - only NOW do we futz about with ld. # See if the linker supports building shared libraries. @@ -509,7 +513,7 @@ dnl Last thing, check how to get a linked executable to have its symbols dnl exported, so that the modules have access to them. dnl -dnl XEmacs FIXME - we need to set ld_dynamic_link_flags propperly for +dnl XEmacs FIXME - we need to set ld_dynamic_link_flags properly for dnl most of these systems, which was missing from libtool. I know they dnl all have a way of doing this, but someone needs to look at this dnl for each OS and make sure it is correct. Remember that the arguments diff -r 72a7cfa4a488 -r abe6d1db359e config.guess --- a/config.guess Mon Aug 13 11:33:40 2007 +0200 +++ b/config.guess Mon Aug 13 11:35:02 2007 +0200 @@ -1,8 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -# + +version='2000-05-30' + # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -23,8 +25,7 @@ # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . -# The master version of this file is at the FSF in /home/gd/gnu/lib. -# Please send patches to . +# Please send patches to . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and @@ -37,6 +38,46 @@ # (but try to keep the structure clean). # +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of this system. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + # Use $HOST_CC if defined. $CC may point to a cross-compiler if test x"$CC_FOR_BUILD" = x; then if test x"$HOST_CC" != x; then @@ -68,6 +109,43 @@ # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-cbm ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format. + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -77,41 +155,51 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text .globl main + .align 4 .ent main main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit .end main EOF $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) + case `./$dummy` in + 0-0) UNAME_MACHINE="alpha" ;; - 15) + 1-0) UNAME_MACHINE="alphaev5" ;; - 14) + 1-1) UNAME_MACHINE="alphaev56" ;; - 10) + 1-101) UNAME_MACHINE="alphapca56" ;; - 16) + 2-303) UNAME_MACHINE="alphaev6" ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; esac fi rm -f $dummy.s $dummy @@ -129,9 +217,6 @@ Amiga*:UNIX_System_V:4.0:*) echo m68k-cbm-sysv4 exit 0;; - amiga:NetBSD:*:*) - echo m68k-cbm-netbsd${UNAME_RELEASE} - exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -162,9 +247,6 @@ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - arm32:NetBSD:*:*) - echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; SR2?01:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; @@ -221,15 +303,12 @@ aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; - atari*:NetBSD:*:*) - echo m68k-atari-netbsd${UNAME_RELEASE} - exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor + # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not @@ -253,15 +332,9 @@ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; - sun3*:NetBSD:*:*) - echo m68k-sun-netbsd${UNAME_RELEASE} - exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - mac68k:NetBSD:*:*) - echo m68k-apple-netbsd${UNAME_RELEASE} - exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -274,9 +347,6 @@ powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; - macppc:NetBSD:*:*) - echo powerpc-apple-netbsd${UNAME_RELEASE} - exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; @@ -292,6 +362,7 @@ mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus +#include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { @@ -331,7 +402,7 @@ AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110] + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] @@ -408,7 +479,7 @@ ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) @@ -429,6 +500,8 @@ 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE #include #include @@ -553,10 +626,13 @@ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ exit 0 ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos @@ -569,13 +645,10 @@ F301:UNIX_System_V:*:*) echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` exit 0 ;; - hp3[0-9][05]:NetBSD:*:*) - echo m68k-hp-netbsd${UNAME_RELEASE} - exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) + i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -585,17 +658,8 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - if test -x /usr/bin/objformat; then - if test "elf" = "`/usr/bin/objformat`"; then - echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 - fi - fi echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; - *:NetBSD:*:*) - echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; @@ -644,6 +708,10 @@ echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; + elf_i?86) + echo "${UNAME_MACHINE}-pc-linux" + exit 0 + ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 @@ -657,7 +725,7 @@ exit 0 ;; elf32arm*) - echo "${UNAME_MACHINE}-unknown-linux-gnu" + echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" exit 0 ;; armelf_linux*) @@ -668,7 +736,7 @@ echo "${UNAME_MACHINE}-unknown-linux-gnuaout" exit 0 ;; - elf32ppc) + elf32ppc | elf32ppclinux) # Determine Lib Version cat >$dummy.c < @@ -695,51 +763,65 @@ if test "$?" = 0 ; then LIBC="libc1" fi - fi + fi rm -f $dummy.c $dummy echo powerpc-unknown-linux-gnu${LIBC} exit 0 ;; + shelf_linux) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; esac if test "${UNAME_MACHINE}" = "alpha" ; then - sed 's/^ //' <$dummy.s - .globl main - .ent main - main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main + cat <$dummy.s + .data + \$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main + main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main EOF LIBC="" $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) + case `./$dummy` in + 0-0) UNAME_MACHINE="alpha" ;; - 15) + 1-0) UNAME_MACHINE="alphaev5" ;; - 14) + 1-1) UNAME_MACHINE="alphaev56" ;; - 10) + 1-101) UNAME_MACHINE="alphapca56" ;; - 16) + 2-303) UNAME_MACHINE="alphaev6" ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; esac objdump --private-headers $dummy | \ @@ -753,6 +835,7 @@ elif test "${UNAME_MACHINE}" = "mips" ; then cat >$dummy.c < /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { @@ -768,6 +851,8 @@ EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy + elif test "${UNAME_MACHINE}" = "s390"; then + echo s390-ibm-linux && exit 0 else # Either a pre-BFD a.out linker (linux-gnuoldld) # or one that does not give us useful --help. @@ -789,6 +874,7 @@ cat >$dummy.c < #ifdef __cplusplus +#include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { @@ -860,7 +946,11 @@ echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; + i?86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; pc:*:*:*) + # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp @@ -974,8 +1064,26 @@ *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; *:QNX:*:4*) - echo i386-qnx-qnx${UNAME_VERSION} + echo i386-pc-qnx + exit 0 ;; + NSR-W:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; esac @@ -1116,6 +1224,47 @@ esac fi -#echo '(Unable to guess system type)' 1>&2 +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess version = $version + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -r 72a7cfa4a488 -r abe6d1db359e config.sub --- a/config.sub Mon Aug 13 11:33:40 2007 +0200 +++ b/config.sub Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,10 @@ #! /bin/sh # Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. + +version='2000-05-31' + # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -25,6 +29,9 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. +# Written by Per Bothner . +# Please send patches to . +# # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. @@ -45,30 +52,61 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - linux-gnu*) + nto-qnx* | linux-gnu*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -169,15 +207,18 @@ tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ + | hppa64 \ + | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ + | alphaev6[78] \ | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr5000 | miprs64vr5000el | mcore \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | fr30) + | thumb | d10v | fr30 | avr) basic_machine=$basic_machine-unknown ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) @@ -201,8 +242,11 @@ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ - | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ + | hppa2.0n-* | hppa64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ + | alphaev6[78]-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ | clipper-* | orion-* \ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ @@ -210,9 +254,10 @@ | mips64el-* | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | t3e-* \ + | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* ) + | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ + | bs2000-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -464,9 +509,6 @@ basic_machine=i386-unknown os=-mingw32 ;; - i386-qnx | qnx) - basic_machine=i386-qnx - ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -513,6 +555,10 @@ mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; monitor) basic_machine=m68k-rom68k os=-coff @@ -585,6 +631,9 @@ np1) basic_machine=np1-gould ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -617,7 +666,7 @@ pentium | p5 | k5 | k6 | nexen) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86) + pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) @@ -626,7 +675,7 @@ pentium-* | p5-* | k5-* | k6-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-* | 6x86-*) + pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) @@ -729,6 +778,10 @@ sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; symmetry) basic_machine=i386-sequent os=-dynix @@ -918,12 +971,25 @@ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*) + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit*) # Remember, each alternative MUST END IN *, to match a version number. ;; + -qnx*) + case $basic_machine in + x86-* | i[34567]86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mon960* | -lnews*) + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` @@ -940,6 +1006,9 @@ -opened*) os=-openedition ;; + -wince*) + os=-wince + ;; -osfrose*) os=-osfrose ;; @@ -964,6 +1033,9 @@ -ns2 ) os=-nextstep2 ;; + -nsk) + os=-nsk + ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` @@ -977,9 +1049,6 @@ -oss*) os=-sysv3 ;; - -qnx) - os=-qnx4 - ;; -svr4) os=-sysv4 ;; @@ -1230,3 +1299,11 @@ esac echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -r 72a7cfa4a488 -r abe6d1db359e configure --- a/configure Mon Aug 13 11:33:40 2007 +0200 +++ b/configure Mon Aug 13 11:35:02 2007 +0200 @@ -14,7 +14,7 @@ ### from the file `./configure.in'. ### To rebuild it, execute the command ### autoconf -### in the this directory. You must have autoconf version 2.12 or later. +### in the this directory. You must have autoconf version 2.13 or later. ### This file is part of XEmacs. @@ -92,6 +92,7 @@ subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} ac_max_here_lines=12 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 @@ -239,7 +240,6 @@ pkgdir='${datadir}/${instvardir}/lisp' package_path='' etcdir='${datadir}/${instvardir}/etc' -lockdir='${statedir}/${inststaticdir}/lock' archlibdir='${datadir}/${instvardir}/${configuration}' docdir='${archlibdir}' with_prefix='yes' @@ -350,6 +350,7 @@ with_sparcworks | \ with_tooltalk | \ with_ldap | \ + with_postgresql | \ with_pop | \ with_kerberos | \ with_hesiod | \ @@ -358,7 +359,6 @@ external_widget | \ verbose | \ extra_verbose | \ - const_is_losing | \ usage_tracking | \ use_union_type | \ pdump | \ @@ -367,7 +367,7 @@ memory_usage_stats | \ with_clash_detection | \ with_modules | \ - no_doc_file ) + quick_build ) case "$val" in y | ye | yes ) val=yes ;; n | no ) val=no ;; @@ -551,14 +551,17 @@ byte_code ) error_check_byte_code=yes ;; nobyte_code ) error_check_byte_code=no ;; + glyphs ) error_check_glyphs=yes ;; + noglyphs ) error_check_glyphs=no ;; + * ) bogus_error_check=yes ;; esac if test "$bogus_error_check" -o \ \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then if test "$error_check_default" = yes ; then - types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'." + types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', \`noglyphs' and \`nobyte-code'." else - types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'." + types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', \`glyphs' and \`byte-code'." fi (echo "$progname: Usage error:" echo " " "Valid types for the \`--$optname' option are: @@ -571,6 +574,7 @@ error_check_gc=$new_default error_check_malloc=$new_default error_check_byte_code=$new_default + error_check_glyphs=$new_default new_default= # reset this fi echeck_notfirst=true @@ -579,7 +583,7 @@ prefix | exec_prefix | bindir | datadir | statedir | libdir | \ - mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \ + mandir | infodir | infopath | lispdir | etcdir | pkgdir | \ archlibdir | docdir | package_path ) if test "$valomitted" = "yes"; then if test "$#" = 0; then @@ -689,14 +693,6 @@ EOF } ;; - statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF - Defining LOCKDIR_USER_DEFINED -EOF -cat >> confdefs.h <<\EOF -#define LOCKDIR_USER_DEFINED 1 -EOF -} - ;; docdir ) { test "$extra_verbose" = "yes" && cat << \EOF Defining DOCDIR_USER_DEFINED EOF @@ -722,16 +718,17 @@ "with_menubars" | \ "with_scrollbars" | \ - "with_dialogs" | \ + "with_dialogs" | \ "with_widgets" ) case "$val" in l | lu | luc | luci | lucid ) val=lucid ;; m | mo | mot | moti | motif ) val=motif ;; a | at | ath | athe | athen | athena ) val=athena ;; - n | no | non | none ) val=no ;; + n | no | non | none ) val=no ;; + y | ye | yes ) val=yes ;; * ) (echo "$progname: Usage error:" echo " " "The \`--$optname' option must have one of these values: - \`lucid', \`motif', \`athena', or \`no'." + \`lucid', \`motif', \`athena', \`yes', or \`no'." echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; esac eval "$opt=\"$val\"" @@ -740,6 +737,7 @@ "use_minimal_tagbits" | \ "use_indexed_lrecord_implementation" | \ "run_in_place" | \ + "const_is_losing" | \ "with_gnu_make" ) echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2 ;; @@ -832,7 +830,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:836: checking whether ln -s works" >&5 +echo "configure:834: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -995,6 +993,15 @@ PROGNAME=xemacs fi +{ test "$extra_verbose" = "yes" && cat << EOF + Defining EMACS_PROGNAME = "$PROGNAME" +EOF +cat >> confdefs.h <> confdefs.h <<\EOF +#define ERROR_CHECK_GLYPHS 1 +EOF +} + if test "${debug:=$beta}" = "yes"; then use_assertions=yes memory_usage_stats=yes extra_objs="$extra_objs debug.o" && if test "$extra_verbose" = "yes"; then @@ -1080,7 +1095,7 @@ echo $ac_n "checking "host system type"""... $ac_c" 1>&6 -echo "configure:1084: checking "host system type"" >&5 +echo "configure:1099: 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/'` @@ -1110,8 +1125,7 @@ m68*-sony-* ) machine=news ;; mips-sony-* ) machine=news-risc ;; clipper-* ) machine=clipper ;; - arm-* ) machine=arm ;; - armv34lb-* ) machine=arm ;; + arm* ) machine=arm ;; ns32k-* ) machine=ns32000 ;; esac @@ -1480,12 +1494,39 @@ esac -if test -z "$machine" -o -z "$opsys"; then - (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems." - echo "$progname: Check \`etc/MACHINES' for recognized configuration names." - ) >&2 - exit 1 -fi +test -z "$machine" && machine=`echo $canonical | sed 's/-.*$//'` +test -z "$opsys" && opsys=`echo $canonical | sed 's/^^-*-^-*-//'` + +if test -r "${srcdir}/src/m/${machine}.h"; then + machfile="m/${machine}.h" + { test "$extra_verbose" = "yes" && cat << EOF + Defining config_machfile = "$machfile" +EOF +cat >> confdefs.h <> confdefs.h <&6 -echo "configure:1580: checking for $ac_word" >&5 +echo "configure:1618: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1603,7 +1641,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:1607: checking for $ac_word" >&5 +echo "configure:1645: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1651,7 +1689,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:1655: checking for $ac_word" >&5 +echo "configure:1693: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1680,7 +1718,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1684: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1722: 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' @@ -1693,12 +1731,12 @@ cat > conftest.$ac_ext << EOF -#line 1697 "configure" +#line 1735 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1740: \"$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 @@ -1726,19 +1764,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:1730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1768: 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:1735: checking whether we are using GNU C" >&5 +echo "configure:1773: 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:1780: \"$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 @@ -1756,7 +1794,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1760: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1798: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1789,7 +1827,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:1793: checking for $ac_word" >&5 +echo "configure:1831: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1816,7 +1854,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:1820: checking for $ac_word" >&5 +echo "configure:1858: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1864,7 +1902,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:1868: checking for $ac_word" >&5 +echo "configure:1906: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1893,7 +1931,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1897: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1935: 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' @@ -1906,12 +1944,12 @@ cat > conftest.$ac_ext << EOF -#line 1910 "configure" +#line 1948 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1953: \"$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 @@ -1939,19 +1977,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:1943: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1981: 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:1948: checking whether we are using GNU C" >&5 +echo "configure:1986: 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:1993: \"$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 @@ -1969,7 +2007,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1973: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2011: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2002,7 +2040,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:2006: checking for $ac_word" >&5 +echo "configure:2044: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2029,7 +2067,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:2033: checking for $ac_word" >&5 +echo "configure:2071: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2077,7 +2115,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:2081: checking for $ac_word" >&5 +echo "configure:2119: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2106,7 +2144,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2110: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2148: 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' @@ -2119,12 +2157,12 @@ cat > conftest.$ac_ext << EOF -#line 2123 "configure" +#line 2161 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2166: \"$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 @@ -2152,19 +2190,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:2156: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2194: 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:2161: checking whether we are using GNU C" >&5 +echo "configure:2199: 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:2206: \"$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 @@ -2182,7 +2220,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2186: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2224: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2219,7 +2257,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:2223: checking how to run the C preprocessor" >&5 +echo "configure:2261: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2232,13 +2270,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:2242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2280: \"$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 : @@ -2249,13 +2287,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:2259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2297: \"$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 : @@ -2266,13 +2304,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:2276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2314: \"$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 : @@ -2296,10 +2334,11 @@ echo "$ac_t""$CPP" 1>&6 + echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2301: checking for AIX" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&6 -echo "configure:2330: checking for GNU libc" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { @@ -2340,7 +2379,7 @@ ; return 0; } EOF -if { (eval echo configure:2344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_glibc=yes else @@ -2360,21 +2399,78 @@ } - -cat > conftest.$ac_ext <> confdefs.h <<\EOF +#define __EXTENSIONS__ 1 +EOF +} + + if test "$os_release" -ge 55; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining _XOPEN_SOURCE = 500 +EOF +cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE 500 +EOF +} + + { test "$extra_verbose" = "yes" && cat << \EOF + Defining _XOPEN_SOURCE_EXTENDED +EOF +cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE_EXTENDED 1 +EOF +} + + fi ;; + linux) + { test "$extra_verbose" = "yes" && cat << \EOF + Defining _POSIX_C_SOURCE = 199506L +EOF +cat >> confdefs.h <<\EOF +#define _POSIX_C_SOURCE 199506L +EOF +} + + { test "$extra_verbose" = "yes" && cat << \EOF + Defining _XOPEN_SOURCE = 500 +EOF +cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE 500 +EOF +} + + { test "$extra_verbose" = "yes" && cat << \EOF + Defining _XOPEN_SOURCE_EXTENDED +EOF +cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE_EXTENDED 1 +EOF +} + + ;; +esac + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -2385,6 +2481,7 @@ case "$conftest_rc" in 11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;; 12) echo "You appear to be using the DEC C compiler." ; __DECC=yes ;; + 13) echo "You appear to be using the SCO C compiler." ; __USLC__=yes ;; esac fi rm -fr conftest* @@ -2398,7 +2495,8 @@ -cat > $tempcname < $tempcname < confdefs.h +cat >> $tempcname <&6 +echo "configure:2703: 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 + rm -rf conftest* + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + 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 + rm -rf conftest* + need_kalloca=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + c_switch_system="$xe_save_c_switch_system" +fi +rm -f conftest* + echo "$ac_t""$need_kalloca" 1>&6 + test "$need_kalloca" = "yes" && c_switch_system="$c_switch_system -Kalloca" && if test "$extra_verbose" = "yes"; then echo " Appending \"-Kalloca\" to \$c_switch_system"; fi +fi if test "$cflags_specified" = "no"; then if test "$GCC" = "yes"; then @@ -2596,6 +2758,64 @@ CFLAGS="-O" ; fi fi +if test "$GCC" = "yes"; then +echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6 +echo "configure:2764: 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.*) + case "$CFLAGS" in + *-O2*|*-O3*) + case "$CFLAGS" in + *-fno-schedule-insns*) ;; + *) + echo "$ac_t""yes" 1>&6 + echo "configure: warning: Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures" 1>&2 + echo "configure: warning: without also using -fno-schedule-insns." 1>&2 + { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; } + ;; + esac + ;; + esac + ;; + Linux:alpha:egcs-2.91.*) + echo "$ac_t""yes" 1>&6 + echo "configure: warning: There have been reports of egcs-1.1 not compiling XEmacs correctly on" 1>&2 + echo "configure: warning: Alpha Linux. There have also been reports that egcs-1.0.3a is O.K." 1>&2 + { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; } + ;; + *:i*86*:2.7.2*) + case "$GCC_VERSION" in + 2.7.2) + case "$CFLAGS" in + *-O2*|*-O3*) + case "$CFLAGS" in + *-fno-strength-reduce*) ;; + *) + echo "$ac_t""yes" 1>&6 + echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2 + echo "configure: warning: -fno-strength-reduce." 1>&2 + { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; } + ;; + esac + ;; + esac + ;; + esac + case "$CFLAGS" in + *-fno-caller-saves*) ;; + *) + echo "$ac_t""yes" 1>&6 + echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2 + echo "configure: warning: -fno-caller-saves." 1>&2 + { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; } + ;; + esac + ;; +esac +echo "$ac_t""no" 1>&6 +fi + if test "$GCC" = "yes"; then set x $ld_switch_system; shift; ld_switch_system="" @@ -2655,12 +2875,15 @@ test -n "$objects_system" && extra_objs="$extra_objs $objects_system" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"$objects_system\"" fi -test -n "$unexec" && extra_objs="$extra_objs $unexec" && if test "$extra_verbose" = "yes"; then +test -n "$unexec" && test ! "$pdump" = "yes" && extra_objs="$extra_objs $unexec" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"$unexec\"" fi +test "$pdump" = "yes" && extra_objs="$extra_objs dumper.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"dumper.o\"" + fi echo $ac_n "checking for dynodump""... $ac_c" 1>&6 -echo "configure:2664: checking for dynodump" >&5 +echo "configure:2887: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -2698,12 +2921,12 @@ done echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6 -echo "configure:2702: checking for terminateAndUnload in -lC" >&5 +echo "configure:2925: 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:2941: \"$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 @@ -2822,7 +3045,7 @@ if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:2826: checking "for runtime libraries flag"" >&5 +echo "configure:3049: checking "for runtime libraries flag"" >&5 case "$opsys" in sol2 ) dash_r="-R" ;; decosf* | linux* | irix*) dash_r="-rpath " ;; @@ -2844,14 +3067,14 @@ done fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +#line 3071 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* dash_r="$try_dash_r" else @@ -2952,57 +3175,11 @@ doug_lea_malloc=no fi after_morecore_hook_exists=yes -echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6 -echo "configure:2957: checking for malloc_get_state" >&5 - -cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char malloc_get_state(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state) -choke me -#else -malloc_get_state(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_malloc_get_state=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_malloc_get_state=no" -fi -rm -f conftest* - -if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -doug_lea_malloc=no -fi - echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6 -echo "configure:3003: checking for malloc_set_state" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3206: \"$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 @@ -3045,16 +3222,16 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:3049: checking whether __after_morecore_hook exists" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3235: \"$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 @@ -3068,22 +3245,20 @@ if test "$system_malloc" = "yes" ; then GNU_MALLOC=no GNU_MALLOC_reason=" - (The GNU allocators don't work with this system configuration)." + - The GNU allocators don't work with this system configuration." elif test "$with_system_malloc" = "yes" ; then GNU_MALLOC=no GNU_MALLOC_reason=" - (User chose not to use GNU allocators)." + - User chose not to use GNU allocators." elif test "$with_debug_malloc" = "yes" ; then GNU_MALLOC=no GNU_MALLOC_reason=" - (User chose to use Debugging Malloc)." -fi - -if test "$doug_lea_malloc" = "yes" ; then - if test "$GNU_MALLOC" = yes ; then - GNU_MALLOC_reason=" - (Using Doug Lea's new malloc from the GNU C Library.)" - fi + - User chose to use Debugging Malloc." +fi + +if test "$doug_lea_malloc" = "yes" -a "$GNU_MALLOC" = "yes" ; then + GNU_MALLOC_reason=" + - Using Doug Lea's new malloc from the GNU C Library." { test "$extra_verbose" = "yes" && cat << \EOF Defining DOUG_LEA_MALLOC EOF @@ -3094,7 +3269,7 @@ if test "$after_morecore_hook_exists" = "no" ; then GNU_MALLOC_reason=" - (Using Doug Lea's new malloc from the Linux C Library.)" + - Using Doug Lea's new malloc from the Linux C Library." { test "$extra_verbose" = "yes" && cat << \EOF Defining _NO_MALLOC_WARNING_ EOF @@ -3104,7 +3279,6 @@ } fi - use_minimal_tagbits=yes fi @@ -3113,7 +3287,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:3117: checking for $ac_word" >&5 +echo "configure:3291: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -3168,7 +3342,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:3172: checking for a BSD compatible install" >&5 +echo "configure:3346: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" @@ -3222,7 +3396,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:3226: checking for $ac_word" >&5 +echo "configure:3400: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -3250,101 +3424,19 @@ test -n "$YACC" || YACC="yacc" -for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h +for ac_hdr in a.out.h cygwin/version.h fcntl.h inttypes.h libgen.h locale.h mach/mach.h sys/param.h sys/pstat.h sys/time.h sys/timeb.h sys/un.h ulimit.h unistd.h utime.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3258: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3266: \"$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* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_hdr -EOF -cat >> confdefs.h <&6 -fi -done - -for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3299: 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:3307: \"$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* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_hdr -EOF -cat >> confdefs.h <&6 -fi -done - -for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3340: 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:3348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3440: \"$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* @@ -3374,10 +3466,10 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3378: checking for sys/wait.h that is POSIX.1 compatible" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3393,7 +3485,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -3417,10 +3509,10 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3421: checking for ANSI C header files" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3428,7 +3520,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3524: \"$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* @@ -3445,7 +3537,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 @@ -3463,7 +3555,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 @@ -3481,7 +3573,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') @@ -3492,7 +3584,7 @@ exit (0); } EOF -if { (eval echo configure:3496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:3588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -3518,10 +3610,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3522: checking whether time.h and sys/time.h may both be included" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3530,7 +3622,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3554,10 +3646,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3558: checking for sys_siglist declaration in signal.h or unistd.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3569,7 +3661,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3594,9 +3686,9 @@ echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:3598: checking for struct utimbuf" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < @@ -3615,7 +3707,7 @@ static struct utimbuf x; x.actime = x.modtime; ; return 0; } EOF -if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3711: \"$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 @@ -3635,10 +3727,10 @@ rm -f conftest* echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3639: checking return type of signal handlers" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3655,7 +3747,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3677,10 +3769,10 @@ echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3681: checking for size_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3711,10 +3803,10 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3715: checking for pid_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3745,10 +3837,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3749: checking for uid_t in sys/types.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF @@ -3784,10 +3876,10 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:3788: checking for mode_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3818,10 +3910,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3822: checking for off_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3852,10 +3944,10 @@ fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:3856: checking for ssize_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3886,10 +3978,71 @@ fi +echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 +echo "configure:3983: checking for socklen_t" >&5 +cat > conftest.$ac_ext < +socklen_t x; + +int main() { + +; return 0; } +EOF +if { (eval echo configure:3994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + +cat > conftest.$ac_ext < +int accept (int, struct sockaddr *, size_t *); + +int main() { + +; return 0; } +EOF +if { (eval echo configure:4012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + +echo "$ac_t""size_t" 1>&6 +{ test "$extra_verbose" = "yes" && cat << \EOF + Defining socklen_t = size_t +EOF +cat >> confdefs.h <<\EOF +#define socklen_t size_t +EOF +} + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + +echo "$ac_t""int" 1>&6 +{ test "$extra_verbose" = "yes" && cat << \EOF + Defining socklen_t = int +EOF +cat >> confdefs.h <<\EOF +#define socklen_t int +EOF +} + +fi +rm -f conftest* +fi +rm -f conftest* + echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:3891: checking for struct timeval" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < @@ -3905,7 +4058,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:3909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -3927,10 +4080,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:3931: checking whether struct tm is in sys/time.h or time.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3938,7 +4091,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3962,10 +4115,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:3966: checking for tm_zone in struct tm" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -3973,7 +4126,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:3977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -3996,10 +4149,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:4000: checking for tzname" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -4009,7 +4162,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:4013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -4035,10 +4188,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4039: checking for working const" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4112,7 +4265,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:4116: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:4269: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -4137,12 +4290,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4141: checking whether byte ordering is bigendian" >&5 +echo "configure:4294: 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 @@ -4153,11 +4306,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:4157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4310: \"$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 @@ -4168,7 +4321,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:4172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4185,7 +4338,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:4355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_bigendian=no else @@ -4225,10 +4378,10 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4229: checking size of short" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4239,7 +4392,7 @@ exit(0); } EOF -if { (eval echo configure:4243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -4267,10 +4420,10 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4271: checking size of int" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4281,7 +4434,7 @@ exit(0); } EOF -if { (eval echo configure:4285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -4303,10 +4456,10 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4307: checking size of long" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4317,7 +4470,7 @@ exit(0); } EOF -if { (eval echo configure:4321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -4339,10 +4492,10 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4343: checking size of long long" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4353,7 +4506,7 @@ exit(0); } EOF -if { (eval echo configure:4357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4510: \"$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 @@ -4375,10 +4528,10 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4379: checking size of void *" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4389,7 +4542,7 @@ exit(0); } EOF -if { (eval echo configure:4393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4546: \"$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 @@ -4412,7 +4565,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:4416: checking for long file names" >&5 +echo "configure:4569: 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: @@ -4458,10 +4611,10 @@ echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4462: checking for sin" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4641: \"$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 @@ -4502,12 +4655,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:4506: checking for sin in -lm" >&5 +echo "configure:4659: 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:4675: \"$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 @@ -4562,14 +4715,14 @@ cat > conftest.$ac_ext < int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:4573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4726: \"$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 @@ -4586,14 +4739,14 @@ rm -f conftest* echo "checking type of mail spool file locking" 1>&6 -echo "configure:4590: checking type of mail spool file locking" >&5 +echo "configure:4743: 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:4594: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4773: \"$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 @@ -4646,6 +4799,12 @@ test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf test -z "$mail_locking" -a "$mail_use_locking" = "yes" && mail_locking=locking +if test -z "$mail_locking"; then + case "$opsys" in cygwin* | mingw*) + mail_locking=pop ;; + esac +fi + if test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining MAIL_LOCK_LOCKF EOF @@ -4670,6 +4829,9 @@ EOF } +elif test "$mail_locking" = "pop"; then + with_pop=yes + mail_locking= else mail_locking="dot-locking"; { test "$extra_verbose" = "yes" && cat << \EOF Defining MAIL_LOCK_DOT EOF @@ -4689,12 +4851,12 @@ case "$opsys" in decosf*) echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:4693: checking for cma_open in -lpthreads" >&5 +echo "configure:4855: 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:4871: \"$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 @@ -4741,7 +4903,7 @@ esac echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:4745: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:4907: 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; @@ -4750,19 +4912,21 @@ else echo "$ac_t""no" 1>&6 fi -if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then - echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6 -echo "configure:4756: 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 ;; - *) echo "$ac_t""no" 1>&6 ;; - esac +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:4919: 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 ;; + *) echo "$ac_t""no" 1>&6 ;; + esac + fi fi echo "checking "for specified window system"" 1>&6 -echo "configure:4766: checking "for specified window system"" >&5 +echo "configure:4930: checking "for specified window system"" >&5 if test "$with_x11" != "no"; then test "$x_includes $x_libraries" != "NONE NONE" && \ @@ -4795,7 +4959,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:4799: checking for X" >&5 +echo "configure:4963: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4855,12 +5019,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:4864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5028: \"$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* @@ -4929,14 +5093,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:5104: \"$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. @@ -5045,17 +5209,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:5049: checking whether -R must be followed by a space" >&5 +echo "configure:5213: 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 +#line 5216 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:5223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -5071,14 +5235,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 +#line 5239 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:5246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -5114,12 +5278,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:5118: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:5282: 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:5298: \"$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,12 +5318,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:5158: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:5322: 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:5338: \"$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 @@ -5199,10 +5363,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:5203: checking for gethostbyname" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5393: \"$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 @@ -5246,12 +5410,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:5250: checking for gethostbyname in -lnsl" >&5 +echo "configure:5414: 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:5430: \"$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 @@ -5292,10 +5456,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:5296: checking for connect" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5486: \"$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 @@ -5341,12 +5505,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:5345: checking "$xe_msg_checking"" >&5 +echo "configure:5509: 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:5525: \"$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 @@ -5381,10 +5545,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:5385: checking for remove" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5575: \"$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 @@ -5428,12 +5592,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:5432: checking for remove in -lposix" >&5 +echo "configure:5596: 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:5612: \"$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 @@ -5468,10 +5632,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:5472: checking for shmat" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5662: \"$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 @@ -5515,12 +5679,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:5519: checking for shmat in -lipc" >&5 +echo "configure:5683: 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:5699: \"$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 @@ -5567,12 +5731,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:5571: checking "$xe_msg_checking"" >&5 +echo "configure:5735: 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:5751: \"$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 @@ -5658,7 +5822,9 @@ break; fi done - if test "$GCC" = yes -a -d /usr/shlib; then X_LIBS="$X_LIBS -L/usr/shlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L/usr/shlib\" to \$X_LIBS"; fi; fi + case "$opsys" in + decosf*) if test "$GCC" = yes -a -d /usr/shlib; then X_LIBS="$X_LIBS -L/usr/shlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L/usr/shlib\" to \$X_LIBS"; fi; fi ;; + esac ld_switch_x_site="$X_LIBS" @@ -5752,7 +5918,7 @@ echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:5756: checking for X defines extracted by xmkmf" >&5 +echo "configure:5922: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -5767,32 +5933,47 @@ cd .. rm -fr conftestdir for word in $xmkmf_defines; do - case "$word" in - -D*=* ) ;; - -D* ) word=`echo '' $word | sed -e 's:^ *-D::'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $word -EOF -cat >> confdefs.h </dev/null; then :; else + if test "$val" = "1" + then { test "$extra_verbose" = "yes" && cat << EOF + Defining $sym +EOF +cat >> confdefs.h <> confdefs.h <&6 -echo "configure:5788: checking for X11/Intrinsic.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5796: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5977: \"$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* @@ -5816,12 +5997,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:5820: checking for XOpenDisplay in -lX11" >&5 +echo "configure:6001: 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: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 @@ -5857,12 +6038,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:5861: checking "$xe_msg_checking"" >&5 +echo "configure:6042: 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:6058: \"$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 @@ -5900,12 +6081,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:5904: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:6085: 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:6101: \"$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 @@ -5939,12 +6120,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:5943: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:6124: 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:6140: \"$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 @@ -5978,14 +6159,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:5982: checking the version of X11 being used" >&5 +echo "configure:6163: 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:5989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:6170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest foobar; x11_release=$? else @@ -6006,19 +6187,83 @@ } + if test "${x11_release}" = "4"; then + case "$with_widgets" in + "" | "no") with_widgets=no ;; + *) { echo "Error:" "Widget support requires X11R5 or greater" >&2; exit 1; } ;; + esac + fi + + for ac_func in XConvertCase +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:6201: checking for $ac_func" >&5 + +cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6227: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_func +EOF +cat >> confdefs.h <&6 +fi +done + + for ac_hdr in X11/Xlocale.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6014: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6267: \"$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* @@ -6049,7 +6294,7 @@ echo $ac_n "checking for XFree86""... $ac_c" 1>&6 -echo "configure:6053: checking for XFree86" >&5 +echo "configure:6298: checking for XFree86" >&5 if test -d "/usr/X386/include" -o \ -f "/etc/XF86Config" -o \ -f "/etc/X11/XF86Config" -o \ @@ -6069,12 +6314,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:6073: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:6318: 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:6334: \"$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 @@ -6124,19 +6369,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:6128: checking for main in -lXbsd" >&5 +echo "configure:6373: 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:6385: \"$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 @@ -6173,22 +6418,22 @@ fi if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:6177: checking for MS-Windows" >&5 +echo "configure:6422: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:6180: checking for main in -lgdi32" >&5 +echo "configure:6425: 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:6437: \"$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 @@ -6218,7 +6463,7 @@ } install_pp="$blddir/lib-src/installexe.sh" - libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32 -lwinspool" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32 -lwinspool\" to \$libs_system"; fi + libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool\" to \$libs_system"; fi test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" && if test "$extra_verbose" = "yes"; then echo " Appending \"msw\" to \$dragndrop_proto"; fi if test "$window_system" != x11; then window_system=msw @@ -6254,12 +6499,12 @@ fi fi cat > conftest.$ac_ext < int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } EOF -if { (eval echo configure:6263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:6508: \"$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 @@ -6275,7 +6520,6 @@ cat conftest.$ac_ext >&5 fi rm -fr conftest* - const_is_losing=no with_file_coding=yes extra_objs="$extra_objs console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o\"" @@ -6321,6 +6565,50 @@ done fi +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:6572: 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:6580: \"$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* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_BALLOON_HELP +EOF +cat >> confdefs.h <<\EOF +#define HAVE_BALLOON_HELP 1 +EOF +} + + extra_objs="$extra_objs balloon_help.o balloon-x.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"balloon_help.o balloon-x.o\"" + fi +else + echo "$ac_t""no" 1>&6 +fi + +fi + bitmapdir= case "$window_system" in @@ -6335,7 +6623,7 @@ esac echo "checking for WM_COMMAND option" 1>&6 -echo "configure:6339: checking for WM_COMMAND option" >&5; +echo "configure:6627: checking for WM_COMMAND option" >&5; if test "$with_wmcommand" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_WMCOMMAND @@ -6350,15 +6638,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:6354: checking for X11/Xauth.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6650: \"$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* @@ -6381,12 +6669,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:6385: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:6673: 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:6689: \"$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 @@ -6442,15 +6730,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:6446: checking for ${dir}tt_c.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6742: \"$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* @@ -6465,13 +6753,13 @@ rm -f conftest* if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - tt_c_h_path="${dir}tt_c.h"; break + tt_c_h_file="${dir}tt_c.h"; break else echo "$ac_t""no" 1>&6 fi done - if test -z "$tt_c_h_path"; then + if test -z "$tt_c_h_file"; then if test "$with_tooltalk" = "yes"; then (echo "$progname: Usage error:" echo " " "Unable to find required tooltalk header files." @@ -6486,12 +6774,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:6490: checking "$xe_msg_checking"" >&5 +echo "configure:6778: 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:6794: \"$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 @@ -6544,10 +6832,10 @@ } { test "$extra_verbose" = "yes" && cat << EOF - Defining TT_C_H_PATH = "$tt_c_h_path" -EOF -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:6563: checking for Dt/Dt.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6859: \"$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* @@ -6590,12 +6878,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:6594: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:6882: 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:6898: \"$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 @@ -6675,7 +6963,7 @@ fi echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 -echo "configure:6679: checking if drag and drop API is needed" >&5 +echo "configure:6967: checking if drag and drop API is needed" >&5 if test "$with_dragndrop" != "no" ; then if test -n "$dragndrop_proto" ; then with_dragndrop=yes @@ -6696,18 +6984,18 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:6700: checking for LDAP" >&5 +echo "configure:6988: checking for LDAP" >&5 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ldap.h""... $ac_c" 1>&6 -echo "configure:6703: checking for ldap.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6999: \"$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* @@ -6730,15 +7018,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:6734: checking for lber.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7030: \"$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* @@ -6762,12 +7050,12 @@ if test "$with_ldap" != "no"; then echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6 -echo "configure:6766: checking for ldap_search in -lldap" >&5 +echo "configure:7054: 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:7070: \"$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 @@ -6803,12 +7091,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:6807: checking "$xe_msg_checking"" >&5 +echo "configure:7095: 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:7111: \"$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 @@ -6844,12 +7132,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:6848: checking "$xe_msg_checking"" >&5 +echo "configure:7136: 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:7152: \"$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 @@ -6885,12 +7173,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:6889: checking "$xe_msg_checking"" >&5 +echo "configure:7177: 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:7193: \"$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 @@ -6952,10 +7240,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:6956: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7270: \"$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 @@ -7007,26 +7295,176 @@ fi +if test "$with_postgresql" != "no"; then + echo "checking for PostgreSQL" 1>&6 +echo "configure:7301: 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:7306: 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:7314: \"$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* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + libpq_fe_h_file=${header_dir}libpq-fe.h; break +else + echo "$ac_t""no" 1>&6 +fi + + done + + test -n "$libpq_fe_h_file" && { +echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6 +echo "configure:7338: 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 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + have_libpq=yes +else + echo "$ac_t""no" 1>&6 +fi + + } + + if test -n "$libpq_fe_h_file" -a "$have_libpq" = "yes"; then + with_postgresql=yes + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_POSTGRESQL +EOF +cat >> confdefs.h <<\EOF +#define HAVE_POSTGRESQL 1 +EOF +} + + +echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6 +echo "configure:7387: 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 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + with_postgresqlv7=yes; + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_POSTGRESQLV7 +EOF +cat >> confdefs.h <<\EOF +#define HAVE_POSTGRESQLV7 1 +EOF +} + +else + echo "$ac_t""no" 1>&6 +fi + + + { test "$extra_verbose" = "yes" && cat << EOF + Defining LIBPQ_FE_H_FILE = "$libpq_fe_h_file" +EOF +cat >> confdefs.h <&2; exit 1; } + fi +fi + if test "$window_system" != "none"; then echo "checking for graphics libraries" 1>&6 -echo "configure:7014: checking for graphics libraries" >&5 +echo "configure:7451: checking for graphics libraries" >&5 xpm_problem="" if test -z "$with_xpm"; then echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:7019: checking for Xpm - no older than 3.4f" >&5 +echo "configure:7456: checking for Xpm - no older than 3.4f" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext < int main(int c, char **v) { return c == 1 ? 0 : XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30406 ? 2 : 0 ;} EOF -if { (eval echo configure:7030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7468: \"$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 @@ -7068,17 +7506,17 @@ libs_x="-lXpm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXpm\" to \$libs_x"; fi echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6 -echo "configure:7072: checking for \"FOR_MSW\" xpm" >&5 +echo "configure:7510: 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:7520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* xpm_for_msw=no else @@ -7104,15 +7542,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:7108: checking for compface.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7554: \"$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* @@ -7135,12 +7573,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:7139: checking for UnGenFace in -lcompface" >&5 +echo "configure:7577: 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:7593: \"$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 @@ -7203,12 +7641,12 @@ if test "$with_png $with_tiff" != "no no"; then echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:7207: checking for inflate in -lc" >&5 +echo "configure:7645: 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:7661: \"$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 @@ -7238,12 +7676,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:7242: checking for inflate in -lz" >&5 +echo "configure:7680: 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:7696: \"$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 @@ -7273,12 +7711,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:7277: checking for inflate in -lgz" >&5 +echo "configure:7715: 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:7731: \"$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 @@ -7319,15 +7757,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:7323: checking for jpeglib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7769: \"$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* @@ -7350,12 +7788,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:7354: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:7792: 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:7808: \"$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 @@ -7402,10 +7840,10 @@ png_problem="" test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:7406: checking for pow" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7870: \"$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 @@ -7449,15 +7887,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:7453: checking for png.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7899: \"$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* @@ -7480,12 +7918,12 @@ } test -z "$with_png" && { echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:7484: checking for png_read_image in -lpng" >&5 +echo "configure:7922: 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:7938: \"$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 @@ -7519,10 +7957,10 @@ } if test -z "$with_png"; then echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 -echo "configure:7523: checking for workable png version information" >&5 +echo "configure:7961: checking for workable png version information" >&5 xe_check_libs="-lpng -lz" cat > conftest.$ac_ext < int main(int c, char **v) { @@ -7530,7 +7968,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:7534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7972: \"$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 @@ -7573,15 +8011,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:7577: checking for tiffio.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8023: \"$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* @@ -7604,12 +8042,12 @@ } test -z "$with_tiff" && { echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7608: checking for TIFFClientOpen in -ltiff" >&5 +echo "configure:8046: 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:8062: \"$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 @@ -7659,10 +8097,10 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:7663: checking for X11 graphics libraries" >&5 +echo "configure:8101: checking for X11 graphics libraries" >&5 echo "checking for the Athena widgets" 1>&6 -echo "configure:7666: checking for the Athena widgets" >&5 +echo "configure:8104: checking for the Athena widgets" >&5 case "$with_athena" in "xaw" | "") athena_variant=Xaw athena_3d=no ;; @@ -7676,12 +8114,12 @@ if test "$athena_3d" = "no"; then echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:7680: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 +echo "configure:8118: 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:8134: \"$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 @@ -7708,12 +8146,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:7712: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:8150: 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:8166: \"$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 @@ -7755,12 +8193,12 @@ else echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:7759: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:8197: 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:8213: \"$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 @@ -7789,12 +8227,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6 -echo "configure:7793: checking for threeDClassRec in -lXaw" >&5 +echo "configure:8231: 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:8247: \"$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 @@ -7836,15 +8274,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:7840: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8286: \"$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* @@ -7864,15 +8302,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:7868: checking for X11/Xaw/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8314: \"$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* @@ -7898,15 +8336,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:7902: checking for X11/$athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8348: \"$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* @@ -7923,15 +8361,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:7927: checking for X11/$athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8373: \"$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* @@ -7959,15 +8397,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:7963: checking for $athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8409: \"$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* @@ -7984,15 +8422,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:7988: checking for $athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8434: \"$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* @@ -8021,15 +8459,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:8025: checking for X11/Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8046,15 +8484,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:8050: checking for X11/Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8496: \"$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* @@ -8086,15 +8524,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:8090: checking for Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8536: \"$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* @@ -8111,15 +8549,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:8115: checking for Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8561: \"$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* @@ -8151,15 +8589,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:8155: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8601: \"$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* @@ -8194,15 +8632,15 @@ ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:8198: checking for Xm/Xm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8644: \"$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* @@ -8219,12 +8657,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:8223: checking for XmStringFree in -lXm" >&5 +echo "configure:8661: 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:8677: \"$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 @@ -8264,9 +8702,9 @@ if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:8268: checking for Lesstif" >&5 +echo "configure:8706: checking for Lesstif" >&5 cat > conftest.$ac_ext < #ifdef LESSTIF_VERSION @@ -8320,11 +8758,83 @@ libs_x="-l$athena_lib $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-l$athena_lib\" to \$libs_x"; fi - { test "$extra_verbose" = "yes" && cat << EOF - Defining ATHENA_H_PATH = $athena_h_path -EOF -cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <&6 -echo "configure:8603: checking for Mule-related features" >&5 +echo "configure:9114: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -8624,15 +9135,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8628: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8663,12 +9174,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:8667: checking for strerror in -lintl" >&5 +echo "configure:9178: 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:9194: \"$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 @@ -8712,18 +9223,18 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:8716: checking for Mule input methods" >&5 +echo "configure:9227: checking for Mule input methods" >&5 case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:8719: checking for XIM" >&5 +echo "configure:9230: checking for XIM" >&5 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6 -echo "configure:8722: checking for XOpenIM in -lX11" >&5 +echo "configure:9233: 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:9249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8758,12 +9269,12 @@ if test "$have_motif $have_lesstif" = "yes no"; then echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:8762: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:9273: 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:9289: \"$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 @@ -8839,15 +9350,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:8843: checking for XFontSet" >&5 +echo "configure:9354: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:8846: checking for XmbDrawString in -lX11" >&5 +echo "configure:9357: 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: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 @@ -8898,15 +9409,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:8902: checking for wnn/jllib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9421: \"$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* @@ -8931,10 +9442,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8935: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9472: \"$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 @@ -8986,12 +9497,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:8990: checking for crypt in -lcrypt" >&5 +echo "configure:9501: 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:9517: \"$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 @@ -9037,12 +9548,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:9041: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:9552: 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:9568: \"$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 @@ -9071,12 +9582,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:9075: checking for jl_dic_list_e in -lwnn4" >&5 +echo "configure:9586: 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:9602: \"$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 @@ -9105,12 +9616,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:9109: checking for jl_dic_list_e in -lwnn6" >&5 +echo "configure:9620: 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:9636: \"$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 @@ -9139,12 +9650,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:9143: checking for dic_list_e in -lwnn6_fromsrc" >&5 +echo "configure:9654: 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:9670: \"$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 @@ -9203,12 +9714,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:9207: checking for jl_fi_dic_list in -l$libwnn" >&5 +echo "configure:9718: 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:9734: \"$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 @@ -9254,15 +9765,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:9258: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9266: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9777: \"$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* @@ -9289,15 +9800,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:9293: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9812: \"$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* @@ -9325,15 +9836,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:9329: checking for canna/RK.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9848: \"$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* @@ -9356,12 +9867,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:9360: checking for RkBgnBun in -lRKC" >&5 +echo "configure:9871: 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:9887: \"$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 @@ -9395,12 +9906,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:9399: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:9910: 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:9926: \"$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 @@ -9460,12 +9971,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:9464: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:9975: 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:9991: \"$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 @@ -9559,13 +10070,13 @@ fi -for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getpt getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask +for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9566: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10103: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_func +EOF +cat >> confdefs.h <&6 +fi +done + + +for ac_func in getpt _getpt grantpt unlockpt ptsname killpg tcgetpgrp +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:10134: checking for $ac_func" >&5 + +cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:10160: \"$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 @@ -9616,17 +10184,192 @@ done -extra_objs="$extra_objs realpath.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"realpath.o\"" - fi - -for ac_func in getloadavg +echo $ac_n "checking for openpty""... $ac_c" 1>&6 +echo "configure:10189: checking for openpty" >&5 + +cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char openpty(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_openpty) || defined (__stub___openpty) +choke me +#else +openpty(); +#endif + +; return 0; } +EOF +if { (eval echo configure:10215: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_openpty=no" +fi +rm -f conftest* + +if eval "test \"`echo '$ac_cv_func_'openpty`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_openpty=yes +else + echo "$ac_t""no" 1>&6 + + +echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 +echo "configure:10234: 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 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + have_openpty=yes need_libutil=yes +else + echo "$ac_t""no" 1>&6 +fi + + +fi + +if test "$have_openpty" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_OPENPTY +EOF +cat >> confdefs.h <<\EOF +#define HAVE_OPENPTY 1 +EOF +} + + for ac_hdr in pty.h libutil.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:10285: 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:10293: \"$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* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_hdr +EOF +cat >> confdefs.h <&6 +fi +done + + test "$need_libutil" = "yes" && libs_system="$libs_system -lutil" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lutil\" to \$libs_system"; fi +fi + +for ac_hdr in sys/stropts.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:10329: 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:10337: \"$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* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_hdr +EOF +cat >> confdefs.h <&6 +fi +done + +if test "$ac_cv_header_sys_stropts_h" = "yes"; then + for ac_func in isastream do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9627: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10396: \"$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 @@ -9676,21 +10419,164 @@ fi done - -if test "$ac_cv_func_getloadavg" != "yes" -then - extra_objs="$extra_objs getloadavg.o" && if test "$extra_verbose" = "yes"; then + for ac_hdr in sys/strtio.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:10427: 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:10435: \"$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* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_hdr +EOF +cat >> confdefs.h <&6 +fi +done + fi + +extra_objs="$extra_objs realpath.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"realpath.o\"" + fi + +for ac_func in getloadavg +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:10472: checking for $ac_func" >&5 + +cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:10498: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_func +EOF +cat >> confdefs.h <&6 +fi +done + + +if test "$ac_cv_func_getloadavg" = "yes"; then + for ac_hdr in sys/loadavg.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:10531: 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:10539: \"$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* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_hdr +EOF +cat >> confdefs.h <&6 +fi +done + +else + extra_objs="$extra_objs getloadavg.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"getloadavg.o\"" fi echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:9689: checking for kstat_open in -lkstat" >&5 +echo "configure:10575: 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:10591: \"$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 @@ -9732,15 +10618,56 @@ fi + for ac_hdr in kstat.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:10626: 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:10634: \"$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* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_hdr +EOF +cat >> confdefs.h <&6 +fi +done + echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:9739: checking for kvm_read in -lkvm" >&5 +echo "configure:10666: 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:10682: \"$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 @@ -9785,16 +10712,16 @@ fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:9789: checking whether netdb declares h_errno" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:9798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10725: \"$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 @@ -9814,16 +10741,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:9818: checking for sigsetjmp" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:9827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10754: \"$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 @@ -9843,11 +10770,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:9847: checking whether localtime caches TZ" >&5 +echo "configure:10774: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext < #if STDC_HEADERS @@ -9882,7 +10809,7 @@ exit (0); } EOF -if { (eval echo configure:9886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then emacs_cv_localtime_cache=no else @@ -9912,9 +10839,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:9916: checking whether gettimeofday accepts one or two arguments" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + gettimeofday (&time, 0); + +; return 0; } +EOF +if { (eval echo configure:10866: \"$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 @@ -9958,19 +10884,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:9962: checking for inline" >&5 +echo "configure:10888: 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:10900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -10002,35 +10928,25 @@ ;; esac -if test "$ac_cv_c_inline" != "no"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_INLINE -EOF -cat >> confdefs.h <<\EOF -#define HAVE_INLINE 1 -EOF -} - - test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" && if test "$extra_verbose" = "yes"; then +test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && extra_objs="$extra_objs inline.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"inline.o\"" fi -fi # 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:10024: checking for working alloca.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:10034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10950: \"$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 @@ -10054,10 +10970,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:10058: checking for alloca" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11005: \"$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 @@ -10124,10 +11040,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:10128: checking whether alloca needs Cray hooks" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&6 -echo "configure:10155: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11097: \"$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 @@ -10207,10 +11123,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:10211: checking stack direction for C alloca" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_stack_direction=1 else @@ -10258,15 +11174,15 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:10262: checking for vfork.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11186: \"$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* @@ -10294,10 +11210,10 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:10298: checking for working vfork" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < @@ -10392,7 +11308,7 @@ } } EOF -if { (eval echo configure:10396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_vfork_works=yes else @@ -10418,10 +11334,10 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:10422: checking for working strcoll" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main () @@ -10431,7 +11347,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:10435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -10459,10 +11375,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10463: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11405: \"$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 @@ -10513,10 +11429,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:10517: checking whether getpgrp takes no argument" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -10598,10 +11514,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:10602: checking for working mmap" >&5 +echo "configure:11518: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext < #include @@ -10634,7 +11550,7 @@ return 1; } EOF -if { (eval echo configure:10638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then have_mmap=yes else @@ -10656,8 +11572,38 @@ } -test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no -test "$rel_alloc" = "default" -a "$have_mmap" = "yes" && rel_alloc=yes +test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no +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:11580: checking for M_MMAP_THRESHOLD" >&5 + cat > conftest.$ac_ext < +int main() { + +#ifndef M_MMAP_THRESHOLD +#error No M_MMAP_THRESHOLD :-( +!@+$%^&*_)(_ - unlikely to compile... +#endif + +; return 0; } +EOF +if { (eval echo configure:11594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + rel_alloc=no; echo "$ac_t""yes" 1>&6; +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + rel_alloc=yes; echo "$ac_t""no" 1>&6; +fi +rm -f conftest* + else + rel_alloc=yes + fi +fi test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF Defining REL_ALLOC EOF @@ -10669,15 +11615,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:10673: checking for termios.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11627: \"$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* @@ -10720,15 +11666,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:10724: checking for termio.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11678: \"$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* @@ -10760,10 +11706,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:10764: checking for socket" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11736: \"$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 @@ -10801,15 +11747,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:10805: checking for netinet/in.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11759: \"$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* @@ -10826,15 +11772,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:10830: checking for arpa/inet.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11784: \"$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* @@ -10859,9 +11805,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:10863: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:11809: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext < @@ -10872,7 +11818,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:10876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11822: \"$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 @@ -10890,9 +11836,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:10894: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:11840: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext < @@ -10902,7 +11848,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:10906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11852: \"$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 @@ -10933,10 +11879,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:10937: checking for msgget" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11909: \"$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 @@ -10974,15 +11920,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:10978: checking for sys/ipc.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11932: \"$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* @@ -10999,15 +11945,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:11003: checking for sys/msg.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11957: \"$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* @@ -11045,15 +11991,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:11049: checking for dirent.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12003: \"$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* @@ -11080,15 +12026,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:11084: checking for sys/dir.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12038: \"$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* @@ -11121,15 +12067,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:11125: checking for nlist.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12079: \"$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* @@ -11159,22 +12105,22 @@ echo "checking "for sound support"" 1>&6 -echo "configure:11163: checking "for sound support"" >&5 +echo "configure:12109: 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:11170: checking for multimedia/audio_device.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12124: \"$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* @@ -11222,12 +12168,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:11226: checking for ALopenport in -laudio" >&5 +echo "configure:12172: 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:12188: \"$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 @@ -11269,12 +12215,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:11273: checking for AOpenAudio in -lAlib" >&5 +echo "configure:12219: 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:12235: \"$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 @@ -11323,15 +12269,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:11327: checking for ${dir}/soundcard.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12281: \"$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* @@ -11352,10 +12298,10 @@ echo " xemacs will be linked with \"linuxplay.o\"" fi { test "$extra_verbose" = "yes" && cat << EOF - Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h" -EOF -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:11389: checking for audio/audiolib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11397: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12350: \"$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* @@ -11411,12 +12364,12 @@ echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6 -echo "configure:11415: checking for AuOpenServer in -laudio" >&5 +echo "configure:12368: 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:12384: \"$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 @@ -11466,7 +12419,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 @@ -11497,7 +12450,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:11501: checking for $ac_word" >&5 +echo "configure:12454: 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. @@ -11526,10 +12479,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:11530: checking for esd_play_stream" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12509: \"$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 @@ -11603,7 +12556,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:11607: checking for TTY-related features" >&5 +echo "configure:12560: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -11619,12 +12572,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:11623: checking for tgetent in -lncurses" >&5 +echo "configure:12576: 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:12592: \"$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 @@ -11668,15 +12621,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:11672: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12633: \"$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* @@ -11691,22 +12644,22 @@ rm -f conftest* if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - curses_h_path=ncurses/curses.h + curses_h_file=ncurses/curses.h else echo "$ac_t""no" 1>&6 fi ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:11702: checking for ncurses/term.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12663: \"$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* @@ -11721,7 +12674,7 @@ rm -f conftest* if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - term_h_path=ncurses/term.h + term_h_file=ncurses/term.h else echo "$ac_t""no" 1>&6 fi @@ -11736,15 +12689,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:11740: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11748: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12701: \"$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* @@ -11759,7 +12712,7 @@ rm -f conftest* if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - curses_h_path=ncurses/curses.h + curses_h_file=ncurses/curses.h else echo "$ac_t""no" 1>&6 fi @@ -11779,12 +12732,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:11783: checking for tgetent in -l$lib" >&5 +echo "configure:12736: 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:12752: \"$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 @@ -11826,12 +12779,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:11830: checking for tgetent in -lcurses" >&5 +echo "configure:12783: 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:12799: \"$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 @@ -11860,12 +12813,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:11864: checking for tgetent in -ltermcap" >&5 +echo "configure:12817: 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:12833: \"$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 @@ -11906,33 +12859,33 @@ fi fi { test "$extra_verbose" = "yes" && cat << EOF - Defining CURSES_H_PATH = "${curses_h_path-curses.h}" -EOF -cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <&6 -echo "configure:11928: checking for gpm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12889: \"$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* @@ -11955,12 +12908,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:11959: checking for Gpm_Open in -lgpm" >&5 +echo "configure:12912: 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:12928: \"$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 @@ -12021,20 +12974,20 @@ test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ != "no no no" && echo "checking for database support" 1>&6 -echo "configure:12025: checking for database support" >&5 +echo "configure:12978: 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:12030: checking for ndbm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12991: \"$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* @@ -12064,12 +13017,12 @@ if test "$with_database_gdbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:12068: checking for dbm_open in -lgdbm" >&5 +echo "configure:13021: 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:13037: \"$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 @@ -12108,10 +13061,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:12112: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13091: \"$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 @@ -12153,12 +13106,12 @@ echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:12157: checking for dbm_open in -ldbm" >&5 +echo "configure:13110: 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:13126: \"$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 @@ -12210,11 +13163,14 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6 -echo "configure:12214: checking for Berkeley db.h" >&5 - for path in "db/db.h" "db.h"; do +echo "configure:13167: checking for Berkeley db.h" >&5 + for header in "db/db.h" "db.h"; do cat > conftest.$ac_ext < +#if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) #ifdef HAVE_INTTYPES_H #define __BIT_TYPES_DEFINED__ #include @@ -12225,33 +13181,34 @@ typedef uint64_t u_int64_t; #endif #endif -#include <$path> - -int main() { - -; return 0; } -EOF -if { (eval echo configure:12235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - db_h_path="$path"; break +#endif +#include <$header> + +int main() { + +; return 0; } +EOF +if { (eval echo configure:13192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + db_h_file="$header"; break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done - if test -z "$db_h_path" + if test -z "$db_h_file" then echo "$ac_t""no" 1>&6; with_database_berkdb=no - else echo "$ac_t""$db_h_path" 1>&6 + else echo "$ac_t""$db_h_file" 1>&6 fi if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6 -echo "configure:12251: checking for Berkeley DB version" >&5 +echo "configure:13208: checking for Berkeley DB version" >&5 cat > conftest.$ac_ext < +#line 13210 "configure" +#include "confdefs.h" +#include <$db_h_file> #if DB_VERSION_MAJOR > 1 yes #endif @@ -12268,10 +13225,10 @@ rm -f conftest* echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6 -echo "configure:12272: checking for $dbfunc" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13255: \"$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 @@ -12313,12 +13270,12 @@ echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:12317: checking for $dbfunc in -ldb" >&5 +echo "configure:13274: 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:13290: \"$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 @@ -12355,10 +13312,10 @@ if test "$with_database_berkdb" = "yes"; then { test "$extra_verbose" = "yes" && cat << EOF - Defining DB_H_PATH = "$db_h_path" -EOF -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:12397: checking for SOCKSinit in -lsocks" >&5 +echo "configure:13354: 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:13370: \"$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 @@ -12464,19 +13421,22 @@ if test "$with_modules" != "no"; then echo "checking for module support" 1>&6 -echo "configure:12468: checking for module support" >&5 - - ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` +echo "configure:13425: 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:12472: checking for dlfcn.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13440: \"$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* @@ -12492,14 +13452,14 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - + echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:12498: checking for dlopen in -ldl" >&5 +echo "configure:13458: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13474: \"$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 @@ -12529,12 +13489,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:12533: checking for dlopen in -lc" >&5 +echo "configure:13493: checking for dlopen in -lc" >&5 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13509: \"$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 @@ -12572,8 +13532,8 @@ echo "$ac_t""no" 1>&6 fi - if test -n "$have_dl"; then - { test "$extra_verbose" = "yes" && cat << \EOF + if test -n "$have_dl"; then + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DLOPEN EOF cat >> confdefs.h <<\EOF @@ -12581,15 +13541,15 @@ EOF } - else - + else + echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:12588: checking for shl_load in -ldld" >&5 +echo "configure:13548: 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:13564: \"$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 @@ -12615,7 +13575,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 libdl=dld have_dl=yes; - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SHL_LOAD EOF cat >> confdefs.h <<\EOF @@ -12627,12 +13587,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:12631: checking for dld_init in -ldld" >&5 +echo "configure:13591: 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:13607: \"$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 @@ -12658,7 +13618,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 libdl=dld have_dl=yes; - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DLD_INIT EOF cat >> confdefs.h <<\EOF @@ -12674,8 +13634,8 @@ fi - fi - + fi + fi if test -n "$have_dl"; then dll_ld= @@ -12688,7 +13648,7 @@ xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:12692: checking how to build dynamic libraries for ${xehost}" >&5 +echo "configure:13652: checking how to build dynamic libraries for ${xehost}" >&5 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. case "$xehost" in *-*-linux-gnu*) ;; @@ -12716,9 +13676,9 @@ XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:12720: checking checking whether we are using GNU C" >&5 +echo "configure:13680: checking checking whether we are using GNU C" >&5 cat > conftest.$ac_ext <&6 -echo "configure:12744: checking how to produce PIC code" >&5 +echo "configure:13704: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -12752,7 +13712,7 @@ # PIC is the default for these OSes. ;; - os2*) + aix3* | aix4* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) @@ -12761,6 +13721,9 @@ # like `-m68040'. dll_cflags='-m68020 -resident32 -malways-restore-a4' ;; + *cygwin* | *mingw* ) + # PIC is the default + ;; *) dll_cflags='-fPIC' ;; @@ -12830,21 +13793,21 @@ if test -n "$dll_cflags"; then echo "$ac_t""${dll_cflags}" 1>&6 - + # 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:12837: checking if PIC flag ${dll_cflags} really works" >&5 +echo "configure:13800: 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:13811: \"$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 @@ -12875,7 +13838,7 @@ xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:12879: checking if C compiler can produce shared libraries" >&5 +echo "configure:13842: checking if C compiler can produce shared libraries" >&5 if test "$XEGCC" = yes; then xcldf="-shared" xldf="-shared" @@ -12926,14 +13889,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:13900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cc_produces_so=yes else @@ -12958,7 +13921,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:12962: checking for ld used by GCC" >&5 +echo "configure:13925: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -12983,7 +13946,7 @@ esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:12987: checking for GNU ld" >&5 +echo "configure:13950: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -13021,7 +13984,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:13025: checking if the linker is GNU ld" >&5 +echo "configure:13988: 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 @@ -13044,11 +14007,12 @@ dll_ld=$CC dll_ldflags=$xcldf can_build_shared=yes + ld_shlibs=yes else # 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:13052: checking whether the linker supports shared libraries" >&5 +echo "configure:14016: checking whether the linker supports shared libraries" >&5 dll_ld=$CC dll_ldflags=$LDFLAGS ld_shlibs=yes @@ -13263,10 +14227,10 @@ for ac_func in dlerror _dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13267: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14257: \"$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 @@ -13328,11 +14292,11 @@ fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:14300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -13628,17 +14592,6 @@ -LOCKDIR=$lockdir -while true; do - case "$LOCKDIR" in - *\$* ) eval "LOCKDIR=$LOCKDIR" ;; - *) break ;; - esac -done - - - - DOCDIR=$docdir while true; do case "$DOCDIR" in @@ -13741,22 +14694,6 @@ EOF } -{ test "$extra_verbose" = "yes" && cat << EOF - Defining config_machfile = "$machfile" -EOF -cat >> confdefs.h <> confdefs.h <> confdefs.h <<\EOF -#define NO_DOC_FILE 1 +test "$quick_build" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF + Defining QUICK_BUILD +EOF +cat >> confdefs.h <<\EOF +#define QUICK_BUILD 1 EOF } @@ -13948,59 +14885,121 @@ echo " XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'. - - Where should the build process find the source code? $srcdir - What installation prefix should install use? $prefix - What operating system and machine description files should XEmacs use? - \`$opsysfile' and \`$machfile' - What compiler should XEmacs be built with? $CC $CFLAGS - Should XEmacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason} - Should XEmacs use the relocating allocator for buffers? $rel_alloc - What window system should XEmacs use? ${window_system}" -if test "$with_x11" = "yes"; then - echo " Where do we find X Windows header files? $x_includes" - echo " Where do we find X Windows libraries? $x_libraries" -fi +" +echo " +Compilation / Installation:" +echo " Source code location: $srcdir" +echo " Installation prefix: $prefix" if test -n "$site_includes"; then - echo " Additional header files: $site_includes" + echo " Additional header files: $site_includes" fi if test -n "$site_libraries"; then - echo " Additional libraries: $site_libraries" + echo " Additional libraries: $site_libraries" fi if test -n "$site_prefixes"; then - echo " Additional prefixes: $site_prefixes" + echo " Additional prefixes: $site_prefixes" fi if test -n "$runpath"; then - echo " Runtime library search path: $runpath" -fi -if test "$have_xaw" = "yes"; then - echo " Athena library to link: $athena_lib" - echo " Athena header include path: $athena_h_path" -fi -test "$with_dnet" = yes && echo " Compiling in support for DNET." -test "$with_socks" = yes && echo " Compiling in support for SOCKS." -test "$with_xauth" = yes && echo " Compiling in support for XAUTH." -if test "$with_xmu" != yes -a "$with_x11" = yes; then - echo " No Xmu; substituting equivalent routines." -fi - + echo " Runtime library search path: $runpath" +fi + +if test -n "$opsysfile" +then echo " Operating system description file: \`$opsysfile'" +else echo " Not using any operating system description file" +fi +if test -n "$machfile" +then echo " Machine description file: \`$machfile'" +else echo " Not using any machine description file" +fi + +echo " Compiler: $CC $CFLAGS" +echo " Relocating allocator for buffers: $rel_alloc" +echo " GNU version of malloc: ${GNU_MALLOC}${GNU_MALLOC_reason}" + +echo " +Window System:" +if test "$with_msw" = "yes"; then + echo " Compiling in support for the Microsoft window system." +fi +if test "$with_x11" = "yes"; then + echo " Compiling in support for the X window system:" + echo " - X Windows headers location: $x_includes" + echo " - X Windows libraries location: $x_libraries" + if test "$with_xauth" != yes; then + echo " - Xau (X authority) not available." + fi + if test "$with_xmu" != yes; then + echo " - Xmu library not available; substituting equivalent routines." + fi + if test "$with_wmcommand" != no; then + echo " - Handling WM_COMMAND properly." + fi +fi +if test "$need_athena" = "yes"; then + echo " Compiling in support for the Athena widget set:" + echo " - Athena headers location: $athena_h_path" + echo " - Athena library to link: $athena_lib" +fi +case "$with_menubars" in + lucid ) echo " Using Lucid menubars." ;; + motif ) echo " Using Motif menubars." + echo " *WARNING* The Motif menubar implementation is currently buggy." + echo " We recommend using the Lucid menubar instead." + echo " Re-run configure with --with-menubars='lucid'." ;; + msw ) echo " Using MS-Windows menubars." ;; +esac +case "$with_scrollbars" in + lucid ) echo " Using Lucid scrollbars." ;; + motif ) echo " Using Motif scrollbars." ;; + athena ) echo " Using Athena scrollbars." ;; + msw ) echo " Using MS-Windows scrollbars." ;; +esac +case "$with_dialogs" in + motif ) echo " Using Motif dialog boxes." + if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then + echo " *WARNING* The Motif dialog boxes cause problems on AIX 4.3 and higher." + echo " We recommend using the Athena dialog boxes instead." + echo " Install libXaw and re-run configure with --with-dialogs='athena'." + echo " Read the PROBLEMS file for more information." + fi; fi ;; + athena ) echo " Using Athena dialog boxes." ;; + msw ) echo " Using MS-Windows dialog boxes." ;; +esac +case "$with_widgets" in + motif ) echo " Using Motif native widgets." ;; + athena ) echo " Using Athena native widgets." ;; + msw ) echo " Using MS-Windows native widgets." ;; +esac +if test "$with_dragndrop" = yes; then + echo " Compiling in support for Drag'n'Drop (EXPERIMENTAL)." + echo " - Drag'n'Drop prototype: $dragndrop_proto." +fi + +echo " +TTY:" +test "$with_ncurses" = yes && echo " Compiling in support for ncurses." +test "$with_gpm" = yes && echo " Compiling in support for GPM (General Purpose Mouse)." + +echo " +Images:" +test "$with_gif" = yes && echo " Compiling in support for GIF images (builtin)." if test "$with_xpm" = yes; then - echo " Compiling in support for XPM images." + echo " Compiling in support for XPM images." elif test "$with_x11" = yes; then - echo " --------------------------------------------------------------------" - echo " WARNING: Compiling without XPM support." + echo " WARNING: -----------------------------------------------------------" + echo " WARNING: Compiling without XPM image support." if test "$xpm_problem" != ""; then echo " Reason: $xpm_problem" fi echo " WARNING: You should strongly consider installing XPM." echo " WARNING: Otherwise toolbars and other graphics will look suboptimal." echo " WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)" - echo " --------------------------------------------------------------------" + echo " WARNING: -----------------------------------------------------------" fi if test "$with_png" = yes; then - echo " Compiling in support for PNG image handling." + echo " Compiling in support for PNG images." elif test "$window_system" != "none"; then - echo " --------------------------------------------------------------------" + echo " WARNING: -----------------------------------------------------------" echo " WARNING: Compiling without PNG image support." if test "$png_problem" != ""; then echo " Reason: $png_problem" @@ -14008,91 +15007,66 @@ echo " WARNING: You should strongly consider installing the PNG libraries." echo " WARNING: Otherwise certain images and glyphs may not display." echo " WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)" - echo " --------------------------------------------------------------------" -fi -test "$with_gif" = yes && echo " Compiling in support for (builtin) GIF image handling." -test "$with_jpeg" = yes && echo " Compiling in support for JPEG image handling." -test "$with_tiff" = yes && echo " Compiling in support for TIFF image handling." + echo " WARNING: -----------------------------------------------------------" +fi +test "$with_jpeg" = yes && echo " Compiling in support for JPEG images." +test "$with_tiff" = yes && echo " Compiling in support for TIFF images." test "$with_xface" = yes && echo " Compiling in support for X-Face message headers." -test "$with_native_sound" = yes && echo " Compiling in native sound support." -test "$with_nas_sound" = yes && echo " Compiling in network sound (NAS) support." -test "$old_nas" = yes && echo " nas library lacks error trapping, will play synchronously." -test "$with_esd_sound" = yes && echo " Compiling in support for Enlightened Sound Daemon (ESD)." - -test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley DB." +echo " +Sound:" +test "$with_native_sound" = yes && echo " Compiling in support for sound (native)." +test "$with_nas_sound" = yes && echo " Compiling in support for NAS (network audio system)." +test "$old_nas" = yes && echo " - NAS library lacks error trapping; will play synchronously." +test "$with_esd_sound" = yes && echo " Compiling in support for ESD (Enlightened Sound Daemon)." + +echo " +Databases:" +test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley database." test "$with_database_dbm" = yes && echo " Compiling in support for DBM." test "$with_database_gdbm" = yes && echo " Compiling in support for GNU DBM." - -test "$with_ldap" = yes && echo " Compiling in support for LDAP." - -test "$with_ncurses" = yes && echo " Compiling in support for ncurses." -test "$with_gpm" = yes && echo " Compiling in support for GPM (General Purpose Mouse)." - -test "$with_mule" = yes && echo " Compiling in Mule (multi-lingual) support." -test "$with_file_coding" = yes && echo " Compiling in File coding support." -test "$with_xim" != no && echo " Compiling in XIM (X11R5+ I18N input method) support." -test "$with_xim" = motif && echo " Using Motif to provide XIM support." -test "$with_xim" = xlib && echo " Using raw Xlib to provide XIM support." -test "$with_xfs" = yes && echo " Using XFontSet to provide bilingual menubar." -test "$with_canna" = yes && echo " Compiling in support for Canna on Mule." +test "$with_ldap" = yes && echo " Compiling in support for LDAP." +if test "$with_postgresql" = yes; then + echo " Compiling in support for PostgreSQL." + echo " - Using PostgreSQL header file: $libpq_fe_h_file" + test "$with_postgresqlv7" = yes && echo " - Using PostgreSQL V7 bindings." +fi + +echo " +Internationalization:" +test "$with_mule" = yes && echo " Compiling in support for Mule (multi-lingual Emacs)." +test "$with_file_coding" = yes && echo " Compiling in support for file coding." +test "$with_xim" != no && echo " Compiling in support for XIM (X11R5+ I18N input method)." +test "$with_xim" = motif && echo " - Using Motif to provide XIM support." +test "$with_xim" = xlib && echo " - Using raw Xlib to provide XIM support." +test "$with_xfs" = yes && echo " - Using XFontSet to provide bilingual menubar." +test "$with_canna" = yes && echo " Compiling in support for Canna on Mule." if test "$with_wnn" = yes; then echo " Compiling in support for the WNN input method on Mule." - test "$with_wnn6" = yes && echo " Using WNN version 6." -fi -test "$with_i18n3" = yes && echo " Compiling in I18N support, level 3 (doesn't currently work)." - -test "$with_cde" = yes && echo " Compiling in support for CDE." + test "$with_wnn6" = yes && echo " - Using WNN version 6." +fi +test "$with_i18n3" = yes && echo " Compiling in support for I18N level 3 (doesn't currently work)." + +echo " +Mail:" +test "$with_pop" = yes && echo " Compiling in support for POP mail retrieval." +test "$with_kerberos" = yes && echo " Compiling in support for Kerberos POP authentication." +test "$with_hesiod" = yes && echo " Compiling in support for Hesiod POP server access." +test -n "$mail_locking" && echo " Compiling in support for \"$mail_locking\" mail spool file locking method." + +echo " +Other Features:" test "$with_tooltalk" = yes && echo " Compiling in support for ToolTalk." -test "$with_offix" = yes && echo " Compiling in support for OffiX." -test "$with_dragndrop" = yes && echo " Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )." test "$with_workshop" = yes && echo " Compiling in support for Sun WorkShop." -test "$with_wmcommand" != no && echo " Compiling in support for proper WM_COMMAND handling." -case "$with_menubars" in - lucid ) echo " Using Lucid menubars." ;; - motif ) echo " Using Motif menubars." - echo " *WARNING* The Motif menubar implementation is currently buggy." - echo " We recommend using the Lucid menubar instead." - echo " Re-run configure with --with-menubars='lucid'." ;; - msw ) echo " Using MS-Windows menubars." ;; -esac -case "$with_scrollbars" in - lucid ) echo " Using Lucid scrollbars." ;; - motif ) echo " Using Motif scrollbars." ;; - athena ) echo " Using Athena scrollbars." ;; - msw ) echo " Using MS-Windows scrollbars." ;; -esac -case "$with_widgets" in - motif ) echo " Using Motif native widgets." ;; - athena ) echo " Using Athena native widgets." ;; - msw ) echo " Using MS-Windows native widgets." ;; -esac -case "$with_dialogs" in - motif ) - echo " Using Motif dialog boxes." - if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then - echo " *WARNING* The Motif dialog boxes cause problems on AIX 4.3 and higher." - echo " We recommend using the Athena dialog boxes instead." - echo " Install libXaw and re-run configure with --with-dialogs='athena'." - echo " Read the PROBLEMS file for more information." - fi; fi - ;; - athena ) echo " Using Athena dialog boxes." ;; - msw ) echo " Using MS-Windows dialog boxes." ;; -esac -test "$with_modules" = "yes" && echo " Compiling in dynamic shared object module support." -test "$with_clash_detection" = yes && \ - echo " Clash detection will use \"$lockdir\" for locking files." -echo " movemail will use \"$mail_locking\" for locking mail spool files." -test "$with_pop" = yes && echo " Using POP for mail access." -test "$with_kerberos" = yes && echo " Using Kerberos for POP authentication." -test "$with_hesiod" = yes && echo " Using Hesiod to get POP server host." -test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." -test "$pdump" = yes && echo " Using the new portable dumper (wishful thinking)." -test "$debug" = yes && echo " Compiling in extra code for debugging." -test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)." -if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \ - != "no no no no no"; then +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." +test "$pdump" = yes && echo " Using the new portable dumper." +test "$debug" = yes && echo " Compiling in support for extra debugging code." +test "$usage_tracking" = yes && echo " Compiling in support for active usage tracking (Sun internal)." +if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc $error_check_glyphs" \ + != "no no no no no no"; then echo " WARNING: ---------------------------------------------------------" echo " WARNING: Compiling in support for runtime error checking." echo " WARNING: XEmacs will run noticeably more slowly as a result." @@ -14277,9 +15251,6 @@ s%@etcdir@%$etcdir%g s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g s%@ETCDIR@%$ETCDIR%g -s%@lockdir@%$lockdir%g -s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g -s%@LOCKDIR@%$LOCKDIR%g s%@docdir@%$docdir%g s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g s%@DOCDIR@%$DOCDIR%g @@ -14546,8 +15517,8 @@ | sed -e 's/^\#.*//' \ -e 's/^[ ][ ]*$//'\ -e 's/^ / /' \ - | sed -n -e '/^..*$/p' \ - | sed '/^\"/ { + -e '/^[ ]*$/d' \ + -e '/^\"/ { s/\\\([\"]\)/\1/g s/^[ ]*\"// s/\"[ ]*$// @@ -14560,8 +15531,8 @@ | sed -e 's/^\#.*//' \ -e 's/^[ ][ ]*$//'\ -e 's/^ / /' \ - | sed -n -e '/^..*$/p' \ - | sed '/^\"/ { + -e '/^[ ]*$/d' \ + -e '/^\"/ { s/\\\([\"]\)/\1/g s/^[ ]*\"// s/\"[ ]*$// diff -r 72a7cfa4a488 -r abe6d1db359e configure.in --- a/configure.in Mon Aug 13 11:33:40 2007 +0200 +++ b/configure.in Mon Aug 13 11:35:02 2007 +0200 @@ -14,7 +14,7 @@ ### from the file `./configure.in'. ### To rebuild it, execute the command ### autoconf -### in the this directory. You must have autoconf version 2.12 or later. +### in the this directory. You must have autoconf version 2.13 or later. ### This file is part of XEmacs. @@ -50,7 +50,7 @@ dnl We use the m4 quoting characters [ ] (as established by the dnl autoconf system), so quote them like this: [[foo]] -AC_PREREQ(2.12)dnl +AC_PREREQ(2.13)dnl dnl Redefine some standard autoconf macros dnl here is how XEmacs is different: dnl - no cache file @@ -307,6 +307,7 @@ dnl Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} dnl Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ])dnl AC_INIT_PARSE_ARGS @@ -357,7 +358,6 @@ pkgdir='${datadir}/${instvardir}/lisp' package_path='' etcdir='${datadir}/${instvardir}/etc' -lockdir='${statedir}/${inststaticdir}/lock' archlibdir='${datadir}/${instvardir}/${configuration}' docdir='${archlibdir}' with_prefix='yes' @@ -368,9 +368,6 @@ with_widgets='' with_dialogs='' with_file_coding='' -dnl const_is_losing is removed - we rely on AC_C_CONST instead. -dnl We accept (and ignore) the --const-is-losing option for compatibility. -dnl const_is_losing='yes' cpp='' cppflags='' libs='' ldflags='' dynamic='' with_x11='' @@ -508,6 +505,7 @@ with_sparcworks | \ with_tooltalk | \ with_ldap | \ + with_postgresql | \ with_pop | \ with_kerberos | \ with_hesiod | \ @@ -516,7 +514,6 @@ external_widget | \ verbose | \ extra_verbose | \ - const_is_losing | \ usage_tracking | \ use_union_type | \ pdump | \ @@ -525,7 +522,7 @@ memory_usage_stats | \ with_clash_detection | \ with_modules | \ - no_doc_file ) + quick_build ) dnl Make sure the value given was either "yes" or "no". case "$val" in y | ye | yes ) val=yes ;; @@ -640,7 +637,7 @@ done ;; - dnl Has the user specified a prefered Athena widget set? + dnl Has the user specified a preferred Athena widget set? dnl This bit expands any alias names out for us... "with_athena" ) case "$val" in @@ -713,14 +710,17 @@ byte_code ) error_check_byte_code=yes ;; nobyte_code ) error_check_byte_code=no ;; + glyphs ) error_check_glyphs=yes ;; + noglyphs ) error_check_glyphs=no ;; + * ) bogus_error_check=yes ;; esac if test "$bogus_error_check" -o \ \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then if test "$error_check_default" = yes ; then - types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'." + types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', \`noglyphs' and \`nobyte-code'." else - types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'." + types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', \`glyphs' and \`byte-code'." fi USAGE_ERROR(["Valid types for the \`--$optname' option are: $types."]) @@ -731,6 +731,7 @@ error_check_gc=$new_default error_check_malloc=$new_default error_check_byte_code=$new_default + error_check_glyphs=$new_default new_default= # reset this fi echeck_notfirst=true @@ -744,7 +745,7 @@ dnl Has the user specified one of the path options? prefix | exec_prefix | bindir | datadir | statedir | libdir | \ - mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \ + mandir | infodir | infopath | lispdir | etcdir | pkgdir | \ archlibdir | docdir | package_path ) dnl If the value was omitted, get it from the next argument. if test "$valomitted" = "yes"; then @@ -772,7 +773,6 @@ AC_DEFINE(LISPDIR_USER_DEFINED) AC_DEFINE(MODULEDIR_USER_DEFINED) AC_DEFINE(ETCDIR_USER_DEFINED) ;; - statedir | lockdir ) AC_DEFINE(LOCKDIR_USER_DEFINED) ;; docdir ) AC_DEFINE(DOCDIR_USER_DEFINED) ;; exec_prefix | libdir | archlibdir ) AC_DEFINE(ARCHLIBDIR_USER_DEFINED) ;; esac @@ -787,15 +787,16 @@ dnl Has the user specified the toolkit(s) to use for GUI elements? "with_menubars" | \ "with_scrollbars" | \ - "with_dialogs" | \ + "with_dialogs" | \ "with_widgets" ) case "$val" in l | lu | luc | luci | lucid ) val=lucid ;; m | mo | mot | moti | motif ) val=motif ;; a | at | ath | athe | athen | athena ) val=athena ;; - n | no | non | none ) val=no ;; + n | no | non | none ) val=no ;; + y | ye | yes ) val=yes ;; * ) USAGE_ERROR(["The \`--$optname' option must have one of these values: - \`lucid', \`motif', \`athena', or \`no'."]) ;; + \`lucid', \`motif', \`athena', \`yes', or \`no'."]) ;; esac eval "$opt=\"$val\"" ;; @@ -804,6 +805,7 @@ "use_minimal_tagbits" | \ "use_indexed_lrecord_implementation" | \ "run_in_place" | \ + "const_is_losing" | \ "with_gnu_make" ) AC_MSG_WARN([Obsolete option \`--$optname' ignored.]) ;; @@ -1004,6 +1006,8 @@ PROGNAME=xemacs fi +AC_DEFINE_UNQUOTED(EMACS_PROGNAME, "$PROGNAME") + dnl ---------------------------------- dnl Error checking and debugging flags dnl ---------------------------------- @@ -1016,6 +1020,7 @@ test "${error_check_gc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GC) test "${error_check_malloc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_MALLOC) test "${error_check_byte_code=$beta}" = yes && AC_DEFINE(ERROR_CHECK_BYTE_CODE) +test "${error_check_glyphs=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GLYPHS) dnl debug=yes must be set when error checking is present. This should be dnl fixed up. dnl debug implies other options @@ -1086,8 +1091,7 @@ m68*-sony-* ) machine=news ;; mips-sony-* ) machine=news-risc ;; clipper-* ) machine=clipper ;; - arm-* ) machine=arm ;; - armv[34][lb]-* ) machine=arm ;; + arm* ) machine=arm ;; ns32k-* ) machine=ns32000 ;; esac @@ -1547,13 +1551,28 @@ esac -if test -z "$machine" -o -z "$opsys"; then - (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems." - echo "$progname: Check \`etc/MACHINES' for recognized configuration names." - ) >&2 - exit 1 +dnl Initialize machine and opsys from $canonical if not in our database above. +test -z "$machine" && machine=`echo $canonical | sed 's/-.*$//'` +test -z "$opsys" && opsys=`echo $canonical | sed 's/^[^-]*-[^-]*-//'` + +dnl Use configure-time autodetection if s&m not available +if test -r "${srcdir}/src/m/${machine}.h"; then + machfile="m/${machine}.h" + AC_DEFINE_UNQUOTED(config_machfile, "$machfile") +else + echo "XEmacs has no builtin knowledge of \`$machine' machines." + echo "Using configure-time autodetection only." fi +if test -r "${srcdir}/src/s/${opsys}.h"; then + opsysfile="s/${opsys}.h" + AC_DEFINE_UNQUOTED(config_opsysfile, "$opsysfile") +else + echo "XEmacs has no builtin knowledge of \`$opsys' operating systems." + echo "Using configure-time autodetection only." +fi + + if test -z "$dynamic"; then case "$opsys" in hpux* | sunos4* ) dynamic=no ;; @@ -1582,9 +1601,6 @@ stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'` AC_DEFINE_UNQUOTED(STACK_TRACE_EYE_CATCHER, $stack_trace_eye_catcher) -machfile="m/${machine}.h" -opsysfile="s/${opsys}.h" - dnl -------------------------------------------------- dnl Determine the compiler, set up for feature testing dnl -------------------------------------------------- @@ -1597,7 +1613,7 @@ XE_ADD_OBJS(sunpro.o) fi -if test "$with_clash_detection" = "yes"; then +if test "$with_clash_detection" != "no"; then AC_DEFINE(CLASH_DETECTION) XE_ADD_OBJS(filelock.o) fi @@ -1644,7 +1660,14 @@ AC_PROG_CPP -AC_AIX +dnl -------------------------------------------------------------------- +dnl Compiler feature macros +dnl -------------------------------------------------------------------- + +AC_AIX dnl Defines _ALL_SOURCE on AIX. + +dnl We want feature macros defined here *and* in config.h.in, so that +dnl the compilation environment at configure time and compile time agree. AC_MSG_CHECKING(for GNU libc) AC_TRY_COMPILE([#include ],[ @@ -1658,6 +1681,23 @@ dnl Well. then why not fix fucking pop? test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE) +dnl We'd like to use vendor extensions, where available. +dnl We'd like to use functions from the latest Unix98 standards. +dnl See http://www.opengroup.org/onlinepubs/007908799/xsh/compilation.html +case "$opsys" in + sol2) + AC_DEFINE(__EXTENSIONS__) + dnl Solaris 2 before 2.5 had some bugs with feature test macro interaction. + if test "$os_release" -ge 55; then + AC_DEFINE(_XOPEN_SOURCE,500) + AC_DEFINE(_XOPEN_SOURCE_EXTENDED) + fi ;; + linux) + AC_DEFINE(_POSIX_C_SOURCE,199506L) + AC_DEFINE(_XOPEN_SOURCE,500) + AC_DEFINE(_XOPEN_SOURCE_EXTENDED) + ;; +esac dnl Identify compilers to enable compiler-specific hacks. dnl Add support for other compilers HERE! @@ -1667,6 +1707,8 @@ return 11; #elif defined __DECC return 12; +#elif defined __USLC__ && defined __SCO_VERSION__ +return 13; #else return 0; #endif @@ -1674,6 +1716,7 @@ [case "$conftest_rc" in 11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;; 12) echo "You appear to be using the DEC C compiler." ; __DECC=yes ;; + 13) echo "You appear to be using the SCO C compiler." ; __USLC__=yes ;; esac]) @@ -1709,7 +1752,8 @@ [#]endif ])dnl CPP_boolean_to_sh -cat > $tempcname < $tempcname < confdefs.h +cat >> $tempcname < +socklen_t x; +],[],[AC_MSG_RESULT(yes)],[ +AC_TRY_COMPILE([#include +int accept (int, struct sockaddr *, size_t *); +],[],[ +AC_MSG_RESULT(size_t) +AC_DEFINE(socklen_t,size_t)], [ +AC_MSG_RESULT(int) +AC_DEFINE(socklen_t,int)])]) + AC_MSG_CHECKING(for struct timeval) AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME #include @@ -2295,9 +2461,18 @@ test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf test -z "$mail_locking" -a "$mail_use_locking" = "yes" && mail_locking=locking +if test -z "$mail_locking"; then + case "$opsys" in cygwin* | mingw*) + mail_locking=pop ;; + esac +fi + if test "$mail_locking" = "lockf"; then AC_DEFINE(MAIL_LOCK_LOCKF) elif test "$mail_locking" = "flock"; then AC_DEFINE(MAIL_LOCK_FLOCK) elif test "$mail_locking" = "locking"; then AC_DEFINE(MAIL_LOCK_LOCKING) +elif test "$mail_locking" = "pop"; then + with_pop=yes + mail_locking= else mail_locking="dot-locking"; AC_DEFINE(MAIL_LOCK_DOT) fi test "$mail_locking" = "lockf" -a "$ac_cv_func_lockf" != "yes" && \ @@ -2323,13 +2498,15 @@ fi dnl Link with "-z ignore" on Solaris if supported -if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then - AC_MSG_CHECKING(for \"-z ignore\" linker flag) - case "`ld -h 2>&1`" in - *-z\ ignore\|record* ) AC_MSG_RESULT(yes) - XE_PREPEND(-z ignore, ld_switch_site) ;; - *) AC_MSG_RESULT(no) ;; - esac +if test "$opsys" = "sol2"; then + if test "$os_release" -ge 56; then + AC_MSG_CHECKING(for \"-z ignore\" linker flag) + case "`ld -h 2>&1`" in + *-z\ ignore\|record* ) AC_MSG_RESULT(yes) + XE_PREPEND(-z ignore, ld_switch_site) ;; + *) AC_MSG_RESULT(no) ;; + esac + fi fi dnl ---------------------- @@ -2426,7 +2603,9 @@ done dnl Avoid version mismatch for shared library libXm.so on osf4 - if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi + case "$opsys" in + decosf*) if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi ;; + esac ld_switch_x_site="$X_LIBS" @@ -2473,10 +2652,19 @@ cd .. rm -fr conftestdir for word in $xmkmf_defines; do - case "$word" in - -D*=* ) ;; - -D* ) word=`echo '' $word | sed -e 's:^ *-D::'` - AC_DEFINE_UNQUOTED($word) ;; + case "$word" in -D* ) + sym=`echo '' $word | sed -e 's:^ *-D::' -e 's:=.*::'` + case "$word" in + -D*=* ) val=`echo '' $word | sed -e 's:^.*=::'` ;; + * ) val=1 ;; + esac +dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above. + if grep "^#define $sym " confdefs.h >/dev/null; then :; else + if test "$val" = "1" + then AC_DEFINE_UNQUOTED($sym) + else AC_DEFINE_UNQUOTED($sym,$val) + fi + fi ;; esac done fi @@ -2511,6 +2699,15 @@ AC_MSG_RESULT(R${x11_release}) AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release}) + if test "${x11_release}" = "4"; then + case "$with_widgets" in + "" | "no") with_widgets=no ;; + *) XE_DIE("Widget support requires X11R5 or greater") ;; + esac + fi + + AC_CHECK_FUNCS(XConvertCase) + AC_CHECK_HEADERS(X11/Xlocale.h) dnl remove this - we should avoid checking for specific OS @@ -2562,7 +2759,7 @@ if test "$with_msw" = "yes"; then AC_DEFINE(HAVE_MS_WINDOWS) install_pp="$blddir/lib-src/installexe.sh" - XE_APPEND(-lshell32 -lgdi32 -luser32 -lcomctl32 -lwinspool, libs_system) + XE_APPEND(-lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool, libs_system) test "$with_dragndrop" != no && XE_APPEND(msw, dragndrop_proto) if test "$window_system" != x11; then window_system=msw @@ -2585,7 +2782,6 @@ AC_TRY_RUN([#include int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }], [AC_DEFINE(HAVE_MSG_SELECT)]) - const_is_losing=no with_file_coding=yes XE_ADD_OBJS(console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o) fi @@ -2638,6 +2834,14 @@ done fi +dnl Balloon Help requires the Shape extension, not available everywhere, +dnl for example not on AIX 4.3. +if test "$with_x11" = "yes"; then + AC_CHECK_HEADER(X11/extensions/shape.h, [ + AC_DEFINE(HAVE_BALLOON_HELP) + XE_ADD_OBJS(balloon_help.o balloon-x.o)]) +fi + dnl FSF 19.29 has some bitmapdir stuff here. bitmapdir= @@ -2680,9 +2884,9 @@ dnl autodetect the location of tt_c.h dnl tt_c.h might be in Tt or desktop include directories for dir in "" "Tt/" "desktop/" ; do - AC_CHECK_HEADER(${dir}tt_c.h, tt_c_h_path="${dir}tt_c.h"; break) + AC_CHECK_HEADER(${dir}tt_c.h, tt_c_h_file="${dir}tt_c.h"; break) done - if test -z "$tt_c_h_path"; then + if test -z "$tt_c_h_file"; then if test "$with_tooltalk" = "yes"; then USAGE_ERROR("Unable to find required tooltalk header files.") fi @@ -2704,7 +2908,7 @@ test -z "$with_tooltalk" && with_tooltalk=yes if test "$with_tooltalk" = "yes"; then AC_DEFINE(TOOLTALK) - AC_DEFINE_UNQUOTED(TT_C_H_PATH, "$tt_c_h_path") + AC_DEFINE_UNQUOTED(TT_C_H_FILE, "$tt_c_h_file") XE_PREPEND($tt_libs, libs_x) XE_ADD_OBJS(tooltalk.o) fi @@ -2795,6 +2999,38 @@ AC_CHECK_FUNCS(ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result) fi +dnl Autodetect PostgreSQL +dnl On many Linux systems, PostgreSQL is packaged to be installed in /usr; +dnl in this case, configure will easily detect it there. +dnl +dnl If PostgreSQL is installed into a different prefix, +dnl (such as the default /usr/local/pgsql when building from source), +dnl that prefix must be specified using the --site-prefixes flag. +if test "$with_postgresql" != "no"; then + AC_CHECKING(for PostgreSQL) + +dnl Look for these standard header file locations, known to be used on Linux + for header_dir in "" "pgsql/" "postgresql/"; do + AC_CHECK_HEADER(${header_dir}libpq-fe.h, + libpq_fe_h_file=${header_dir}libpq-fe.h; break) + done + + test -n "$libpq_fe_h_file" && { AC_CHECK_LIB(pq,PQconnectdb,have_libpq=yes) } + + if test -n "$libpq_fe_h_file" -a "$have_libpq" = "yes"; then + with_postgresql=yes + AC_DEFINE(HAVE_POSTGRESQL) + AC_CHECK_LIB(pq,PQconnectStart, [ + with_postgresqlv7=yes; + AC_DEFINE(HAVE_POSTGRESQLV7)]) + AC_DEFINE_UNQUOTED(LIBPQ_FE_H_FILE, "$libpq_fe_h_file") + XE_PREPEND(-lpq, LIBS) + XE_ADD_OBJS(postgresql.o) + elif test "$with_postgresql" = "yes"; then + XE_DIE("Required PostgreSQL support cannot be provided. Check --site-prefixes.") + fi +fi + dnl ---------------------- dnl Graphics libraries dnl ---------------------- @@ -2807,7 +3043,8 @@ if test -z "$with_xpm"; then AC_MSG_CHECKING(for Xpm - no older than 3.4f) xe_check_libs=-lXpm - AC_TRY_RUN([#include + AC_TRY_RUN([#define XPM_NUMBERS +#include int main(int c, char **v) { return c == 1 ? 0 : XpmIncludeVersion != XpmLibraryVersion() ? 1 : @@ -3092,12 +3329,24 @@ dnl Add the Athena widget library we located earlier XE_PREPEND(-l$athena_lib, libs_x) - dnl Export the path for lwlib, used to build and include the headers - dnl from the right place later on. - AC_DEFINE_UNQUOTED(ATHENA_H_PATH, $athena_h_path) + dnl Tell lwlib where to find the Athena header files. + dnl Many people have tried to create a `smart' way of doing this, + dnl but all have failed. Before changing the following ugly definitions, + dnl consult the veterans of many a battle. + AC_DEFINE_UNQUOTED(ATHENA_Scrollbar_h_,"$athena_h_path/Scrollbar.h") + AC_DEFINE_UNQUOTED(ATHENA_Dialog_h_,"$athena_h_path/Dialog.h") + AC_DEFINE_UNQUOTED(ATHENA_Form_h_,"$athena_h_path/Form.h") + AC_DEFINE_UNQUOTED(ATHENA_Command_h_,"$athena_h_path/Command.h") + AC_DEFINE_UNQUOTED(ATHENA_Label_h_,"$athena_h_path/Label.h") + AC_DEFINE_UNQUOTED(ATHENA_LabelP_h_,"$athena_h_path/LabelP.h") + AC_DEFINE_UNQUOTED(ATHENA_Toggle_h_,"$athena_h_path/Toggle.h") + AC_DEFINE_UNQUOTED(ATHENA_ToggleP_h_,"$athena_h_path/ToggleP.h") + AC_DEFINE_UNQUOTED(ATHENA_AsciiText_h_,"$athena_h_path/AsciiText.h") + AC_DEFINE_UNQUOTED(ATHENA_XawInit_h_,"$athena_h_path/XawInit.h") AC_DEFINE(LWLIB_USES_ATHENA) AC_DEFINE(NEED_ATHENA) + need_athena="yes" if test "$athena_3d" = "yes"; then AC_DEFINE(HAVE_ATHENA_3D) @@ -3305,20 +3554,50 @@ XE_COMPUTE_RUNPATH() fi -AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getpt getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask) +AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask) + +dnl Check for PTY support functions. +dnl getpt is the preferred pty allocation method on glibc systems. +dnl _getpt is the preferred pty allocation method on SGI systems. +dnl grantpt, unlockpt, ptsname are defined by Unix98. +AC_CHECK_FUNCS(getpt _getpt grantpt unlockpt ptsname killpg tcgetpgrp) + +dnl openpty is the preferred pty allocation method on BSD and Tru64 systems. +dnl openpty might be declared in pty.h or in libutil.h. +AC_CHECK_FUNC(openpty, have_openpty=yes, [ + AC_CHECK_LIB(util, openpty, have_openpty=yes need_libutil=yes)]) +if test "$have_openpty" = "yes"; then + AC_DEFINE(HAVE_OPENPTY) + AC_CHECK_HEADERS(pty.h libutil.h) + test "$need_libutil" = "yes" && XE_APPEND(-lutil, libs_system) +fi + +dnl Check for STREAM support functions. +dnl Confusingly, "str" means both "string" and "SysV Streams". +AC_CHECK_HEADERS(sys/stropts.h) +if test "$ac_cv_header_sys_stropts_h" = "yes"; then + AC_CHECK_FUNCS(isastream) + AC_CHECK_HEADERS(sys/strtio.h) dnl TIOCSIGNAL +fi dnl Use our own realpath always. XE_ADD_OBJS(realpath.o) -dnl Check whether the system provides getloadavg (Solaris 7 has it) +dnl Check whether the system provides getloadavg(). AC_CHECK_FUNCS(getloadavg) -if test "$ac_cv_func_getloadavg" != "yes" -then +if test "$ac_cv_func_getloadavg" = "yes"; then + dnl Solaris 8 declares getloadavg() in . + dnl glibc 2.2 declares getloadavg() in ... + dnl ...if we #define _GNU_SOURCE, which we do. + AC_CHECK_HEADERS(sys/loadavg.h) +else + dnl We define our own getloadavg() using lower level functions. XE_ADD_OBJS(getloadavg.o) dnl Used by getloadavg() - does not require root priveleges AC_CHECK_LIB(kstat, kstat_open) + AC_CHECK_HEADERS(kstat.h) dnl Another way to get the load average AC_CHECK_LIB(kvm, kvm_read) @@ -3402,8 +3681,7 @@ ], [ struct timeval time; - struct timezone dummy; - gettimeofday (&time, &dummy); + gettimeofday (&time, 0); ], [AC_MSG_RESULT(two)], [AC_MSG_RESULT(one) @@ -3412,10 +3690,7 @@ AC_C_INLINE -if test "$ac_cv_c_inline" != "no"; then - AC_DEFINE(HAVE_INLINE) - test "$GCC" = "yes" && XE_ADD_OBJS(inline.o) -fi +test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && XE_ADD_OBJS(inline.o) dnl HP-UX has a working alloca in libPW. dnl case "${GCC}${opsys}" in hpux* ) @@ -3480,8 +3755,21 @@ dnl rel_alloc requires either GNU malloc or system malloc with mmap dnl We only turn rel_alloc on by default if mmap is available. -test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no -test "$rel_alloc" = "default" -a "$have_mmap" = "yes" && rel_alloc=yes +test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no +if test "$rel_alloc $have_mmap" = "default yes"; then + if test "$doug_lea_malloc" = "yes"; then + dnl Check if malloc() calls mmap(), making rel_alloc pointless. + AC_MSG_CHECKING(for M_MMAP_THRESHOLD) + AC_TRY_COMPILE([#include ],[ +#ifndef M_MMAP_THRESHOLD +#error No M_MMAP_THRESHOLD :-( +!@+$%^&*_)(_ - unlikely to compile... +#endif +], [rel_alloc=no; AC_MSG_RESULT(yes);], [rel_alloc=yes; AC_MSG_RESULT(no);]) + else + rel_alloc=yes + fi +fi test "$rel_alloc" = "yes" && AC_DEFINE(REL_ALLOC) dnl Check for terminal I/O variants @@ -3592,11 +3880,19 @@ sound_found=yes need_miscplay=yes XE_ADD_OBJS(linuxplay.o) - [AC_DEFINE_UNQUOTED(SOUNDCARD_H_PATH, "${dir}/soundcard.h")] + [AC_DEFINE_UNQUOTED(SOUNDCARD_H_FILE, "${dir}/soundcard.h")] break) done fi + dnl Win32 Native uses native sound + if test -z "$sound_found"; then + if test "$with_msw" = "yes"; then + sound_found=yes + native_sound_lib= + fi + fi + test "$sound_found" = "yes" && with_native_sound=yes fi @@ -3667,8 +3963,8 @@ fi if test "$with_ncurses" = "yes"; then AC_DEFINE(HAVE_NCURSES) - AC_CHECK_HEADER(ncurses/curses.h, curses_h_path=ncurses/curses.h) - AC_CHECK_HEADER(ncurses/term.h, term_h_path=ncurses/term.h) + AC_CHECK_HEADER(ncurses/curses.h, curses_h_file=ncurses/curses.h) + AC_CHECK_HEADER(ncurses/term.h, term_h_file=ncurses/term.h) XE_ADD_OBJS(terminfo.o) XE_PREPEND(-lncurses, LIBS) @@ -3678,7 +3974,7 @@ dnl ) save_c_switch_site="$c_switch_site" c_switch_site="$c_switch_site -I/usr/include/ncurses" - AC_CHECK_HEADER(ncurses/curses.h, curses_h_path=ncurses/curses.h) + AC_CHECK_HEADER(ncurses/curses.h, curses_h_file=ncurses/curses.h) if test "$ac_cv_header_ncurses_curses_h" = "yes" then AC_MSG_WARN("Your system has the bogus ncurses include bug.") else c_switch_site="$save_c_switch_site" @@ -3710,8 +4006,8 @@ fi fi fi - AC_DEFINE_UNQUOTED(CURSES_H_PATH, "${curses_h_path-curses.h}") - AC_DEFINE_UNQUOTED(TERM_H_PATH, "${term_h_path-term.h}") + AC_DEFINE_UNQUOTED(CURSES_H_FILE, "${curses_h_file-curses.h}") + AC_DEFINE_UNQUOTED(TERM_H_FILE, "${term_h_file-term.h}") dnl Autodetect gpm test -z "$with_gpm" && { AC_CHECK_HEADER(gpm.h, , with_gpm=no) } @@ -3779,8 +4075,11 @@ dnl Check for Berkeley DB. if test "$with_database_berkdb" != "no"; then AC_MSG_CHECKING(for Berkeley db.h) - for path in "db/db.h" "db.h"; do - AC_TRY_COMPILE([#ifdef HAVE_INTTYPES_H + for header in "db/db.h" "db.h"; do + AC_TRY_COMPILE([ +#include +#if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) +#ifdef HAVE_INTTYPES_H #define __BIT_TYPES_DEFINED__ #include typedef uint8_t u_int8_t; @@ -3790,18 +4089,19 @@ typedef uint64_t u_int64_t; #endif #endif -#include <$path> -],[], db_h_path="$path"; break) +#endif +#include <$header> +],[], db_h_file="$header"; break) done - if test -z "$db_h_path" + if test -z "$db_h_file" then AC_MSG_RESULT(no); with_database_berkdb=no - else AC_MSG_RESULT($db_h_path) + else AC_MSG_RESULT($db_h_file) fi if test "$with_database_berkdb" != "no"; then AC_MSG_CHECKING(for Berkeley DB version) AC_EGREP_CPP(yes, -[#include <$db_h_path> +[#include <$db_h_file> #if DB_VERSION_MAJOR > 1 yes #endif @@ -3811,7 +4111,7 @@ fi if test "$with_database_berkdb" = "yes"; then - AC_DEFINE_UNQUOTED(DB_H_PATH, "$db_h_path") + AC_DEFINE_UNQUOTED(DB_H_FILE, "$db_h_file") AC_DEFINE(HAVE_BERKELEY_DB) test "$need_libdb" = "yes" && XE_PREPEND(-ldb, LIBS) else with_database_berkdb=no @@ -3840,20 +4140,25 @@ if test "$with_modules" != "no"; then AC_CHECKING(for module support) - dnl Find headers and libraries - AC_CHECK_HEADER(dlfcn.h, [ - AC_CHECK_LIB(dl, dlopen, [ have_dl=yes libdl=dl], [ - AC_CHECK_LIB(c, dlopen, [ have_dl=yes ])])]) - if test -n "$have_dl"; then - AC_DEFINE(HAVE_DLOPEN) + dnl Check for MS-Windows + if test "$with_msw" = "yes"; then + have_dl=yes; else - AC_CHECK_LIB(dld, shl_load, [ - libdl=dld have_dl=yes; - AC_DEFINE(HAVE_SHL_LOAD)], [ - AC_CHECK_LIB(dld, dld_init, [ - libdl=dld have_dl=yes; - AC_DEFINE(HAVE_DLD_INIT)])]) - fi + dnl Find headers and libraries + AC_CHECK_HEADER(dlfcn.h, [ + AC_CHECK_LIB(dl, dlopen, [ have_dl=yes libdl=dl], [ + AC_CHECK_LIB(c, dlopen, [ have_dl=yes ])])]) + if test -n "$have_dl"; then + AC_DEFINE(HAVE_DLOPEN) + else + AC_CHECK_LIB(dld, shl_load, [ + libdl=dld have_dl=yes; + AC_DEFINE(HAVE_SHL_LOAD)], [ + AC_CHECK_LIB(dld, dld_init, [ + libdl=dld have_dl=yes; + AC_DEFINE(HAVE_DLD_INIT)])]) + fi + fi dnl end !MS-Windows if test -n "$have_dl"; then dnl XE_SHLIB_STUFF (in aclocal.m4) defines $can_build_shared @@ -4128,17 +4433,6 @@ done AC_SUBST(ETCDIR) -AC_SUBST(lockdir) -AC_SUBST(LOCKDIR_USER_DEFINED) -LOCKDIR=$lockdir -while true; do - case "$LOCKDIR" in - *\$* ) eval "LOCKDIR=$LOCKDIR" ;; - *) break ;; - esac -done -AC_SUBST(LOCKDIR) - AC_SUBST(docdir) AC_SUBST(DOCDIR_USER_DEFINED) DOCDIR=$docdir @@ -4214,8 +4508,6 @@ XE_SPACE(ac_configure_args, $ac_configure_args) AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "$configuration") AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "$ac_configure_args") -AC_DEFINE_UNQUOTED(config_machfile, "$machfile") -AC_DEFINE_UNQUOTED(config_opsysfile, "$opsysfile") dnl Following are deprecated @@ -4240,8 +4532,7 @@ test "$with_i18n3" = "yes" && AC_DEFINE(I18N3) test "$GCC" = "yes" && AC_DEFINE(USE_GCC) test "$external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET) -test "$no_doc_file" = "yes" && AC_DEFINE(NO_DOC_FILE) -dnl test "$const_is_losing" = "yes" && AC_DEFINE(CONST_IS_LOSING) +test "$quick_build" = "yes" && AC_DEFINE(QUICK_BUILD) test "$with_purify" = "yes" && AC_DEFINE(PURIFY) test "$with_quantify" = "yes" && AC_DEFINE(QUANTIFY) test "$with_pop" = "yes" && AC_DEFINE(MAIL_USE_POP) @@ -4280,59 +4571,121 @@ echo " XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'. - - Where should the build process find the source code? $srcdir - What installation prefix should install use? $prefix - What operating system and machine description files should XEmacs use? - \`$opsysfile' and \`$machfile' - What compiler should XEmacs be built with? $CC $CFLAGS - Should XEmacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason} - Should XEmacs use the relocating allocator for buffers? $rel_alloc - What window system should XEmacs use? ${window_system}" -if test "$with_x11" = "yes"; then - echo " Where do we find X Windows header files? $x_includes" - echo " Where do we find X Windows libraries? $x_libraries" -fi +" +echo " +Compilation / Installation:" +echo " Source code location: $srcdir" +echo " Installation prefix: $prefix" if test -n "$site_includes"; then - echo " Additional header files: $site_includes" + echo " Additional header files: $site_includes" fi if test -n "$site_libraries"; then - echo " Additional libraries: $site_libraries" + echo " Additional libraries: $site_libraries" fi if test -n "$site_prefixes"; then - echo " Additional prefixes: $site_prefixes" + echo " Additional prefixes: $site_prefixes" fi if test -n "$runpath"; then - echo " Runtime library search path: $runpath" + echo " Runtime library search path: $runpath" +fi + +if test -n "$opsysfile" +then echo " Operating system description file: \`$opsysfile'" +else echo " Not using any operating system description file" +fi +if test -n "$machfile" +then echo " Machine description file: \`$machfile'" +else echo " Not using any machine description file" fi -if test "$have_xaw" = "yes"; then - echo " Athena library to link: $athena_lib" - echo " Athena header include path: $athena_h_path" + +echo " Compiler: $CC $CFLAGS" +echo " Relocating allocator for buffers: $rel_alloc" +echo " GNU version of malloc: ${GNU_MALLOC}${GNU_MALLOC_reason}" + +echo " +Window System:" +if test "$with_msw" = "yes"; then + echo " Compiling in support for the Microsoft window system." +fi +if test "$with_x11" = "yes"; then + echo " Compiling in support for the X window system:" + echo " - X Windows headers location: $x_includes" + echo " - X Windows libraries location: $x_libraries" + if test "$with_xauth" != yes; then + echo " - Xau (X authority) not available." + fi + if test "$with_xmu" != yes; then + echo " - Xmu library not available; substituting equivalent routines." + fi + if test "$with_wmcommand" != no; then + echo " - Handling WM_COMMAND properly." + fi +fi +if test "$need_athena" = "yes"; then + echo " Compiling in support for the Athena widget set:" + echo " - Athena headers location: $athena_h_path" + echo " - Athena library to link: $athena_lib" fi -test "$with_dnet" = yes && echo " Compiling in support for DNET." -test "$with_socks" = yes && echo " Compiling in support for SOCKS." -test "$with_xauth" = yes && echo " Compiling in support for XAUTH." -if test "$with_xmu" != yes -a "$with_x11" = yes; then - echo " No Xmu; substituting equivalent routines." +case "$with_menubars" in + lucid ) echo " Using Lucid menubars." ;; + motif ) echo " Using Motif menubars." + echo " *WARNING* The Motif menubar implementation is currently buggy." + echo " We recommend using the Lucid menubar instead." + echo " Re-run configure with --with-menubars='lucid'." ;; + msw ) echo " Using MS-Windows menubars." ;; +esac +case "$with_scrollbars" in + lucid ) echo " Using Lucid scrollbars." ;; + motif ) echo " Using Motif scrollbars." ;; + athena ) echo " Using Athena scrollbars." ;; + msw ) echo " Using MS-Windows scrollbars." ;; +esac +case "$with_dialogs" in + motif ) echo " Using Motif dialog boxes." + if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then + echo " *WARNING* The Motif dialog boxes cause problems on AIX 4.3 and higher." + echo " We recommend using the Athena dialog boxes instead." + echo " Install libXaw and re-run configure with --with-dialogs='athena'." + echo " Read the PROBLEMS file for more information." + fi; fi ;; + athena ) echo " Using Athena dialog boxes." ;; + msw ) echo " Using MS-Windows dialog boxes." ;; +esac +case "$with_widgets" in + motif ) echo " Using Motif native widgets." ;; + athena ) echo " Using Athena native widgets." ;; + msw ) echo " Using MS-Windows native widgets." ;; +esac +if test "$with_dragndrop" = yes; then + echo " Compiling in support for Drag'n'Drop (EXPERIMENTAL)." + echo " - Drag'n'Drop prototype: $dragndrop_proto." fi +echo " +TTY:" +test "$with_ncurses" = yes && echo " Compiling in support for ncurses." +test "$with_gpm" = yes && echo " Compiling in support for GPM (General Purpose Mouse)." + +echo " +Images:" +test "$with_gif" = yes && echo " Compiling in support for GIF images (builtin)." if test "$with_xpm" = yes; then - echo " Compiling in support for XPM images." + echo " Compiling in support for XPM images." elif test "$with_x11" = yes; then - echo " --------------------------------------------------------------------" - echo " WARNING: Compiling without XPM support." + echo " WARNING: -----------------------------------------------------------" + echo " WARNING: Compiling without XPM image support." if test "$xpm_problem" != ""; then echo " Reason: $xpm_problem" fi echo " WARNING: You should strongly consider installing XPM." echo " WARNING: Otherwise toolbars and other graphics will look suboptimal." echo " WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)" - echo " --------------------------------------------------------------------" + echo " WARNING: -----------------------------------------------------------" fi if test "$with_png" = yes; then - echo " Compiling in support for PNG image handling." + echo " Compiling in support for PNG images." elif test "$window_system" != "none"; then - echo " --------------------------------------------------------------------" + echo " WARNING: -----------------------------------------------------------" echo " WARNING: Compiling without PNG image support." if test "$png_problem" != ""; then echo " Reason: $png_problem" @@ -4340,91 +4693,66 @@ echo " WARNING: You should strongly consider installing the PNG libraries." echo " WARNING: Otherwise certain images and glyphs may not display." echo " WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)" - echo " --------------------------------------------------------------------" + echo " WARNING: -----------------------------------------------------------" fi -test "$with_gif" = yes && echo " Compiling in support for (builtin) GIF image handling." -test "$with_jpeg" = yes && echo " Compiling in support for JPEG image handling." -test "$with_tiff" = yes && echo " Compiling in support for TIFF image handling." +test "$with_jpeg" = yes && echo " Compiling in support for JPEG images." +test "$with_tiff" = yes && echo " Compiling in support for TIFF images." test "$with_xface" = yes && echo " Compiling in support for X-Face message headers." -test "$with_native_sound" = yes && echo " Compiling in native sound support." -test "$with_nas_sound" = yes && echo " Compiling in network sound (NAS) support." -test "$old_nas" = yes && echo " nas library lacks error trapping, will play synchronously." -test "$with_esd_sound" = yes && echo " Compiling in support for Enlightened Sound Daemon (ESD)." - -test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley DB." +echo " +Sound:" +test "$with_native_sound" = yes && echo " Compiling in support for sound (native)." +test "$with_nas_sound" = yes && echo " Compiling in support for NAS (network audio system)." +test "$old_nas" = yes && echo " - NAS library lacks error trapping; will play synchronously." +test "$with_esd_sound" = yes && echo " Compiling in support for ESD (Enlightened Sound Daemon)." + +echo " +Databases:" +test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley database." test "$with_database_dbm" = yes && echo " Compiling in support for DBM." test "$with_database_gdbm" = yes && echo " Compiling in support for GNU DBM." - -test "$with_ldap" = yes && echo " Compiling in support for LDAP." - -test "$with_ncurses" = yes && echo " Compiling in support for ncurses." -test "$with_gpm" = yes && echo " Compiling in support for GPM (General Purpose Mouse)." - -test "$with_mule" = yes && echo " Compiling in Mule (multi-lingual) support." -test "$with_file_coding" = yes && echo " Compiling in File coding support." -test "$with_xim" != no && echo " Compiling in XIM (X11R5+ I18N input method) support." -test "$with_xim" = motif && echo " Using Motif to provide XIM support." -test "$with_xim" = xlib && echo " Using raw Xlib to provide XIM support." -test "$with_xfs" = yes && echo " Using XFontSet to provide bilingual menubar." -test "$with_canna" = yes && echo " Compiling in support for Canna on Mule." +test "$with_ldap" = yes && echo " Compiling in support for LDAP." +if test "$with_postgresql" = yes; then + echo " Compiling in support for PostgreSQL." + echo " - Using PostgreSQL header file: $libpq_fe_h_file" + test "$with_postgresqlv7" = yes && echo " - Using PostgreSQL V7 bindings." +fi + +echo " +Internationalization:" +test "$with_mule" = yes && echo " Compiling in support for Mule (multi-lingual Emacs)." +test "$with_file_coding" = yes && echo " Compiling in support for file coding." +test "$with_xim" != no && echo " Compiling in support for XIM (X11R5+ I18N input method)." +test "$with_xim" = motif && echo " - Using Motif to provide XIM support." +test "$with_xim" = xlib && echo " - Using raw Xlib to provide XIM support." +test "$with_xfs" = yes && echo " - Using XFontSet to provide bilingual menubar." +test "$with_canna" = yes && echo " Compiling in support for Canna on Mule." if test "$with_wnn" = yes; then echo " Compiling in support for the WNN input method on Mule." - test "$with_wnn6" = yes && echo " Using WNN version 6." + test "$with_wnn6" = yes && echo " - Using WNN version 6." fi -test "$with_i18n3" = yes && echo " Compiling in I18N support, level 3 (doesn't currently work)." - -test "$with_cde" = yes && echo " Compiling in support for CDE." +test "$with_i18n3" = yes && echo " Compiling in support for I18N level 3 (doesn't currently work)." + +echo " +Mail:" +test "$with_pop" = yes && echo " Compiling in support for POP mail retrieval." +test "$with_kerberos" = yes && echo " Compiling in support for Kerberos POP authentication." +test "$with_hesiod" = yes && echo " Compiling in support for Hesiod POP server access." +test -n "$mail_locking" && echo " Compiling in support for \"$mail_locking\" mail spool file locking method." + +echo " +Other Features:" test "$with_tooltalk" = yes && echo " Compiling in support for ToolTalk." -test "$with_offix" = yes && echo " Compiling in support for OffiX." -test "$with_dragndrop" = yes && echo " Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )." test "$with_workshop" = yes && echo " Compiling in support for Sun WorkShop." -test "$with_wmcommand" != no && echo " Compiling in support for proper WM_COMMAND handling." -case "$with_menubars" in - lucid ) echo " Using Lucid menubars." ;; - motif ) echo " Using Motif menubars." - echo " *WARNING* The Motif menubar implementation is currently buggy." - echo " We recommend using the Lucid menubar instead." - echo " Re-run configure with --with-menubars='lucid'." ;; - msw ) echo " Using MS-Windows menubars." ;; -esac -case "$with_scrollbars" in - lucid ) echo " Using Lucid scrollbars." ;; - motif ) echo " Using Motif scrollbars." ;; - athena ) echo " Using Athena scrollbars." ;; - msw ) echo " Using MS-Windows scrollbars." ;; -esac -case "$with_widgets" in - motif ) echo " Using Motif native widgets." ;; - athena ) echo " Using Athena native widgets." ;; - msw ) echo " Using MS-Windows native widgets." ;; -esac -case "$with_dialogs" in - motif ) - echo " Using Motif dialog boxes." - if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then - echo " *WARNING* The Motif dialog boxes cause problems on AIX 4.3 and higher." - echo " We recommend using the Athena dialog boxes instead." - echo " Install libXaw and re-run configure with --with-dialogs='athena'." - echo " Read the PROBLEMS file for more information." - fi; fi - ;; - athena ) echo " Using Athena dialog boxes." ;; - msw ) echo " Using MS-Windows dialog boxes." ;; -esac -test "$with_modules" = "yes" && echo " Compiling in dynamic shared object module support." -test "$with_clash_detection" = yes && \ - echo " Clash detection will use \"$lockdir\" for locking files." -echo " movemail will use \"$mail_locking\" for locking mail spool files." -test "$with_pop" = yes && echo " Using POP for mail access." -test "$with_kerberos" = yes && echo " Using Kerberos for POP authentication." -test "$with_hesiod" = yes && echo " Using Hesiod to get POP server host." -test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." -test "$pdump" = yes && echo " Using the new portable dumper (wishful thinking)." -test "$debug" = yes && echo " Compiling in extra code for debugging." -test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)." -if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \ - != "no no no no no"; then +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." +test "$pdump" = yes && echo " Using the new portable dumper." +test "$debug" = yes && echo " Compiling in support for extra debugging code." +test "$usage_tracking" = yes && echo " Compiling in support for active usage tracking (Sun internal)." +if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc $error_check_glyphs" \ + != "no no no no no no"; then echo " WARNING: ---------------------------------------------------------" echo " WARNING: Compiling in support for runtime error checking." echo " WARNING: XEmacs will run noticeably more slowly as a result." @@ -4494,9 +4822,9 @@ -e 's/^[ TAB][ TAB]*$//'\ -e 's/^ /TAB/' \ dnl Delete blank lines - | sed -n -e '/^..*$/p' \ + -e '/^[ ]*$/d' \ dnl Restore lines quoted above to original contents. - | sed '/^\"/ { + -e '/^\"/ { s/\\\([\"]\)/\1/g s/^[ TAB]*\"// s/\"[ TAB]*$// diff -r 72a7cfa4a488 -r abe6d1db359e configure.usage --- a/configure.usage Mon Aug 13 11:33:40 2007 +0200 +++ b/configure.usage Mon Aug 13 11:35:02 2007 +0200 @@ -9,34 +9,40 @@ Options marked with a (*) are auto-detected. +Many features require external packages to be installed first. +Get them from ftp://ftp.xemacs.org/pub/xemacs/aux. + Use colons (or quoted spaces) to separate directory names in option values which are PATHs (i.e. lists of directories). +The results of configure tests are saved in config.log, which is useful +for diagnosing problems. + + General options: --help Issue this usage message. ---verbose Display the results of configure tests. ---extra-verbose Display even more information, useful for debugging. +--verbose Accepted but ignored. +--extra-verbose Display more information, useful for debugging. Compilation options: ---compiler=prog C compiler to use. +--compiler=PROG C compiler to use --with-gcc (*) Use GCC to compile XEmacs. ---without-gcc Don't use GCC to compile XEmacs. --cflags=FLAGS Compiler flags (such as -O) ---cpp=prog C preprocessor to use (e.g. /usr/ccs/lib/cpp or cc -E) +--cpp=PROG C preprocessor to use (e.g. /usr/ccs/lib/cpp or cc -E) --cppflags=FLAGS C preprocessor flags (e.g. -I/foo or -Dfoo=bar) --libs=LIBS Additional libraries (e.g. -lfoo) --ldflags=FLAGS Additional linker flags (e.g. -L/foo) ---site-includes=PATH List of directories to search first for header files. ---site-libraries=PATH List of directories to search first for libraries. +--site-includes=PATH List of directories to search first for header files +--site-libraries=PATH List of directories to search first for libraries --site-prefixes=PATH List of directories to search for include/ and lib/ subdirectories, just after 'site-includes' and - 'site-libraries'. + 'site-libraries' --site-runtime-libraries=PATH List of ALL directories to search for dynamically - linked libraries at run time. + linked libraries at run time --dynamic=yes Link dynamically if supported by system. --dynamic=no Force static linking on systems where dynamic linking is the default. @@ -47,19 +53,19 @@ Installation options: --prefix=DIR Install files below DIR. Defaults to `/usr/local'. ---with-prefix Compile the value of --prefix into the executable. - Defaults to `yes'. ---without-prefix Don't compile the value of --prefix into the executable. +--with-prefix=no Don't compile the value of --prefix into the + executable. Window-system options: --with-x11 (*) Support the X Window System. ---without-x11 Don't support X. --x-includes=DIR Search for X header files in DIR. --x-libraries=DIR Search for X libraries in DIR. ---without-toolbars Don't compile with any toolbar support. ---without-wmcommand Compile without realized leader window which will +--with-msw (*) Support MS Windows as a window system (only under + Cygwin and MinGW). +--with-toolbars=no Don't compile with any toolbar support. +--with-wmcommand=no Compile without realized leader window which will keep the WM_COMMAND property. --with-athena=TYPE Use TYPE Athena widgets (xaw, 3d, next, 95, or xpm) @@ -74,44 +80,81 @@ --with-widgets=TYPE Use TYPE widgets (motif, athena, or no). Motif widgets will be used if Motif can be found. Other widget types are currently unsupported. ---with-dragndrop (*) Compile in the generic drag and drop API. This is +--with-dragndrop Compile in the generic drag and drop API. This is automatically added if one of the drag and drop protocols is found (currently CDE, OffiX, MSWindows). *WARNING* The Drag'n'drop support is under development and is considered experimental. ---with-cde (*) Compile in support for CDE drag and drop. ---with-offix (*) Compile in support for OffiX drag and drop. +--with-cde Compile in support for CDE drag and drop. +--with-offix Compile in support for OffiX drag and drop. *WARNING* If you compile in OffiX, you may not be able to use multiple X displays success- fully. If the two servers are from different vendors, the results may be unpredictable. ---without-xmu (*) For those unfortunates whose vendors don't ship Xmu. +--with-xmu=no (*) For those unfortunates whose vendors don't ship Xmu. --external-widget Compile with external widget support. ---with-xpm (*) Compile with support for XPM files. - It is highly recommended that you obtain XPM - (version 3.4h or better) if you don't already - have it. Get it from the XEmacs FTP site. ---with-xface (*) Compile with support for X-Face mail header - conversion. Requires the compface library. - Get it from the XEmacs FTP site. ---without-gif Compile without the built-in support for GIF image - conversion. ---with-jpeg (*) Compile with support for JPEG image conversion. - Requires libjpeg from the Independent JPEG Group. - Get it from the XEmacs FTP site. ---with-png (*) Compile with support for PNG image conversion. - Requires libpng. Get it from the XEmacs FTP site. ---with-tiff (*) Compile with support for TIFF image conversion. - Requires Sam Lefflier's libtiff library. - Get if from the XEmacs FTP site. + + +TTY (character terminal) options: + +--with-tty=no Don't support ttys. +--with-ncurses (*) Use the ncurses library for tty support. +--with-gpm (*) Compile in GPM mouse support for ttys. + + +Image options: + +--with-xpm (*) Compile with support for XPM images. PRACTICALLY + REQUIRED. Although this library is nonstandard and + a real hassle to build, many basic things (e.g. + toolbars) depend on it, and you will run into + many problems without it. +--with-png (*) Compile with support for PNG images. Recommended + because the images on the About page are not viewable + without it. +--with-jpeg (*) Compile with support for JPEG images. Useful if + you are using a mail, news reader, or web browser + in XEmacs, so that JPEG images can be displayed. +--with-tiff (*) Compile with support for TIFF images. Possibly + useful, for the same reason as JPEG images. +--with-xface (*) Compile with support for X-Face mail headers. + Requires the compface package. Of doubtful + usefulness. +--with-gif=no Compile without the (builtin) support for GIF images. -TTY options: +Sound options: + +--with-sound=TYPE,[TYPE],... Compile with native sound support. + Valid types are `native', `nas' and `esd'. + Prefix a type with 'no' to disable. + The first option can be `none' or `all'. + `none' is a synonym for `nonative,nonas,noesd'. + `all' is a synonym for native,nas,esd or `all'. + The default is to autodetect all sound support. +--native-sound-lib=LIB Native sound support library. Needed on Suns + with --with-sound=both because both sound libraries + are called libaudio. + + +Database options: ---without-tty Don't support TTY-s. ---with-ncurses (*) Use the ncurses library for tty support. ---with-gpm (*) Compile in support for General Purpose Mouse. +--with-database=TYPE (*) Compile with database support. Valid types are + `no' or a comma-separated list of one or more + of `berkdb' and either `dbm' or `gnudbm'. +--with-ldap (*) Compile with support for the LDAP protocol. +--with-postgresql (*) Compile with support for the PostgreSQL RDBMS. + + +Mail options: + +--mail-locking=TYPE (*) Specify the locking to be used by movemail to prevent + concurrent updates of mail spool files. Valid types + are `lockf', `flock', and `dot'. +--with-pop Support POP for mail retrieval. +--with-kerberos Support Kerberos-authenticated POP. +--with-hesiod Support Hesiod to get the POP server host. Additional features: @@ -120,30 +163,9 @@ --with-workshop Support the Sun WorkShop (formerly Sparcworks) development environment. --with-socks Compile with support for SOCKS (an Internet proxy). ---with-database=TYPE (*) Compile with database support. Valid types are - `no' or a comma-separated list of one or more - of `berkdb' and either `dbm' or `gnudbm'. ---with-sound=TYPE,[TYPE],... Compile with native sound support. - Valid types are `native', `nas' and `esd'. - Prefix a type with 'no' to disable. - The first option can be `none' or `all'. - `none' is a synonym for `nonative,nonas,noesd'. - `all' is a synonym for native,nas,esd or `all'. - The default is to autodetect all sound support. ---native-sound-lib=LIB Native sound support library. Needed on Suns - with --with-sound=both because both sound libraries - are called libaudio. ---with-pop support POP for mail retrieval ---with-kerberos support Kerberos-authenticated POP ---with-hesiod support Hesiod to get the POP server host --with-dnet (*) Compile with support for DECnet. ---with-ldap (*) Compile with support for the LDAP protocol (requires - installed LDAP libraries on the system). ---mail-locking=TYPE (*) Specify the locking to be used by movemail to prevent - concurrent updates of mail spool files. Valid types - are `lockf', `flock', and `dot'. ---with-modules Compile in experimental support for dynamically - loaded libraries (Dynamic Shared Objects). +--with-modules Compile in experimental support for dynamically + loaded libraries (Dynamic Shared Objects). --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, @@ -165,9 +187,9 @@ and localdir files in case run-time searching for them fails. --moduledir=DIR Directory to install dynamic modules in. ---pdump New, experimental, non-working, don't-sue-me-if- - your-house-collapses-and-your-wife-goes-away, - portable dumper. +--pdump New, experimental, non-working, don't-sue-me-if- + your-house-collapses-and-your-wife-leaves-you, + portable dumper. Internationalization options: @@ -186,8 +208,7 @@ 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 comercial package WNN - version 6 +--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 bilingual menubar. @@ -230,10 +251,7 @@ --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 not do clash detection. ---lockdir=DIR The directory to put clash detection files in, such as - `/var/lock/emacs'. - Defaults to `${statedir}/xemacs/lock'. + file. The default is to do clash detection. You may also specify any of the `path' variables found in Makefile.in, including --bindir, --libdir, --docdir, --lispdir, --sitelispdir, @@ -245,17 +263,18 @@ unsuccessful after disturbing the status quo, it removes config.status. The configure script also recognizes some environment variables, each -of which is equivalent to a corresponding configure flag. A specified -configure flag always overrides the environment variable. +of which is equivalent to a corresponding configure flag. Configure +flags take precedence over environment variables, if both are specified. -envvar configure flag ------ -------------- -CC --compiler -CPP --cpp -CFLAGS --cflags -CPPFLAGS --cppflags -LDFLAGS --ldflags -LIBS --libs -LD_RUN_PATH --site-runtime-libraries +environment corresponding +variable configure flag +----------- -------------- +CC --compiler +CPP --cpp +CFLAGS --cflags +CPPFLAGS --cppflags +LDFLAGS --ldflags +LIBS --libs +LD_RUN_PATH --site-runtime-libraries For more details on the install process, consult the INSTALL file. diff -r 72a7cfa4a488 -r abe6d1db359e dynodump/dynodump.c --- a/dynodump/dynodump.c Mon Aug 13 11:33:40 2007 +0200 +++ b/dynodump/dynodump.c Mon Aug 13 11:35:02 2007 +0200 @@ -68,12 +68,12 @@ * Note. under this mechanism, any data item that undergoes * relocation and is then further modified during the execution of * the image before dynodump(3x) is called will lose the - * modification that occured during the applications execution. + * modification that occurred during the applications execution. * * N.B. The above commentary is not quite correct in the flags have been hardwired * to RTLD_SAVREL. */ -#pragma ident "@(#) $Id: dynodump.c,v 1.6 1998/03/31 20:10:55 steve Exp $ - SMI" +#pragma ident "@(#) $Id: dynodump.c,v 1.6.2.2 2000/09/20 02:39:17 martinb Exp $ - SMI" #define __EXTENSIONS__ 1 @@ -301,7 +301,7 @@ * If we had a .heap section, then its size is part of the program * headers notion of data size. Because we're only going to output one * heap section (ignoring the one in the running binary) we need to - * subract the size of that which we're ignoring. + * subtract the size of that which we're ignoring. */ if (heap_cache) { edata = S_ROUND((data_phdr->p_vaddr diff -r 72a7cfa4a488 -r abe6d1db359e etc/CHARSETS --- a/etc/CHARSETS Mon Aug 13 11:33:40 2007 +0200 +++ b/etc/CHARSETS Mon Aug 13 11:35:02 2007 +0200 @@ -16,7 +16,7 @@ tibetan-1-column:241:2:94:4:1:0:56:0:Tibetan 1 column glyph tibetan:252:2:94:4:2:0:55:0:Tibetan characters lao:167:1:94:3:1:0:49:0:Lao characters (ISO10646 0E80..0EDF) -indian-1-column:240:2:94:4:1:0:54:0:Indian charset for 2-column width glypps +indian-1-column:240:2:94:4:1:0:54:0:Indian charset for 2-column width glyphs indian-2-column:251:2:94:4:2:0:53:0:Indian charset for 2-column width glyphs indian-is13194:225:1:94:3:2:0:53:1:Generic Indian charset for data exchange with IS 13194 ascii-right-to-left:166:1:94:3:1:1:66:0:ASCII (left half of ISO8859-1) with right-to-left direction diff -r 72a7cfa4a488 -r abe6d1db359e etc/Emacs.ad --- a/etc/Emacs.ad Mon Aug 13 11:33:40 2007 +0200 +++ b/etc/Emacs.ad Mon Aug 13 11:35:02 2007 +0200 @@ -17,9 +17,6 @@ ! ! See the NEWS file (C-h n) or XEmacs manual (C-h i) for a description of ! the various resources and the syntax for setting them. -! -! Energize users: note that this is not the same app-defaults file that is -! used with the Energize-specific version of XEmacs. ! Colors and backgrounds. @@ -188,9 +185,21 @@ ! Note that the menubar resources do not use the `face' syntax, since they ! are X toolkit widgets and thus outside the domain of XEmacs proper. ! +! When X Font Sets are enabled with ./configure --with-xfs (eg, for +! multilingual menubars and XIM), some .font resources (those specific to +! the Lucid widget set) are ignored in favor of .fontSet resources. This +! example shows how to add fonts for Japanese menubars: +! +! *menubar*FontSet: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-*, \ +! -*-*-*-*-*-*-*-120-*-jisx0208.1983-0 +! *menubar*Font: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-* *popup*Font: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-* +! Gui elements share this font +! +Emacs.gui-element.attributeFont: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-iso8859-* + ! Font in the Motif dialog boxes. ! (Motif uses `fontList' while most other things use `font' - if you don't ! know why you probably don't want to.) @@ -260,6 +269,11 @@ : Enter()\n\ : Leave()\n +! Native Widget translations +! ======================= +Emacs*Text*translations: #override\n\ + : widget-focus-in() select-start()\n + ! XIM input method style ! ======================= diff -r 72a7cfa4a488 -r abe6d1db359e etc/NEWS --- a/etc/NEWS Mon Aug 13 11:33:40 2007 +0200 +++ b/etc/NEWS Mon Aug 13 11:35:02 2007 +0200 @@ -47,6 +47,28 @@ Delete key to delete backwards, despite the presence (according to Xlib) of a BackSpace key on the keyboard. +** Shifted motion keys now select text by default. You can turn this +off by setting `shifted-motion-keys-select-region' to nil. + +** You can now set the variable `kill-whole-line' to `always', which +makes `kill-line' (C-k) delete the entire line always, not just when +the cursor is at the beginning of the line. This behavior, as well as +the existing kill-whole-line behavior, now only take effect when +kill-line is called interactively, although this is a departure from a +previous behavior in the case of setting this variable kill-whole-line +to t. It is almost certainly what has always been intended, and most +likely the old way of doing things introduced bugs. + +The new function `historical-kill-line' ignores the `kill-whole-line' +setting and always gives the historical behavior of only killing to +the end of the line. This function is bound to Sh-C-k, so that the +kill to end of line behavior is available, even when `kill-whole-line' +has been customized. + +** XEmacs menus now have accelerators by default. If a menu item does +not have an accelerator specified, one is created dynamically, using +numbers 1-9 and letters. + ** Interactive searching and matching case improvements. Case sensitiveness in searching operations is normally controlled by @@ -68,13 +90,20 @@ ** You can now use the buffer tabs to switch between buffers. The tabs are located between the toolbar and the uppermost window, in a location called "gutter". If you dislike the buffer tabs, you can -disable them by specifying: +disable them by customizing `gutter-buffers-tab-visible-p', or by +placing this in your .emacs: - (set-specifier default-gutter-visible-p nil) + (set-gutter-element-visible-p default-gutter-visible-p 'buffers-tab nil) -in your `.emacs'. You can change the location of the gutter with +You can change the location of the gutter with `set-default-gutter-position', however currently only MS-Windows -supports tab widgets with orientations other than vertical.. +supports tab widgets with orientations other than vertical. + +** Kill and yank now interact with the clipboard by default under +Windows. This was done by changing the default value of +`interprogram-cut-function' and `interprogram-paste-function'. You +can get the old behavior by setting these to nil, and there is an +option on the options menu to do this. ** When you press RET at a minibuffer prompt that provides a default value, the value is stored in history instead of an empty line. Also, @@ -91,6 +120,13 @@ unwanted spaces, and an optional prefix now allows them to behave the old way. +Also, the behavior of `string-rectangle' is now compliant with +`pending-delete-mode': if this mode is active, then the string +replaces the region rectangle. Otherwise, the command does not delete +or overwrite any existing text. For those who want that feature but do +not use pending-delete-mode, a new function, `replace-rectangle', is +available. + As a side effect, the FORCE argument to `move-to-column' now understands the special value `coerce', which means that the line should not be filled if it is too short to reach the desired column. @@ -151,8 +187,8 @@ per X. The only thing selection doesn't do is set the clipboard automatically -as this would break the MS-Windows model. If you want this behaviour -then set `selection-sets-clipboard' to t +as this would break the MS-Windows model. If you want this behavior +then set `selection-sets-clipboard' to t. ** Mail spool locking now works correctly. XEmacs has always come with a little auxiliary program, movemail, @@ -169,22 +205,65 @@ binary kit, set the `mail-lock-method' variable at startup, or the EMACSLOCKMETHOD environment variable. +** Init file will move to ~/.xemacs/init.el. + +If `~/.xemacs/init.el' exists, XEmacs will prefer it over `~/.emacs' +as an init file. The file may be byte-compiled as +`~/.xemacs/init.elc'. + +Future versions of XEmacs will stop supporting `~/.emacs' as an init +file. XEmacs offers automatic migration upon startup. + +** Custom file will move to ~/.xemacs/custom.el. + +Whereas customize settings were formerly stored in the regular init +file, XEmacs now prefers them to be in a separate file +`~/.xemacs/custom.el', completely under automatic control. This +change goes with the migration of the init file, and XEmacs offers +automatic migration upon startup. + +** Init file may be called .emacs.el. + +For the time being, like in GNU Emacs 20.4 and on, you can now name +the XEmacs init file `.emacs.el'. Formerly the name had to be +`.emacs'. If you use the name `.emacs.el', you can byte-compile the +file in the usual way. + +If both `.emacs' and `.emacs.el' exist, the latter file is the one +that is used. + ** New command-line switches -user-init-file and -user-init-directory. These can be used to specify alternate locations for what is normally ~/.emacs and ~/.xemacs. Moreover, -user (which used to only work in unpredictable ways) -is now equivalent to --user-init-file ~/.emacs -user-init-directory ~/.xemacs. +is now equivalent to -user-init-file ~/.xemacs/init.el +-user-init-directory ~/.xemacs. or -user-init-file +~/.emacs -user-init-directory ~/.xemacs, whichever init +file comes first. ** New variable `mswindows-meta-activates-menu'. -If you set this variable to nil then pressing the Alt key under -MS-Windows will no longer activate the menubar. The default is t. +If you set this variable to nil then pressing and releasing the Alt +key under MS-Windows will no longer activate the menubar. The default +is t. This is not to be confused with `menu-accelerator-enabled', +which enables the use of Alt+ accelerators to invoke the +menus. + +** Pixel-based scrolling has been implemented. +By default this will attempt to scroll in increments equal to the +height of the default face. Set `window-pixel-scroll-increment' to +modify this behavior. -** Pixel-based scrolling has been implemented. -By default this will attempt to scroll in increments equal to the -height of the default face. Set `window-pixel-scroll-increment' to -modify this behaviour. +** Operation progress can be displayed using graphical widgets. +See `lprogress-display' for details. This support has been switched +on by default for font-lock and some web browsing functions. If you +do not like this behavior set `progress-feedback-use-echo-area'. + +** The PostgreSQL Relational Database Management System is now supported. +It is now possible to build XEmacs so that the programming interface +to the PostgreSQL RDBMS (libpq) is available in XEmacs Lisp. +Supported versions of PostgreSQL are 6.5.3 (earlier versions may work, +but have not been tested) and 7.0-beta1. ** Etags changes. @@ -241,15 +320,7 @@ between `temacs' and `xemacs'. This is all very experimental, though. Configure with `--pdump' to -try testing it. NOTE: it is expected that `make' will fail after -dumping `xemacs.dmp'. This is because Makefiles have not yet been -modified to not expect `temacs' producing an `xemacs' executable. You -can try it out by simply running `src/temacs'. If it starts without -failure, the portable dumping worked. - -#### NOTE: the portable dumper is not really usable yet, because the -state of built-in variables is not yet saved. Olivier promised to fix -it. Nag, nag. +try testing it. ** Much effort has been invested to make XEmacs Lisp faster: @@ -295,8 +366,8 @@ buffer. As a side effect subwindow support now works once again. All of this is still fairly experimental and there is no -documentation. The current APIs might change in a future version of -XEmacs. Some widgets are only available under MS-Windows. See the +documentation. The current APIs might change in a future version of +XEmacs. Some widgets are only available under MS-Windows. See the file glyphs-test.el in the XEmacs src distribution for examples of usage. @@ -309,7 +380,7 @@ for most packages (and some core Lisp files) to use correctly. Also, the `init-file-user' variable has been obsoleted in the process. -The user-visible options like `-u' have not changed their behaviour. +The user-visible options like `-u' have not changed their behavior. ** XEmacs finally has an automated test suite! Although this is not yet very sophisticated, it is already responsible @@ -438,11 +509,26 @@ (keywordp (intern ":foo")) ; The same as (keywordp :foo) => t -This behaviour is compatible with other code which treats symbols +This behavior is compatible with other code which treats symbols beginning with colon as keywords only if they are interned in the global obarray. `keywordp' used to wrongly return t in both cases above. +** New variables `this-command-properties' and +`last-command-properties' are now available for communication between +consecutive commands. Commands should use these to communicate with +the pre/post-command hooks, subsequent commands, wrapping commands, +etc. in preference to looking at and/or setting `this-command'. + +** New functions `add-one-shot-hook' and `add-local-one-shot-hook' make +it possible to add a "one-shot" hook, which is to say a hook that runs +only once, and automatically removes itself after the first time it +has run. + +** The descriptor that specifies the text of a menu item can now be an +evaluated expression. This makes this descriptor parallel with +others, which can also be expressions. + * Changes in XEmacs 21.0 ======================== diff -r 72a7cfa4a488 -r abe6d1db359e etc/OONEWS --- a/etc/OONEWS Mon Aug 13 11:33:40 2007 +0200 +++ b/etc/OONEWS Mon Aug 13 11:35:02 2007 +0200 @@ -801,7 +801,7 @@ customizable Common Lisp like one (implemented entirely in Emacs Lisp). During reading of Emacs Lisp source files, it is about 40% slower than the built-in reader, but there is no difference in -loading byte compiled files - they dont contain any syntactic sugar +loading byte compiled files - they don't contain any syntactic sugar and are loaded with the built in subroutine `load'. ** ediff - Compare and merge files with graphical difference display @@ -4568,7 +4568,7 @@ `get', `put', and `remprop' have been generalized to allow you to set and retrieve properties on many different kinds of objects: symbols, strings, faces, glyphs, and extents (for extents, however, this is not -yet implemented). They are joined by a new function `object-props' +yet implemented). They are joined by a new function `object-plist' that returns all of the properties that have been set on an object. New functions `plists-eq' and `plists-equal' are provided for diff -r 72a7cfa4a488 -r abe6d1db359e etc/TUTORIAL.fr --- a/etc/TUTORIAL.fr Mon Aug 13 11:33:40 2007 +0200 +++ b/etc/TUTORIAL.fr Mon Aug 13 11:35:02 2007 +0200 @@ -1,9 +1,9 @@ -Copyright (c) 1997, Didier Verna . +Copyright (c) 1997-2000, Didier Verna . Se reporter à la fin du document pour les conditions. Vous lisez actuellement la version française du tutoriel d'Emacs. -Cette version a été produite à partir de la version anglaise, qui est +Cette version a été produite à partir de la version anglaise, qui est Copyright (c) 1985, 1996 Free Software Foundation, Inc. @@ -29,7 +29,7 @@ NOTE IMPORTANTE: pour quitter Emacs, tapez C-x C-c (deux caractères). -Quand vous trouvez les caractères >> au début d'une ligne, cette ligne +Quand vous trouvez les caractères >> au début d'une ligne, cette ligne vous donne des directives pour essayer une commande. Par exemple: <> >> Maintenant, tapez C-v («view next screen») pour passer à l'écran @@ -37,7 +37,7 @@ enfoncée et tapez 'v'). À partir de maintenant, refaites la même chose quand vous avez fini de lire tout l'écran. -Remarquez que quand vous changez d'écran, les deux dernières lignes de +Remarquez que quand vous changez d'écran, les deux dernières lignes de l'écran précédent sont conservées, ceci afin de conserver un minimum de continuité dans la lecture. @@ -70,7 +70,7 @@ * MOUVEMENTS DE BASE DU CURSEUR ------------------------------- -Passer d'un écran à l'autre, c'est bien ... mais comment faire pour se +Passer d'un écran à l'autre, c'est bien ... mais comment faire pour se déplacer dans le texte d'un seul écran? Il existe plusieurs manières de faire. La plus simple est d'utiliser @@ -98,8 +98,8 @@ >> Amenez le curseur sur cette ligne avec quelques C-n. ->> Déplacez vous sur la ligne avec des C-f, puis vers le haut avec des - C-p. Remarquez ce que fait C-p quand le curseur est au milieu de la +>> Déplacez vous sur la ligne avec des C-f, puis vers le haut avec des + C-p. Remarquez ce que fait C-p quand le curseur est au milieu de la ligne. Chaque ligne de texte se termine avec un caractère nommé Newline, qui @@ -125,7 +125,7 @@ se passe. Si vous trouvez que le déplacement caractère par caractère est trop -lent, vous pouvez vous déplacer mot par mot. M-f et M-b vous déplacent +lent, vous pouvez vous déplacer mot par mot. M-f et M-b vous déplacent respectivement d'un mot en avant et en arrière. >> Tapez quelques M-f et M-b. @@ -143,7 +143,7 @@ commandes Control agissent sur des unités plus primaires (caractères, lignes etc.). -Ce parallèle existe encore entre les lignes et les phrases: C-a et C-e +Ce parallèle existe encore entre les lignes et les phrases: C-a et C-e vous positionnent au début ou à la fin d'une ligne, tandis que M-a et M-e vous déplacent au début ou à la fin d'une phrase. @@ -157,7 +157,7 @@ «point». En d'autres termes, le curseur à l'écran se trouve où le point est dans le texte. -Voici un résumé des commandes simples de déplacement, y compris celles +Voici un résumé des commandes simples de déplacement, y compris celles relatives aux mots et aux phrases: C-f En avant d'un caractère @@ -203,21 +203,21 @@ déplacement plus complexes. La plupart des commandes d'Emacs acceptent un argument numérique, qui -sert souvent comme compteur de répétition. Pour donner un tel argument +sert souvent comme compteur de répétition. Pour donner un tel argument à une fonction, tapez C-u puis les chiffres, et enfin entrez la commande. Si vous disposez de la touche (ou ou ), vous pouvez aussi tapez directement les chiffres tout en maintenant la -touche enfoncée. Il est préférable d'apprendre la méthode C-u car +touche enfoncée. Il est préférable d'apprendre la méthode C-u car elle fonctionne sur tous les terminaux. Par exemple, C-u 8 C-f vous déplace de huit caractères en avant. - + >> Essayez d'utiliser C-n avec un argument numérique pour vous déplacer d'un seul coup sur une autre ligne. Certaines commandes n'interprètent pas leur argument numérique comme -un compteur de répétition. C'est le cas de C-v et M-v qui déplacent le -texte d'autant de lignes plutôt que d'écrans entiers. Par exemple, C-u +un compteur de répétition. C'est le cas de C-v et M-v qui déplacent le +texte d'autant de lignes plutôt que d'écrans entiers. Par exemple, C-u 4 C-v déroulera l'écran de 4 lignes. >> Essayez C-u 8 C-v. @@ -253,14 +253,14 @@ , celles-ci vous déplaceront d'écran en écran comme C-v et M-v. Toutes ces commandes acceptent des arguments numériques comme décrit -précédemment. +précédemment. * QUAND EMACS EST BLOQUÉ ------------------------ Si jamais Emacs ne répond plus à vos ordres, vous pouvez l'arrêter en -toute sécurité en tapant C-g. C-g peut aussi être utilisé pour stopper +toute sécurité en tapant C-g. C-g peut aussi être utilisé pour stopper une commande qui met trop de temps à s'exécuter. C-g sert également à annuler un argument numérique, ou une commande @@ -271,7 +271,7 @@ Maintenant, tapez C-f. Le curseur doit finalement ne bouger que d'un seul caractère, puisque vous avez annulé l'argument. -Si vous avez tapé un par erreur, vous pourrez toujours l'annuler +Si vous avez tapé un par erreur, vous pourrez toujours l'annuler avec C-g. @@ -296,12 +296,12 @@ Emacs peut afficher plusieurs fenêtres, chacune avec un texte différent. Le terme «fenêtre» signifie ici une zone particulière dans -la fenêtre d'Emacs; il ne s'agit pas de fenêtres pouvant se superposer +la fenêtre d'Emacs; il ne s'agit pas de fenêtres pouvant se superposer dans votre système de multifenétrage. Emacs peut aussi ouvrir -plusieurs fenêtres X (appelées «frames» en jargon Emacsien), mais ceci +plusieurs fenêtres X (appelées «frames» en jargon Emacsien), mais ceci est décrit ultérieurement. -Pour l'instant, mieux vaut ne pas trop s'occuper de plusieurs fenêtres +Pour l'instant, mieux vaut ne pas trop s'occuper de plusieurs fenêtres simultanées, sauf peut-être pour savoir les éliminer toutes sauf une. Ceci est effectué par la commande C-x 1 ('un', pas 'L'). Cette commande tue toutes les fenêtres sauf celle dans laquelle vous vous @@ -335,7 +335,7 @@ temps! Plus généralement, efface le caractère situé juste avant le -curseur. +curseur. >> Maintenant, tapez quelques caractères, puis effacez-les avec . Ne vous inquiétez pas pour le contenu de ce tutoriel, ce @@ -364,11 +364,11 @@ >> Tapez pour réinsérer le Newline que vous avez effacé. Rappelez-vous bien que la plupart des commandes acceptent un argument -numérique, y compris l'insertion de caractères: +numérique, y compris l'insertion de caractères: >> Tapez C-u 8 *, vous obtiendrez "********". -Vous connaissez maintenant les commandes de base pour insérer du texte +Vous connaissez maintenant les commandes de base pour insérer du texte et corriger des erreurs. Toujours grâce aux touches et , vous pouvez aussi effacer du texte par mot ou par ligne: @@ -386,7 +386,7 @@ texte pour vous donner la possibilité de le réintroduire. L'opération de réintroduction s'appelle le «yanking». Vous pouvez réintroduire le texte à la même place ou ailleurs. Vous pouvez même le réintroduire -plusieurs fois, pourquoi pas à des endroits différents. La commande de +plusieurs fois, pourquoi pas à des endroits différents. La commande de «yanking» est C-y. Notez bien la différence entre «effacer» et «supprimer». Un texte @@ -396,7 +396,7 @@ >> Placez le curseur au début d'une ligne non vide. Tapez C-k pour supprimer le texte sur cette ligne. ->> Tapez C-k une deuxième fois. Vous remarquerez que cette fois-ci, la +>> Tapez C-k une deuxième fois. Vous remarquerez que cette fois-ci, la ligne elle-même est supprimée (le caractère Newline). C-k traite son argument numérique de manière spéciale: il supprime @@ -455,7 +455,7 @@ Une alternative à C-x u est C-_. C-x u existe car c'est plus facile à taper sur certains claviers. Sur d'autres vous pouvez également -obtenir C-_ en tapant C-/. +obtenir C-_ en tapant C-/. Enfin, la commande d'annulation accepte les argument numériques. @@ -466,18 +466,18 @@ Pour sauver votre texte, vous avez besoin de le mettre dans un fichier, sans quoi il disparaîtra quand vous quitterez Emacs. On dit «trouver» un fichier («finding»), ou encore «visiter» un fichier -(«visiting»), ou bien «ouvrir». +(«visiting»), ou bien «ouvrir». Visiter un fichier revient à voir son contenu dans Emacs. Si vous -modifiez le texte du fichier dans Emacs, ces changements ne deviennent -pas permanent, sauf si vous «sauvez» le fichier. Cela permet de ne pas +modifiez le texte du fichier dans Emacs, ces changements ne deviennent +pas permanent, sauf si vous «sauvez» le fichier. Cela permet de ne pas avoir des fichiers à moitié modifiés sur votre système, à moins que vous ne le souhaitiez vraiment. D'autre part, quand Emacs «sauve» un -fichier, il commence par copier l'ancienne version sous un nouveau nom +fichier, il commence par copier l'ancienne version sous un nouveau nom afin que vous puissiez toujours revenir en arrière. Regardez en bas de la fenêtre d'Emacs. Vous trouverez une ligne -contenant des tirets '-', et la chaîne de caractères +contenant des tirets '-', et la chaîne de caractères «Emacs: TUTORIAL.FRANCAIS». Cela vous donne le nom du fichier que vous êtes en train de visiter. En ce moment, vous visitez le fichier «TUTORIAL.FRANCAIS» qui correspond au Tutoriel d'Emacs, version @@ -501,14 +501,14 @@ manière, on l'appelle «minibuffer». Les commandes d'édition ordinaires peuvent être utilisées pour éditer le nom du fichier. -Pendant que vous êtes en train de taper le nom du fichier, vous pouvez +Pendant que vous êtes en train de taper le nom du fichier, vous pouvez annuler la commande grâce à C-g. >> Tapez C-x C-f puis C-g. Cela annule le minibuffer ainsi que la commande C-x C-f. Vous n'allez finalement pas visiter de fichier. Quand le nom du fichier est correct, tapez . La commande -prendra alors effet et ira chercher le fichier. Après avoir terminé la +prendra alors effet et ira chercher le fichier. Après avoir terminé la saisie du nom, le minibuffer disparaît. Au bout d'un petit moment, le contenu du fichier apparaît et vous @@ -519,7 +519,7 @@ Cette commande copie le texte contenu dans Emacs vers le fichier lui-même. La première fois que vous le faites, Emacs sauvegarde la -version initiale du fichier sous un autre nom, en ajoutant un '~' à la +version initiale du fichier sous un autre nom, en ajoutant un '~' à la fin du nom. Quand la sauvegarde est terminée, Emacs affiche le nom du fichier dans @@ -528,17 +528,17 @@ système (non pas qu'Emacs ne puisse jamais crasher lui-même ...). >> Tapez C-x C-s pour sauver votre copie du tutoriel. - Vous devriez voir apparaître «Wrote ...TUTORIAL.FRANCAIS" tout en bas + Vous devriez voir apparaître «Wrote ...TUTORIAL.FRANCAIS" tout en bas de la fenêtre. NOTE: Sur certains systèmes, C-x C-s bloque l'écran et Emacs ne dit plus rien. Cela signifie qu'une «fonctionnalité» système que l'on -appelle le «flow control» intercepte le C-s et l'empêche de parvenir à +appelle le «flow control» intercepte le C-s et l'empêche de parvenir à Emacs. Pour débloquer la situation, tapez C-q. Reportez-vous dans ce cas à la section «Spontaneous Entry to Incremental Search» du manuel -d'Emacs pour plus d'information sur cette ... «particularité». +d'Emacs pour plus d'information sur cette ... «particularité». -Vous pouvez visiter des fichiers existant, mais aussi des fichiers qui +Vous pouvez visiter des fichiers existant, mais aussi des fichiers qui n'existent pas. C'est en fait comme cela que l'on crée un nouveau fichier dans Emacs. Initialement, le fichier sera inexistant, et la première fois que vous demanderez à Emacs de le sauver, il créera @@ -572,7 +572,7 @@ C-b. Par contre, TOUT texte que vous pouvez voir dans Emacs appartient à un buffer. ->> Tapez C-x 1 pour faire disparaître le buffer contenant la liste des +>> Tapez C-x 1 pour faire disparaître le buffer contenant la liste des buffers. Quand vous éditez un fichier, puis que vous en ouvrez un autre, le @@ -608,7 +608,7 @@ Remarquez qu'il existe des boutons n'ayant aucun équivalent clavier. Par exemple, le menu «Buffers» donne la liste de tous les -buffers par ordre de plus récente utilisation. Vous pouvez passer d'un +buffers par ordre de plus récente utilisation. Vous pouvez passer d'un buffer à l'autre en les sélectionnant par leur nom dans ce menu. @@ -622,12 +622,12 @@ cliquant le bouton de gauche au début de la portion à sélectionner, puis en Shift-cliquant à l'autre bout. -Pour supprimer un morceau de texte, utilisez C-w ou le bouton «Cut» du +Pour supprimer un morceau de texte, utilisez C-w ou le bouton «Cut» du menu «Edit». Notez bien que ces deux commandes ne sont pas -équivalentes: C-w ne fait que supprimer le texte en le sauvegardant de +équivalentes: C-w ne fait que supprimer le texte en le sauvegardant de manière interne (comme C-k), mais «Cut» sauvegarde en plus le texte dans le clipboard de X Window, où il pourra être accédé par d'autres -applications. +applications. Pour récupérer du texte en provenance d'autres applications, utilisez «Paste» du menu «Edit». @@ -664,11 +664,11 @@ Ces commandes, bien que très utiles, sont utilisées moins souvent que celles que vous avez déjà apprises. Vous en connaissez déjà deux: les commandes relatives aux fichiers (C-x C-f et C-x C-s). Un autre -exemple est la commande pour quitter définitivement Emacs, C-x C-c (ne +exemple est la commande pour quitter définitivement Emacs, C-x C-c (ne vous inquiétez pas des éventuels changements qui seraient perdus, C-x C-c vous propose de sauver ces changements avant de tuer Emacs). -C-z est la commande qui vous permet de quitter Emacs «temporairement», +C-z est la commande qui vous permet de quitter Emacs «temporairement», pour que vous puissiez y revenir plus tard. Sur les systèmes le permettant, C-z «suspend» Emacs, ce qui signifie @@ -688,7 +688,7 @@ des circonstances où vous ne vous déloguez pas, mieux vaut suspendre par C-z au lieu de sortir véritablement d'Emacs. -Il existe de nombreuses commandes sous C-x. Voici celles que vous avez +Il existe de nombreuses commandes sous C-x. Voici celles que vous avez apprises jusque là: C-x C-f Visiter un fichier (Find File). @@ -702,7 +702,7 @@ commande «replace-string» substitue globalement une chaîne de caractères par une autre. Si vous tapez M-x, Emacs vous affichera M-x en bas de la fenêtre et vous pourrez alors taper le nom d'une -commande, ici replace-string. Tapez simplement 'repl s ' +commande, ici replace-string. Tapez simplement 'repl s ' et Emacs complétera le nom pour vous. Terminez le nom avec La commande replace-string requiert deux arguments: la chaîne à @@ -710,12 +710,12 @@ chaînes par . >> Déplacez le curseur sur la ligne blanche en dessous de ce - paragraphe, puis tapez - M-x replsRemarquezNotez. + paragraphe, puis tapez + M-x replsRemarquezNotez. Remarquez comme cette ligne a changé: le mot R-e-m-a-r-q-u-e-z a été remplacé par N-o-t-e-z partout où il est apparu après le - curseur. + curseur. * SAUVEGARDE AUTOMATIQUE @@ -749,15 +749,15 @@ La ligne juste au dessus de la zone d'écho s'appelle ligne de mode («modeline»). Elle dit actuellement quelque chose comme ça: ---**-XEmacs: TUTORIAL.FRANCAIS (Fundamental)--L752--67%--------- +--**-XEmacs: TUTORIAL.FRANCAIS (Fundamental)--L752--67%--------- -Cette ligne fournit des renseignements utiles sur le status d'Emacs et +Cette ligne fournit des renseignements utiles sur le status d'Emacs et le texte que vous éditez. Vous connaissez déjà la signification du nom de fichier: c'est celui -que vous êtes en train d'éditer. -xx%- indique le pourcentage de texte +que vous êtes en train d'éditer. -xx%- indique le pourcentage de texte situé au dessus du curseur. Si vous pouvez voir le début du fichier à -l'écran, --Top-- sera indiqué au lieu de --00%--. Si le bas du fichier +l'écran, --Top-- sera indiqué au lieu de --00%--. Si le bas du fichier est visible, il y aura --Bot-- à la place. Si votre texte est tout entier contenu dans la fenêtre, vous verrez --All--. @@ -793,7 +793,7 @@ comme faisant partie des mots. Auparavant, ces caractères étaient considérés comme des séparateurs de mots. En général, les modes majeurs ne changent que très peu le comportement des commandes -habituelles. +habituelles. Pour voir la documentation du mode majeur courant, tapez C-h m. @@ -808,7 +808,7 @@ désactivés indépendamment du mode majeur courant. Vous pouvez en utiliser autant que possible en même temps. -Un mode mineur très utile pour éditer du texte est le mode +Un mode mineur très utile pour éditer du texte est le mode «Auto Fill». Quand ce mode est activé, Emacs coupe lui-même les lignes si vous tapez du texte trop long pour être contenu sur une seule. @@ -828,7 +828,7 @@ Tapez du texte jusqu'à ce que la ligne soit coupée, puis replacez la marge à 70. -Si vous faites des changements au milieu d'un paragraphe, le mode Auto +Si vous faites des changements au milieu d'un paragraphe, le mode Auto Fill ne recoupera pas les lignes tout seul. Pour réajuster les lignes d'un tel paragraphe, tapez M-q avec le curseur n'importe où dans le paragraphe. @@ -847,7 +847,7 @@ La commande de recherche d'Emacs est un peu différente de celle des autres éditeurs de texte dans la mesure où elle est incrémentale: la recherche intervient au fur et à mesure que vous tapez la chaîne à -rechercher. +rechercher. Pour démarrer une recherche, tapez C-s (en avant) ou C-r (en arrière). MAIS PAS TOUT DE SUITE !! Attendez un peu pour tester ... @@ -872,10 +872,10 @@ NOTE: Sur certains systèmes, C-x C-s bloque l'écran et Emacs ne dit plus rien. Cela signifie qu'une «fonctionnalité» système que l'on -appelle le «flow control» intercepte le C-s et l'empêche de parvenir à +appelle le «flow control» intercepte le C-s et l'empêche de parvenir à Emacs. Pour débloquer la situation, tapez C-q. Reportez-vous dans ce cas à la section «Spontaneous Entry to Incremental Search» du manuel -d'Emacs pour plus d'information sur cette ... «particularité». +d'Emacs pour plus d'information sur cette ... «particularité». Si vous êtes au milieu d'une recherche incrémentale et que vous tapez , vous constaterez que le dernier caractère de la chaîne est @@ -923,7 +923,7 @@ C-M-v (ou C-v si vous n'avez pas de touche ) est un exemple de Control-Méta caractère. L'ordre dans lequel les touches - et sont enfoncées n'a pas d'importance. Ce sont juste + et sont enfoncées n'a pas d'importance. Ce sont juste des modificateurs. Par contre, n'est pas un modificateur, donc vous êtes obligés de taper d'abord , et C-v ensuite. @@ -959,7 +959,7 @@ l'utiliser pour sortir du minibuffer ou éliminer des fenêtres superflues. ->> Tapez M-x pour vous rendre dans le minibuffer, puis tapez +>> Tapez M-x pour vous rendre dans le minibuffer, puis tapez pour en sortir. Il n'est pas possible d'utiliser C-g pour sortir d'un niveau récursif @@ -985,7 +985,7 @@ vous ne désirez finalement pas d'aide après avoir tapé C-h, tapez simplement C-g. -(Quelques sites redéfinissent la commande C-h. Cela ne devrait vraiment +(Quelques sites redéfinissent la commande C-h. Cela ne devrait vraiment pas être fait, donc allez vous plaindre à votre administrateur système. Si C-h ne marche pas, tapez M-x help.) @@ -994,7 +994,7 @@ la commande en question. >> Tapez C-h c C-p. - Le message doit ressembler à quelque chose comme + Le message doit ressembler à quelque chose comme C-p runs the command previous-line @@ -1041,11 +1041,11 @@ Ce tutoriel est fait pour être compréhensible par tout nouvel utilisateur. Donc si quelque chose n'est pas clair, n'hésitez pas à -vous plaindre !! +vous plaindre !! Si vous avez plus particulièrement des remarques à faire sur la version française, vous pouvez aussi me contacter directement -(Didier Verna ). +(Didier Verna ). COPIES / DISTRIBUTION @@ -1057,7 +1057,7 @@ Cracraft. * Ben Wing l'a mis à jour pour X Windows. * Martin Buchholz et Hrvoje Niksic y ont apporté des corrections pour - XEmacs. + XEmacs. * J'en (Didier Verna) ai fait une version française un beau jour de 1997. Cette version du tutoriel, tout comme Emacs, est copyrightée, et vous @@ -1082,4 +1082,3 @@ COPYING et à distribuer Emacs à vos amis. Aidez-nous à tuer l'obstructionnisme logiciel en utilisant, écrivant et partageant du logiciel libre! - diff -r 72a7cfa4a488 -r abe6d1db359e etc/TUTORIAL.ja --- a/etc/TUTORIAL.ja Mon Aug 13 11:33:40 2007 +0200 +++ b/etc/TUTORIAL.ja Mon Aug 13 11:35:02 2007 +0200 @@ -1,741 +1,1052 @@ - ============================== - $BF|K\8l(B GNUEMACS(Mule) $BF~LgJT(B - ============================== +Copyright (c) 1985, 1996 Free Software Foundation, Inc. +$B;HMQ>r7o$O%U%!%$%k:G8e$r;2>H$N$3$H(B + $B$"$J$?$,8=:_8+$F$$$k$N$O(B XEmacs $BF~Lg%,%$%I$G$9!#(B -$BCm0U!'(B $B$3$NF~LgJT$O!"!V=,$&$h$j47$l$m!W$r%b%C%H!<$K:n@.$5$l$F$$$^(B - $B$9!#(B">>" $B$+$i;O$^$k9T$O!"$=$N;~2?$r$9$Y$-$+$r;X<($7$F$$$^$9!#(B - +XEmacs $B$N%3%^%s%I$rF~NO$9$k$K$O!"0lHL$K%3%s%H%m!<%k%-!$N$b$N$G$"$C$?$j$7$^$9(B +$B!JNc$($P!"(BSun $B$N%-!<%\!<%I$G$O!"%9%Z!<%9%P!<$N:8$N%@%$%"%b%s%I%-!<$,(B +META $B$G$9!K!#(BMETA $B%-!<$,L5$$>l9g$O!"(BESC $B$rBe$o$j$K;H$&$3$H$,$G$-$^$9!#(B +$B$=$3$G!"(BMETA $B$H$+(B CONTROL $B$H$+$r=q$/Be$o$j$K!" $B%3%s%H%m!<%k%-!<$r2!$7$?$^$^!"(B<$BJ8;z(B>$B%-!<$r2!$7$^$9!#Nc$($P!"(B + C-f $B$O%3%s%H%m!<%k%-!<$r2!$7$J$,$i(B f $B$N%-!<$r2!$9$3$H$G$9!#(B -C-<$BJ8;z(B> $B%3%s%H%m!<%k!&%-!<$r2!$7$?$^$^!"(B<$BJ8;z(B>$B%-!<$r2!$7$^$9!#Nc$($P!"(B - C-f $B$O!"%3%s%H%m!<%k!&%-!<$r2!$7$J$,$i(B f $B$N%-!<$r2!$9$3$H$r(B - $B0UL#$7$^$9!#(B -<> - >> $B$=$l$G$O!"(BC-v$B!J(BView Next Screen; $B $B%a%?%-!<$r2!$7$?$^$^!"(B<$BJ8;z(B>$B%-!<$r2!$7$^$9!#$b$7%a%?%-!<$,$J(B + $B$$>l9g$O!"%(%9%1!<%W%-!<$r2!$7$F$+$iN%$7!"$=$l$+$i(B<$BJ8;z(B>$B%-!<(B + $B$r2!$7$^$9!#0J9_%(%9%1!<%W%-!<$N$3$H$r(B $B$H=q$-$^$9!#(B + +$B!*=EMW!*(B: XEmacs$B$r=*N;$9$k$K$O!"(BC-x C-c $B$r%?%$%W$7$^$9!#(B -ESC <$BJ8;z(B> $B%(%9%1!<%W!&%-!<$r2!$7$F$+$iN%$7!"$=$l$+$i(B<$BJ8;z(B>$B%-!<$r2!$7$^(B - $B$9!#(B +">>" $B$G;O$^$k9T$O!"$=$N;~2?$r$9$Y$-$+$r;X<($7$F$$$^$9!#Nc$($P!"(B +<> +>> $B$G$O(B C-v $B!J$B$O!"BgJ8;z$G$b>.J8;z$G$b%3%^%s%I$H$7$F$OF1$80UL#$K$J$j(B - $B$^$9!#%a%?%-!<$,;H$($k$J$i$P(B ESC <$BJ8;z(B> $B$NBe$o$j$K(B M-<$BJ8;z(B> - ($B%a%?%-!<$r2!$7$?$^$^(B<$BJ8;z(B>$B%-!<$r2!$9(B) $B$,;H$($^$9!#(B +$BA0$N2hLL$Hl9g!"%5%9%Z%s%I$9$k!J0l;~E*$K;_$a$k(B)$B$3$H$,(B - $B=PMh$^$9!#(BEmacs$B$r%5%9%Z%s%I$9$k$K$O!"(BC-z$B$r%?%$%W$7$^$9!#(B +$B$^$:$O!"%U%!%$%k$NCf$r0\F0$7$F9T$/J}K!$rCN$kI,MW$,$"$j$^$9!#(BC-v $B$K$h$C(B +$B$F@h$K?J$`$3$H$O$b$&H=$j$^$7$?!#85$KLa$k$K$O!"(BM-v $B!J%a%?%-!<$r2!$7$J$,(B +$B$i(B v$B!"$b$7$/$O(B $B$r2!$7$FN%$7$F(B v$B!K$G$9!#(B + +>> M-v $B$H(B C-v $B$r;H$C$F!"A08e$K0\F0$9$k$3$H$r2?2s$+;n$7$F2<$5$$!#(B - $B$5$F!"$3$l$+$i$O!"0l2hLLJ,FI$_=*$($?$i!"(BC-v $B$rF~NO$7$F9T$C$F2<$5$$!#(B - - $BA0$N2hLL$H> ESC v $B$H(B C-v $B$r;H$C$F!"A08e$K0\F0$9$k$3$H$r2?2s$+;n$7$F$_$J$5$$!#(B - -$BMWLs(B -==== $B%U%!%$%k$r2hLLKh$K8+$F9T$/$K$O!"$9!#$3$N$H$-!"85%+!<%=%k$N$"$C$?9T$,(B - $B2hLL$NCf1{$K$/$k$h$&$K$9$k(B + C-v $B$9!#$3$N$H$-!"%+!<%=%k$N$"$k9T$,2hLL$NCf1{$K(B + $B$/$k$h$&$K$9$k!#!J(BC-1 $B$8$c$J$/$C$F(B C-L $B$G$9$h!*!K(B - >> $B:#%+!<%=%k$,$I$3$K$"$k$+!"$=$N6a$/$K$I$s$J%F%-%9%H$,=q$+$l$F$$$k(B - $B$+$r3P$($J$5$$!#(BC-l $B$r%?%$%W$7!"%+!<%=%k$,$I$3$K0\F0$7$?$+!"$=$N(B - $B6a$/$N%F%-%9%H$O$I$&$J$C$?$+$rD4$Y$F$_$J$5$$!#(B +>> $B%+!<%=%k$r8+$D$1!"$=$N6a$/$K$I$s$JJ8>O$,=q$+$l$F$$$k$+$r3P$(!"(B + $B$=$l$+$i(B C-l $B$r%?%$%W$7$F2<$5$$!#(B + $B%+!<%=%k$,$I$3$K0\F0$7$?$+!"$=$N6a$/$N%F%-%9%H$O$I$&$J$C$?$+$rD4$Y(B + $B$F$_$^$7$g$&!#(B -$B4pK\E*$J%+!<%=%k$N@)8f(B -====================== + +$B!v4pK\E*$J%+!<%=%k$N@)8f(B +======================== - $B2hLLKh$N0\F0$O$G$-$k$h$&$K$J$j$^$7$?!#:#EY$O!"2hLL$NCf$G!"FCDj$N>l=j$K(B -$B0\F0$9$k$?$a$NJ}K!$r21$($^$7$g$&!#$3$l$K$O$$$/$D$+$N$d$jJ}$,$"$j$^$9!#0l$D(B -$B$NJ}K!$O!"A0(B(previous)$B$l!"(BC-p, C-n, C-f,C-b $B$K3d$jEv$F$i$l$F(B -$B$*$j!"8=:_$N>l=j$+$i?7$7$$>l=j$K%+!<%=%k$r0\F0$5$;$^$9!#?^$G=q$1$P!"(B +$B2hLLKh$N0\F0$O$G$-$k$h$&$K$J$j$^$7$?!#:#EY$O!"2hLL$NCf$G!"FCDj$N>l=j$K(B +$B0\F0$9$k$?$a$NJ}K!$r21$($^$7$g$&!#(B +$B$3$l$K$O$$$/$D$+$N$d$jJ}$,$"$j$^$9!#0lHV4pK\E*$JJ}K!$O(B C-p, C-b, C-f, +C-n $B$r;H$&$3$H$G$9!#$3$l$i$O$=$l$>$l%+!<%=%k$rA0$N9T!"A0$NJ8;z!"$l!"(BPrevious, Next, Backward, Forward $B$NF,J8;z$K$J$C$F(B -$B$$$k$N$G!"21$($d$9$$$G$7$g$&!#$3$l$i$O!"4pK\E*$J%+!<%=%k0\F0%3%^%s%I$G$"$j!"(B -$B$$$D$G$b;H$&$b$N$G$9!#(B - - >> C-n $B$r2?2s$+%?%$%W$7!"!J:#!"$"$J$?$,FI$s$G$$$k!K$3$N9T$^$G%+!<%=(B - $B%k$r0\F0$5$;$J$5$$!#(B - - >> C-f $B$r;H$C$F9T$NCf$[$I$K0\F0$7!"(BC-p $B$G2?9T$+>e$K0\F0$7$F$_$J$5(B - $B$$!#%+!<%=%k$N0LCV$NJQ2=$KCm0U$7$J$5$$!#(B - - >> $B9T$N@hF,$G(B C-b $B$r%?%$%W$7$F$_$J$5$$!#%+!<%=%k$O$I$3$K0\F0$7$^$9$+(B - $B!)$5$i$K$b$&>/$7(B C-b $B$r%?%$%W$7!":#EY$O(B C-f $B$G9TKv$NJ}$KLa$j$J$5(B - $B$$!#%+!<%=%k$,9TKv$r1[$($k$H$I$&$J$j$^$9$+!)(B +>> C-n $B$H(B C-p $B$G%+!<%=%k$r>e?^$N??Cf$N9T$KF0$+$7$F2<$5$$!#$=$l$+$i(B C-l + $B$r%?%$%W$7$F?^$NA4BN$,2hLLCf1{$K$/$k$h$&$K$7$F$_$^$7$g$&!#(B - $B2hLL$N@hF,$dKvHx$r1[$($F%+!<%=%k$r0\F0$5$;$h$&$H$9$k$H!"$=$NJ}8~$K$"$k(B -$B%F%-%9%H$,0\F0$7$FMh$F!"%+!<%=%k$O>o$K2hLLFb$K$"$k$h$&$K$5$l$^$9!#(B +$B$3$l$i$O$N%3%^%s%I$O$=$l$>$l!"(BPrevious, Next, Backward, Forward $B$NF,J8(B +$B;z$K$J$C$F$$$k$N$G!"21$($d$9$$$G$7$g$&!#$3$l$i$O!"4pK\E*$J%+!<%=%k0\F0(B +$B%3%^%s%I$G$"$j!"$$$D$G$b;H$&$b$N$G$9!#:#$3$3$G3P$($F2<$5$$!#(B + +>> C-n $B$r2?2s$+%?%$%W$7!"!J:#!"$"$J$?$,FI$s$G$$$k!K$3$N9T$^$G%+!<%=%k(B + $B$r0\F0$5$;$^$7$g$&!#(B + +>> C-f $B$r;H$C$F9T$NCf$[$I$K0\F0$7!"(BC-p $B$G2?9T$+>e$K0\F0$5$;$^$7$g$&!#(B + $B%+!<%=%k$N0LCV$NJQ2=$KCm0U$7$F2<$5$$!#(B + +$B3F9T$N:G8e$K$O!JL\$K$O8+$($J$$!K(B Newline $BJ8;z$,$"$j$^$9!#$3$l$O> $B9T$N@hF,$G(B C-b $B$r%?%$%W$7$F$_$^$7$g$&!#%+!<%=%k$OA0$N9T$NKvHx$K0\F0(B + $B$9$k$O$:$G$9!#$3$l$O(B C-b $B$,A0$N(B Newline $BJ8;z$r1[$($FLa$C$?$+$i$G$9!#(B + +$BF1MM$K(B C-f $B$O%+!<%=%k$r(B Newline $BJ8;z$r1[$($F> $B$5$i$K$b$&>/$7(B C-b $B$r%?%$%W$7$F%+!<%=%k0\F0$N46$8$rGD$s$G2<$5$$!#(B + $B:#EY$O(B C-f $B$G9TKv$^$G?J$s$G2<$5$$!#(B + $B$5$i$K$b$&0lEY(B C-f $B$r%?%$%W$7$FO$,2hLL$NCf$K0\F0$7$FMh$F$^$9!#$3$l$r!V%9%/%m!<%k!W$H8F$S$^$9!#2hLL(B +$B$,%9%/%m!<%k$9$k$3$H$K$h$C$F!"%+!<%=%k$r0\F0$5$;$F$b!"%+!<%=%k$O>o$K2h(B +$BLLFb$K$"$k$h$&$K$5$l$^$9!#(B + +>> C-n $B$r;H$C$F!"%+!<%=%k$r2hLL$N2 f) $B$G0lC18l@h$X!"(BM-b ( b) $B$G0lC18lA0$X0\F0$7$^$9!#(B + +$BCm0U!'(B $BF|K\8l$K$D$$$F$O!"C18l$N@Z$lL\$rG'<1$9$k$3$H$O$G$-$^$;$s$,!"5?(B + $B;wE*$JJ8@a$rC18l$N@Z$lL\$H$7$F$$$^$9!#(B + +>> M-f $B$d(B M-b $B$r2?2s$+;n$7$F$_$^$7$g$&!#(B - >> C-n $B$r;H$C$F!"%+!<%=%k$r2hLL$N2> M-f $B$H(B M-b $B$r(B C-f $B$H(B C-b $B$r8r$($J$,$i?t2s;n$7!"C18l$NCf$KF~$k;~$H!"(B + $BC18l$HC18l$N4V$K$$$k;~$NF0$-$rD4$Y$F2<$5$$!#(B + +C-f $B$H(B C-b $B$KBP$9$k!"(BM-f $B$H(B M-b $B$NN`;w@-$KCmL\$7$^$7$g$&!#B?$/$N>l9g!"(B +$B%a%?%-!<$OJ8=q$r9=@.$9$k%f%K%C%H!JC18l!"J8!"CJMn!K$KBP$9$kA`:n$K;H$$!"(B +$B%3%s%H%m!<%k%-!<$O$=$l$h$j$b$b$C$H4pK\E*$JBP>]!JJ8;z$H$+9TEy!K$KBP$9$k(B +$BA`:n$K;H$$$^$9!#(B + +$B$3$NN`;w@-$O9T$HJ8$N4X78$K$b$"$j$^$9!#(BC-a $B$H(B C-e $B$O$=$l$>$l9TF,$H9TKv(B +$B$K0\F0$7!"(BM-a $B$H(B M-e $B$O$=$l$>$lJ8F,$HJ8Kv$K0\F0$7$^$9!#(B + +>> C-a $B$r#22s!"$=$l$+$i(B C-e $B$r#22s;n$7$^$7$g$&!#(B + M-a $B$r#22s!"$=$l$+$i(B M-e $B$r#22s;n$7$^$7$g$&!#(B + +C-a $B$d(B C-e $B$O7+JV$7$F$b$=$l0J>e0\F0$7$^$;$s$,!"(BM-a $B$r7+$jJV$9$H$I$s$I(B +$B$sA0$NJ8F,$KLa$C$F$$$-$^$9!#$3$NItJ,$G$ON`;w@-$,GK$l$F$$$^$9$,!"$^$"$3(B +$B$l$,<+A3$JF0:n$G$O$J$$$G$7$g$&$+!#(B - $B0lJ8;zC10L$N0\F0$G$O$^$I$m$C$3$7$$$H;W$&$J$i!"C18lC10L$G0\F0$9$k$3$H$b(B -$B$G$-$^$9!#(BESC f $B$G0lC18lJ,@h$K?J$_!"(BESC b $B$G0lC18lJ,A0$KLa$j$^$9!#(B +$BJ8>OCf$G%+!<%=%k$,$"$k0LCV$r!V%]%$%s%H!W$H8F$S$^$9!#8@$$$+$($l$P!"%+!<(B +$B%=%k$O!"J8>O$N$I$3$K%]%$%s%H$,$"$k$+$r2hLL>e$G<($7$F$$$k$N$G$9!#(B + +$B0J2<$KC1=c$J%+!<%=%k0\F0A`:n$K$D$$$FMWLs$7$^$9!#$3$N$J$+$K$O!"C18l$d9T(B +$BC10L$G$N0\F0%3%^%s%I$b4^$^$l$F$$$^$9!#(B + + C-f $B0lJ8;z> $B$3$l$iA4It$r2?EY$+;n$7$FN}=,$7$^$7$g$&!#(B + $B$I$l$bIQHK$K;H$&%3%^%s%I$G$9!#(B + +$B$"$HFs$D!"=EMW$J%+!<%=%k0\F0%3%^%s%I$,$"$j$^$9!#%U%!%$%k$N@hF,$K0\F0$9(B +$B$k(B M-< $B$H!"%U%!%$%k$NKvHx$K0\F0$9$k(B M-> $B$G$9!#(B -$BCm0U!'(B $BF|K\8l$K$D$$$F$O!"C18l$N@Z$lL\$rG'<1$9$k$3$H$O$G$-$^$;$s$,!"(B - $B5?;wE*$JJ8@a$rC18l$N@Z$lL\$H$7$F$$$^$9!#(B +$BBgDq$NCe$K$"$j!"$=$l$r%?%$%W$9(B +$B$k$K$O%7%U%H%-!<$r;H$&I,MW$,$"$j$^$9!#$7$?$,$C$F(B M-< $B$r%?%$%W$9$k$K$O!"(B +$B%a%?%-!<$H%7%U%H%-!<$H%3%s%^%-!<$rF1;~$K2!$5$M$P$J$j$^$;$s!#(B + +>> M-< $B$r;n$7$F!"$3$NF~Lg%,%$%I$N@hF,$K0\F0$7$^$7$g$&!#(B + $B$=$l$+$i!"(BC-v $B$r2?EY$+;H$C$F$3$3$^$G5"$C$F$-$F$/$@$5$$!#(B + +>> M-> $B$r;n$7$F!"$3$NF~Lg%,%$%I$NKvHx$K0\F0$7$^$7$g$&!#(B + $B$=$l$+$i!"(BM-v $B$r2?EY$+;H$C$F$3$3$^$G5"$C$F$-$F$/$@$5$$!#(B + +$B$b$7CeC#$7(B +$B$F$/$l$P!"$3$l$i$N%3%s%H%m!<%kJ8;z$rBG$DJ}$,!"Lp0u%-!<$rBG$D$h$j$:$C$H(B +$BB.$$$3$H$,J,$k$G$7$g$&!Jo$N0LCV$+$iBg$-$/F0$+$5$J$$$G$h$$$N$G!K!#(B +$B:G8e$K!"0lEY$3$l$i$N%3%s%H%m!<%kJ8;z$rBG$D=,47$rIU$1$?$i!"$b$C$H?J$s$@(B +$B%+!<%=%k0\F0%3%^%s%I$b4JC1$K3P$($k$3$H$,$G$-$^$9!#(B - >> ESC f $B$d(B ESC b $B$r2?2s$+%?%$%W$7$F$_$J$5$$!#(BC-f $B$d(B C-b $B$HJ;MQ$7$F(B - $B$_$J$5$$!#(B +XEmacs$B$NBgDq$N%3%^%s%I$K$O?tCM0z?t$rM?$($k$3$H$,$G$-$^$9!#BgDq$N>l9g$3(B +$B$N?tCM$G7+$jJV$72s?t$r;X<($9$k$3$H$K$J$j$^$9!#?tCM0z?t$rM?$($k$K$O!"%3(B +$B%^%s%I$rF~NO$9$kA0$K(B C-u $B$KB3$$$F?t;z2?7e$+%?%$%W$7$^$9!#$b$7%a%?%-!<(B +$B$,;H$($k$J$i!"%a%?%-!<$r2!$7$J$,$i?t;z$r%?%$%W$9$k$3$H$b$G$-$^$9!#$G$b(B +$B$d$O$j(B C-u $B$r3P$($k$3$H$r4+$a$^$9!#$=$l$O$I$s$JC> $BE,Ev$J?tCM0z?t$r(B C-n $B$"$k$$$O(B C-p $B$KM?$(!"0l2s$N%3%^%s%I$G$J$k$Y$/(B + $B$3$N9T$N6a$/$KMh$k$h$&$K$7$F$_$^$7$g$&!#(B + +$BBgDq$N%3%^%s%I$O?tCM0z?t$r7+$jJV$72s?t$H2rl9g!";XDj$5$l$??t$N9T$@$12hLL$r%9%/(B +$B%m!<%k$5$;$k$3$H$K$J$j$^$9!#Nc$($P(B C-u 4 C-v $B$O2hLL$r#49TJ,>e$K%9%/%m!<(B +$B%k$5$;$^$9!#(B + +>> C-u 8 C-v $B$r;n$7$F$_$^$7$g$&!#(B + +$B2hLL$,>e$K#89T%9%/%m!<%k$7$?$O$:$G$9!#$^$?2hLL$r2<$K%9%/%m!<%k$5$;$k$K$O(B +M-v $B$K0z?t$rM?$($l$P$h$$$N$G$9!#(B + +$B$b$7(B X $B%&%#%s%I%&$r;H$C$F$$$k$N$J$i!"%9%/%m!<%k%P!<$H8F$P$l$k=DD9$N;M(B +$B3Q$$%(%j%"$,(B XEmacs $B$N%&%#%s%I%&$N1&C<$K$"$k$O$:$G$9!#$=$3$r%^%&%9$GA`(B +$B:n$7$F2hLL$r%9%/%m!<%k$5$;$k$3$H$b$G$-$^$9!#(B - C-f $B$d(B C-b $B$KBP$9$k!"(BESC f $B$d(B ESC b $B$NN`;w@-$KCmL\$7$^$7$g$&!#B?$/$N(B -$B>l9g!"(BESC <$BJ8;z(B>$B$OJ8=q4X78$N=hM}$K;H$o$l!"0lJ}(BC-<$BJ8;z(B>$B$O$=$l$h$j$b$b$C$H4p(B -$BK\E*$JBP>]!JJ8;z$H$+9T$H$+!K$KBP$9$kA`:n$K;H$o$l$^$9!#(B +>> $B%9%/%m!<%k%P!<$NCf$G%^%&%9$N??Cf$N%\%?%s$r2!$7$F$_$^$7$g$&!#%\%?%s(B + $B$r2!$7$?0LCV$G7h$^$kJ8>O$N0LCV$^$G2hLL$,%9%/%m!<%k$7$^$9!#(B + +>> $B%9%/%m!<%k%P!<$N0lHV>e$+$i#39TL\$[$I$N$H$3$m$K%^%&%9$r0\F0$7$F!":8(B + $B$N%\%?%s$r2?EY$+2!$7$F$_$^$7$g$&!#(B + +* X $BC$l9T$N:G=i$H:G8e$K0\F0$7!"(BC_home $B$H(B +C-end $B$O%U%!%$%k$N:G=i$H:G8e$K0\F0$7$^$9!#%-!<%\!<%I$K(B PgUp $B$H(B PgDn $B%-!<(B +$B$,$"$l$P!"(BM-v $B$H(B C-v $B$N$h$&$K!"0lEY$K0l2hLLKh!">e2<$K0\F0$9$k$?$a$K;H(B +$B$&$3$H$,$G$-$^$9!#(B - C-a $B$H(B C-e $B$bCN$C$F$$$FJXMx$J%3%^%s%I$G$9!#(BC-a $B$O%+!<%=%k$r9T$N@hF,$K(B -$B0\F0$5$;!"(BC-e $B$O9T$NKvHx$K0\F0$5$;$^$9!#(B +$B$3$l$iA4$F$N%3%^%s%I$O>e$G@bL@$5$l$F$$$k$h$&$K?tCM0z?t$ro$K4JC1$G$9!#(B + + +$B!v(B XEmacs $B$,%O%s%0$7$?;~!JF0$+$J$/$J$C$?;~!K(B +========================================== + +$B$b$7(B XEmacs $B$,%3%^%s%I$KH?1~$7$J$/$J$C$?$i!"(BC-g $B$r%?%$%W$9$k$3$H$G(B +XEmacs $B$r0BA4$K;_$a$k$3$H$,$G$-$^$9!#(BC-g $B$G$H$F$b;~4V$N$+$+$k%3%^%s%I(B +$B$r;_$a$k$3$H$,$G$-$^$9!#(B + +C-g $B$O$^$?!"?tCM0z?t$re$N%-!> C-u 100 $B$H%?%$%W$7$F0z?t#1#0#0$r@_Dj$7$F$+$i(B C-g $B$rBG$C$F$_$^$7$g$&!#(B + $B$=$l$+$i(B C-f $B$rBG$C$F2<$5$$!#0lJ8;z$7$+?J$^$J$$$O$:$G$9!#$J$<$J$i!"(B + C-g $B$G?tCM0z?t$,%-%c%s%;%k$5$l$?$+$i$G$9!#(B + +$B4V0c$C$F(B $B$r%?%$%W$7$F$7$^$C$?;~$b!"(BC-g $B$G$=$l$rC$;$^$9!#(B - >> C-a $B$r#22s!"$=$l$+$i(B C-e $B$r#22sF~NO$7$F$_$J$5$$!#$3$l$i$N%3%^%s%I(B - $B$r#22s0J>e7+JV$7$F$b!"%+!<%=%k$O$=$l0J>e0\F0$7$J$$$3$H$KCm0U!#(B +$B!v;HMQIT2D(B (disabled) $B%3%^%s%I(B +================================== - $B$"$HFs$D!"4JC1$J%+!<%=%k0\F0%3%^%s%I$,$"$j$^$9!#%U%!%$%k$N@hF,$K0\F0$9(B -$B$k(B ESC < $B$H!"%U%!%$%k$NKvHx$K0\F0$9$k(B ESC > $B$G$9!#(B +$B$$$/$D$+$N%3%^%s%I$O=i?4e$G<($7$F$$$k$N$G$9!#(B +$B$b$72?$l$+$N;HMQIT2D%3%^%s%I$r%?%$%W$7$?$i!"$=$l$O$I$&$$$&%3%^%s%I$+$,(B +$BI=<($5$l!"K\Ev$K$=$l$r> `C-x n p' : $B$H%?%$%W$7$F$_$^$7$g$&!J$3$l$O;HMQIT2D%3%^%s%I$G$9!K!#(B + $B$=$l$+$i(B n $B$H%?%$%W$7$^$7$g$&!#(B - ESC f $B0lC18l@h$K?J$`(B - ESC b $B0lC18l8e$KLa$k(B + +$B!v%&%#%s%I%&(B +============ - C-n $B$l8DJL$NJ8>O$rI=<($9$k$3$H$,$G$-(B +$B$^$9!#(BXEmacs $B$G;H$o$l$F$$$k!V%&%#%s%I%&!W$O%&%#%s%I%&%7%9%F%`$G$N=E$J$C(B +$B$F$$$kJL$N%&%#%s%I%&$K8@5Z$7$F$$$k$N$G$O$J$/!"C10l$N(B X $B%&%#%s%I%&2<$G(B +$B$NJL$NAk$N$3$H$r8@$C$F$$$k$3$H$KCm0U$7$F$/$@$5$$!#!J(BXEmacs $B$OJ#?t$N(B X +$B$N%&%#%s%I%&!"(BXEmacs $B$NMQ8l$G$O!V%U%l!<%`!W$r;}$D$3$H$b$G$-$^$9!#$3$l(B +$B$O8e$[$I@bL@$7$^$9!#!K(B - C-a $B9T$N:G=i$K0\F0(B - C-e $B9T$N:G8e$K0\F0(B - - ESC < $B%U%!%$%k$N:G=i$K0\F0(B - ESC > $B%U%!%$%k$N:G8e$K0\F0(B +$B$3$3$G$O!"J#?t$N%&%#%s%I%&$r;H$&5;=Q$K$O?($i$J$$$[$&$,8-L@$G$7$g$&!#$G(B +$B$b!"%X%k%W$dFCDj$N%3%^%s%I$N=PNO$G8=$l$k$+$b$7$l$J$$M>J,$J%&%#%s%I%&$r(B +$B>C$7$F!"$I$&$d$C$F85$N0l$D$N%&%#%s%I%&$N>uBV$KLa$k$+$r@bL@$9$k$3$H$OI,(B +$BMW$G$7$g$&!#$=$l$O4JC1$G$9!#(B - >> $B3F!9$N%3%^%s%I$r;n$7$F$_$J$5$$!#$3$l$i$N%3%^%s%I$O!":G$b$7$P$7$P(B - $B;H$o$l$k$b$N$G$9!#:G8e$NFs$D$G$O!"$3$N>l=j$H$ON%$l$?$H$3$m$K0\F0(B - $B$9$k$N$G!"(B C-v $B$d(B ESC v $B$r;H$C$F$3$3$KLa$C$FMh$k$h$&$K$7$J$5$$!#(B + C-x 1 $B%&%#%s%I%&$r#1$D$K$9$k!J$D$^$jB>$N%&%#%s%I%&$rA4It>C$9!K(B - Emacs$B$NB>$N%3%^%s%I$HF1MM$K!"$3$l$i$N%3%^%s%I$K$O!"7+$jJV$7$N2s?t$r;X(B -$BDj$9$k0z?t(B $B$rM?$($k$3$H$,$G$-$^$9!#$=$N$?$a$K$O!"%3%^%s%I$rF~NO$9$kA0$K!"(B -C-u$B$KB3$$$F7+$jJV$92s?t$rF~NO$7$^$9!#(B +$B$D$^$j(B C-x $B$rBG$C$F$+$i$5$i$K(B 1 $B$rBG$D$N$G$9!#$3$N%3%^%s%I$O%+!<%=%k$N(B +$B$"$k%&%#%s%I%&$r2hLLA4BN$K9-$2$^$9!#B>$N%&%#%s%I%&$OA4It>C$($^$9!#(B + +>> $B%+!<%=%k$r$3$N9T$K;}$C$F$-$F!"(BC-u 0 C-l $B$H%?%$%W$7$F$_$F2<$5$$!#(B - $BNc$($P!"(BC-u 8 C-f $B$H$9$k$H!"#8J8;zJ,@h$K0\F0$7$^$9!#(B - - >> C-n $B$"$k$$$O(B C-p $B$KE,Ev$J0z?t$r;XDj$7$F!"0l2s$N0\F0$G$J$k$Y$/$3(B - $B$N9T$N6a$/$KMh$k$h$&$K$7$F$_$J$5$$!#(B +$B!J(BC-l $B$,2hLL$r:FIA2h$9$k$3$H$r;W$$=P$7$F$/$@$5$$!#$=$l$K?tCM0z?t$rM?$((B +$B$k$H!"!V2hLL$r:FIA2h$7$F8=:_$N9T$r2hLL$N:G>eIt$+$i$=$N?t$@$1N%$l$?$H$3(B +$B$m$K0\F0$7$J$5$$!W$H$$$&0UL#$K$J$j$^$9!#$G$9$+$i!"(BC-u 0 C-l $B$O!V2hLL$r(B +$B:FIA2h$7$F!"8=:_$N9T$r:G>eIt$K$9$k!W$H$$$&0UL#$K$J$j$^$9!#!K(B - C-v $B$d(B ESC v $B$K$D$$$F$O>/$70c$$$^$9!#$3$N>l9g!";XDj$5$l$??t$N9T$@$12h(B -$BLL$r0\F0$9$k$3$H$K$J$j$^$9!#(B +>> $BB3$$$F(B Control-x 2 $B$H%?%$%W$7$F2<$5$$!#(B + $B?7$7$$%&%#%s%I%&$,$3$N%P%C%U%!$NFbMF$rI=<($9$k$?$a$K8=$l$k$H$H$b$K!"(B + $B$3$N%&%#%s%I%&$,$I$N$h$&$K=L$`$+$r8+$F2<$5$$!#(B - >> C-u 3 C-v $B$HF~NO$7$F$_$J$5$$!#(B +>> C-x 1 $B$H%?%$%W$7$F!"?7$7$$%&%#%s%I%&$,>C$($k$N$r8+$F2<$5$$!#(B - $B85$KLa$k$K$O!"(BC-u 3 ESC v $B$r;H$($P$h$$$N$G$9!#(B -$BCf;_%3%^%s%I(B +$B!vA^F~$H:o=|(B ============ - C-g $B$H$$$&%3%^%s%I$G!"F~NO$rI,MW$H$9$k$h$&$J%3%^%s%I$rCf;_$9$k$3$H$,(B -$B$G$-$^$9!#Nc$($P!"0z?t$rF~NO$7$F$$$kESCf$d!"#2$D0J>e$N%-!$B!J2~9T%-!A0$KF~NO$7$?J8;z$r:o=|$9$k$K$O!"(B $B$r%?%$%W$7$^$9!#(B $B$O!"(B +$B%-!<%\!<%I>e$K!V(BDel$B!W$H=q$$$F$"$k%-!<$G$9!#;~$K$O(B $B%-!<$b(B + $B$H$7$FF0:n$7$^$9$,!"$$$D$b$G$O$"$j$^$;$s!#(B + +$B$h$j0lHLE*$K$O!"(B $B$O8=:_%+!<%=%k$N$"$k0LCV$ND>A0$NJ8;z$r:o=|$7(B +$B$^$9!#(B + +>> $BJ8;z$r$$$/$D$+%?%$%W$7!"$=$l$+$i$=$l$i$r(B $B$r;H$C$F:o=|$7(B + $B$F2<$5$$!#$3$N%U%!%$%k$rJQ99$9$k$3$H$r5$$K$9$kI,MW$O$"$j$^$;$s!#%*(B + $B%j%8%J%k$NF~Lg%,%$%I%U%!%$%k$OJQ99$5$l$^$;$s$+$i!#:#8+$F$$$k%U%!%$(B + $B%k$O$"$J$?$N$?$a$N%3%T!<$G$9!#(B - >> C-u 100 $B$r%?%$%W$7$F0z?t$r#1#0#0$K@_Dj$7!"(BC-g $B$r%?%$%W$7$J$5$$!#(B - $B$=$N$"$H$G(B C-f $B$r%?%$%W$7$F$_$J$5$$!#2?J8;z0\F0$7$^$7$?$+!)$b$7(B - $B4V0c$C$F(B ESC $B$rF~NO$7$F$7$^$C$?;~$b!"(BC-g $B$rF~NO$9$l$PC$;$^(B - $B$9!#(B +$BJ8>O$N0l9T$,2hLL$K<}$^$i$J$$DxD9$/$J$C$?>l9g!"$=$N9T$O2hLL>e$N> $B2hLL$N1&C<$^$GJ8>O$rF~NO$7!"$5$i$KF~NO$rB3$1$F2<$5$$!#(B + $B7QB39T$,$G$-$k$N$,J,$k$G$7$g$&!#(B + +>> $B$r;H$C$F2hLL$K<}$^$k$H$3$m$^$G8=:_$N9T$rC;$/$7$F$_$F$/$@$5(B + $B$$!#7QB39T$O>C$($^$9!#(B + +$B2~9TJ8;z$bB>$NJ8;z$HF1$8$h$&$K:o=|$G$-$^$9!##2$D$N9T$N4V$N2~9TJ8;z$r>C(B +$B$9$H$=$l$i$N9T$,9g$o$5$j#1$D$N9T$K$J$j$^$9!#$b$7$=$N9g$o$5$C$?9T$,2hLL(B +$B$NI}$h$j$bD9$$>l9g$O!"7QB39T$H$J$C$FI=<($5$l$^$9!#(B + +>> $B%+!<%=%k$r9T$N@hF,$K0\F0$7!"(B $B$r%?%$%W$7$F2<$5$$!#8=:_$N9T$,(B + $B$=$NA0$N9T$H$D$J$,$j$^$9!#(B -$B%(%i!<(B -====== +>> $B$r%?%$%W$7$F!":#:o=|$7$?2~9TJ8;z$r$^$?A^F~$7$F2<$5$$!#(B + +XEmacs $B$N$[$H$s$I$N%3%^%s%I$O!"7+$jJV$7$N2s?t;XDj$G$-$k$3$H$r;W$$=P$7(B +$B$F2<$5$$!#$3$l$O!"J8;z$NA^F~$K$D$$$F$bEv$F$O$^$j$^$9!#(B + +>> C-u 8 * $B$H%?%$%W$9$k$H(B ******** $B$,A^F~$5$l$^$9!#;n$7$F$_$^$7$g$&!#(B + +$B$3$l$G!"(BXEmacs $B$G%F%-%9%H$rF~NO$7!"$^$?4V0c$$$r=$@5$9$k$b$C$H$b4pK\E*(B +$B$JJ}K!$r3X$s$@$3$H$K$J$j$^$9!#J8;z$HF1$8MM$K!"C18l$d9T$b:o=|$9$k$3$H$,(B +$B$G$-$^$9!#:o=|A`:n$K$D$$$FMWLs$9$k$H $B%+!<%=%k$ND>A0$NJ8;z$r:o=|!J(Bdelete$B!K(B + C-d $B%+!<%=%k$N$"$kJ8;z$r:o=|!J(Bdelete$B!K(B + + M- $B%+!<%=%k$ND>A0$NC18l$r>C5n!J(Bkill$B!K(B + M-d $B%+!<%=%k0LCV0J9_$K$"$kC18l$r>C5n!J(Bkill$B!K(B - $B;~$K$O!"(BEmacs$B$G5v$5$l$F$$$J$$A`:n$r$7$F$7$^$&$3$H$,$"$j$^$9!#Nc$($P!"(B -$B%3%^%s%I$NDj5A$5$l$F$$$J$$%3%s%H%m!<%k!&%-!<$rF~NO$7$F$7$^$C$?;~$K$O!"(BEmacs -$B$O%Y%k$rLD$i$7!"$5$i$K!"2hLL$N0lHV2<$K!"2?$,0-$+$C$?$+$rI=<($7$^$9!#(B + C-k $B%+!<%=%k0LCV$+$i9TKv$^$G$r>C5n!J(Bkill$B!K(B + M-k $B%+!<%=%k0LCV$+$iJ8Kv$^$G$r>C5n!J(Bkill$B!K(B + + $B$H(B C-d $B$KBP$9$k(B M- $B$H(B M-d $B$O!"(BC-f $B$H(B M-f $B$G;O$^$C$?N`(B +$B;w@-$r$^$?3HD%$7$^$9!#$3$3$G(B $B$O%3%s%H%m!<%kJ8;z$G$O$"$j$^$;$s(B +$B$,!"$^$"!"$=$l$O5$$K$7$J$$$G2<$5$$!#(BC-k $B$H(B M-k $B$N4X78$O(B C-e $B$H(B M-e $B$N(B +$B4X78!J9T$HJ8$NBPHf!K$HF1$8$G$9!#(B - Emacs$B$N%P!<%8%g%s$K$h$C$F$O!"$3$NF~LgJT$K=q$+$l$F$$$k$3$H$rl9g$,$"$jF@$^$9!#$=$NMM$J>l9g$K$O!"%(%i!<%a%C%;!<%8$,I=<($5$l$^$9$+$i!"(B -$B2?$+%+!<%=%k0\F0%-!<$r2!$7$F!"$=$Ne>C$7$?>l9g!"(BXEmacs $B$O$=$N>C$7$?%F%-%9%H$rJ]B8$7$F$*$$(B +$B$F!"$^$?85$KLa$9$3$H$,$G$-$k$h$&$K$7$F$$$^$9!#$3$N!V85$KLa$9!W$H$$$&F0(B +$B:n$r:FF~!J(Byanking$B!K$H8F$S$^$9!#>C$7$?%F%-%9%H$O!"85$HF1$8>l=j$K$G$b85(B +$B$H$O0c$&>l=j$K$G$b:FF~$G$-$^$9!#$^$?!"2?EY$b:FF~$7$F%F%-%9%H$N%3%T!<$r(B +$BJ#?t:n$k$3$H$b$G$-$^$9!#:FF~$N$?$a$N%3%^%s%I$O(B C-y $B$G$9!#(B + +$B!V>C5n!J(Bkill$B!K!W$H!V:o=|!J(Bdelete$B!K!W$N0c$$$K5$$r$D$1$F2<$5$$!#>C5n$7$?(B +$B%F%-%9%H$O:FF~$G$-$^$9$,!":o=|$7$?$b$N$O:FF~$G$-$^$;$s!#0lHL$K!"BgNL$N(B +$B%F%-%9%H$r>C$9%3%^%s%I$O$=$N%F%-%9%H$rJ]B8$7$F$*$-$^$9$,!"0lJ8;z$H$+6u(B +$BGr9T$d6uGrJ8;z$r:o=|$9$k%3%^%s%I$O:o=|$7$?$b$N$rJ]B8$7$-$^$;$s!#(B -$B%&%#%s%I%&(B -========== +>> $B6u9T$G$J$$9T$N@hF,$K%+!<%=%k$r0\F0$5$;$F2<$5$$!#(B + $B$=$l$+$i(B C-k $B$G$=$N9T$N%F%-%9%H$r>C5n$7$F2<$5$$!#(B +>> $B$b$&0lEY(B C-k $B$r%?%$%W$7$F$/$@$5$$!#$=$N9T$KB3$/2~9TJ8;z$,>C$5$l$k$N(B + $B$,J,$j$^$7$?$+!#(B + +$B0l2sL\$N(B C-k $B$O$=$N9T$N%F%-%9%H$r>C$7!"#22sL\$N(B C-k $B$O$=$N9T<+?H$r>C$7(B +$B$F$=$N@h$N9T$r>e$2$F$-$^$9!#(BC-k $B$N?tCM0z?t$N07$$$OFCC$7$^$9!#$3$l$OC1$J$k7+$jJV$7$G$O$"$j$^$;$s!#(B +C-u 2 C-k $B$O#2$D$N9T$H$=$l$>$l$KB3$/2~9TJ8;z$r>C$7$^$9$,!"(BC-k $B$r#2EY%?(B +$B%$%W$7$F$b$=$&$O$J$j$^$;$s!#(B + +$B:G8e$K>C5n$7$?%F%-%9%H$r8=:_%+!<%=%k$,$"$k0LCV$K:FF~$9$k$K$O(B C-y $B$r%?(B +$B%$%W$7$^$9!#(B + +>> $B;n$7$F2<$5$$!#(BC-y $B$r%?%$%W$7$F:G8e$K>C5n$7$?%F%-%9%H$r:FF~$7$^$7$g$&!#(B - Emacs$B$O4v$D$b$N%&%#%s%I%&$r;}$D$3$H$H!"$=$N$=$l$>$l$KBP$7$F%F%-%9%H$r(B -$BI=<($9$k$3$H$,$G$-$^$9!#%X%k%W$d!"4v$D$+$N%3%^%s%I$+$i$N=PNO$rI=<($9$k$?$a(B -$B$K8=$l$?M>J,$J%&%#%s%I%&$r>C$9$?$a$K!"C5n$7$?3F9T$OA4It$^$H$a$FJ]B8$5$l$k$N$G!"0l2s$N(B C-y $B$G(B +$B$=$l$i$N9T$,A4It:FF~$5$l$^$9!#(B + +>> C-k $B$r2?EY$+B3$1$F%?%$%W$7$F$_$F2<$5$$!#(B + +$B$5$"!">C5n$7$?%F%-%9%H$r:FF~$7$^$7$g$&!#(B - C-x 1 $B%&%#%s%I%&$r#1$D$K$9$k!#(B +>> C-y $B$r%?%$%W$7$F2<$5$$!#C5n$7$?%F%-%9%H$r:FF~$7$?$$$N$K!"JL$N%F%-%9%H$r$=$N8e>C5n$7$?;~(B +$B$O$I$&$9$l$P$h$$$G$7$g$&!)(B C-y $B$O:G8e$K>C5n$7$?$b$N$r:FF~$7$^$9!#$G$b(B +$B$=$l$G$h$j0JA0$K>C5n$7$?%F%-%9%H$,$J$/$J$k$o$1$G$O$"$j$^$;$s!#$=$&$$$&(B +$B%F%-%9%H$O(B M-y $B$G:FF~$G$-$^$9!#(BC-y $B$G:G8e$K>C5n$7$?%F%-%9%H$r:FF~$7$?(B +$BD>8e$K(BM-y $B$r%?%$%W$9$k$H!"$=$N:FF~$5$l$?%F%-%9%H$O$=$l0JA0$K>C5n$7$?$b(B +$B$N$KJQ99$5$l$^$9!#2?EY$bB3$1$F(B M-y $B$r%?%$%W$9$k$H!"$5$i$KA0$K>C5n$7$?(B +$B%F%-%9%H$r8F$SLa$;$^$9!#K>$_$N%F%-%9%H$K9T$-Ev$C$?$i!"$=$l$O$=$N$^$^$K(B +$B$7$FJT=8:n6H$rB3$1$l$P$h$$$N$G$9!#(B - C-x 1 $B$O!"B>$N%&%#%s%I%&$r>C$7$F!"%+!<%=%k$N$"$k%&%#%s%I%&$r!"2hLLA4BN(B -$B$K9-$2$^$9!#(B +$B$"$k2s?t$@$1(B M-y $B$r7+$jJV$7$?$i!"$^$?:G=i!J$D$^$j:G8e$K>C5n$7$?%F%-%9(B +$B%H!K$KLa$j$^$9!#(B - >> $B%+!<%=%k$r$3$N9T$K;}$C$F$-$F!"(BC-u 0 C-l $B$H%?%$%W$7$^$9!#(B +>> $B0l9T>C5n$7!"JL$N9T$K9T$C$F$=$N9T$r>C5n$7$F2<$5$$!#(B + $B$=$l$+$i(B C-y $B$G#2HVL\!J:G8e!K$K>C5n$7$?9T$r:FF~$7$F2<$5$$!#(B + $BB3$$$F(B M-y $B$G$=$N9T$r:G=i$K>C5n$7$?9T$KJQ$($F2<$5$$!#(B + M-y $B$rB3$1$I$&$J$k$+8+$F$_$^$7$g$&!##2HVL\$K>C5n$7$?9T$,La$C$FMh$k(B + $B$^$G(B M-y $B$r7+$jJV$7!"$5$i$K$b$&2?EY$+(B M-y $B$r$7$^$7$g$&!#(B + $B$b$7K>$_$J$i(B M-y $B$K@5$b$7$/$OIi$N?tCM0z?t$rM?$($F$bNI$$$G$7$g$&!#(B + + +$B!vC$7(B(UNDO) +================ + +$B$b$7!"J8>O$rJQ99$7$?8e$G$=$NJQ99$O4V0c$$$@$C$?$H;W$C$?$i!"C$7(B +$B!J(Bundo$B!K%3%^%s%I(B C-x u $B$G$=$NJQ99$rC$9$3$H$,$G$-$^$9!#(B - >> C-h k C-f $B$H%?%$%W$7$J$5$$!#?7$7$$%&%#%s%I%&$,(B C-f $B%3%^%s%I$N%I%-(B - $B%e%a%s%H$rI=<($9$k$?$a$K8=$l$k$HF1;~$K!"$3$N%&%#%s%I%&$,$I$N$h$&(B - $B$K=L$`$+$r4Q;!$7$J$5$$!#(B +$BDL>o!"(BC-x u $B$O0l$D$N%3%^%s%I$K$h$kJQ99$rC$7$^$9!#B3$1$F2?EY$b(B C-x +u $B$r9T$($P$=$N$?$S$K0l$DA0$N%3%^%s%I$,C$7$K$J$j$^$9!#(B + +$B$?$@$7$3$l$K$ONc30$,Fs$D$"$j$^$9!#$^$:!"J8>O$rJQ99$7$J$$%3%^%s%I$OC$7$K$J$j$^$;$s!#%+!<%=%k0\F0$d%9%/%m!<%k$N%3%^%s%I$,$=$l$KEv$?$j$^$9!#(B +$B$=$l$+$i!"%F%-%9%HJ8;z$NA^F~!J<+8JA^F~%3%^%s%I!K$O(B 20 $B8D0l$^$H$a$G07$o(B +$B$l$^$9!#$3$l$O%F%-%9%H$NA^F~$rC$9$?$a$N(B C-x u $B$N2s?t$r8:$i$9$?$a(B +$B$G$9!#(B + +>> $B$3$N9T$r(BC-k$B$G>C$7$F2<$5$$!#$=$7$F!"(BC-x u $B$GLa$7$F2<$5$$!#(B - >> C-x 1$B$H%?%$%W$7$F!"%I%-%e%a%s%H$N8=$o$l$F$$$?%&%#%s%I%&$r>C$7$J$5(B - $B$$!#(B +C-_ $B$bC$7!J(Bundo$B!K$r9T$J$&%3%^%s%I$G$9!#5!G=$O!"(BC-x u $B$HF1$8$G$9$,!"(B +$BB3$1$F2?EY$b%?%$%W$9$k>l9g$O$h$jJXMx$G$9!#(BC-_ $B$NLdBj$O!"%-!<%\!<%I$K$h$C(B +$B$F$O$I$&$d$C$F%?%$%W$9$k$N$+J,$j$E$i$$;v$G$9!#$@$+$i(B C-x u $B$,$"$k$N$G(B +$B$9!#C $B$r%?%$%W$7$^$9!#(B - - $BD>A0$KF~NO$7$?J8;z$r:o=|$9$k$K$O!"(B $B$rF~NO$7$^$9!#(B $B$O!"(B -$B%-!<%\!<%I$G!V(BDelete$B!W$H=q$$$F$"$k%-!<$r2!$7$FF~NO$7$^$9!#!V(BDelete$B!W$N$+$o(B -$B$j$K!V(BRubout$B!W$H=q$$$F$"$k$+$bCN$l$^$;$s!#$h$j0lHLE*$K$O!"(B $B$O!"8=:_(B -$B%+!<%=%k$N$"$k0LCV$ND>A0$NJ8;z$r:o=|$7$^$9!#(B - - >> $BJ8;z$r$$$/$D$+%?%$%W$7!"$=$l$+$i$=$l$i$r(B $B$r;H$C$F:o=|$7(B - $B$J$5$$!#(B +$BJT=8$7$F$$$kJ8>O$r915WE*$JJ*$K$9$k$K$O!"$=$l$r%U%!%$%k$KJ]B8$7$J$1$l$P(B +$B$J$j$^$;$s!#$5$b$J$$$H!"(BXEmacs $B$N=*N;$HF1;~$K$=$l$O$J$/$J$C$F$7$^$$$^(B +$B$9!#JT=8$7$?J*$r%U%!%$%k$KF~$l$k$K$O%U%!%$%k$r3+$$$F$+$i$7$^$9!#!J%U%!(B +$B%$%k$r(B "visit" $B$9$k$H$b8@$$$^$9!K!#(B - >> $B1&%^!<%8%s$r1[$($k$^$G%F%-%9%H$r%?%$%W$7$J$5$$!#%F%-%9%H$,0l9T$N(B - $BI}0J>e$KD9$/$J$k$H!"$=$N9T$O2hLL$+$i$O$_=P$7$F!V7QB3!W$5$l$^$9!#(B - $B1&C<$K$"$k(B'\'$B5-9f$O!"$=$N9T$,7QB3$5$l$F$$$k$3$H$rI=$7$F$$$^$9!#(B - Emacs$B$O!"8=:_JT=8Cf$N0LCV$,8+$($k$h$&$K9T$r%9%/%m!<%k$7$^$9!#2hLL(B - $B$N1&$"$k$$$O:8$NC<$K$"$k(B'\'$B5-9f$O!"$=$NJ}8~$K9T$,$^$@B3$$$F$$$k$3(B - $B$H$rI=$7$F$$$^$9!#(B +$B%U%!%$%k$r3+$/$H$O!"$=$N%U%!%$%k$NCf?H$r(B XEmacs $B$G8+$k$3$H$r0UL#$7$^$9!#(B +$B?'!9$J0UL#$G!"$=$l$O$"$J$?$,%U%!%$%k<+?H$rJT=8$7$F$$$k$+$NMM$G$9!#$7$+(B +$B$7!"(BXEmacs $B$G9T$&JQ99$O%U%!%$%k$r%;!<%V$9$kKx$O915WE*$J$b$N$H$J$j$^$;(B +$B$s!#$3$l$O!"$=$l$rK>$^$J$$$N$K!"ESCf$^$GJQ99$7$?%U%!%$%k$,;D$k$N$rHr$1(B +$B$k$?$a$G$9!#%;!<%V$7$?8e$G$5$(!"JQ99$7$?$b$N$,4V0c$C$F$$$?;~$N$?$a$K!"(B +$B85$N%U%!%$%k$OL>A0$rJQ$($F;D$5$l$^$9!#(B - $B$3$l$O!"J8>O$G@bL@$9$k$h$j> $B@h$[$IF~NO$7$?!"7QB3$5$l$?9T$N>e$K%+!<%=%k$r$b$C$F$$$-!"(BC-d $B$G%F(B - $B%-%9%H$r:o=|$7$F!"%F%-%9%H$,0l9T$K<}$^$k$h$&$K$7$F$_$J$5$$!#7QB3(B - $B$rI=$9(B'\'$B5-9f$O>C$($^$7$?$M!#(B +$B2hLL$N0lHV2<6a$/$K!"(B"ISO7--%%-XEmacs: TUTORIAL.ja" $B$NMM$JJ8;zNs$G;O$^(B +$B$j(B "----" $B$G=*$C$F$$$k9T$,$"$k$O$:$G$9!#2hLL$N$3$NItJ,$O>o$K8=:_3+$$$F(B +$B$$$k%U%!%$%k$NL>A0$,I=<($5$l$F$$$^$9!#:#$O(B "TUTORIAL.ja" $B$H$$$&L>$N%U%!(B +$B%$%k!J$3$l$O(B XEmacs $BF~Lg%,%$%I$N$"$J$?MQ$N%3%T!<$G$9!K$r3+$$$F$$$^$9!#(B +XEmacs $B$G%U%!%$%k$r3+$/$H$=$N%U%!%$%k$NL>A0$,$3$NItJ,$K8=$l$^$9!#(B - >> $B%+!<%=%k$r9T$N@hF,$K0\F0$7!"(B $B$rF~NO$7$J$5$$!#$3$l$O$=$N9T(B - $B$ND>A0$N9T6g@Z$j$r:o=|$9$k$N$G!"$=$N9T$,A0$N9T$H$D$J$,$C$F$7$^$$(B - $B$^$9!#$D$J$,$C$?9T$,2hLL$NI}$h$jD9$/$J$k$H!"7QB3$NI=<($,$5$l$k$G(B - $B$7$g$&!#(B +$B%U%!%$%k$r3+$$$?$jJ]B8$7$?$j$9$k%3%^%s%I$O!"#2$D$NJ8;z$+$i@.$k$H$$$&E@(B +$B$G:#$^$G3X$s$@B>$N%3%^%s%I$H$O0c$$$^$9!#N>J}$H$b!"(BControl-x $B$H$$$&J8;z(B +$B$G;O$^$j$^$9!#(BControl-x $B$G;O$^$k%3%^%s%I$O$?$/$5$s$"$j$^$9!#B?$/$O%U%!(B +$B%$%k!"%P%C%U%!$d$=$l$i$K4XO"$7$?$b$N$K4X78$7$?$3$H$r$7$^$9!#$3$l$i$N%3(B +$B%^%s%I$O#2!"#3!"#4J8;z$G$9!#(B - >> $B$r2!$7$F!"$b$&0lEY9T6g@Z$j$rA^F~$7$J$5$$!#(B - - Emacs$B$N$[$H$s$I$N%3%^%s%I$O!"7+$jJV$7$N2s?t$rM?$($k$3$H$,$G$-$^$9!#$3(B -$B$N$3$H$O!"J8;z$NA^F~$K$D$$$F$bEv$F$O$^$j$^$9!#(B - - >> C-u 8 * $B$HF~NO$7$F$_$J$5$$!#$I$&$J$j$^$7$?$+!#(B +$B%U%!%$%k$r3+$/$?$a$N%3%^%s%I$O$3$l$^$G3X$s$@$b$N$H$O0c$$!"%U%!%$%k$NL>(B +$BA0$r;XDj$7$J$1$l$P$J$j$^$;$s!#$3$l$r!"%3%^%s%I$,!VCl9g$O0z?t$O%U%!%$%kL>$G$9!#l9g$K$O!"FsHVL\$N9T$N@hF,$K9T$-!"(BC-o $B$r(B -$BF~NO$7$^$9!#(B - - >> $BE,Ev$J9T$N@hF,$K9T$-!"$=$3$G(B C-o $B$rF~NO$7$F$_$J$5$$!#(B + C-x C-f Find a file - $B$3$l$G!"(BEmacs$B$G!"%F%-%9%H$rF~NO$7!"$^$?4V0c$$$r=$@5$9$k$b$C$H$b4pK\E*(B -$B$JJ}K!$r3X$s$@$3$H$K$J$j$^$9!#J8;z$HF1$8MM$K!"C18l$d9T$b:o=|$9$k$3$H$,$G$-(B -$B$^$9!#:o=|A`:n$K$D$$$FMWLs$9$k$H$rJ9$$$F$-$^$9!#%?%$%W$7$?%U%!%$%k(B +$BL>$O2hLL$N:G2<9T$KI=<($5$l$^$9!#$3$N:G2<9T$O!"$3$&$$$&F~NO$N$?$a$K;H$C(B +$B$F$$$k;~$O!"%_%K%P%C%U%!$H8F$S$^$9!#DL>o$NJT=8%3%^%s%I$G%U%!%$%kL>$rJT(B +$B=8$9$k$3$H$b$G$-$^$9!#(B - $B%+!<%=%k$ND>A0$NJ8;z$r:o=|(B - C-d $B%+!<%=%k$N$"$kJ8;z$r:o=|(B - - ESC $B%+!<%=%k$ND>A0$NC18l$r:o=|(B - ESC d $B%+!<%=%k0LCV0J9_$K$"$kC18l$r:o=|(B +$B%U%!%$%kL>$NF~NOCf!J$"$k$$$O$=$NB>$N%_%K%P%C%U%!F~NOCf!K$K(B C-g $B$K$h$C(B +$B$F%3%^%s%I$r%-%c%s%;%k$G$-$^$9!#(B - C-k $B%+!<%=%k0LCV$+$i9TKv$^$G$r:o=|(B +>> C-x C-f $B$r%?%$%W$7$F$+$i(B C-g $B$r%?%$%W$7$F$_$^$7$g$&!#%_%K%P%C%U%!$,(B + $BC$5$l!"$=$l$r;H$C$F$$$?%3%^%s%I(B C-x C-f $B<+BN$bC$5$l$^$9!#(B + $B$@$+$i!"%U%!%$%k$O2?$b3+$+$l$^$;$s!#(B - $B2?$+$r:o=|$7$?8e$G!"$=$l$r85$KLa$7$?$/$J$k$3$H$,$"$j$^$9!#(BEmacs$B$O!"0l(B -$BJ8;z$h$j$bBg$-$$C10L$G:o=|$r9T$C$?;~$K$O!":o=|$7$?FbMF$rJ]B8$7$F$*$-$^$9!#(B -$B85$KLa$9$K$O!"(BC-y $B$r;H$$$^$9!#Cm0U$7$?$$$N$O!"(BC-y $B$r:o=|$r9T$C$?>l=j$@$1$G(B -$B$O$J$/!"$I$3$K$G$b=PMh$k$3$H$G$9!#(BC-y $B$O!"J]B8$5$l$?%F%-%9%H$r8=:_%+!<%=%k(B -$B$N$"$k>l=j$KA^F~$9$k$?$a$N%3%^%s%I$G$9$+$i!"$3$l$r;H$C$F%F%-%9%H$N0\F0$r9T(B -$B$&$3$H$,$G$-$^$9!#(B +$B%U%!%$%kL>$rF~NO$7$?$i!"(B$B%-!<$r%?%$%W$7F~NO$r40N;$5$;$^$9!#$=$&(B +$B$9$k$H!"(BC-x C-f $B%3%^%s%I$,Av$j;O$a;XDj$7$?%U%!%$%k$r3+$-$^$9!#%_%K%P%C(B +$B%U%!$O(B C-x C-f $B%3%^%s%I$N=*N;$H$H$b$K>C$($^$9!#(B - $B:o=|$r9T$&%3%^%s%I$K$O!"(B"Delete" $B%3%^%s%I$H!"(B"Kill" $B%3%^%s%I$H$,$"$j$^(B -$B$9!#(B"Kill" $B%3%^%s%I$G$O:o=|$5$l$?$b$N$OJ]B8$5$l$^$9$,!"(B"Delete" $B%3%^%s%I$G(B -$B$OJ]B8$5$l$^$;$s!#$?$@$7!"7+$jJV$72s?t$,M?$($i$l$k$H!"J]B8$5$l$^$9!#(B +$B%U%!%$%k$NFbMF$,2hLL$KI=<($5$l$k$H!"$=$NFbMF$rJQ99$9$k$3$H$,$G$-$^$9!#(B +$B2C$($?JQ99$r915WE*$J$b$N$K$7$?$1$l$P!"> C-n $B$r#22s$[$I%?%$%W$7$F!"2hLL$NE,Ev$J>l=j$K0\F0$7$J$5$$!#$=$7$F!"(B - C-k $B$G!"$=$N9T$r:o=|$7$J$5$$!#(B + C-x C-s Save the file - $B0l2sL\$N(B C-k $B$G$=$N9T$NFbMF$,:o=|$5$l!"$b$&0lEY(B C-k $B$rF~NO$9$k$H!"$=$N(B -$B9T<+?H$,:o=|$5$l$^$9!#$b$7!"(BC-k $B$K7+$jJV$72s?t$r;XDj$7$?>l9g$K$O!"$=$N2s?t(B -$B$@$1$N9T$,!JFbMF$H9T<+?H$H$,F1;~$K!K:o=|$5$l$^$9!#(B - - $B:#:o=|$5$l$?%F%-%9%H$O!"J]B8$5$l$F$$$k$N$G!"$=$l$r> C-y $B$r;n$7$F$_$J$5$$!#(B +$B$3$l$O(B XEmacs $B$,J];}$7$F$$$kJ8>O$r%U%!%$%k$K%3%T!<$7$^$9!#=i$a$F$3$l$r(B +$BA0$KIU$1BX$($k$N$G!"$=$NFbMF$O<:(B +$B$o$l$^$;$s!#$=$N?7$7$$L>A0$O85$N%U%!%$%k$NL>A0$N:G8e$K(B'~'$B$r$D$1$?$b$N(B +$B$G$9!#(B - C-k $B$r2?EY$bB3$1$F9T$&$H!":o=|$5$l$k%F%-%9%H$O!"$^$H$a$FJ]B8$5$l!"(BC-y -$B$G!"$=$NA4$F$,> C-k $B$r2?EY$b%?%$%W$7$F$_$J$5$$!#(B +$B%;!<%V$,=*$o$k$H!"%;!<%V$7$?%U%!%$%k$NL>A0$,I=<($5$l$^$9!#3d$HIQHK$K%;!<(B +$B%V$7$?J}$,NI$$$G$7$g$&!#%7%9%F%`$,Mn$A$F$b$;$C$+$/$N:n6H$,%Q%"$K$J$i$J(B +$B$$$h$&$K!#(B - >> $B%F%-%9%H$r$N%F%-%9%H$r:o=|$9$k$H$I$&(B -$B$J$k$G$7$g$&$+!#(BC-y $B$O!"$b$C$H$b:G6a:o=|$5$l$?$b$N$r> C-x C-s $B$H%?%$%W$7$F$3$NF~Lg%,%$%I$N%3%T!<$r%;!<%V$7$F2<$5$$!#(B + $B2hLL:G2> $B9T$r:o=|$7!"%+!<%=%k$r0\F0$5$;!"JL$N9T$r:o=|$7$J$5$$!#(BC-y $B$r9T$&(B - $B$H!"#2HVL\$N9T$,F@$i$l$^$9!#(B - -$BC$7(B(UNDO) -============== +$BCm0U!'%7%9%F%`$K$h$C$F$O(B C-x C-s $B$H%?%$%W$9$k$H2hLL$,F0$+$J$/$J$j(B +XEmacs $B$,I=<($7$h$&$H$9$k$b$N$,2?$b2hLL$K=P$J$/$J$j$^$9!#$3$l$O!"%U%m!<(B +$B%3%s%H%m!<%k$H8F$P$l$k#O#S$N5!G=$,(B C-s $B$rB*$(!"(BXEmacs $B$KEO$5$J$$$h$&$K(B +$B$7$F$$$k$N$G$9!#$3$l$r2r=|$9$k$K$O(B C-q $B$r%?%$%W$7$^$9!#$=$l$+$i(B XEmacs +$B%^%K%e%"%k$N(B "Spontaneous Entry to Incremental Search ($BCN$i$L4V$K%$%s(B +$B%/%j%a%s%?%k%5!<%A$K$J$k(B)" $B$N@a$rFI$s$G$/$@$5$$!#$3$N$d$C$+$$$J#O#S$N(B +$B5!G=$K$I$&BP=h$9$l$PNI$$$+$,:\$C$F$$$^$9!#(B - $B$$$D$G$b!"%F%-%9%H$rJQ99$7$?$1$l$I$b!"$=$l$r$b$H$KLa$7$?$$$H$-$O(BC-x u -$B$GD>$j$^$9!#IaDL$O4V0c$($?%3%^%s%I$rL58z$K$9$kF/$-$r$7$^$9!#7+$jJV$7$F(BUNDO -$B$r9T$J$*$&$H$9$k;~$O!"2?EY$b$=$N%3%^%s%I$r9T$J$($P=PMh$k$h$&$K$J$C$F$$$^$9!#(B - - >> $B$3$N9T$r(BC-k$B$G>C$7$F2<$5$$!#$=$7$F!"(BC-x u$B$GLa$7$F2<$5$$!#(B - - C-_$B$O!"(BUNDO$B$r9T$J$&!"$b$&0l$D$N%3%^%s%I$G$9!#5!G=$O!"(BC-x u$B$HF1$8$G$9!#(B - - C-_$B$d(BC-x u$B$K(BUNDO$B$N2s?t$r!"M?$($k$3$H$,=PMh$^$9!#(B +$B4{B8$N%U%!%$%k$r3+$-!"FbMF$r8+!"JT=8$9$k$3$H$,$G$-$^$9!#B8:_$7$J$$%U%!(B +$B%$%k$r3+$/$3$H$b$G$-$^$9!#(BXEmacs $B$G?7$7$$%U%!%$%k$r:n$k$K$OO$rF~NO$7$F$$$-$^$9!#(B +$B%U%!%$%k$r%;!<%V$7$h$&$H$7$?;~$K=i$a$F?7$7$$%U%!%$%k$,:n$i$l!":#$^$GF~(B +$BNO$7$?FbMF$,$=$l$K=q$-9~$^$l$^$9!#$=$l0J9_$O!"$"$J$?$O4{B8$N%U%!%$%k(B +$B!J$?$C$?:#:n$i$l$?%U%!%$%k!K$rJT=8$7$F$$$k$H;W$C$F2<$5$$!#(B -$B%U%!%$%k(B -======== +$B!v%P%C%U%!(B +========== + +$B#2$DL\$N%U%!%$%k$r(B C-x C-f $B$G3+$$$F$b!":G=i$N%U%!%$%k$O(B XEmacs $BFbIt$K(B +$B;D$C$?$^$^$G$9!#$=$C$A$N%U%!%$%k$KLa$k$K$O$b$&0lEY(B C-x C-f $B$G$=$N%U%!(B +$B%$%k$r3+$1$P$h$$$N$G$9!#$3$&$d$C$F!"4v$D$b$N%U%!%$%k$r(B XEmacs $B$G3+$/$3(B +$B$H$,$G$-$^$9!#(B - $B%F%-%9%H$X$NJQ99$r1J5WE*$K$9$k$?$a$K$O!"$=$l$r%U%!%$%k$KJ]B8$7$J$1$l$P(B -$B$J$j$^$;$s!#J]B8$5$l$J$$$H!"$[$I$3$7$?JQ99$O!"(BEmacs$B$r=*N;$9$k$HF1;~$K<:$o$l(B -$B$F$7$^$$$^$9!#(B +>> "foo" $B$H$$$&L>$N%U%!%$%k$r:n$j$^$7$g$&!#(BC-x C-f foo $B$G$9!#(B + $B2?$+J8>O$rF~$l!"JT=8$7!"(BC-x C-s $B$G(B "foo" $B$r%;!<%V$7$F2<$5$$!#(B + $B:G8e$K(B C-x C-f TUTORIAL.ja $B$H%?%$%W$7(B + $BF~Lg%,%$%I$KLa$j$^$7$g$&!#(B + +XEmacs $B$O%U%!%$%k$NFbMF$r%P%C%U%!!J(Bbuffer$B!K$H8F$P$l$k$b$N$NCf$K3JG<$7(B +$B$F$$$^$9!#%U%!%$%k$r3+$/$H?7$7$$%P%C%U%!$,$G$-$^$9!#(BXEmacs $B$,8=:_;}$C(B +$B$F$$$k%P%C%U%!$N%j%9%H$r8+$k$K$O!"> C-x C-b $B$r;n$7$F$_$^$7$g$&!#(B + +$B3F%P%C%U%!$,$I$s$JIw$KL>A0$d$=$l$,3+$$$F$$$k%U%!%$%k$KBP$9$k%U%!%$%kL>(B +$B$r;}$C$F$$$k$+8+$F2<$5$$!#%U%!%$%k$r3+$$$F$$$J$$%P%C%U%!$b$"$j$^$9!#$?(B +$B$H$($P!"(B"*Buffer List*" $B$H$$$&L>$N%P%C%U%!$O$I$s$J%U%!%$%k$b3+$$$F$$$^(B +$B$;$s!#$3$l$O%P%C%U%!$N%j%9%H$rFbMF$H$9$k%P%C%U%!$G!"(BC-x C-b $B$G:n$i$l$?(B +$B$b$N$G$9!#(BXEmacs $B$N%&%#%s%I%&Fb$K$"$k%F%-%9%H$O$I$l$b!"$$$:$l$+$N%P%C(B +$B%U%!$N0lIt$G$9!#(B + +>> C-x 1 $B$H%?%$%W$7$F%P%C%U%!%j%9%H$r>C$7$^$7$g$&!#(B - $B$"$J$?$,%U%!%$%k$r%;!<%V!JJ]B8$9$k!K$9$k$^$G!":#$^$G$NJQ99$OJT=8$7$F$$(B -$B$k%U%!%$%k$K=q$-9~$^$l$k;v$O$"$j$^$;$s!#$=$l$O!"$"$J$?$,$=$N$h$&$K9T$$$?$/(B -$B$J$$$N$K!"ESCf$^$GJQ99$r2C$($?$b$N$,>!$N%U%!%$%k$r3+$$$F(B +$B$b!":G=i$N%U%!%$%k$O$^$@%;!<%V$5$l$^$;$s!#JQ99$O(B XEmacs $B$NFbIt!"$=$N%U%!(B +$B%$%k$KBP1~$9$k%P%C%U%!$NCf$K;D$C$?$^$^$G$9!##2HVL\$N%U%!%$%k$N%P%C%U%!(B +$B$r:n$C$?$j!"JT=8$7$?$j$7$F$b!":G=i$N%U%!%$%k$N%P%C%U%!$K$O2?$N1F6A$b$"(B +$B$j$^$;$s!#$3$l$O$H$F$bLr$KN)$A$^$9$,!":G=i$N%U%!%$%k$N%P%C%U%!$r%;!<%V(B +$B$9$k2?$+JXMx$JJ}K!$,I,MW$@$H$$$&$3$H$G$b$"$j$^$9!#(B C-x C-s $B$G%;!<%V$9(B +$B$k$?$a$K(B C-x C-f $B$G85$N%P%C%U%!$KLa$k$N$O$OLq2p$G$9!#$=$3$GA0(B -$B$rJQ$($F%*%j%8%J%k$N%U%!%$%k$r;D$7$^$9!#(B + C-x s $B2?$l$+$N%P%C%U%!$r%;!<%V$9$k(B + +C-x s $B$O!"$^$@%;!<%V$7$F$$$J$$JQ99$,$"$k%P%C%U%!$=$l$>$l$K$D$$$F!"$=$l(B +$B$r%;!<%V$9$k$+$I$&$+$rJ9$$$F$-$^$9!#(B -$BHw9M(B: $B$^$?!"(BEmacs$B$OITB,$N;vBV$KBP$7!"0lDj$N%?%$%_%s%0$4$H$K<+F0E*(B - $B$KJT=8$7$F$$$k%U%!%$%k$NFbMF$rL>A0$rJQ$($?%U%!%$%k$K%;!<%V$7(B - $B$^$9!#$3$l$K$h$C$F!"K|0l$N>l9g$O9T$C$?$NJQ99$KBP$7:G>.8B$NHo(B - $B32$G:Q$`$h$&$K$J$C$F$$$^$9!#(B +>> $B0l9T%F%-%9%H$rF~NO$7$F$+$i(B C-x s $B$H%?%$%W$7$F2<$5$$!#(B + TUTORIAL.ja $B$H$$$&%P%C%U%!$r%;!<%V$9$k$+$I$&$+J9$$$F$/$k$O$:$G$9!#(B + $B!V$O$$!W$HEz$($k$?$a$K(B "y" $B$H%?%$%W$7$F2<$5$$!#(B + +$B!v%a%K%e!<$r;H$&(B +---------------- - $B2hLL$N2<$NJ}$r8+$k$H!"$3$N$h$&$J46$8$G%b!<%I%i%$%s$,I=<($5$l$F$$$k$H;W(B -$B$$$^$9!#(B +$B$b$7(B X $BCeIt$K%a%K%e!<%P!<$,$"$k$3(B +$B$H$K5$IU$/$G$7$g$&!#$3$N%a%K%e!<%P!<$r;H$C$F!V%U%!%$%k$r3+$/!W$H$$$&$h(B +$B$&$J$[$H$s$I$N$h$/;H$&(B XEmacs $B$N%3%^%s%I$r;HMQ$9$k$3$H$,$G$-$^$9!#FCDj(B +$B$N%3%^%s%I$r;HMQ$9$k$?$a$NBG80$r3P$($J$/$F$h$$$N$G!":G=i$O$3$NJ}$,4JC1(B +$B$K;W$($k$G$7$g$&!#(BXEmacs $B$K47$l$F$/$k$K$7$?$,$C$F!"%-!<%\!<%I$N%3%^%s(B +$B%I$r;H$&$3$H$,4JC1$K$J$C$F$/$k$G$7$g$&!#BP1~$9$k%-!<%\!<%I%3%^%s%I$,%3(B +$B%^%s%I$NA0$r8+$D$1$FA*Br$9$k$@$1$G(B +$B$I$N%P%C%U%!$K$G$b0\F0$G$-$^$9!#(B - $B$3$N(BEmacs$B%A%e!<%H%j%"%k$N%3%T!<$O(BMULE.tut$B$H8F$P$l$F$$$^$9!#%U%!%$%k$r(B -$B%U%!%$%s%I!J%U%!%$%k$r8+$D$1$F%P%C%U%!$KFI$_9~$`$3$H!K$9$k$H!"(BMULE.tut$B$NIt(B -$BJ,$KI=<($5$l$^$9!#Nc$($P!"(Bnew-file$B$H$$$&L>A0$N%U%!%$%k$r%U%!%$%s%I$7$?$J$i(B -$B$P!"(B"Mule: new-file"$B$H$$$&%b!<%I%i%$%s$K$J$k$G$7$g$&!#(B - -$BCm0U!'(B $B%b!<%I%i%$%s$K$D$$$F$O8e$[$I@bL@$7$^$9!#>/$7$*BT$A$r!#(B - - $B%U%!%$%k$r%U%!%$%s%I$7$?$j!"%;!<%V$7$?$j$9$k%3%^%s%I$O!"$3$l$^$G$N$b$N(B -$B$H$O0c$$!"#2$D$NJ8;z$+$i$J$C$F$$$^$9!#(BC-x $B$KB3$$$FF~NO$9$kJ8;z$,!"%U%!%$%k(B -$B$KBP$7$F9T$&A`:n$rI=$7$^$9!#(B +$B!v%^%&%9$r;H$&(B +-------------- - $B$b$&0l$D$3$l$^$G$N$b$N$H0c$&E@$O!"%U%!%$%s%I$N;~!"%U%!%$%kL>$r(BEmacs$B$K(B -$BLd$o$l$^$9!#$3$N$3$H$r!"Cl9g$O%U%!%$%kL>$G$9!#(B +X $B$N2<$G$_$N>l=j$G:8%\%?%s$r%/%j%C%/$9$k$3$H$G%F%-%9%H$N%+!<%=%k$r0\F0(B +$B$9$k$3$H$,$G$-!"A*Br$7$?$$%F%-%9%H$r:8%^%&%9%\%?%s$G%I%i%C%0$9$k$3$H$G(B +$B%F%-%9%H$rA*Br$9$k$3$H$,$G$-$^$9!#!J$b$7$/$O!"$=$NBe$o$j$K%F%-%9%H$rA*(B +$BBr$9$k$?$a$K0lJ}$NC<$G:8%^%&%9%\%?%s$r%/%j%C%/$7!"B>$NC<$K0\F0$7$F(B +Shift $B$r2!$7$J$,$i%/%j%C%/$9$k$3$H$,$G$-$^$9!#!K(B - C-x C-f $B%U%!%$%k$r8+$D$1$k!J%U%!%$%s%I$9$k!K(B - - Emacs$B$O%U%!%$%kL>$rJ9$$$F$-$^$9!#$=$l$O!"2hLL$N2<$N9T$K8=$l$^$9!#%U%!(B -$B%$%kL>$r;XDj$7$F$$$kItJ,$O!"%_%K%P%C%U%!$H8F$P$l$k$b$N$G$9!#%_%K%P%C%U%!$O(B -$B$3$NMM$J;H$o$lJ}$r$7$^$9!#%U%!%$%kL>$KB3$$$F!"%j%?!<%s%-!<$r2!$9$H!"%_%K%P(B -$B%C%U%!$KI=<($5$l$F$$$?FbMF$O$b$&I,MW$G$O$J$/$J$k$N$G>C$($F$7$^$$$^$9!#(B +$BA*Br$7$?%F%-%9%H$r>C5n(B $B!J(Bkill$B!K(B $B$9$k$?$a$K$O!"(BC-w $B$+!"(BEdit $B%a%K%e!<$N(B +Cut $B9`L\$r;H$($^$9!#$3$l$i$OEy2A$G$O(B*$BL5$$(B*$B$3$H$KCm0U$7$F$/$@$5$$(B: C-w +$B$O(BXEmacs $B$NFbIt$N$_$K%F%-%9%H$rJ]B8$7$^$9$,!J>e$G@bL@$7$?(B C-k $B$H;w$F$$(B +$B$^$9!K!"(BCut $B$O$3$l$H$H$b$K%F%-%9%H$rB>$N%"%W%j%1!<%7%g%s$,;HMQ2DG=$J(B X +$B$N%/%j%C%W%\!<%I$K$bF~$l$^$9!#(B - >> C-x C-f$B$H%?%$%W$7$?8e$K(BC-g$B$H%?%$%W$7$F2<$5$$!#%_%K%P%C%U%!$NFbMF(B - $B$rC$7!"$^$?!"(BC-x C-f$B%3%^%s%I$bC$7$^$9!#$H8@$&Lu$G!"2?$b(B - $B%U%!%$%k$r8+$D$1$k$h$&$J$3$H$O$7$^$;$s!#(B - - $B:#EY$O%U%!%$%k$r%;!<%V$7$F$_$^$7$g$&!#:#$^$G$NJQ99$rJ]B8$9$k$?$a$K$OA0$r$D$1$i$l$F;D$5$l$F$$$k$N$GFbMF$O<:$o$l$^$;$s!#$=(B -$B$N?7$7$$L>A0$O%*%j%8%J%k$N%U%!%$%k$NL>A0$K(B'~'$B$r$D$1$?$b$N$G$9!#(B - - $B%;!<%V$,=*$o$k$H!"(BEmacs$B$O%;!<%V$7$?%U%!%$%k$NL>A0$rI=<($7$^$9!#(B +$B??Cf$N%^%&%9$N%\%?%s$OIaDL$O2hLL$G8+$($F$$$k$b$N$rA*Br$9$k$?$a$K;H$o$l(B +$B$^$9!#Nc$($P!"(BInfo$B!J%*%s%i%$%s(B XEmacs $B@bL@J8=q!K$K(B C-h i $B$+(B Help $B%a%K%e!<(B +$B$r;H$C$FF~$l$P!"%O%$%i%$%H$5$l$?%j%s%/$r??Cf$N%\%?%s$r2!$9$3$H$GDI$&$3(B +$B$H$,$G$-$^$9!#F1MM$K!"%U%!%$%kL>$rF~NO$7$F$$$k$H$-$K!JNc$($P!"!V%U%!%$(B +$B%k$r3+$/!W$GF~NO$rB%$5$l$?$H$-!K(B TAB $B$GJd408uJd$rI=<($5$;$k$H!"8uJd$N(B +$B0l$D$rA*Br$9$k$?$a$K??Cf$N%\%?%s$G%/%j%C%/$9$k$3$H$,$G$-$^$9!#(B - >> C-x C-s$B$H%?%$%W$7$F%A%e!<%H%j%"%k$N%3%T!<$r%;!<%V$7$F2<$5$$!#$=$N(B - $B;~!"2hLL$N2<$NJ}$K(B"Wrote ...../MULE.tut"$B$HI=<($5$l$^$9!#(B +$B1&$N%^%&%9$N%\%?%s$O%]%C%W%"%C%W%a%K%e!<$rI=<($7$^$9$3$N%a%K%e!<$NFbMF(B +$B$O:#$N%b!<%I$K0MB8$7!"IaDL$O;HMQ$70W$$$h$&$K#2!"#3$NNI$/;H$o$l$k%3%^%s(B +$B%I$r4^$s$G$-$^$9!#(B - $B?7$7$$%U%!%$%k$r:n$k;~!"$"$?$+$b0JA0$+$i$"$C$?%U%!%$%k$r%U%!%$%s%I$9$k(B -$B$h$&$J%U%j$r$7$^$9!#$=$&$7$F!"$=$N%U%!%$%s%I$7$?%U%!%$%k$K%?%$%W$7$F$$$-$^(B -$B$9!#(B +>> $B1&%^%&%9%\%?%s$r2!$7$F$/$@$5$$!#(B - $B%U%!%$%k$r%;!<%V$7$h$&$H$7$?;~$K=i$a$F!"(BEmacs$B$O:#$^$GJT=8$7$F$$$?FbMF(B -$B$r%U%!%$%k$NCf$K=q$-9~$_$^$9!#(B +$B%a%K%e!<$rI=<($5$;B3$1$k$?$a$K$O%\%?%s$r2!$7B3$1$kI,MW$,$"$j$^$9!#(B -$B%P%C%U%!(B -======== - - $B$b$7!"#2HVL\$N%U%!%$%k$r(B C-x C-f $B$G> C-x C-b $B$H%?%$%W$7$J$5$$!#$=$l$>$l$N%P%C%U%!$,$I$N$h$&$KL>A0$r;}(B - $B$C$F$$$k$+!"$=$7$F!"$I$N$h$&$J%U%!%$%kL>$r$D$1$F$$$k$N$+4Q;!$7$J(B - $B$5$$!#(B - - $B%P%C%U%!$K$O%U%!%$%k$H0lCW$J$$$b$N$b$"$j$^$9!#$?$H$($P!"(B -"*Buffer List*" $B$H$$$&%U%!%$%k$O$"$j$^$;$s!#$3$l$O(B C-x C-b $B$K$h$C$F:n$i$l(B -$B$?%P%C%U%!%j%9%H$KBP$7$F$N%P%C%U%!$G$9!#(B - - $B$"$J$?$,8+$F$$$k(BEmacs$B%&%#%s%I%&Fb$K$"$k!"$I$s$J%F%-%9%H$G$b!"$$$:$l$+(B -$B$N%P%C%U%!Fb$K$"$j$^$9!#(B - - >> $B%P%C%U%!%j%9%H$r>C$9$?$a(B C-x 1 $B$H%?%$%W$7$J$5$$!#(B +$B!v%3%^%s%I$N3HD%(B +================ - $B$b$7!"$"$k%U%!%$%k$N%F%-%9%H$KJQ99$r9T$J$C$F$+$i!"B>$N%U%!%$%k$rA0$K$h$k3HD%!#B3$1$F%3%^%s%I$NL>A0$rF~NO$7$^$9!#(B - $B$3$l$i$O0lHL$K!"JXMx$@$1$l$I$b!"$3$l$^$G8+$F$-$?$b$N$[$IIQHK$K$OMQ$$$i(B -$B$l$J$$%3%^%s%I$N$?$a$N$b$N$G$9!#(BC-x C-f $B!J%U%!%$%s%I!K$d(B C-x C-s$B!J%;!<%V!K(B -$B$O$3$NCg4V$G$9!#B>$K!"(BC-x C-c$B!J%(%G%#%?$N=*N;!K$b$=$&$G$9!#(B +$B$3$l$i$O!"0lHLE*$K$OJXMx$@$1$l$I$b!"$3$l$^$G8+$F$-$?$b$N$[$I$OIQHK$KMQ(B +$B$$$i$l$J$$%3%^%s%I$G$9!#(BC-x C-f $B!J%U%!%$%k$r3+$/!K$d(B C-x C-s$B!J%U%!%$%k(B +$B$r%;!<%V!K$O$3$NCg4V$G$9!#B>$K!"(BC-x C-c$B!J(BXEmacs $B$r=*N;!K$b$=$&$G$9!#(B +C-x C-c $B$K4X$7$F$O!"$=$l$^$G$K2C$($?JQ99$,L5$/$J$k$N$r?4G[$9$kI,MW$O$"(B +$B$j$^$;$s!#(BXEmacs $B$r=*N;$5$;$kA0$KJQ99$5$l$?3F%U%!%$%k$r%;!<%V$9$k$+$I(B +$B$&$+J9$$$F$-$^$9$+$i!#(B - C-z$B$O(BEmacs$B$rH4$1$k$N$KNI$/;H$o$l$kJ}K!$G$9!#(BEmacs$B$r=*N;$9$k$3$H$J$/!"(B -$B0lC6!"(Bcsh$B$N%l%Y%k$KLa$k$K$O0lHVNI$$J}K!$H8@$($k$G$7$g$&!#(BC-z$B$r9T$J$o$l$F$b(B -Emacs$B$O%9%H%C%W$7$F$$$k$@$1$G!"FbMF$,GK2u$5$l$k$H$$$&$3$H$O$"$j$^$;$s!#(B - -$BCm0U(B: $B$?$@$7(BX-window$B$G9T$J$C$F$$$k>l9g!"$b$7$/$O;HMQ$7$F$$$k%7%'%k(B - $B$,(Bsh$B$N;~$O!"$3$N8B$j$G$O$"$j$^$;$s!#(B +C-z $B$O!V0l;~E*$K!W(B XEmacs $B$rH4$1$k%3%^%s%I$G$9!#$^$?F1$8(B XEmacs $B%;%C%7%g(B +$B%s$KLa$k$3$H$,$G$-$^$9!#(B - - C-x $B%3%^%s%I$O!"$?$/$5$s$"$j$^$9!#$9$G$K3X$s$@$b$N$O0J2<$N$b$N$G$9!#(B +$B$=$l$,$G$-$k%7%9%F%`>e$J$i!"(BC-z $B$O(B XEmacs $B$r!VCfCG!W$5$;$^$9!#$D$^$j(B +XEmacs $B$r=*N;$9$k$3$H$J$/!"%3%^%s%I%7%'%k$KLa$k$3$H$,$G$-$^$9!#BgJ}$N(B +$BI8=`E*$J%7%'%k$J$i!"(B`fg' $B%3%^%s%I$b$7$/$O(B `%emacs' $B$K$h$C$F(B XEmacs $B$r(B +$B:F3+$G$-$^$9!#(B - C-x C-f $B%U%!%$%k$NJT=8!J(BFind$B!K(B - C-x C-s $B%U%!%$%k$NJ]B8!J(BSave$B!K(B - C-x C-b $B%P%C%U%!%j%9%H$NI=<((B - C-x C-c $B%(%G%#%?$r=*N;$9$k!#%U%!%$%k$NJ]B8$O!"<+F0E*$K$O9T$o$l$^$;(B - $B$s!#$7$+$7!"$b$7%U%!%$%k$,JQ99$5$l$F$$$l$P!"%U%!%$%k$NJ]B8(B - $B$r$9$k$N$+$I$&$+$rJ9$$$F$-$^$9!#J]B8$7$F=*N;$9$kIaDL$NJ}K!(B - $B$O!"(BC-x C-s C-x C-c $B$H$9$k$3$H$G$9!#(B +$B!VCfCG!W5!G=$r$N%W%m%0%i%`$rAv$i$;$F$+$i$^$?(B XEmacs $B$KLa$k$3$H$,$G$-(B +$B$k$h$&$K$7$^$9!#$3$N>l9gK\Ev$K(B XEmacs $B$+$iH4$1=P$k$o$1$G$O$"$j$^$;$s$N(B +$B$G!"%7%'%k%3%^%s%I$N(B `exit' $B$,$=$N%5%V%7%'%k$+$i(B XEmacs $B$KLa$kIaDL$N$d(B +$B$jJ}$G$9!#(B - $BL>A0$K$h$k3HD%%3%^%s%I$K$O!"$"$^$j;H$o$l$J$$$b$N$d!"FCDj$N%b!<%I$G$7$+(B -$B;H$o$J$$$b$N$J$I$,$"$j$^$9!#Nc$H$7$F!"(B"command-apropos" $B$r$H$j$"$2$^$9!#$3(B -$B$N%3%^%s%I$O%-!<%o!<%I$rF~NO$5$;!"$=$l$K%^%C%A$9$kA4$F$N%3%^%s%I$NL>A0$rI=(B -$B<($7$^$9!#(BESC x $B$H%?%$%W$9$k$H!"%9%/%j!<%s$N2<$K(B "M-x" $B$,I=<($5$l$^$9!#$3$l(B -$B$KBP$7$F!"A0!J:#$N>l9g!"(B"command-apropos"$B!K$rF~NO$7$^$9!#(B -"command-a" $B$^$GF~NO$7$?8e%9%Z!<%9$rF~$l$l$P!"8e$NItJ,$O<+F0E*$KJd$o$l$^$9!#(B -$B$3$N8e!"%-!<%o!<%I$rJ9$+$l$^$9$+$i!"CN$j$?$$J8;zNs$r%?%$%W$7$^$9!#$J$*!"%-!<(B -$B%o!<%I$rF~$l$J$$$H!"A4$F$N%3%^%s%I$,I=<($5$l$^$9!#(B +C-x C-c $B$O%m%0%"%&%H$7$h$&$H;W$&;~$K;H$&$b$N$G$9!#%a!<%k%D!<%k!J(Bmail +$B%3%^%s%IEy!K$d$=$NB>$NMM!9$J%"%W%j%1!<%7%g%s%W%m%0%i%`$,5/F0$7$?(B +XEmacs $B$+$iH4$1=P$k>l9g$K;H$&$N$b@5$7$$;H$$J}$G$9!#$3$l$i$N%W%m%0%i%`(B +$B$O(B XEmacs $B$NCfCG$K$I$&BP=h$7$FNI$$$+CN$i$J$$$G$7$g$&$+$i!#$7$+$7$J$,$i!"(B +$BIaDL$N>l9g$O!"%m%0%"%&%H$7$h$&$7$J$$8B$j$O(B XEmacs $B$r=*N;$5$;$k$h$j$O(B +C-z $B$GCfCG$5$;$kJ}$,NI$$$G$7$g$&!#(B - >> ESC x $B$r%?%$%W$7!"B3$1$F!"(B"command-apropos" $B$"$k$$$O(B - "command-a" $B$H%?%$%W$7$^$9!#" - $B$H%?%$%W$7$^$9!#(B - - $B8=$l$?!V%&%#%s%I%&!W$r>C$9$K$O!"(BC-x 1 $B$H%?%$%W$7$^$9!#(B +C-x $B%3%^%s%I$O$?$/$5$s$"$j$^$9!#$3$l$^$G$K!"0J2<$r3X$S$^$7$?!#(B -$B%b!<%I%i%$%s(B -============ - - $B$b$7$f$C$/$j$H%3%^%s%I$rBG$C$?$J$i$P!"2hLL$N2l=j$KBG$C$?$b$N$,I=<($5$l$^$9!#%(%3!<%(%j%"$O2hLL$N(B1$B$P$s2<$N9T$G$9!#$=$N(B -$B$9$0>e$N9T$O!"%b!<%I%i%$%s$H8F$P$l$F$$$^$9!#%b!<%I%i%$%s$O$3$s$JIw$KI=<($5(B -$B$l$F$$$k$G$7$g$&!#(B + C-x C-f $B%U%!%$%k$r3+$/!J(BFind$B!K(B + C-x C-s $B%U%!%$%k$N%;!<%V!J(BSave$B!K(B + C-x C-b $B%P%C%U%!$N%j%9%H%"%C%W(B + C-x C-c XEmacs $B$r=*N;(B + C-x u $BC$7(B - [--]J:--**-Mule: MULE.tut (Fundamental) ---NN%-------------- - +$BL>A0$K$h$k3HD%%3%^%s%I$K$O!"$"$^$j;H$o$J$$$b$N$d!"FCDj$N%b!<%I$G$7$+;H(B +$B$o$J$$$b$N$,$"$j$^$9!#$?$H$($P(B replace-string $B$G$9$,!"$3$l$OJ8;zNs$rCV(B +$B49$9$k$b$N$G$9!#(BM-x $B$r%?%$%W$9$k$H!"(BXEmacs $B$O2hLL$N:G2<9T$K(B M-x $B$HI=<((B +$B$7F~NO$rB%$9$N$G!"$=$3$K%3%^%s%I$NL>A0!J$3$N>l9g(B "replace-string"$B!K$r(B +$BF~$l$J$1$l$P$J$j$^$;$s!#(B"repl s" $B$H$@$1%?%$%W$9$k$H(B XEmacs $B$,%3%^(B +$B%s%IL>$rJd40$7$F$/$l$^$9!#%3%^%s%IL>$rF~$l$?$i(B $B$rBG$C$F2<$5$$!#(B -$BCm0U(B: NN%$B$N(BNN$B$O?t;z$,F~$C$F$$$^$9!#$"$J$?$,;H$C$F$$$k(BEmacs$B$N%b!<(B - $B%I%i%$%s$H0c$&$+$bCN$l$J$$$1$I!"92$F$J$$$h$&$K!#Nc$($P!";~4V(B - $B$d(Buptime$B$,I=<($5$l$F$$$k$N$O!"(Bdisplay-time$B$H$$$&5!G=$,F0$$$F(B - $B$$$k$+$i$G$9!#(B - - $B$3$N9T$K$h$C$FB?$/$NM-MQ$J>pJs$,F@$i$l$^$9!#(B +"Replace string" $B%3%^%s%I$K$O0z?t$,Fs$DI,MW$G$9!#$I$NJ8;zNs$r$I$&CV49(B +$B$9$k$+$G$9!#3F0z?t$rF~NO$9$k$?$S$K(B $B$rBG$C$F2<$5$$!#(B - $B:#!"$"$J$?$,8+$F$$$k%U%!%$%kL>$rI=<($7$F$$$^$9!#(BNN%$B$O8=:_%9%/%j!<%s>e(B -$B$K%U%!%$%k$N0lHV>e$+$i2?%Q!<%;%s%HL\$,I=<($5$l$F$$$k$+$r<($7$F$$$^$9!#%U%!(B -$B%$%k$N0lHV:G=i$rI=<($7$F$$$k$J$i$P!"(B--Top--$B$HI=<($5$l$F$^$9!#%U%!%$%k$N0lHV(B -$B:G8e$rI=<($7$F$$$k$J$i$P!"(B--Bot--$B$HI=<($5$l$^$9!#2hLL$NCf$K%U%!%$%k$NA4$F$,(B -$BI=<($5$l$F$$$k$J$i$P!"(B--All--$B$HI=<($5$l$^$9!#(B - - $B%b!<%I%i%$%s$N>.3g8L$NCf$O!":#$I$s$J%b!<%I$KF~$C$F$$$k$+$r<($7$F$$$^$9!#(B -$B8=:_$O!"%G%U%)%k%H$N(BFundamental$B$KF~$C$F$$$^$9!#$3$l$b%a%8%c!<%b!<%I$N0lNc$G(B -$B$9!#(B - - Emacs$B$O(BLisp mode$B$d(BText mode$B$N$h$&$J$3$H$J$k%W%m%0%i%`8@8l$d%F%-%9%H$K(B -$BBP$7$F%(%G%#%C%H$r9T$&$?$a$N4v$D$+$N%a%8%c!<%b!<%I$r;}$C$F$$$^$9!#$I$s$J;~(B -$B$G$bI,$:$$$:$l$+$N%a%8%c!<%b!<%I$N>uBV$K$J$C$F$$$^$9!#(B - - $B$=$l$>$l$N%a%8%c!<%b!<%I$O4v$D$+$N%3%^%s%I$rA4$/0c$&?6$kIq$$$K$7$F$7$^(B -$B$$$^$9!#Nc$r>e$2$F$_$^$7$g$&!#%W%m%0%i%`$NCf$K%3%a%s%H$r:n$k%3%^%s%I$,$"$j(B -$B$^$9!#%3%a%s%H$r$I$NMM$J7A<0$K$9$k$+$O!"3F%W%m%0%i%`8@8l$K$h$C$F0c$$$^$9$,!"(B -$B$=$l$>$l$N%a%8%c!<%b!<%I$O!"$-$A$s$HF~$l$F$/$l$^$9!#(B +>> $B%+!<%=%k$r$3$3$+$i#29T2<$N6u9T$K0\F0$5$;$F2<$5$$!#(B + M-x repl schangedAltered $B$H%?%$%W$7$^$7$g$&!#(B - $B$=$l$>$l$N%a%8%c!<%b!<%I$KF~$k$?$a$N%3%^%s%I$O%b!<%IL>$N3HD%$5$l$?$b$N(B -$B$K$J$C$F$$$^$9!#Nc$($P!"(BM-x fundamental-mode$B$O(BFundamental$B$KF~$k$?$a$N$b$N$G(B -$B$9!#(B - - $B$b$7!"1Q8l$r%(%G%#%C%H$9$k$J$i$P!"(BText mode$B$KF~$j$^$9!#(B - - >> M-x text-mode $B$H%?%$%W$7$J$5$$!#(B + $B$3$N9T$,$I$&JQ$o$k$+(B(changed)$B8+$^$7$g$&!#$"$J$?$O%+!<%=%k0J9_A4It$N(B + c-h-a-n-g-e-d $B$H$$$&8l$r(B "altered" $B$KJQ$($?$N$G$9!#(B - $B8=:_$N%a%8%c!<%b!<%I$K$D$$$F$N%I%-%e%a%s%H$r8+$?$$;~$O!"(BC-h m$B$H%?%$%W(B -$B$7$^$9!#(B - >> C-h m $B$r;H$C$F(BText mode$B$H(BFundamental mode$B$N0c$$$rD4$Y$J$5$$!#(B - - >> C-x 1$B$G%I%-%e%a%s%H$r2hLL$+$i>C$7$J$5$$!#(B - - $B:8C<$N(B '[--]' $B$O8=:_$N%-!\$7$$@bL@$O(B -$B!V$?$^$4!W$N%^%K%e%"%k$rD4$Y$F2<$5$$!#(B +$B!v<+F0%;!<%V(B +============ - $B$=$N$9$01&$K$O%3!<%IBN7O(B (coding-system) $B$K4X$9$k%U%i%0$N>uBV$,I=(B -$B<($5$l$F$$$^$9!#(BMule $B$O!"%U%!%$%kF~=PNO!"F~NO!"2hLL=PNO$K$D$$$F!"$=$l$>$lFH(B -$BN)$K%3!<%IBN7O$r;XDj$5$;$k$3$H$,=PMh$^$9$,!"DL>o$O%U%!%$%kMQ$N%3!<%IBN7O$N(B -$B%K!<%b%K%C%/$N$_I=<($7$F$$$^$9!#(B - - >> $B%b!<%I%i%$%s>e$K(B"J:","S:",$B$b$7$/$O(B "E:"$B$,I=<($5$l$F$$$k$+$I$&$+3N(B - $BG'$7$J$5$$!#(B - - $B:G=i$N0lJ8;z$,%3!<%IBN7O$N%K!<%b%K%C%/!"> C-x C-k t$B$r(B2$BEY9T$$$J$5$$!#(B +$B%U%!%$%k$KJQ99$r2C$($F$^$@%;!<%V$7$F$$$J$$>l9g!"$=$l$i$NJQ99$O7W;;5!$,(B +$B%/%i%C%7%e$9$k$H<:$o$l$F$7$^$&2DG=@-$,$"$j$^$9!#$=$&$$$&;vBV$rHr$1$k$?(B +$B$a!"JT=8Cf$N3F%U%!%$%k$K$D$$$F<+F0%;!<%V%U%!%$%k$,Dj4|E*$K=q$+$l$^$9!#(B +$B<+F0%;!<%V%U%!%$%k$OF,$H$*?,$K(B # $B$,IU$$$F$$$^$9!#Nc$($P(B "hello.c" $B$H$$(B +$B$&%U%!%$%k$N<+F0%;!<%V%U%!%$%k$O(B "#hello.c#" $B$G$9!#DL>o$NJ}K!$G%U%!%$(B +$B%k$r%;!<%V$7$?$H$-$K!"$=$&$$$&<+F0%;!<%V%U%!%$%k$O>C$5$l$^$9!#(B - $BF~NO%b!<%I$,(BJIS$B%3!<%I$N@_Dj$H$J$C$F$$$k;~!"$b$7$"$J$?$N;H$C$F$$$kC$B$b(BM-<$BJ8;z(B>$B$bF1$8F/$-$r$7$^$9!#:#$^$G$N@bL@$G(BESC -<$BJ8;z(B>$B$H9T$J$C$F$$$?$H$3$m$,!"(BM-<$BJ8;z(B>$B$H$J$j$^$9!#Cm0U$7$J$1$l$P$J$i$J$$$N(B -$B$O!"%7%U%H(BJIS$B$d(BEUC$B%3!<%I$N;~$O;HMQ$G$-$^$;$s!#(B - - $B%3!<%IBN7O$N$N@Z$jBX$($O!"3F!9$N%P%C%U%!$KBP$7$F$N$_M-8z$G$9!#$=$l$>$l(B -$B$N!"%3!<%IBN7O;XDj$K$D$$$F$O!"(BC-h a coding-system $B$G8+$k$3$H(B -$B$,=PMh$^$9!#(B +$B7W;;5!$,%/%i%C%7%e$7$?>l9g!"<+F0%;!<%V$5$l$?JT=8$r2sI|$5$;$k$3$H$,$G$-(B +$B$^$9!#IaDL$K%U%!%$%k!JJT=8$7$F$$$?$b$N$G!"<+F0%;!<%V%U%!%$%k$8$c$"$j$^(B +$B$;$s!K$r3+$-!"$=$l$+$i(B M-x recover file $B$H%?%$%W$9$k$N$G$9!#3N(B +$BG'$r5a$a$F$-$^$9$N$G!"(Byes $B$H%?%$%W$7<+F0%;!<%V$5$l$?%G!<%?$r2s(B +$BI|$7$^$9!#(B - >> C-h a coding-system $B$G=P$F$/$k%I%-%e%a%s%HCf$N!"(B - set-display-coding-system, set-file-coding-system, - set-process-coding-system $B$N@bL@$rFI$_$J$5$$!#(B -$B8!:w(B -===== +$B!v%(%3!<%(%j%"(B +============== - $BJ8;zNs$r!"%U%!%$%kFb$G!"A0J}Kt$O8eJ}$K!"C5$9;v$,$G$-$^$9!#8!:w$r;O$a$k(B -$B%3%^%s%I$O!"%+!<%=%k0LCV0J9_$r8!:w$9$k$J$i$P(B C-s$B!"%+!<%=%k0LCV0JA0$J$i$P(B -C-r $B$G$9!#(BC-s $B$r%?%$%W$9$k$H!"%(%3!<%(%j%"$K(B "I-search:"$B$H$$$&J8;zNs$,%W%m(B -$B%s%W%H$H$7$FI=<($5$l$^$9!#(BESC$B$r2!$9$H!"=*N;$G$-$^$9!#(B +$B$b$7$f$C$/$j$H%3%^%s%I$rBG$C$?$J$i$P!"2hLL$N2<$N%(%3!<%(%j%"$H8F$P$l(B +$B$k>l=j$KBG$C$?$b$N$,I=<($5$l$^$9!#%(%3!<%(%j%"$O2hLL$N:G2<9T$G$9!#(B - >> C-s$B$G8!:w$,;O$^$j$^$9!#$=$l$+$i!"$f$C$/$j$H#1J8;z$:$D(B"cursor"$B$H$$(B - $B$&C18l$rF~NO$7$^$9!##1J8;zF~NO$9$k$4$H$K!"%+!<%=%k$O!"$I$s$JF0$-(B - $B$r$7$^$9$+(B? +$B!v%b!<%I%i%$%s(B +============== + +$B%(%3!<%(%j%"$N$9$0>e$N9T$O!"%b!<%I%i%$%s$H8F$S$^$9!#%b!<%I%i%$%s$O$3$s$JIw$K8+$($k$G$7$g$&!#(B + +ISO7-----XEmacs: TUTORIAL.ja (Fundamental)--L670--58%---------------- + +$B$3$N9T$O(B XEmacs $B$N>uBV5Z$SJT=8Cf$NJ8>O$K$D$$$FM-1W$J>pJs$rM?$($F$/$l$^(B +$B$9!#(B - >> $B$b$EY(B C-s $B$r%?%$%W$9$k$H!"$K$D$$$F$O$b$&J,$C$F$$$^$9$M!#$=$l$O$"$J$?$,3+$$$?%U%!%$%k$G(B +$B$9!#(B-NN%-- $B$OJ8>OCf$N8=:_0LCV$r<($7$F$$$^$9!#J8>O$N(B NN% $B$,2hLL:G>eCJ$h(B +$B$jA0$K$"$k$H$$$&$3$H$G$9!#$b$7J8>O$N:G=i$N9T$,2hLL$K$"$k;~$K$O(B --00%-- +$B$NBe$j$K(B --Top-- $B$HI=<($7$^$9!#$b$7J8>O$N:G8e$N9T$,2hLL$K$"$k;~$K$O(B +--Bot-- $B$HI=<($7$^$9!#$b$72hLL$KA4It<}$^$C$F$7$^$&$h$&$JC;$$J8>O$r8+$F(B +$B$$$k$H$-$K$O(B --All-- $B$HI=<($7$^$9!#(B - >> $B$r#42sF~NO$7$F!"%+!<%=%k$NF0$-$r8+$J$5$$!#(B - - >> ESC$B$r2!$7$F!"=*N;$7$^$9!#(B +$B3g8L$K0O$^$l$?ItJ,$O$I$&$JJT=8%b!<%I$K$$$k$+$r<($7$^$9!#%G%U%)%k%H$O(B +"Fundamental" $B$H$$$&%b!<%I!"$3$l$,8=:_$N%b!<%I$G$9!#$3$l$O!V%a%8%c!<%b!<(B +$B%I!J(Bmajor mode$B!K!W$N0lNc$G$9!#(B - $BC5$7$?$$J8;zNs$r%?%$%WCf$G$b!"%?%$%W$7$?J8;zItJ,$@$1$G!"8!:w$r;O$a$^$9!#(B -$BO$rJT=8Cf$+$r0UL#$9$k$b(B +$B$N$b$"$j$^$9!#$$$D$G$bI,$:$$$:$l$+$N%a%8%c!<%b!<%I$N>uBV$K$J$C$F$$$^$9!#(B +$B$I$N%a%8%c!<%b!<%I$K$$$k$N$+$O!"%b!<%I%i%$%s$N8=:_$O(B "Fundamental" $B$H(B +$BI=<($7$F$$$kItJ,$r8+$l$PJ,$j$^$9!#(B - $B8!:w$B$rF~NO$9$k$H!"8!:wJ8;zNs$N#1HV8e$m$NJ8;z$,>C$($^$9!#(B -$B$=$7$F!"%+!<%=%k$O!"A02s$N0LCV$KLa$j$^$9!#$?$H$($P!"(B"cu"$B$H%?%$%W$7$F!":G=i(B -$B$N(B"cu"$B$N0LCV$K%+!<%=%k$,F0$$$?$H$7$^$9!#$3$3$G(B$B$rF~NO$9$k$H!"%5!<%A(B -$B%i%$%s$N(B'u'$B$,>C$(!"%+!<%=%k$O!"(B'u'$B$r%?%$%W$9$kA0$K!"%+!<%=%k$,$"$C$?(B'c'$B$N0L(B -$BCV$K!"0\F0$7$^$9!#(B +$B3F%a%8%c!<%b!<%I$O4v$D$+$N%3%^%s%I$K0[$J$k?6$kIq$$$r$5$;$^$9!#Nc$($P!"(B +$B%W%m%0%i%`%j%9%HCf$K%3%a%s%H$rF~$l$k$?$a$N%3%^%s%I$,$"$j$^$9!#%3%a%s%H(B +$B$N7A<0!J%7%s%?%C%/%9!K$O!"%W%m%0%i%`8@8l$K$h$C$F0[$J$j!"%a%8%c!<%b!<%I(B +$B$O!"$=$l$KBP1~$9$k8@8l$K9g$C$?7A<0$G%3%a%s%H$rA^F~$7$^$9!#3F%a%8%c!<%b!<(B +$B%I$O3HD%%3%^%s%I$NL>A0$K$J$C$F$$$^$9!#$D$^$j$=$N3HD%%3%^%s%I$r;H$C$F%a(B +$B%8%c!<%b!<%I$r@Z$j49$($k$N$G$9!#Nc$($P!"(BM-x fundamental-mode $B$H$$$&$N(B +$B$O(B Fundamental $B%b!<%I$K@Z$j49$($k$?$a$N%3%^%s%I$G$9!#(B - $B8!:wo$N1Q8l$dF|K\8l$NJ8>O!J$3$N%U%!%$%k$N$h$&$J!K$rJT=8$9$k$N$J$i(B +$B$P!"(BText mode $B$r;H$$$^$7$g$&!#(B + +>> M-x text-mode $B$H%?%$%W$7$F$_$F2<$5$$!#(B + +$B?4G[$7$J$$$G!#$3$l$^$G3X$s$@%3%^%s%I$O$?$$$7$FJQ$o$j$^$;$s$+$i!#$@$1$I!"(B +M-f $B$d(B M-b $B$,%"%]%9%H%m%U%#(B "'" $B$rC18l$N0lIt$@$H2r/$7$@$1$3$H$J$k$N$G$9!#(B -$B%j%+!<%7%V(B $B%(%G%#%F%#%s%0(B $B%l%Y%k(B +$B8=:_$N%a%8%c!<%b!<%I$K$D$$$F$N@bL@J8$r8+$k$K$O(B C-h m $B$H%?%$%W$7$^$9!#(B + +>> C-u C-v $B$r0lFsEY$d$C$F$3$N9T$r2hLL$N>e$NJ}$K;}$C$F$$$-$^$7$g$&!#(B +>> C-h m $B$H%?%$%W$7!"(BText mode $B$H(B Fundamental mode $B$N0c$$$r$_$^$7$g$&!#(B +>> q $B$G(B Text mode $B$N@bL@J8$r2hLL$+$i>C$7$^$7$g$&!#(B - $B$H$-$I$-!"!JITK\0U$K!K%j%+!<%7%V(B $B%(%G%#%F%#%s%0(B $B%l%Y%k$H8F$P$l$k>uBV$K(B -$BF~$k$3$H$,$"$j$^$9!#%a%8%c!<%b!<%I$N>.3g8L(B'()'$B$N2s$j$rCf3g8L(B'[]'$B$G0O$s$@$b(B -$B$N$,%b!<%I%i%$%s>e$KI=<($5$l$^$9!#Nc$($P!"(B(Fundamental)$B$HI=<($5$l$kBe$o$j$K(B -[(Fundamental)]$B$N$h$&$K$J$j$^$9!#(B +$B%a%8%c!<%b!<%I$,!V%a%8%c!$N%^%$%J!<(B +$B%b!<%I$K1F6A$rM?$($:$K!"$=$l$@$1$r%*%s%*%U$G$-$^$9!#$D$^$j!"%^%$%J!<%b!<(B +$B%I$rA4$/;H$o$J$+$C$?$j!"0l8D$@$1;H$C$?$j!"$$$/$D$+$rF1;~$K;H$C$?$j$G$-(B +$B$k$N$G$9!#(B -$BCm0U(B: $B$3$3$G$O%j%+!<%7%V(B $B%(%G%#%F%#%s%0(B $B%l%Y%k<+BN$K$D$$$F$O@bL@$7(B - $B$^$;$s!#(B +$BDL>o$NJ8>O$rJT=8$7$F$$$k;~$K$H$F$bJXMx$J%^%$%J!<%b!<%I$N0l$D$K%*!<%H%U%#(B +$B%k!J(BAuto Fill$B!K%b!<%I$H$$$&$N$,$"$j$^$9!#$3$N%b!<%I$,%*%s$N;~$KJ8>O$r(B +$BF~NO$7$F$$$C$F9T$rD9$/$7$9$.$?>l9g!"<+F0E*$KC18l$HC18l$N4V$G9T$,J,3d$5(B +$B$l$^$9!JF|K\8l$N>l9g$O$I$NJ8;z$N4V$G$b!K!#(B - $B%j%+!<%7%V(B $B%(%G%#%F%#%s%0(B $B%l%Y%k$+$iH4$1$G$k$?$a$K$O!"(BM-x top-level -$B$H%?%$%W$7$^$9!#(B +Auto Fill $B%b!<%I$O(B M-x auto-fill-mode $B$H$d$l$P%*%s$K$G$-$^$9!#(B +$B$=$l$,%*%s$N>uBV$G(B M-x auto-fill-mode $B$H$d$l$,%*%U$K$G$-$^$9!#(B +$B$3$N%3%^%s%I$O!"%b!<%I$,%*%U$J$i%*%s$K!"%*%s$J$i%*%U$K$9$k$N$G$9!#$3$&(B +$B$$$&$N$r!V%b!<%I$r%H%0%k$9$k!W$H8@$$$^$9!#(B - >> $B;n$7$F$_$F2<$5$$!#%9%/%j!<%s$NDl$K(B"Back to top level"$B$HI=<($5$l$^(B - $B$9!#(B +>> M-x auto-fill-mode $B$H%?%$%W$7$F!"(B "asdf " $B$G;O$^$k9T$rF~NO(B + $B$7$F2<$5$$!#9T$,J,3d$5$l$k$^$G2?EY$b(B "asdf " $B$H%?%$%W$7$^$7$g$&!#%9(B + $B%Z!<%9$rK:$l$:$K!#(BAuto Fill $B$O%9%Z!<%9$,F~NO$5$l$?;~$N$_F/$-$^$9!#(B + +$B1&%^!<%8%s$ODL>o(B 70 $BJ8;z!J%+%i%`!K$G$9$,!"(BC-x f $B%3%^%s%I$G$3$l$rJQ99$9(B +$B$k$3$H$,$G$-$^$9!#;XDj$NJ8;z?t$r?tCM0z?t$H$7$FM?$($^$9!#(B - $BK\Ev$O!"$3$N;n$_$,9T$o$l$?;~$O!"$9$G$K%H%C%W%l%Y%k$K$$$?$N$G$9!#(BM-x -top-level$B$O!"2?$b1F6A$rM?$($F$$$^$;$s!#(B +>> $B?tCM0z?t(B 20 $B$G(B C-x f $B$r$d$j$^$7$g$&!#(B (C-u 2 0 C-x f)$B!#(B + $B$=$l$+$iE,Ev$JJ8>O!J1Q8l!K$rF~NO$7!"(B20 $BJ8;z$G9T$,J,3d$5$l$k$N$r8+$F(B + $B$_$^$7$g$&!#$=$l$+$i(B C-x f $B%3%^%s%I$G$^$?%^!<%8%s$r(B 70 $BJ8;z$KLa$7$F(B + $B2<$5$$!#(B - $B%j%+!<%7%V(B $B%(%G%#%F%#%s%0(B $B%l%Y%k$+$iH4$1=P$k$N$KBP$7$F$O(BC-g$B$O8z$-$^$;(B -$B$s!#(B +$B%Q%i%0%i%U$NESCf$rJQ99$7$F$b(B Auto Fill $B%b!<%I$O$=$l$r<+F0E*$K%U%#%k$7(B +$BD>$7$O$7$^$;$s!#(B +$B%Q%i%0%i%U$r%U%#%k$7D>$9$K$O%+!<%=%k$r$=$N%Q%i%0%i%U$NCf$KCV$$$F$+$i(B +M-q $B$r%?%$%W$7$^$9!#(B +>> $B%+!<%=%k$r$3$N9TD>A0$N%Q%i%0%i%U$K0\F0$5$;(B M-q $B$H%?%$%W$7$F2<$5$$!#(B -$B%X%k%W(B +$B!v8!:w(B ====== - Emacs$B$K$O!"$?$/$5$s$NLr$KN)$D5!G=$,$"$j!"$3$3$G!"$9$Y$F$r@bL@$9$k$3$H(B -$B$O!"IT2DG=$G$9!#$7$+$7!"$^$@CN$i$J$$B?$/$N5!G=$r3X$V$?$a$K$O!"(B$B$H8F$P(B -$B$l$k(B C-h $B$r%?%$%W$9$k$3$H$G!"$?$/$5$s$N>pJs$rOCf$NFCDj$NJ8;zNs$r!"A08~$-$K$b8e8~$-$K$bC5$9;v$,$G$-$^$9!#J8;zNs$r(B +$BC5$9$H$$$&$N$O%+!<%=%k0\F0%3%^%s%I$G$9!#$D$^$j!"l=j$^$G%+!<%=%k$r0\F0$5$;$k$N$G$9!#(B + +XEmacs $B$N8!:w%3%^%s%I$OB>$NBg35$N%(%G%#%?$N8!:w%3%^%s%I$H$O0[$j!V%$%s(B +$B%/%j%a%s%?%k!W$G$9!#8!:w$9$kJ8;zNs$r%?%$%W$7$F$$$k$=$P$+$i8!:w$,5/$k$N(B +$B$G$9!#(B + +$B8!:w$r;O$a$k$?$a$N%3%^%s%I$O!"A08~$-$K8!:w$9$k$J$i$P(B C-s$B!"8e8~$-$J$i(B +C-r $B$G$9!#$^$@$G$9!*!*:#$O$^$@;n$5$J$$$G2<$5$$!#(B - $B;H$$J}$O!"(BC-h $B$r%?%$%W$7!"B3$$$FI,MW$J%*%W%7%g%s$r#1J8;z%?%$%W$7$^$9!#(B -$B$o$+$i$J$1$l$P!"(BC-h ? $B$H%?%$%W$9$k$H!"$I$s$J%*%W%7%g%s$,$"$k$N$+I=<($5$l$^(B -$B$9!#$b$7!"(BC-h $B$r%?%$%W$7$F$+$i5$$,JQ$o$C$?$i!"(BC-g $B$r%?%$%W$9$l$P!"C$9(B -$B$3$H$,$G$-$^$9!#(B +C-s $B$rBG$D$H(B "I-search" $B$H$$$&J8;zNs$,%(%3!<%(%j%"$KI=<($5$l$k$N$,8+$((B +$B$k$G$7$g$&!#$3$l$O(B XEmacs $B$,%$%s%/%j%a%s%?%k8!:w$H$$$&>uBV$K$$$F!"$"$J(B +$B$?$,C5$7$?$$J8;zNs$rF~NO$9$k$N$rBT$C$F$$$k$N$G$9!#(B $B$rBG$F$P8!(B +$B:w$r=*$o$l$^$9!#(B + +>> $B$5$F(B C-s $B$H%?%$%W$7$F8!:w$r;O$a$^$7$g$&!#$f$C$/$j$H#1J8;z$:$D(B + "cursor" $B$H$$$&C18l$rF~NO$7$^$9!##1J8;zBG$DKh$K%+!<%=%k$,$I$&F0$/$+(B + $B8+$^$7$g$&!#(B + $B$5$"!"(B"cursor" $B$,#12s8+$D$+$j$^$7$?!#(B +>> $B$b$&0lEY(B C-s $B$HBG$C$F> $B:#EY$O(B $B$r#42sBG$C$F!"%+!<%=%k$NF0$-$r8+$F2<$5$$!#(B +>> $B$HBG$C$F8!:w$r=*N;$7$^$7$g$&!#(B - $B:G$b4pK\E*$J$b$N$O!"(BC-h c $B$G$9!#$3$l$KB3$$$F%-!<$rF~NO$9$k$H!"$=$N%3%^(B -$B%s%I$K$D$$$F$NC;$$@bL@$rI=<($7$^$9!#(B +$B2?$,5/$C$?$+J,$j$^$9$+!)%$%s%/%j%a%s%?%k8!:w$G$O!"JXMx$J$?$a$K%O%$%i%$(B +$B%H$r$7!"$"$J$?$,$=$l$^$G$KBG$C$?J8;zNs$,8=$l$k$H$3$m$K9T$3$&$H$7$^$9!#(B +$B> C-h c C-p $B$H%?%$%W$7$F$_$J$5$$!#(B"C-p runs the command previous- - line"$B$N$h$&$J%a%C%;!<%8$,I=<($5$l$k$O$:$G$9!#(B +$BCm0U!'%7%9%F%`$K$h$C$F$O(B C-s $B$H%?%$%W$9$k$H2hLL$,F0$+$J$/$J$j(B XEmacs +$B$,I=<($7$h$&$H$9$k$b$N$,2?$b2hLL$K=P$J$/$J$j$^$9!#$3$l$O!"%U%m!<%3%s%H(B +$B%m!<%k$H8F$P$l$k#O#S$N5!G=$,(B C-s $B$rB*$(!"(BXEmacs $B$KEO$5$J$$$h$&$K$7$F$$(B +$B$k$N$G$9!#$3$l$r2r=|$9$k$K$O(B C-q $B$r%?%$%W$7$^$9!#$=$l$+$i(B XEmacs $B%^%K%e(B +$B%"%k$N(B "Spontaneous Entry to Incremental Search ($BCN$i$L4V$K%$%s%/%j%a(B +$B%s%?%k%5!<%A$K$J$k(B)" $B$N@a$rFI$s$G$/$@$5$$!#$3$N$d$C$+$$$J#O#S$N5!G=$K(B +$B$I$&BP=h$9$l$PNI$$$+$,:\$C$F$$$^$9!#(B - $B8+$?$3$H$O$"$k$,!"3P$($F$O$$$J$$%3%^%s%I$b;W$$=P$;$k$N$G$9!#(BC-x C-s $B$N(B -$B$h$&$JJ#?t$G#1$D$N%3%^%s%I$b(BC-h c $B$N8e$m$KB3$1$i$l$^$9!#(B +$B%$%s%/%j%a%s%?%k8!:w$NESCf$G(B $B$rBG$D$H8!:wJ8;zNsCf$N#1HV8e$m$N(B +$BJ8;z$,>C$($^$9!#$=$7$F!"%+!<%=%k$O!"A02s$N0LCV$KLa$j$^$9!#$?$H$($P!"(B +"c" $B$H%?%$%W$7$F:G=i$N(B "c" $B$rC5$7$^$9!#$=$l$+$i(B "u" $B$rBG$D$H:G=i$N(B +"cu" $B$N>l=j$K%+!<%=%k$,F0$-$^$9!#$=$3$G(B $B$rBG$D$H(B "u" $B$r8!:wJ8(B +$B;zNs$+$i>C$7$F!"%+!<%9%k$O:G=i$K(B "c" $B$,8=$l$?>l=j$KLa$j$^$9!#(B + - $B$b$C$H>\$7$/CN$j$?$+$C$?$i!"(Bc $B$NBe$o$j$K(B k $B$r;XDj$7$^$9!#(B +C-s $B$O!"8=:_$N%+!<%=%k0LCV0J9_$K=P$F$/$k8!:wJ8;zNs$rC5$7;O$a$^$9!#$b$7!"(B +$BJ8>O$NA0$NJ}$rC5$7$?$+$C$?$i!"(BC-r $B$r%?%$%W$7$^$9!#$3$l$^$G$N(B C-s $B$K$D(B +$B$$$F$N@bL@$O$9$Y$F(B C-r $B$K$bEv$F$O$^$j$^$9!#8!:w$NJ}8~$,H?BP$J$@$1$G$9!#(B - >> C-h k C-p $B$H%?%$%W$7$F$_$J$5$$!#(B +$B!vJ#?t$N%&%#%s%I%&(B +================== + +XEmacs $B$NAGE($J5!G=$N0l$D$H$7$F!"0l$D$N2hLL$KF1;~$K$$$/$D$b$N%&%#%s%I(B +$B%&$rI=<($9$k$3$H$,$G$-$^$9!#(B + +>> $B%+!<%=%k$r$3$N9T$K;}$C$F$-$F(B C-u 0 C-l $B$H%?%$%W$7$F2<$5$$!#(B - Emacs$B$N%&%#%s%I%&$K!"%3%^%s%I$NL>A0$H5!G=$,I=<($5$l$^$9!#FI$_=*$($?$i!"(B -C-x 1 $B$H%?%$%W$9$k$H!"H4$1$i$l$^$9!#(B +>> $B$=$l$+$i(B C-x 2 $B$H%?%$%W$72hLL$r#2$D$N%&%#%s%I%&$KJ,3d$7$^$7$g$&!#(B + $B$I$A$i$N%&%#%s%I%&$b$3$NF~Lg%,%$%I$rI=<($7$F$$$^$9!#%+!<%=%k$O>e$N(B + $B%&%#%s%I%&$K$"$j$^$9!#(B + +>> C-M-v $B$H%?%$%W$72<$N%&%#%s%I%&$r%9%/%m!<%k$5$;$^$7$g$&!#(B + $B!J%a%?%-!<$,$J$$>l9g$O(B ESC C-v $B$H%?%$%W$7$^$9!#!K(B - $BB>$K$bLr$KN)$D%*%W%7%g%s$,$"$j$^$9!#(B +>> C-x o $B!J(B"o" $B$O(B "other$B!JB>J}!K(B" $B$r0UL#$7$^$9!K$r%?%$%W$72<$N%&%#%s%I(B + $B%&$K%+!<%=%k$r0\$7$F2<$5$$!#(B +>> $B2<$N%&%#%s%I%&$G(B C-v $B$d(B M-v $B$r;H$C$F%9%/%m!<%k$5$;$^$7$g$&!#(B + $B$3$3$K=q$$$F$"$k;X<($O>e$N%&%#%s%I%&$GFI$_?J$s$G$/$@$5$$!#(B + +>> $B$b$&0lEY(B C-x o $B$H%?%$%W$7!"%+!<%=%k$r>e$N%&%#%s%I%&$KLa$7$^$9!#(B + $B%+!<%=%k$O>e$N%&%#%s%I%&$N85$"$C$?0LCV$KLa$j$^$9!#(B - C-h f $B%U%!%s%/%7%g%sL>$rF~NO$9$k$H!"%U%!%s%/%7%g%s$rI=<($7$^$9!#(B +C-x o $B$r;H$C$F%&%#%s%I%&4V$r9T$C$?$jMh$?$j$G$-$^$9!#3F%&%#%s%I%&$O$=$l(B +$B<+?H$N%+!<%=%k0LCV$rJ];}$7$F$$$^$9$,!"0lEY$K$O0l$D$N%&%#%s%I%&$@$1$,%+!<(B +$B%=%k$rI=<($7$^$9!#DL>o$NJT=8%3%^%s%I$O3'%+!<%=%k$,$"$k%&%#%s%I%&$KBP$7(B +$B$FF/$-$^$9!#$=$N%&%#%s%I%&$r(B "selected window ($BA*BrCf$N%&%#%s%I%&(B)" $B$H(B +$B8F$S$^$9!#(B - >> C-h f previous-line $B$r%?%$%W$7!"(B $B$r2!$7$J$5$$!#(BC-p $B%3%^%s(B - $B%I$rpJs$rI=<($7$^$9!#(B +C-M-v $B%3%^%s%I$O!"0l$D$N%&%#%s%I%&$GJ8>O$rJT=8Cf$KB>$N%&%#%s%I%&$r;2>H(B +$B$7$F$$$k;~$KLrN)$A$^$9!#JT=8Cf$N>l=j$K%+!<%=%k$rJ]$C$?$^$^!"(BC-M-v $B$GB>(B +$B$N%&%#%s%I%&$rFI$_?J$a$F9T$/$3$H$,$G$-$^$9!#(B + +C-M-v $B$O%3%s%H%m!<%k%a%?J8;z$N0lNc$G$9!#%a%?%-!<$,$"$k>l9g$O!"%3%s%H%m!<(B +$B%k%-!<$H%a%?%-!<$r2!$7$J$,$i(B v $B$r%?%$%W$7$^$9!#%3%s%H%m!<%k%-!<$H%a%?(B +$B%-!<$O$I$A$i$r@h$K2!$7$F$b9=$$$^$;$s!#$I$A$i$b$=$N8e$K%?%$%W$5$l$kJ8;z(B +$B$KBP$9$k=$>~%-!<(B (modifier key) $B$H$7$FF/$/$+$i$G$9!#(B - C-h a $B%-!<%o!<%I$rF~NO$9$k$H!"L>A0$K$=$N%-!<%o!<%I$r4^$`!"A4$F$N%3(B - $B%^%s%I$rI=<($7$^$9!#$3$l$i$N%3%^%s%I$O$9$Y$F(BESC x $B$Gl9g!"(BESC $B%-!<$r;H$$$^$9$,!"$3$N>l9g=gHV$,Bg;v$G$9!#$^$:(B +ESC $B$r2!$7$F$+$iN%$7$F(B CTRL-v $B$rBG$A$^$9!#(BCTRL-ESC v $B$G$OBLL\$G$9!#$3(B +$B$l$O(BESC $B$O$=$l<+BN$,0l$D$NJ8;z$G=$>~%-!<$G$O$J$$$+$i$G$9!#(B + +>> $B>e$N%&%#%s%I%&$G(B C-x 1 $B$H%?%$%W$72<$N%&%#%s%I%&$r>C$7$^$7$g$&(B + +$B!J$b$72<$N%&%#%s%I%&$G(B C-x 1 $B$H%?%$%W$9$k$H>e$N%&%#%s%I%&$,>C$($^$9!#(B +$B$3$N%3%^%s%I$O!V8=:_<+J,$,$$$k%&%#%s%I%&$@$1$K$7$J$5$$!W$H$$$&$b$N$@$H(B +$B;W$C$F2<$5$$!#!K(B + +$BF1$8%P%C%U%!$rN>J}$N%&%#%s%I%&$KI=<($9$kI,MW$O$"$j$^$;$s!#0lJ}$N%&%#%s(B +$B%I%&$G(B C-x C-f $B$G%U%!%$%k$r3+$$$F$bB>J}$N%&%#%s%I%&$OJQ2=$7$^$;$s!#3F(B +$B%&%#%s%I%&$K$*$$$FJL!9$N%U%!%$%k$r3+$/$3$H$,$G$-$k$N$G$9!#(B - >> C-h a file $B$H%?%$%W$7!"(B$B$r2!$7$J$5$$!#L>A0$K(B"file"$B$H$$$&J8(B - $B;z$r;}$DA4$F$N%3%^%s%I$rI=<($7$^$9!#$^$?!"(Bfind-file $B$d(B write-file - $B$H$$$&L>$N(B C-x C-f $B$d(B C-x C-w $B$N$h$&$J%3%^%s%I$bI=<($5$l$^$9!#(B +>> C-x 4 C-f $B$H%?%$%W$7B3$1$F2?$+<+J,$N%U%!%$%kL>$rF~NO$7$F2<$5$$!#(B + $B$GF~NO$r=*$o$i$;$F2<$5$$!#:#;XDj$7$?%U%!%$%k$,2<$N%&%#%s%I(B + $B%&$K8=$l$^$9!#%+!<%=%k$b$=$C$A$K0\$j$^$9!#(B + +>> C-x o $B$H%?%$%W$7>e$N%&%#%s%I%&$KLa$C$F2<$5$$!#$=$l$+$i(B C-x 1 $B$G2<$N(B + $B%&%#%s%I%&$r>C$7$^$7$g$&!#(B + -$B$*$o$j$K(B -======== +$B!v:F5"JT=8%l%Y%k(B (RECURSIVE EDITING LEVELS) -$BK:$l$:$K!'(B $B=*N;$9$k$K$O!"(BC-x C-c $B$H$7$^$9!#(B +$B;~!9!JITK\0U$K!K:F5"JT=8%l%Y%k$H8F$P$l$k>uBV$KF~$k$3$H$,$"$j$^$9!#%b!<(B +$B%I%i%$%s$N%a%8%c!<%b!<%IL>$r0O$`4]3g8L(B "()" $B$,$5$i$Knl3g8L(B "[]" $B$G0O$^(B +$B$l$^$9!#Nc$($P!"(B(Fundamental) $B$HI=<($5$l$kBe$o$j$K(B [(Fundamental)] $B$N(B +$B$h$&$K$J$j$^$9!#(B + +$B:F5"JT=8%l%Y%k$+$iH4$1=P$9$K$O(B ESC ESC ESC $B$H%?%$%W$7$^$9!#$3$l$OHFMQ(B +$B!VH4$1=P$7!W%3%^%s%I$G$9!#M>J,$J%&%#%s%I%&$r>C$7$?$j!"%_%K%P%C%U%!$+$i(B +$BH4$1$?$j$9$k$N$K$b;H$($^$9!#(B - $B$3$NF~LgJT$O!"$^$C$?$/$N=i?4> M-x $B$H%?%$%W$7%_%K%P%C%U%!$KF~$C$F2<$5$$!#$=$l$+$i(B ESC ESC ESC $B$H%?(B + $B%$%W$7H4$1=P$7$F$_$^$7$g$&!#(B - $B$b$7!"(BEMACS $B$r2?F|$+$G$b;H$C$F$_$l$P!"$=$l$r$d$a$F$7$^$&$3$H$J$I$G$-$J(B -$B$/$J$k$G$7$g$&!#:G=i$O8MOG$&$+$bCN$l$^$;$s!#$7$+$7!"$=$l$O$I$s$J%(%G%#%?$G(B -$B$bF1MM$G$9!#(BEMACS $B$N$h$&$K!"Hs>o$KB?$/$N$3$H$,$G$-$k>l9g$K$OFC$K$=$&$G$7$g(B -$B$&!#$=$7$F!"(BEMACS $B$G$O!"C$9$N$K;H$o$l$F$$$k$+$i$G$9!#(B -$BpJs$rDs6!$7$?$D$b$j$G(B +$B$9!#(BXEmacs $B$K$O$"$^$j$K$bB?$/$N5!G=$,$"$k$N$G!"$3$3$G$9$Y$F$r@bL@$9$k(B +$B$N$OL5M}$G$9!#$=$l$G$bLr$KN)$D5!G=$r$b$C$HB?$/3X$S$?$$$H;W$&?M$N$?$a$K(B +$B$O!"(BXEmacs $B$N%3%^%s%I$N@bL@$rFI$`$?$a$N%3%^%s%I$,$"$j$^$9!#$3$l$i$N(B +$B!V%X%k%W!W%3%^%s%I$O3'(B Control-h $BJ8;z!J%X%k%WJ8;z$H8F$S$^$9!K$G;O$^$j(B +$B$^$9!#(B + +$B%X%k%W5!G=$r;H$&$K$O!"(BC-h $B$KB3$$$F$I$s$Jl9g$O(B C-h ? $B$H%?%$%W$7$^$7$g$&!#(B +$B$I$s$JC$9$3$H$,$G$-$^$9!#(B + +$B!J%5%$%H$K$h$C$F$O(B C-h $BJ8;z$r:FB+G{$7$^$9!#Am3gE*$Jl9g$O%7%9%F%`4IM}> C-h c Control-p $B$H%?%$%W$7$F$_$^$7$g$&!#(B + $B0J2<$N$h$&$J%a%C%;!<%8$,I=<($5$l$k$O$:$G$9!#(B + + C-p runs the command previous-line - Jonathan Payne $B$K$h$k(B "JOVE Tutorial" (19 January 86) $B$rJQ99$7$?$b$N$G(B - $B$"$j!"$=$l$O$b$H$b$H$O!"(BCCA-UNIX$B$N(BSteve Zimmerman $B$K$h$C$FJQ99$5$l$?!"(B - MIT $B$N(B "Teach-Emacs" $BF~LgJT(B (31 October 85) $B$r!J$5$i$K!KJQ99$7$?$b$N$G(B - $B$7$?!#(B +$B$3$l$O!V%U%!%s%/%7%g%s$NL>A0!W$rI=<($7$?$N$G$9!#%U%!%s%/%7%g%sL>$O$O$=$N%3%^%s%I$,2?$r$9$k$b$N$J$N$+$,J,$k$h$&$KIU$1$i$l$^$9(B +$B$N$G!"4JC1$J@bL@$H$7$F$b$=$N$^$^Lr$KN)$A$^$9!#0lEY3X$s$@%3%^%s%I$K$D$$(B +$B$F;W$$=P$9$K$O==J,$G$9!#(B + +C-x C-s $B$d!J%a%?%-!<$d%"%k%H%-!<$,$J$$>l9g$N!K(B v $B$J$I$NJ#?tJ8;z(B +$B$N%3%^%s%I$r(B C-h c $B$N8e$K%?%$%W$9$k$3$H$b$G$-$^$9!#(B + +$B%3%^%s%I$K$D$$$F$b$C$HB?$/$N>pJs$,M_$7$1$l$P(B C-h c $B$NBe$o$j$K(B C-h k $B$r(B +$B;H$$$^$9!#(B + +>> C-h k Control-p $B$H%?%$%W$7$F$_$^$7$g$&!#(B + +XEmacs$B$N%&%#%s%I%&$K!"%3%^%s%I$NL>A0$HF1;~$K$=$N5!G=$N@bL@$,I=<($5$l$^(B +$B$9!#FI$_=*$($?$i!"(Bq $B$H%?%$%W$7$F%X%k%W$N%F%-%9%H$r>C$7$^$7$g$&!#(B + +C-h $B$K$OB>$K$bLr$KN)$D%*%W%7%g%s$,$"$j$^$9!#(B - Update - February 1986 by Dana Hoggatt. + C-h f $B%U%!%s%/%7%g%s$N@bL@!#%U%!%s%/%7%g%sL>$rF~NO$7$^$9!#(B - Update - December 1986 by Kim Leburg. +>> C-h f previous-line $B$H%?%$%W$7$F$_$^$7$g$&!#(B + C-p $B%3%^%s%I$rpJs$rI=<($7(B + $B$^$9!#(B - Update/Translate - July 1987 by SANETO Takanori + C-h a $B%O%$%Q!<%"%W%m%]%9!#%-!<%o!<%I$rF~NO$9$k$H!"$=$N%-!<%o!<(B + $B%I$rL>A0$K4^$`A4$F$N4X?t$HJQ?t$r%j%9%H%"%C%W$7$^$9!#(B + Meta-x $B$G5/F0$G$-$k%3%^%s%I$K$O:8B&$K%"%9%?%j%9%/$,IU(B + $B$-$^$9!#(B + +>> C-h a newline $B$H%?%$%W$7$F$_$F2<$5$$!#(B -$BFCJL$JA0$N0lIt$K;}$DA4$F$N4X?t$HJQ?t$rI=<($7$^$9!#(B +$B4X?t$dJQ?t$r$h$j>\$7$/CN$k$?$a$K(B $B$+??Cf$N%^%&%9%\%?%s$r2!$7$F(B +$B$/$@$5$$!#(Bhyper-apropos $B$r=*N;$9$k$?$a$K$O(B `q' $B$rF~NO$7$^$9!#(B + + +$B!v$*$o$j$K(B ========== - $B:G=i$K$3$l$NF|K\8lLu$r:n$i$l$?!"(BSANETO Takanori$B$5$s!#$3$NJ8>O$O(BGMW + -Wnn + Nemacs$B$r;H$C$F=q$-$^$7$?!#$=$N$h$&$JAG@2$i$7$$%W%m%0%i%`$r:n$C$?J}!9(B -$B$X46M;R$5$s!"$I$&$b$"$j$,$H$&!#(B +$BK:$l$J$$$G!*(BXEmacs $B$r=*N;$9$k$K$O!"(BC-x C-c $B$G$9!#$^$?(B XEmacs $B$KLa$C$F(B +$BMh$i$l$k$h$&$K0l;~E*$K%7%'%k$KLa$k$@$1$J$i(B C-z $B$G$9!#!J(BX $B$G$O!"$3$l$O(B +$B8=:_$N(B XEmacs $B$N%U%l!<%`$r%"%$%3%s2=$7$^$9!#!K(B + +$B$3$NF~Lg%,%$%I$O!"$^$C$?$/$N=i?4 $B$,(BNemacs/Mule $BMQ(B +$B$KJQ99!"$5$i$K5HEDLP!"$NJ8@U$O!"0J2<$N$$(B +$B$^$9!#(B - $BNkLZM5?.(B hironobu@sra.co.jp +This tutorial descends from a long line of Emacs tutorials +starting with the one written by Stuart Cracraft for the original Emacs. +Ben Wing updated the tutorial for X Windows. Martin Buchholz and +Hrvoje Niksic added more corrections for XEmacs. +This version of the tutorial, like XEmacs, is copyrighted, and comes +with permission to distribute copies on certain conditions: + +Copyright (c) 1985, 1996 Free Software Foundation -Update/Add - December 1987 by Hironobu Suzuki -Update/Add - November 1989 by Ken'ichi Handa -Update/Add - January 1990 by Shigeki Yoshida -Update/Add - March 1992 by Kenichi HANDA + Permission is granted to anyone to make or distribute verbatim copies + of this document as received, in any medium, provided that the + copyright notice and permission notice are preserved, + and that the distributor grants the recipient permission + for further redistribution as permitted by this notice. + + Permission is granted to distribute modified versions + of this document, or of portions of it, + under the above conditions, provided also that they + carry prominent notices stating who last altered them. + +The conditions for copying XEmacs itself are more complex, but in the +same spirit. Please read the file COPYING and then do give copies of +XEmacs to your friends. Help stamp out software obstructionism +("ownership") by using, writing, and sharing free software! diff -r 72a7cfa4a488 -r abe6d1db359e etc/gnuserv.1 --- a/etc/gnuserv.1 Mon Aug 13 11:33:40 2007 +0200 +++ b/etc/gnuserv.1 Mon Aug 13 11:35:02 2007 +0200 @@ -24,7 +24,7 @@ which an XEmacs process is currently running. .PP \fIgnudoit\fP is a shell script frontend to ``gnuclient -batch -eval form''. -Its use is depreciated. Try to get used to calling gnuclient directly. +Its use is deprecated. Try to get used to calling gnuclient directly. .PP \fIgnuserv\fP is the server program that is set running by XEmacs to handle all incoming and outgoing requests. It is not usually invoked diff -r 72a7cfa4a488 -r abe6d1db359e etc/xemacs-fe.sh --- a/etc/xemacs-fe.sh Mon Aug 13 11:33:40 2007 +0200 +++ b/etc/xemacs-fe.sh Mon Aug 13 11:35:02 2007 +0200 @@ -109,7 +109,7 @@ # # The largish sed script prefixes all version numbers with a sort key. # That key is constructed by padding out any single or double digits to 3 -# digits from the version number, then converting all occurences of `.' to +# digits from the version number, then converting all occurrences of `.' to # `0', and prefixing and suffixing the entire result with an additional # zero. After sorting, the sort key is stripped from the output. # We do all this because `sort' cannot numerically sort decimal numbers and diff -r 72a7cfa4a488 -r abe6d1db359e etc/xemacs.1 --- a/etc/xemacs.1 Mon Aug 13 11:33:40 2007 +0200 +++ b/etc/xemacs.1 Mon Aug 13 11:35:02 2007 +0200 @@ -1,4 +1,4 @@ -.TH XEMACS 1 "1998 January 13" +.TH XEMACS 1 "2000-09-20" .UC 4 .SH NAME xemacs \- Emacs: The Next Generation @@ -151,7 +151,7 @@ , .B \-no-site-file , and -.B \-no-packages +.B \-no-early-packages \. .TP .BI \-u " user, " \-user " user" @@ -197,16 +197,13 @@ (useful with .BR \-batch ). .PP -.SM Using XEmacs with X +.SM Using XEmacs with X Windows .PP .I XEmacs has been tailored to work well with the X window system. If you run .I XEmacs -from under X windows, it will create its own X window to -display in. You will probably want to start the editor -as a background process -so that you can continue using your original window. +from under X windows, it will create its own X window to display in. .PP .I XEmacs can be started with the following standard X options: @@ -223,9 +220,11 @@ for more information. .TP .B -privateColormap -Require XEmacs to create and use a private colormap for display. This will keep -XEmacs from taking colors from the default colormap and keeping them from other -clients. +Require XEmacs to create and use a private colormap for display. This +will keep XEmacs from taking colors from the default colormap and +keeping them from other clients, at the cost of causing annoying +flicker when the focus changes. Use this option only if your X server +does not support 24 bit visuals. .TP .BI \-geometry " ##x##+##+##" Specify the geometry of the initial window. The ##'s represent a number; @@ -318,7 +317,7 @@ .BI \-xrm " argument" This allows you to set an arbitrary resource on the command line. .I argument -should be a resource specification, as might as in your +should be a resource specification, as might be found in your .I \.Xresources or .I \.Xdefaults @@ -439,7 +438,7 @@ .IR on , the window will be displayed in reverse video. Consider explicitly setting the foreground and background colors instead -of using this resources. +of using this resource. .TP .B borderWidth (\fPclass\fB BorderWidth) Sets the window's border width in pixels. @@ -462,7 +461,7 @@ will try to use (as described above). .TP .B privateColormap (\fPclass\fB PrivateColormap) -If set, +If set, .I XEmacs will default to using a private colormap. .TP @@ -511,7 +510,7 @@ Sets the position of vertical and horizontal scrollbars. Should be one of the strings "top-left", "bottom-left", "top-right", or "bottom-right". The default is "bottom-right" for the Motif and Lucid scrollbars and -"buttom-left" for the Athena scrollbars. +"bottom-left" for the Athena scrollbars. .TP .B topToolBarHeight (\fPclass\fB TopToolBarHeight) Sets the height of the top toolbar, in pixels. 0 means no top toolbar. @@ -642,9 +641,6 @@ /usr/local/lib/xemacs-$VERSION/info - the Info files may be here instead. -/usr/local/lib/xemacs-$VERSION/src - C source files and object files. -(May not be present.) - /usr/local/lib/xemacs-$VERSION/lisp/* - Lisp source files and compiled files that define most editing commands. The files are contained in subdirectories, categorized by function or individual package. Some are preloaded; @@ -661,19 +657,7 @@ preloaded Lisp functions of \fIXEmacs\fP. They are stored here to reduce the size of \fIXEmacs\fP proper. -.br -/usr/local/lib/xemacs-$VERSION/etc/SERVICE - lists people offering -various services to assist users of \fIXEmacs\fP, -including education, troubleshooting, porting and customization. - -/usr/local/lib/xemacs/lock - holds lock files that are made for all -files being modified in -.IR XEmacs , -to prevent simultaneous modification of one file by two users. - /usr/local/lib/xemacs/site-lisp - locally-provided Lisp files. - -/usr/lib/X11/rgb.txt - list of valid X color names. .PP .SH BUGS AND HELP There is a newsgroup, comp.emacs.xemacs, for reporting diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/ChangeLog --- a/lib-src/ChangeLog Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/ChangeLog Mon Aug 13 11:35:02 2007 +0200 @@ -1,3 +1,200 @@ +2000-09-01 Katsumi Yamaoka + + * make-po.c (BUFSIZE): Increase value to 32768. + +2000-10-04 Martin Buchholz + + * XEmacs 21.2.36 is released. + +2000-09-30 Martin Buchholz + + * gnuserv.c (main): Warning removal. + +2000-09-27 Martin Buchholz + + * ellcc.c: Make global variables static. Avoids warnings on AIX. + + * fakemail.c (make_file_preface): Use standard type time_t. + Actually check that the 25th char returned from ctime is '\n'. + +2000-09-19 Martin Buchholz + + * *: Spelling mega-patch + +2000-09-12 Martin Buchholz + + * gnuclient.c (main): + * hexl.c (usage): + Use `Usage', not `usage', in Usage messages. + +2000-07-15 Ben Wing + + * etags.c (add_regex): added commented out code for use figuring + out Windows quoting problems. + * hexl.c (main): fixed warnings about possible used uninitialized. + +2000-07-19 Martin Buchholz + + * XEmacs 21.2.35 is released. + +2000-07-12 Martin Buchholz + + * gnuserv.c: + (handle_internet_request): + (handle_unix_request): + (internet_init): + Use socklen_t instead of int or size_t. + +2000-07-11 Martin Buchholz + + * hexl.c (usage): Use full ANSI C prototypes. + +2000-07-05 Craig Lanning + + * Makefile.in.in (INSTALL_DATA): + * Makefile.in.in (UTILITIES): + * Makefile.in.in (GETOPTDEPS): + * Makefile.in.in (i): + mingw support: don't try to build gnuclient, add + support for building and installing minitar + +2000-06-10 Ben Wing + + * Makefile.in.in (INSTALLABLES_BASE): + * Makefile.in.in (ootags_args): + * Makefile.in.in (yow): + Build i.exe. + Don't build run*.exe. + + * b2m.c: + * b2m.c (main): + * ellcc.c (main): + * etags.c: + * etags.c (main): + * etags.c (get_compressor_from_suffix): + * etags.c (process_file): + * etags.c (readline_internal): + * etags.c (etags_getcwd): + * etags.c (relative_filename): + * etags.c (absolute_filename): + * etags.c (filename_is_absolute): + * etags.c (canonicalize_filename): + * fakemail.c: + * fakemail.c (make_file_preface): + * getopt.c: + * getopt.h: + * gnuclient.c: + * gnuclient.c (filename_expand): + * gnuserv.h: + * gnuserv.h (PATCHLEVEL): + * hexl.c: + * hexl.c (main): + * make-docfile.c: + * make-docfile.c (APPEND_BINARY): + * make-docfile.c (main): + * make-dump-id.c: + * mmencode.c: + * mmencode.c (fromqp): + * mmencode.c (main): + * movemail.c: + * movemail.c (main): + * movemail.c (popmail): + * ootags.c: + * ootags.c (main): + * ootags.c (readline_internal): + * ootags.c (etags_getcwd): + * ootags.c (absolute_filename): + * ootags.c (filename_is_absolute): + * ootags.c (canonicalize_filename): + * pop.c: + * pop.c (DONT_ENCAPSULATE): + * pop.c (pop_open): + * pop.c (socket_connection): + * pop.c (pop_trash): + * profile.c (gettimeofday): + * wakeup.c: + * yow.c (rootrelativepath): + Remove MSDOS support, converting to WIN32_NATIVE where necessary. + WINDOWSNT -> WIN32_NATIVE. + __CYGWIN32__ -> CYGWIN. + DOS_NT -> WIN32_NATIVE. + Remove unused NO_SHORTNAMES. + Changes for removed nt\inc. + +2000-06-07 Ben Wing + + * run.c, run.h, run.rc: Removed. We no longer need these for + building runxemacs.exe, and it's questionable at best whether + rungnuclient.exe was ever used or is even needed. The correct + solution is just to make gnuclient.exe a windows program and + use the gnuattach script to run 'i gnuclient.exe'. Not that + gnuclient currently works under Windows native in any case. + +2000-05-28 Martin Buchholz + + * XEmacs 21.2.34 is released. + +2000-05-11 Ben Wing + + * i.c (get_command): fix unused var warning. + + * make-docfile.c (MDGET): + * make-docfile.c (read_c_string): + rewrite and reindent -- handle closing doc string comment that's + not at beg of line. + +2000-05-01 Martin Buchholz + + * XEmacs 21.2.33 is released. + +2000-04-19 Martin Buchholz + + * gnuclient.c (initialize_signals): Always use full ANSI prototypes. + +2000-04-06 Kirill 'Big K' Katsnelson + + * i.c: New file, source for the i utility. + +2000-03-22 Mike Alexander + + * make-dump-id.c (gettimeofday): new (Windows only) + +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-20 Martin Buchholz + + * make-dump-id.c: Use config.h and systime.h for portability. + +2000-02-20 Olivier Galibert + + * make-dump-id.c: Added. + + * Makefile.in.in: Add support for make-dump-id. + +2000-03-12 Ben Wing + + * etags.c (canonicalize_filename): fixed a problem with gratuitous + capitalization of file names under MS Windows. + +2000-02-23 Martin Buchholz + + * XEmacs 21.2.31 is released. + +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-16 Martin Buchholz + + * XEmacs 21.2.29 is released. + +2000-02-13 Martin Buchholz + + * etags.c: Upgrade to version 13.44. + Only added (unsigned char) casts to calls like isspace (*cp). + 2000-02-07 Martin Buchholz * XEmacs 21.2.28 is released. diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/Makefile.in.in --- a/lib-src/Makefile.in.in Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/Makefile.in.in Mon Aug 13 11:35:02 2007 +0200 @@ -75,33 +75,25 @@ ## Things that a user might actually run, ## which should be installed in bindir. -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE INSTALLABLES_BASE = etags ctags b2m ootags #else INSTALLABLES_BASE = etags ctags b2m gnuclient ootags #endif INSTALLABLE_SCRIPTS = rcs-checkin gnudoit gnuattach #ifdef HAVE_SHLIB -#ifdef HAVE_MS_WINDOWS -INSTALLABLES = $(INSTALLABLES_BASE) runxemacs rungnuclient ellcc -#else INSTALLABLES = $(INSTALLABLES_BASE) ellcc -#endif -#else -#ifdef HAVE_MS_WINDOWS -INSTALLABLES = $(INSTALLABLES_BASE) runxemacs rungnuclient #else INSTALLABLES = $(INSTALLABLES_BASE) #endif -#endif ## Things that Emacs runs internally, or during the build process, ## which should not be installed in bindir. -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE UTILITIES= make-path wakeup profile make-docfile digest-doc \ - sorted-doc movemail cvtmail yow hexl \ - mmencode + sorted-doc movemail cvtmail yow i hexl \ + mmencode minitar #else UTILITIES= make-path wakeup profile make-docfile digest-doc \ sorted-doc movemail cvtmail fakemail yow hexl \ @@ -290,7 +282,7 @@ regex.o: ${srcdir}/../src/regex.c ${top_srcdir}/src/regex.h $(CC) -c `echo $(cflags) | sed 's/-Demacs/ /'` \ - -DINHIBIT_STRING_HEADER ${top_srcdir}/src/regex.c + -DINHIBIT_STRING_HEADER ${top_srcdir}/src/regex.c etags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/etags.c \ $(GETOPTOBJS) regex.o $(ldflags) @@ -305,23 +297,6 @@ ellcc: ${ellcc_deps} $(CC) ${ellcc_args} -o $@ -run_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/run.c \ - $(ldflags) -Wl,--subsystem,windows -e _mainCRTStartup -run_deps = ${srcdir}/run.c ${srcdir}/run.h ${srcdir}/run.rc \ - ${srcdir}/../nt/xemacs.ico ${srcdir}/../nt/file.ico \ - ${srcdir}/../nt/lisp.ico - -run: ${run_deps} - windres --include-dir ${srcdir}/../nt -i run.rc -o run_res.o - $(CC) run_res.o ${run_args} -o $@ - strip $@.exe - -runxemacs: run - cp run.exe $@.exe - -rungnuclient: run - cp run.exe $@.exe - ootags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/ootags.c \ $(GETOPTOBJS) regex.o $(ldflags) ootags_deps = ${srcdir}/ootags.c $(GETOPTDEPS) regex.o ../src/config.h @@ -366,6 +341,12 @@ yow: ${srcdir}/yow.c ../src/paths.h $(CC) $(cflags) ${srcdir}/yow.c $(ldflags) -o $@ +i: ${srcdir}/i.c + $(CC) $(cflags) ${srcdir}/i.c $(ldflags) -o $@ + +minitar: ${srcdir}/../nt/minitar.c + $(CC) $(cflags) ${srcdir}/../nt/minitar.c $(ldflags) -lz -o $@ + hexl: ${srcdir}/hexl.c $(CC) $(cflags) ${srcdir}/hexl.c $(ldflags) -o $@ @@ -375,6 +356,9 @@ make-po: ${srcdir}/make-po.c $(CC) $(cflags) ${srcdir}/make-po.c $(ldflags) -o $@ +make-dump-id: ${srcdir}/make-dump-id.c + $(CC) $(cflags) ${srcdir}/make-dump-id.c $(ldflags) -o $@ + cflags_gnuserv = $(CFLAGS) $(cppflags) $(c_switch_all) ldflags_gnuserv = $(LDFLAGS) $(ld_switch_all) @libs_xauth@ $(ld_libs_general) gnuslib.o: ${srcdir}/gnuslib.c ${srcdir}/gnuserv.h ../src/config.h diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/b2m.c --- a/lib-src/b2m.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/b2m.c Mon Aug 13 11:35:02 2007 +0200 @@ -30,7 +30,7 @@ #include #include #include -#ifdef MSDOS +#ifdef WIN32_NATIVE #include #endif @@ -88,17 +88,12 @@ char *labels = NULL, *p, *today; struct linebuffer data; -#ifdef MSDOS +#ifdef WIN32_NATIVE _fmode = O_BINARY; /* all of files are treated as binary files */ -#if __DJGPP__ > 1 if (!isatty (fileno (stdout))) setmode (fileno (stdout), O_BINARY); if (!isatty (fileno (stdin))) setmode (fileno (stdin), O_BINARY); -#else /* not __DJGPP__ > 1 */ - (stdout)->_flag &= ~_IOTEXT; - (stdin)->_flag &= ~_IOTEXT; -#endif /* not __DJGPP__ > 1 */ #endif progname = argv[0]; diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/config.values.in --- a/lib-src/config.values.in Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/config.values.in Mon Aug 13 11:35:02 2007 +0200 @@ -45,8 +45,6 @@ LISPDIR "@LISPDIR@" LISPDIR_USER_DEFINED "@LISPDIR_USER_DEFINED@" LN_S "@LN_S@" -LOCKDIR "@LOCKDIR@" -LOCKDIR_USER_DEFINED "@LOCKDIR_USER_DEFINED@" MAKE_SUBDIR "@MAKE_SUBDIR@" MODULEDIR "@MODULEDIR@" MODULEDIR_USER_DEFINED "@MODULEDIR_USER_DEFINED@" @@ -116,7 +114,6 @@ libs_xauth "@libs_xauth@" lispdir "@lispdir@" localstatedir "@localstatedir@" -lockdir "@lockdir@" lwlib_objs "@lwlib_objs@" machfile "@machfile@" mandir "@mandir@" diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/cvtmail.c --- a/lib-src/cvtmail.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/cvtmail.c Mon Aug 13 11:35:02 2007 +0200 @@ -24,13 +24,13 @@ * exist in your home directory, containing individual mail messages in * separate files in the standard gosling emacs mail reader format. * - * Program takes one argument: an output file. THis file will contain + * Program takes one argument: an output file. This file will contain * all the messages in Messages directory, in berkeley mail format. * If no output file is mentioned, messages are put in ~/OMAIL. * * In order to get rmail to read the messages, the resulting file must * be mv'ed to ~/mbox, and then have rmail invoked on them. - * + * * Author: Larry Kolodney, 1985 */ @@ -44,8 +44,8 @@ static void *xmalloc (size_t); static void *xrealloc (void *, size_t); static void skip_to_lf (FILE *stream); -static void fatal (CONST char *s1, CONST char *s2); -static void error (CONST char *s1, CONST char *s2); +static void fatal (const char *s1, const char *s2); +static void error (const char *s1, const char *s2); int main (int argc, char *argv[]) @@ -106,7 +106,7 @@ fclose (cff); } fclose (mddf); - fclose (mfilef); + fclose (mfilef); return 0; } @@ -139,14 +139,14 @@ /* Print error message and exit. */ static void -fatal (CONST char *s1, CONST char *s2) +fatal (const char *s1, const char *s2) { error (s1, s2); exit (1); } static void -error (CONST char *s1, CONST char *s2) +error (const char *s1, const char *s2) { fprintf (stderr, "cvtmail: "); fprintf (stderr, s1, s2); diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/ellcc.c --- a/lib-src/ellcc.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/ellcc.c Mon Aug 13 11:35:02 2007 +0200 @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -109,7 +110,7 @@ #endif static void *xmalloc (size_t); static void fatal (char *, char *); -static void add_to_argv (CONST char *); +static void add_to_argv (const char *); static void do_compile_mode (void); static void do_link_mode (void); static void do_init_mode (void); @@ -120,16 +121,19 @@ #define ELLCC_LINK_MODE 1 #define ELLCC_INIT_MODE 2 -int ellcc_mode = ELLCC_COMPILE_MODE; -char *progname; -char *mod_name = (char *)0, *mod_version = (char *)0, *mod_title = (char *)0; -char *mod_output = (char *)0; -int verbose = 0; -char **exec_argv; -int exec_argc = 1, *exec_args; -int real_argc = 0; -int prog_argc; -char **prog_argv; +static int ellcc_mode = ELLCC_COMPILE_MODE; +static char *progname; +static char *mod_name = NULL; +static char *mod_version = NULL; +static char *mod_title = NULL; +static char *mod_output = NULL; +static int verbose = 0; +static char **exec_argv; +static int exec_argc = 1; +static int *exec_args; +static int real_argc = 0; +static int prog_argc; +static char **prog_argv; /* * We allow the user to over-ride things in the environment @@ -149,7 +153,7 @@ prog_argc = argc; prog_argv = argv; -#if defined(MSDOS) || defined(WINDOWSNT) +#if defined(WIN32_NATIVE) tmp = strrchr (argv[0], '\\'); if (tmp != (char *)0) tmp++; @@ -346,12 +350,12 @@ * arguments, taking quoting into account. This can get ugly. */ static void -add_to_argv (CONST char *str) +add_to_argv (const char *str) { int sm = 0; - CONST char *s = (CONST char *)0; + const char *s = (const char *)0; - if ((str == (CONST char *)0) || (str[0] == '\0')) + if ((str == (const char *)0) || (str[0] == '\0')) return; while (*str) @@ -378,7 +382,7 @@ exec_argv[real_argc][l] = '\0'; real_argc++; sm = 0; /* Back to start state */ - s = (CONST char *)0; + s = (const char *)0; break; } else if (*str == '\\') @@ -423,14 +427,14 @@ } } - if (s != (CONST char *)0) + if (s != (const char *)0) { int l = str-s; exec_argv[real_argc] = xnew (l+2, char); strncpy (exec_argv[real_argc], s, l); exec_argv[real_argc][l] = '\0'; real_argc++; - s = (CONST char *)0; + s = (const char *)0; } } diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/etags.c --- a/lib-src/etags.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/etags.c Mon Aug 13 11:35:02 2007 +0200 @@ -29,10 +29,9 @@ * Regexp tags by Tom Tromey. * * Francesco Potorti` (pot@gnu.org) is the current maintainer. - * Ansified by Martin Buchholz, 19991105. */ -char pot_etags_version[] = "@(#) pot revision number is 13.33"; +char pot_etags_version[] = "@(#) pot revision number is 13.44"; #define TRUE 1 #define FALSE 0 @@ -41,6 +40,12 @@ # define DEBUG FALSE #endif +#if defined(__STDC__) && (__STDC__ || defined(__SUNPRO_C)) +# define P_(proto) proto +#else +# define P_(proto) () +#endif + #ifdef HAVE_CONFIG_H # include /* On some systems, Emacs defines static as nothing for the sake @@ -54,48 +59,39 @@ # define _GNU_SOURCE 1 /* enables some compiler checks on GNU */ #endif -#ifdef MSDOS -# include -# include -# include -# ifndef HAVE_CONFIG_H -# define DOS_NT -# include -# endif -#endif /* MSDOS */ - -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE # include # include # include +# include # include # define MAXPATHLEN _MAX_PATH -# ifdef HAVE_CONFIG_H -# undef HAVE_NTGUI -# else -# define DOS_NT -# endif /* not HAVE_CONFIG_H */ # ifndef HAVE_GETCWD # define HAVE_GETCWD # endif /* undef HAVE_GETCWD */ -#endif /* WINDOWSNT */ - -#if !defined (WINDOWSNT) && defined (STDC_HEADERS) -#include -#include -#endif +#else /* !WIN32_NATIVE */ +# ifdef STDC_HEADERS +# include +# include +# else + extern char *getenv (); +# endif +#endif /* !WIN32_NATIVE */ #ifdef HAVE_UNISTD_H # include #else -# ifdef HAVE_GETCWD - extern char *getcwd (); +# if defined (HAVE_GETCWD) && !defined (WIN32_NATIVE) + extern char *getcwd (char *buf, size_t size); # endif #endif /* HAVE_UNISTD_H */ #include #include #include +#ifndef errno + extern int errno; +#endif #include #include @@ -175,7 +171,7 @@ typedef int bool; -typedef void Lang_function (); +typedef void Lang_function P_((FILE *)); typedef struct { @@ -220,74 +216,80 @@ /* Many compilers barf on this: Lang_function Ada_funcs; so let's write it this way */ -void Ada_funcs (FILE *inf); -void Asm_labels (FILE *inf); -void C_entries (int c_ext, FILE *inf); -void default_C_entries (FILE *inf); -void plain_C_entries (FILE *inf); -void Cjava_entries (FILE *inf); -void Cobol_paragraphs (FILE *inf); -void Cplusplus_entries (FILE *inf); -void Cstar_entries (FILE *inf); -void Erlang_functions (FILE *inf); -void Fortran_functions (FILE *inf); -void Yacc_entries (FILE *inf); -void Lisp_functions (FILE *inf); -void Pascal_functions (FILE *inf); -void Perl_functions (FILE *inf); -void Postscript_functions (FILE *inf); -void Prolog_functions (FILE *inf); -void Python_functions (FILE *inf); -void Scheme_functions (FILE *inf); -void TeX_functions (FILE *inf); -void just_read_file (FILE *inf); - -compressor *get_compressor_from_suffix (char *file, char **extptr); -language *get_language_from_name (char *name); -language *get_language_from_interpreter (char *interpreter); -language *get_language_from_suffix (char *file); -int total_size_of_entries (register node *np); -long readline (linebuffer *lbp, FILE *stream); -long readline_internal (linebuffer *lbp, register FILE *stream); -void get_tag (register char *bp); +static void Ada_funcs P_((FILE *)); +static void Asm_labels P_((FILE *)); +static void C_entries P_((int c_ext, FILE *)); +static void default_C_entries P_((FILE *)); +static void plain_C_entries P_((FILE *)); +static void Cjava_entries P_((FILE *)); +static void Cobol_paragraphs P_((FILE *)); +static void Cplusplus_entries P_((FILE *)); +static void Cstar_entries P_((FILE *)); +static void Erlang_functions P_((FILE *)); +static void Fortran_functions P_((FILE *)); +static void Yacc_entries P_((FILE *)); +static void Lisp_functions P_((FILE *)); +static void Pascal_functions P_((FILE *)); +static void Perl_functions P_((FILE *)); +static void Postscript_functions P_((FILE *)); +static void Prolog_functions P_((FILE *)); +static void Python_functions P_((FILE *)); +static void Scheme_functions P_((FILE *)); +static void TeX_functions P_((FILE *)); +static void just_read_file P_((FILE *)); + +static void print_language_names P_((void)); +static void print_version P_((void)); +static void print_help P_((void)); +int main P_((int, char **)); +static int number_len P_((long)); + +static compressor *get_compressor_from_suffix P_((char *, char **)); +static language *get_language_from_name P_((char *)); +static language *get_language_from_interpreter P_((char *)); +static language *get_language_from_suffix P_((char *)); +static int total_size_of_entries P_((node *)); +static long readline P_((linebuffer *, FILE *)); +static long readline_internal P_((linebuffer *, FILE *)); +static void get_tag P_((char *)); #ifdef ETAGS_REGEXPS -void analyse_regex (char *regex_arg, bool ignore_case); -void add_regex (char *regexp_pattern, bool ignore_case, language *lan); -void free_patterns (void); +static void analyse_regex P_((char *, bool)); +static void add_regex P_((char *, bool, language *)); +static void free_patterns P_((void)); #endif /* ETAGS_REGEXPS */ -void error (const char *s1, const char *s2); -void suggest_asking_for_help (void); -void fatal (char *s1, char *s2); -void pfatal (char *s1); -void add_node (node *np, node **cur_node_p); - -void init (void); -void initbuffer (linebuffer *lbp); -void find_entries (char *file, FILE *inf); -void free_tree (register node *np); -void pfnote (char *name, bool is_func, char *linestart, int linelen, int lno, long int cno); -void new_pfnote (char *name, int namelen, bool is_func, char *linestart, int linelen, int lno, long int cno); -void process_file (char *file); -void put_entries (register node *np); -void takeprec (void); - -char *concat (char *s1, char *s2, char *s3); -char *skip_spaces (char *cp); -char *skip_non_spaces (char *cp); -char *savenstr (char *cp, int len); -char *savestr (char *cp); -char *etags_strchr (const char *sp, int c); -char *etags_strrchr (const char *sp, int c); -char *etags_getcwd (void); -char *relative_filename (char *file, char *dir); -char *absolute_filename (char *file, char *dir); -char *absolute_dirname (char *file, char *dir); -bool filename_is_absolute (char *fn); -void canonicalize_filename (register char *fn); -void grow_linebuffer (linebuffer *lbp, int toksize); -long *xmalloc (unsigned int size); -long *xrealloc (char *ptr, unsigned int size); +static void error P_((const char *, const char *)); +static void suggest_asking_for_help P_((void)); +static void fatal P_((char *, char *)); +static void pfatal P_((char *)); +static void add_node P_((node *, node **)); + +static void init P_((void)); +static void initbuffer P_((linebuffer *)); +static void find_entries P_((char *, FILE *)); +static void free_tree P_((node *)); +static void pfnote P_((char *, bool, char *, int, int, long)); +static void new_pfnote P_((char *, int, bool, char *, int, int, long)); +static void process_file P_((char *)); +static void put_entries P_((node *)); +static void takeprec P_((void)); + +static char *concat P_((char *, char *, char *)); +static char *skip_spaces P_((char *)); +static char *skip_non_spaces P_((char *)); +static char *savenstr P_((char *, int)); +static char *savestr P_((char *)); +static char *etags_strchr P_((const char *, int)); +static char *etags_strrchr P_((const char *, int)); +static char *etags_getcwd P_((void)); +static char *relative_filename P_((char *, char *)); +static char *absolute_filename P_((char *, char *)); +static char *absolute_dirname P_((char *, char *)); +static bool filename_is_absolute P_((char *f)); +static void canonicalize_filename P_((char *)); +static void grow_linebuffer P_((linebuffer *, int)); +static long *xmalloc P_((unsigned int)); +static long *xrealloc P_((char *, unsigned int)); char searchar = '/'; /* use /.../ searches */ @@ -320,7 +322,7 @@ bool _wht[CHARS], _nin[CHARS], _itk[CHARS], _btk[CHARS], _etk[CHARS]; char /* white chars */ - *white = " \f\t\n\r", + *white = " \f\t\n\r\v", /* not in a name */ *nonam = " \f\t\n\r(=,[;", /* token ending chars */ @@ -562,19 +564,16 @@ Compressed files are supported using gzip and bzip2."); } -#ifdef XEMACS -# define EMACS_NAME "XEmacs" -#else +#ifndef EMACS_NAME # define EMACS_NAME "GNU Emacs" #endif - #ifndef VERSION -# define VERSION "20" +# define VERSION "21" #endif static void print_version () { - printf ("%s (" EMACS_NAME " %s)\n", (CTAGS) ? "ctags" : "etags", VERSION); + printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION); puts ("Copyright (C) 1999 Free Software Foundation, Inc. and Ken Arnold"); puts ("This program is distributed under the same terms as Emacs"); @@ -762,7 +761,7 @@ #include #include #define OUTSIZE MAX_FILE_SPEC_LEN -short +static short fn_exp (out, in) vspec *out; char *in; @@ -807,7 +806,7 @@ v1.01 nmm 19-Aug-85 gfnames - return in successive calls the name of each file specified by the provided arg expanding wildcards. */ -char * +static char * gfnames (arg, p_error) char *arg; bool *p_error; @@ -871,9 +870,9 @@ bool got_err; #endif -#ifdef DOS_NT +#ifdef WIN32_NATIVE _fmode = O_BINARY; /* all of files are treated as binary files */ -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ progname = argv[0]; nincluded_files = 0; @@ -1057,12 +1056,12 @@ if (streq (tagfile, "-")) { tagf = stdout; -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Switch redirected `stdout' to binary mode (setting `_fmode' doesn't take effect until after `stdout' is already open). */ if (!isatty (fileno (stdout))) setmode (fileno (stdout), O_BINARY); -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ } else tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); @@ -1183,7 +1182,7 @@ * and EXTPTR is not significant. * Idea by Vladimir Alexiev */ -compressor * +static compressor * get_compressor_from_suffix (file, extptr) char *file; char **extptr; @@ -1192,7 +1191,7 @@ char *slash, *suffix; /* This relies on FN to be after canonicalize_filename, - so we don't need to consider backslashes on DOS_NT. */ + so we don't need to consider backslashes on WIN32_NATIVE. */ slash = etags_strrchr (file, '/'); suffix = etags_strrchr (file, '.'); if (suffix == NULL || suffix < slash) @@ -1202,22 +1201,17 @@ suffix += 1; /* Let those poor souls who live with DOS 8+3 file name limits get some solace by treating foo.cgz as if it were foo.c.gz, etc. - Only the first do loop is run if not MSDOS */ -#ifdef MSDOS + */ do { for (compr = compressors; compr->suffix != NULL; compr++) if (streq (compr->suffix, suffix)) return compr; + if (1) /* !MSDOS */ + break; /* do it only once: not really a loop */ if (extptr != NULL) *extptr = ++suffix; } while (*suffix != '\0'); -#else - for (compr = compressors; compr->suffix != NULL; compr++) - if (streq (compr->suffix, suffix)) - return compr; -#endif - return NULL; } @@ -1226,7 +1220,7 @@ /* * Return a language given the name. */ -language * +static language * get_language_from_name (name) char *name; { @@ -1249,7 +1243,7 @@ /* * Return a language given the interpreter name. */ -language * +static language * get_language_from_interpreter (interpreter) char *interpreter; { @@ -1272,7 +1266,7 @@ /* * Return a language given the file name. */ -language * +static language * get_language_from_suffix (file) char *file; { @@ -1296,7 +1290,7 @@ /* * This routine is called on each file argument. */ -void +static void process_file (file) char *file; { @@ -1360,21 +1354,7 @@ compressed_name = concat (file, ".", compr->suffix); if (stat (compressed_name, &stat_buf) != 0) { -#ifdef MSDOS - char *suf = compressed_name + strlen (file); - size_t suflen = strlen (compr->suffix) + 1; - for ( ; suf[1]; suf++, suflen--) - { - memmove (suf, suf + 1, suflen); - if (stat (compressed_name, &stat_buf) == 0) - { - real_name = compressed_name; - break; - } - } - if (real_name != NULL) - break; -#endif + /* XEmacs: delete MSDOS code */ free (compressed_name); compressed_name = NULL; } @@ -1454,7 +1434,7 @@ * subscripted by the chars in "white" are set to TRUE. Thus "_wht" * of a char is TRUE if it is the string "white", else FALSE. */ -void +static void init () { register char *sp; @@ -1464,13 +1444,12 @@ iswhite(i) = notinname(i) = begtoken(i) = intoken(i) = endtoken(i) = FALSE; for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = TRUE; for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = TRUE; + notinname('\0') = notinname('\n'); for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = TRUE; + begtoken('\0') = begtoken('\n'); for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = TRUE; + intoken('\0') = intoken('\n'); for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = TRUE; - iswhite('\0') = iswhite('\n'); - notinname('\0') = notinname('\n'); - begtoken('\0') = begtoken('\n'); - intoken('\0') = intoken('\n'); endtoken('\0') = endtoken('\n'); } @@ -1480,7 +1459,7 @@ */ node *last_node = NULL; -void +static void find_entries (file, inf) char *file; FILE *inf; @@ -1567,7 +1546,7 @@ } /* Record a tag. */ -void +static void pfnote (name, is_func, linestart, linelen, lno, cno) char *name; /* tag name, or NULL if unnamed */ bool is_func; /* tag is a function */ @@ -1637,7 +1616,7 @@ * `nonam'. */ #define traditional_tag_style TRUE -void +static void new_pfnote (name, namelen, is_func, linestart, linelen, lno, cno) char *name; /* tag name, or NULL if unnamed */ int namelen; /* tag length */ @@ -1679,7 +1658,7 @@ * free_tree () * recurse on left children, iterate on right children. */ -void +static void free_tree (np) register node *np; { @@ -1704,7 +1683,7 @@ * add_node is the only function allowed to add nodes, so it can * maintain state. */ -void +static void add_node (np, cur_node_p) node *np, **cur_node_p; { @@ -1762,7 +1741,7 @@ } } -void +static void put_entries (np) register node *np; { @@ -1846,7 +1825,7 @@ * is irrelevant with the new tags.el, but is still supplied for * backward compatibility. */ -int +static int total_size_of_entries (np) register node *np; { @@ -1884,6 +1863,10 @@ st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef, st_C_typespec }; +static unsigned int hash P_((const char *, unsigned int)); +static struct C_stab_entry * in_word_set P_((const char *, unsigned int)); +static enum sym_type C_symtype P_((char *, int, int)); + /* Feed stuff between (but not including) %[ and %] lines to: gperf -c -k 1,3 -o -p -r -t %[ @@ -2245,6 +2228,9 @@ */ int methodlen; +static bool consider_token P_((char *, int, int, int, int, int, bool *)); +static void make_C_tag P_((bool)); + /* * consider_token () * checks to see if the current token is at the start of a @@ -2267,7 +2253,7 @@ consider_token (str, len, c, c_ext, cblev, parlev, is_func_or_var) register char *str; /* IN: token pointer */ register int len; /* IN: token length */ - register char c; /* IN: first char after the token */ + register int c; /* IN: first char after the token */ int c_ext; /* IN: C extensions mask */ int cblev; /* IN: curly brace level */ int parlev; /* IN: parenthesis level */ @@ -2597,7 +2583,7 @@ } -void +static void C_entries (c_ext, inf) int c_ext; /* extension of C */ FILE *inf; /* input file */ @@ -2819,7 +2805,7 @@ if (*lp != '\0') lp += 1; while (*lp != '\0' - && !isspace (*lp) && *lp != '(') + && !iswhite (*lp) && *lp != '(') lp += 1; c = *lp++; toklen += lp - oldlp; @@ -3270,7 +3256,7 @@ * Process either a C++ file or a C file depending on the setting * of a global flag. */ -void +static void default_C_entries (inf) FILE *inf; { @@ -3278,7 +3264,7 @@ } /* Always do plain ANSI C. */ -void +static void plain_C_entries (inf) FILE *inf; { @@ -3286,7 +3272,7 @@ } /* Always do C++. */ -void +static void Cplusplus_entries (inf) FILE *inf; { @@ -3294,7 +3280,7 @@ } /* Always do Java. */ -void +static void Cjava_entries (inf) FILE *inf; { @@ -3302,7 +3288,7 @@ } /* Always do C*. */ -void +static void Cstar_entries (inf) FILE *inf; { @@ -3310,7 +3296,7 @@ } /* Always do Yacc. */ -void +static void Yacc_entries (inf) FILE *inf; { @@ -3333,7 +3319,7 @@ * Read a file, but do no processing. This is used to do regexp * matching on files that have no language defined. */ -void +static void just_read_file (inf) FILE *inf; { @@ -3345,6 +3331,10 @@ /* Fortran parsing */ +static bool tail P_((char *)); +static void takeprec P_((void)); +static void getit P_((FILE *)); + static bool tail (cp) char *cp; @@ -3361,7 +3351,7 @@ return FALSE; } -void +static void takeprec () { dbp = skip_spaces (dbp); @@ -3374,14 +3364,14 @@ dbp += 3; return; } - if (!isdigit (*dbp)) + if (!isdigit ((unsigned char) *dbp)) { --dbp; /* force failure */ return; } do dbp++; - while (isdigit (*dbp)); + while (isdigit ((unsigned char) *dbp)); } static void @@ -3402,7 +3392,7 @@ dbp += 6; dbp = skip_spaces (dbp); } - if (!isalpha (*dbp) && *dbp != '_' && *dbp != '$') + if (!isalpha ((unsigned char) *dbp) && *dbp != '_' && *dbp != '$') return; for (cp = dbp + 1; *cp != '\0' && intoken (*cp); cp++) continue; @@ -3411,7 +3401,7 @@ } -void +static void Fortran_functions (inf) FILE *inf; { @@ -3488,6 +3478,9 @@ * Philippe Waroquiers , 1998-04-24 * Ada parsing */ + +static void adagetit P_((FILE *, char *)); + /* Once we are positioned after an "interesting" keyword, let's get the real tag value necessary. */ static void @@ -3540,7 +3533,7 @@ dbp = skip_spaces (dbp); for (cp = dbp; (*cp != '\0' - && (isalpha (*cp) || isdigit (*cp) || *cp == '_' || *cp == '.')); + && (isalpha ((unsigned char) *cp) || isdigit ((unsigned char) *cp) || *cp == '_' || *cp == '.')); cp++) continue; if (cp == dbp) @@ -3557,7 +3550,7 @@ } } -void +static void Ada_funcs (inf) FILE *inf; { @@ -3654,7 +3647,7 @@ * Unix and microcontroller assembly tag handling * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]' */ -void +static void Asm_labels (inf) FILE *inf; { @@ -3664,13 +3657,13 @@ { /* If first char is alphabetic or one of [_.$], test for colon following identifier. */ - if (isalpha (*cp) || *cp == '_' || *cp == '.' || *cp == '$') + if (isalpha ((unsigned char) *cp) || *cp == '_' || *cp == '.' || *cp == '$') { /* Read past label. */ cp++; - while (isalnum (*cp) || *cp == '_' || *cp == '.' || *cp == '$') + while (isalnum ((unsigned char) *cp) || *cp == '_' || *cp == '.' || *cp == '$') cp++; - if (*cp == ':' || isspace (*cp)) + if (*cp == ':' || iswhite (*cp)) { /* Found end of label, so copy it and add it to the table. */ pfnote (savenstr(lb.buffer, cp-lb.buffer), TRUE, @@ -3686,7 +3679,7 @@ * Perl sub names: look for /^sub[ \t\n]+[^ \t\n{]+/ * Perl variable names: /^(my|local).../ */ -void +static void Perl_functions (inf) FILE *inf; { @@ -3696,14 +3689,14 @@ { if (*cp++ == 's' && *cp++ == 'u' - && *cp++ == 'b' && isspace (*cp++)) + && *cp++ == 'b' && iswhite (*cp++)) { cp = skip_spaces (cp); if (*cp != '\0') { char *sp = cp; while (*cp != '\0' - && !isspace (*cp) && *cp != '{' && *cp != '(') + && !iswhite (*cp) && *cp != '{' && *cp != '(') cp++; pfnote (savenstr (sp, cp-sp), TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); @@ -3719,7 +3712,7 @@ && *cp++ == 'c' && *cp++ == 'a' && *cp++ == 'l')) - && (*cp == '(' || isspace (*cp))) + && (*cp == '(' || iswhite (*cp))) { /* After "my" or "local", but before any following paren or space. */ char *varname = NULL; @@ -3728,7 +3721,7 @@ if (*cp == '$' || *cp == '@' || *cp == '%') { char* varstart = ++cp; - while (isalnum (*cp) || *cp == '_') + while (isalnum ((unsigned char) *cp) || *cp == '_') cp++; varname = savenstr (varstart, cp-varstart); } @@ -3752,7 +3745,7 @@ * Python support by Eric S. Raymond * Look for /^def[ \t\n]+[^ \t\n(:]+/ or /^class[ \t\n]+[^ \t\n(:]+/ */ -void +static void Python_functions (inf) FILE *inf; { @@ -3762,10 +3755,10 @@ { if (*cp++ == 'd' && *cp++ == 'e' - && *cp++ == 'f' && isspace (*cp++)) + && *cp++ == 'f' && iswhite (*cp++)) { cp = skip_spaces (cp); - while (*cp != '\0' && !isspace (*cp) && *cp != '(' && *cp != ':') + while (*cp != '\0' && !iswhite (*cp) && *cp != '(' && *cp != ':') cp++; pfnote (NULL, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); @@ -3776,10 +3769,10 @@ && *cp++ == 'l' && *cp++ == 'a' && *cp++ == 's' - && *cp++ == 's' && isspace (*cp++)) + && *cp++ == 's' && iswhite (*cp++)) { cp = skip_spaces (cp); - while (*cp != '\0' && !isspace (*cp) && *cp != '(' && *cp != ':') + while (*cp != '\0' && !iswhite (*cp) && *cp != '(' && *cp != ':') cp++; pfnote (NULL, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); @@ -3792,7 +3785,7 @@ * We could look for anything that could be a paragraph name. * i.e. anything that starts in column 8 is one word and ends in a full stop. */ -void +static void Cobol_paragraphs (inf) FILE *inf; { @@ -3805,10 +3798,10 @@ bp += 8; /* If eoln, compiler option or comment ignore whole line. */ - if (bp[-1] != ' ' || !isalnum (bp[0])) + if (bp[-1] != ' ' || !isalnum ((unsigned char) bp[0])) continue; - for (ep = bp; isalnum (*ep) || *ep == '-'; ep++) + for (ep = bp; isalnum ((unsigned char) *ep) || *ep == '-'; ep++) continue; if (*ep++ == '.') pfnote (savenstr (bp, ep-bp), TRUE, @@ -3825,7 +3818,7 @@ * "forward" immediately following the procedure statement; if found, * the tag is skipped. */ -void +static void Pascal_functions (inf) FILE *inf; { @@ -4002,6 +3995,11 @@ * lisp tag functions * look for (def or (DEF, quote or QUOTE */ + +static int L_isdef P_((char *)); +static int L_isquote P_((char *)); +static void L_getit P_((void)); + static int L_isdef (strp) register char *strp; @@ -4020,7 +4018,7 @@ && (*++strp == 'o' || *strp == 'O') && (*++strp == 't' || *strp == 'T') && (*++strp == 'e' || *strp == 'E') - && isspace (*++strp)); + && iswhite (*++strp)); } static void @@ -4040,7 +4038,7 @@ } for (cp = dbp /*+1*/; - *cp != '\0' && *cp != '(' && !isspace(*cp) && *cp != ')'; + *cp != '\0' && *cp != '(' && !iswhite(*cp) && *cp != ')'; cp++) continue; if (cp == dbp) @@ -4050,7 +4048,7 @@ lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } -void +static void Lisp_functions (inf) FILE *inf; { @@ -4069,7 +4067,7 @@ /* Check for (foo::defmumble name-defined ... */ do dbp++; - while (*dbp != '\0' && !isspace (*dbp) + while (*dbp != '\0' && !iswhite (*dbp) && *dbp != ':' && *dbp != '(' && *dbp != ')'); if (*dbp == ':') { @@ -4096,7 +4094,7 @@ * Also look at "defineps" for PSWrap * suggested by Masatake YAMATO */ -void +static void Postscript_functions (inf) FILE *inf; { @@ -4131,7 +4129,7 @@ * look for (set! xyzzy */ -void +static void Scheme_functions (inf) FILE *inf; { @@ -4146,7 +4144,7 @@ { bp = skip_non_spaces (bp); /* Skip over open parens and white space */ - while (isspace (*bp) || *bp == '(') + while (iswhite (*bp) || *bp == '(') bp++; get_tag (bp); } @@ -4155,7 +4153,7 @@ && (bp[2] == 'E' || bp[2] == 'e') && (bp[3] == 'T' || bp[3] == 't') && (bp[4] == '!' || bp[4] == '!') - && (isspace (bp[5]))) + && (iswhite (bp[5]))) { bp = skip_non_spaces (bp); bp = skip_spaces (bp); @@ -4184,9 +4182,9 @@ :chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem\ :part:appendix:entry:index"; -void TEX_mode (FILE *inf); -struct TEX_tabent *TEX_decode_env (char *evarname, char *defenv); -int TEX_Token (char *cp); +static void TEX_mode P_((FILE *)); +static struct TEX_tabent *TEX_decode_env P_((char *, char *)); +static int TEX_Token P_((char *)); char TEX_esc = '\\'; char TEX_opgrp = '{'; @@ -4195,7 +4193,7 @@ /* * TeX/LaTeX scanning loop. */ -void +static void TeX_functions (inf) FILE *inf; { @@ -4242,7 +4240,7 @@ /* Figure out whether TeX's escapechar is '\\' or '!' and set grouping chars accordingly. */ -void +static void TEX_mode (inf) FILE *inf; { @@ -4277,7 +4275,7 @@ /* Read environment and prepend it to the default string. Build token table. */ -struct TEX_tabent * +static struct TEX_tabent * TEX_decode_env (evarname, defenv) char *evarname; char *defenv; @@ -4334,7 +4332,7 @@ Otherwise return -1. Keep the capital `T' in `token' for dumb truncating compilers (this distinguishes it from `TEX_toktab' */ -int +static int TEX_Token (cp) char *cp; { @@ -4352,11 +4350,11 @@ * Assumes that the predicate starts at column 0. * Only the first clause of a predicate is added. */ -int prolog_pred (char *s, char *last); -void prolog_skip_comment (linebuffer *plb, FILE *inf); -int prolog_atom (char *s, int pos); - -void +static int prolog_pred P_((char *, char *)); +static void prolog_skip_comment P_((linebuffer *, FILE *)); +static int prolog_atom P_((char *, int)); + +static void Prolog_functions (inf) FILE *inf; { @@ -4372,7 +4370,7 @@ { if (cp[0] == '\0') /* Empty line */ continue; - else if (isspace (cp[0])) /* Not a predicate */ + else if (iswhite (cp[0])) /* Not a predicate */ continue; else if (cp[0] == '/' && cp[1] == '*') /* comment. */ prolog_skip_comment (&lb, inf); @@ -4392,7 +4390,7 @@ } -void +static void prolog_skip_comment (plb, inf) linebuffer *plb; FILE *inf; @@ -4420,7 +4418,7 @@ * Return the size of the name of the predicate, or 0 if no header * was found. */ -int +static int prolog_pred (s, last) char *s; char *last; /* Name of last clause. */ @@ -4461,7 +4459,7 @@ * - A quoted arbitrary string. Single quotes can escape themselves. * Backslash quotes everything. */ -int +static int prolog_atom (s, pos) char *s; int pos; @@ -4470,11 +4468,11 @@ origpos = pos; - if (islower(s[pos]) || (s[pos] == '_')) + if (islower((unsigned char) s[pos]) || (s[pos] == '_')) { /* The atom is unquoted. */ pos++; - while (isalnum(s[pos]) || (s[pos] == '_')) + while (isalnum((unsigned char) s[pos]) || (s[pos] == '_')) { pos++; } @@ -4518,11 +4516,11 @@ * * Assumes that Erlang functions start at column 0. */ -int erlang_func (char *s, char *last); -void erlang_attribute (char *s); -int erlang_atom (char *s, int pos); - -void +static int erlang_func P_((char *, char *)); +static void erlang_attribute P_((char *)); +static int erlang_atom P_((char *, int)); + +static void Erlang_functions (inf) FILE *inf; { @@ -4538,7 +4536,7 @@ { if (cp[0] == '\0') /* Empty line */ continue; - else if (isspace (cp[0])) /* Not function nor attribute */ + else if (iswhite (cp[0])) /* Not function nor attribute */ continue; else if (cp[0] == '%') /* comment */ continue; @@ -4577,7 +4575,7 @@ * Return the size of the name of the function, or 0 if no function * was found. */ -int +static int erlang_func (s, last) char *s; char *last; /* Name of last clause. */ @@ -4615,7 +4613,7 @@ * -define(Foo(M, N), M+N). * -record(graph, {vtab = notable, cyclic = true}). */ -void +static void erlang_attribute (s) char *s; { @@ -4642,7 +4640,7 @@ * Consume an Erlang atom (or variable). * Return the number of bytes consumed, or -1 if there was an error. */ -int +static int erlang_atom (s, pos) char *s; int pos; @@ -4651,11 +4649,11 @@ origpos = pos; - if (isalpha (s[pos]) || s[pos] == '_') + if (isalpha ((unsigned char) s[pos]) || s[pos] == '_') { /* The atom is unquoted. */ pos++; - while (isalnum (s[pos]) || s[pos] == '_') + while (isalnum ((unsigned char) s[pos]) || s[pos] == '_') pos++; return pos - origpos; } @@ -4690,6 +4688,11 @@ #ifdef ETAGS_REGEXPS +static char *scan_separators P_((char *)); +static void analyse_regex P_((char *, bool)); +static void add_regex P_((char *, bool, language *)); +static char *substitute P_((char *, char *, struct re_registers *)); + /* Take a string like "/blah/" and turn it into "blah", making sure that the first and last characters are the same, and handling quoted separator characters. Actually, stops on the occurrence of @@ -4735,7 +4738,7 @@ /* Look at the argument of --regex or --no-regex and do the right thing. Same for each line of a regexp file. */ -void +static void analyse_regex (regex_arg, ignore_case) char *regex_arg; bool ignore_case; @@ -4805,7 +4808,7 @@ /* Turn a name, which is an ed-style (but Emacs syntax) regular expression, into a real regular expression by compiling it. */ -void +static void add_regex (regexp_pattern, ignore_case, lang) char *regexp_pattern; bool ignore_case; @@ -4837,6 +4840,10 @@ patbuf->buffer = NULL; patbuf->allocated = 0; +#if 0 /* useful when debugging windows quoting convention problems */ + printf ("Compiling regex pattern: %s\n", regexp_pattern); +#endif + err = re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf); if (err != NULL) { @@ -4875,7 +4882,7 @@ for (t = etags_strchr (out, '\\'); t != NULL; t = etags_strchr (t + 2, '\\')) - if (isdigit (t[1])) + if (isdigit ((unsigned char) t[1])) { dig = t[1] - '0'; diglen = regs->end[dig] - regs->start[dig]; @@ -4888,7 +4895,7 @@ result = xnew (size + 1, char); for (t = result; *out != '\0'; out++) - if (*out == '\\' && isdigit (*++out)) + if (*out == '\\' && isdigit ((unsigned char) *++out)) { /* Using "dig2" satisfies my debugger. Bleah. */ dig = *out - '0'; @@ -4907,7 +4914,7 @@ } /* Deallocate all patterns. */ -void +static void free_patterns () { pattern *pp; @@ -4922,7 +4929,7 @@ return; } -void +static void get_tag (bp) register char *bp; { @@ -4932,7 +4939,7 @@ return; /* Go till you get to white space or a syntactic break */ for (cp = bp + 1; - *cp != '\0' && *cp != '(' && *cp != ')' && !isspace (*cp); + *cp != '\0' && *cp != '(' && *cp != ')' && !iswhite (*cp); cp++) continue; pfnote (savenstr (bp, cp-bp), TRUE, @@ -4941,7 +4948,7 @@ #endif /* ETAGS_REGEXPS */ /* Initialize a linebuffer for use */ -void +static void initbuffer (lbp) linebuffer *lbp; { @@ -4959,7 +4966,7 @@ * platforms (for text files, it translates CR-NL to NL as it reads in the * file). */ -long +static long readline_internal (lbp, stream) linebuffer *lbp; register FILE *stream; @@ -4994,7 +5001,7 @@ if (p > buffer && p[-1] == '\r') { p -= 1; -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Assume CRLF->LF translation will be performed by Emacs when loading this file, so CRs won't appear in the buffer. It would be cleaner to compensate within Emacs; @@ -5023,7 +5030,7 @@ * Like readline_internal, above, but in addition try to match the * input line against relevant regular expressions. */ -long +static long readline (lbp, stream) linebuffer *lbp; FILE *stream; @@ -5084,7 +5091,7 @@ * Return a pointer to a space of size strlen(cp)+1 allocated * with xnew where the string CP has been copied. */ -char * +static char * savestr (cp) char *cp; { @@ -5095,7 +5102,7 @@ * Return a pointer to a space of size LEN+1 allocated with xnew where * the string CP has been copied for at most the first LEN characters. */ -char * +static char * savenstr (cp, len) char *cp; int len; @@ -5111,11 +5118,13 @@ /* * Return the ptr in sp at which the character c last * appears; NULL if not found + * + * Identical to POSIX strrchr, included for portability. */ -char * +static char * etags_strrchr (sp, c) - const char *sp; - int c; + register const char *sp; + register int c; { register const char *r; @@ -5125,49 +5134,51 @@ if (*sp == c) r = sp; } while (*sp++); - return (char *) r; + return (char *)r; } /* * Return the ptr in sp at which the character c first * appears; NULL if not found + * + * Identical to POSIX strchr, included for portability. */ -char * +static char * etags_strchr (sp, c) - const char *sp; - int c; + register const char *sp; + register int c; { do { if (*sp == c) - return (char *) sp; + return (char *)sp; } while (*sp++); return NULL; } /* Skip spaces, return new pointer. */ -char * +static char * skip_spaces (cp) char *cp; { - while (isspace (*cp)) /* isspace('\0')==FALSE */ + while (iswhite (*cp)) cp++; return cp; } /* Skip non spaces, return new pointer. */ -char * +static char * skip_non_spaces (cp) char *cp; { - while (!iswhite (*cp)) /* iswhite('\0')==TRUE */ + while (*cp != '\0' && !iswhite (*cp)) cp++; return cp; } /* Print error message and exit. */ -void +static void fatal (s1, s2) char *s1, *s2; { @@ -5175,7 +5186,7 @@ exit (BAD); } -void +static void pfatal (s1) char *s1; { @@ -5183,7 +5194,7 @@ exit (BAD); } -void +static void suggest_asking_for_help () { fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", @@ -5198,7 +5209,7 @@ } /* Print error message. `s1' is printf control string, `s2' is arg for it. */ -void +static void error (s1, s2) const char *s1, *s2; { @@ -5209,7 +5220,7 @@ /* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ -char * +static char * concat (s1, s2, s3) char *s1, *s2, *s3; { @@ -5226,7 +5237,7 @@ /* Does the same work as the system V getcwd, but does not need to guess the buffer size in advance. */ -char * +static char * etags_getcwd () { #ifdef HAVE_GETCWD @@ -5246,19 +5257,6 @@ return path; #else /* not HAVE_GETCWD */ -#ifdef MSDOS - char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ - - getwd (path); - - for (p = path; *p != '\0'; p++) - if (*p == '\\') - *p = '/'; - else - *p = lowcase (*p); - - return strdup (path); -#else /* not MSDOS */ linebuffer path; FILE *pipe; @@ -5269,13 +5267,12 @@ pclose (pipe); return path.buffer; -#endif /* not MSDOS */ #endif /* not HAVE_GETCWD */ } /* Return a newly allocated string containing the file name of FILE relative to the absolute directory DIR (which should end with a slash). */ -char * +static char * relative_filename (file, dir) char *file, *dir; { @@ -5289,7 +5286,7 @@ while (*fp++ == *dp++) continue; fp--, dp--; /* back to the first differing char */ -#ifdef DOS_NT +#ifdef WIN32_NATIVE if (fp == afn && afn[0] != '/') /* cannot build a relative name */ return afn; #endif @@ -5315,7 +5312,7 @@ /* Return a newly allocated string containing the absolute file name of FILE given DIR (which should end with a slash). */ -char * +static char * absolute_filename (file, dir) char *file, *dir; { @@ -5323,7 +5320,7 @@ if (filename_is_absolute (file)) res = savestr (file); -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* We don't support non-absolute file names with a drive letter, like `d:NAME' (it's too much hassle). */ else if (file[1] == ':') @@ -5347,8 +5344,8 @@ while (cp >= res && !filename_is_absolute (cp)); if (cp < res) cp = slashp; /* the absolute name begins with "/.." */ -#ifdef DOS_NT - /* Under MSDOS and NT we get `d:/NAME' as absolute +#ifdef WIN32_NATIVE + /* Under Windows we get `d:/NAME' as absolute file name, so the luser could say `d:/../NAME'. We silently treat this as `d:/NAME'. */ else if (cp[0] != '/') @@ -5377,7 +5374,7 @@ /* Return a newly allocated string containing the absolute file name of dir where FILE resides given DIR (which should end with a slash). */ -char * +static char * absolute_dirname (file, dir) char *file, *dir; { @@ -5398,25 +5395,25 @@ /* Whether the argument string is an absolute file name. The argument string must have been canonicalized with canonicalize_filename. */ -bool +static bool filename_is_absolute (fn) char *fn; { return (fn[0] == '/' -#ifdef DOS_NT +#ifdef WIN32_NATIVE || (isalpha(fn[0]) && fn[1] == ':' && fn[2] == '/') #endif ); } /* Translate backslashes into slashes. Works in place. */ -void +static void canonicalize_filename (fn) register char *fn; { -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Canonicalize drive letter case. */ - if (islower (fn[0])) + if (islower (fn[0]) && fn[1] == ':') fn[0] = toupper (fn[0]); /* Convert backslashes to slashes. */ for (; *fn != '\0'; fn++) @@ -5429,7 +5426,7 @@ } /* Increase the size of a linebuffer. */ -void +static void grow_linebuffer (lbp, toksize) linebuffer *lbp; int toksize; @@ -5440,7 +5437,7 @@ } /* Like malloc but get fatal error if memory is exhausted. */ -long * +static long * xmalloc (size) unsigned int size; { @@ -5450,7 +5447,7 @@ return result; } -long * +static long * xrealloc (ptr, size) char *ptr; unsigned int size; diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/fakemail.c --- a/lib-src/fakemail.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/fakemail.c Mon Aug 13 11:35:02 2007 +0200 @@ -46,14 +46,6 @@ return 1; } #else /* not BSD 4.2 (or newer) */ -#ifdef MSDOS -int -main (int argc, char *argv[]) -{ - return 0; -} -#else /* not MSDOS */ -/* This conditional contains all the rest of the file. */ /* These are defined in config in some versions. */ @@ -144,7 +136,7 @@ #define MAIL_PROGRAM_NAME "/bin/mail" #endif -static CONST char *my_name; +static const char *my_name; static char *the_date; static char *the_user; static line_list file_preface; @@ -171,7 +163,7 @@ /* Print error message. `s1' is printf control string, `s2' is arg for it. */ static void -error (CONST char *s1, CONST char *s2) +error (const char *s1, const char *s2) { printf ("%s: ", my_name); printf (s1, s2); @@ -182,7 +174,7 @@ /* Print error message and exit. */ static void -fatal (CONST char *s1, CONST char *s2) +fatal (const char *s1, const char *s2) { error (s1, s2); exit (1); @@ -310,7 +302,7 @@ make_file_preface (void) { char *the_string, *temp; - long idiotic_interface; + time_t idiotic_interface; long prefix_length; long user_length; long date_length; @@ -321,8 +313,9 @@ the_date = ctime (&idiotic_interface); /* the_date has an unwanted newline at the end */ date_length = strlen (the_date) - 1; - the_date[date_length] = '\0'; -#ifdef WINDOWSNT + if (the_date[date_length] == '\n') + the_date[date_length] = '\0'; +#ifdef WIN32_NATIVE temp = "(null)"; #else temp = cuserid ((char *) NULL); @@ -419,20 +412,20 @@ } static void -put_line (CONST char *string) +put_line (const char *string) { register stream_list rem; for (rem = the_streams; rem != ((stream_list) NULL); rem = rem->rest_streams) { - CONST char *s = string; + const char *s = string; int column = 0; /* Divide STRING into lines. */ while (*s != 0) { - CONST char *breakpos; + const char *breakpos; /* Find the last char that fits. */ for (breakpos = s; *breakpos && column < 78; ++breakpos) @@ -673,5 +666,4 @@ return close_the_streams (); } -#endif /* not MSDOS */ #endif /* not BSD 4.2 (or newer) */ diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/getopt.c --- a/lib-src/getopt.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/getopt.c Mon Aug 13 11:35:02 2007 +0200 @@ -73,7 +73,7 @@ #endif #endif -#if defined (WIN32) && !defined (__CYGWIN32__) +#if defined (WIN32_NATIVE) && !defined (CYGWIN) /* It's not Unix, really. See? Capital letters. */ #include #undef getpid diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/getopt.h --- a/lib-src/getopt.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/getopt.h Mon Aug 13 11:35:02 2007 +0200 @@ -98,7 +98,7 @@ #define required_argument 1 #define optional_argument 2 -#if defined (__GNU_LIBRARY__) || defined (__cplusplus) +#if defined (__GNU_LIBRARY__) || defined (__cplusplus) || defined (CYGWIN) /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/gnuclient.c --- a/lib-src/gnuclient.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/gnuclient.c Mon Aug 13 11:35:02 2007 +0200 @@ -27,6 +27,17 @@ Please mail bugs and suggestions to the XEmacs maintainer. */ +/* #### This file should be a windows-mode, not console-mode program under + Windows. (i.e. its entry point should be WinMain.) gnuattach functionality, + to the extent it's used at all, should be retrieved using a script that + calls the i.exe wrapper program, to obtain stdio handles. + + #### For that matter, both the functionality of gnuclient and gnuserv + should be merged into XEmacs itself using a -remote arg, just like + Netscape and other modern programs. + + --ben */ + /* * This file incorporates new features added by Bob Weiner , * Darrell Kindred and Arup Mukherjee . @@ -48,7 +59,6 @@ #include #include #include -#define DONT_ENCAPSULATE #include #ifdef HAVE_STRING_H @@ -121,7 +131,7 @@ } void -initialize_signals () +initialize_signals (void) { /* Set up signal handler to pass relevant signals to emacs process. We used to send SIGSEGV, SIGBUS, SIGPIPE, SIGILL and others to @@ -190,7 +200,7 @@ /* Absolute (unix-style) pathname. Do nothing */ strcat (fullpath, filename); } -#ifdef __CYGWIN32__ +#ifdef CYGWIN else if (filename[0] && filename[0] == '\\' && filename[1] && filename[1] == '\\') { @@ -215,7 +225,7 @@ /* Assume relative Unix style path. Get the current directory and prepend it. FIXME: need to fix the case of DOS paths like "\foo", where we need to get the current drive. */ - + strcat (fullpath, get_current_working_directory ()); len = strlen (fullpath); @@ -231,13 +241,13 @@ /* Encase the string in quotes, escape all the backslashes and quotes in string. */ static char * -clean_string (CONST char *s) +clean_string (const char *s) { int i = 0; char *p, *res; { - CONST char *const_p; + const char *const_p; for (const_p = s; *const_p; const_p++, i++) { if (*const_p == '\\' || *const_p == '\"') @@ -293,7 +303,7 @@ /* A strdup imitation. */ static char * -my_strdup (CONST char *s) +my_strdup (const char *s) { char *new_s = (char *) malloc (strlen (s) + 1); if (new_s) @@ -451,11 +461,11 @@ { fprintf (stderr, #ifdef INTERNET_DOMAIN_SOCKETS - "usage: %s [-nw] [-display display] [-q] [-v] [-l library]\n" + "Usage: %s [-nw] [-display display] [-q] [-v] [-l library]\n" " [-batch] [-f function] [-eval form]\n" " [-h host] [-p port] [-r remote-path] [[+line] file] ...\n", #else /* !INTERNET_DOMAIN_SOCKETS */ - "usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval form] " + "Usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval form] " "[[+line] path] ...\n", #endif /* !INTERNET_DOMAIN_SOCKETS */ progname); @@ -563,7 +573,7 @@ progname); exit (1); } - /* Don't do disconnect_from_server becasue we have already read + /* Don't do disconnect_from_server because we have already read data, and disconnect doesn't do anything else. */ #ifndef INTERNET_DOMAIN_SOCKETS if (connect_type == (int) CONN_IPC) diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/gnuserv.c --- a/lib-src/gnuserv.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/gnuserv.c Mon Aug 13 11:35:02 2007 +0200 @@ -15,8 +15,8 @@ Please mail bugs and suggestions to the author at the above address. */ -/* HISTORY - * 11-Nov-1990 bristor@simba +/* HISTORY + * 11-Nov-1990 bristor@simba * Added EOT stuff. */ @@ -84,7 +84,7 @@ ipc_exit (int stat) { msgctl (ipc_qid,IPC_RMID,0); - + if (ipc_wpid != 0) kill (ipc_wpid, SIGKILL); @@ -102,7 +102,7 @@ } /* ipc_handle_signal */ -/* +/* ipc_spawn_watchdog -- spawn a watchdog task to clean up the message queue should the server process die. */ @@ -190,7 +190,7 @@ msgctl (ipc_qid, IPC_STAT, &msg_st); strncpy (buf, msgp->mtext, len); buf[len] = '\0'; /* terminate */ - + printf ("%d %s", ipc_qid, buf); fflush (stdout); @@ -210,7 +210,7 @@ /* read in "n/m:" (n=client fd, m=message length) */ - while (offset < (GSERV_BUFSZ-1) && + while (offset < (GSERV_BUFSZ-1) && ((len = read (0, buf + offset, 1)) > 0) && buf[offset] != ':') { @@ -237,7 +237,7 @@ exit (1); } - /* Send this string off, but only if we have enough space */ + /* Send this string off, but only if we have enough space */ if (GSERV_BUFSZ > total) { @@ -291,7 +291,7 @@ int len; printf("%d ",s); - + /* read until we get a newline or no characters */ while ((len = recv(s,buf,GSERV_BUFSZ-1,0)) > 0) { buf[len] = '\0'; @@ -309,7 +309,7 @@ fprintf(stderr,"%s: unable to recv\n",progname); exit(1); } /* if */ - + } /* echo_request */ @@ -327,7 +327,7 @@ int result_len; /* read in "n/m:" (n=client fd, m=message length) */ - while (offset < GSERV_BUFSZ && + while (offset < GSERV_BUFSZ && ((len = read(0,buf+offset,1)) > 0) && buf[offset] != ':') { offset += len; @@ -338,7 +338,7 @@ fprintf(stderr,"%s: unable to read\n",progname); exit(1); } - + /* parse the response from emacs, getting client fd & result length */ buf[offset] = '\0'; sscanf(buf,"%d/%d", &s, &result_len); @@ -371,7 +371,7 @@ /* send the newline */ buf[1] = '\0'; send_string(s,buf); - close(s); + close(s); } /* handle_response */ #endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ @@ -390,9 +390,9 @@ # include static Xauth *server_xauth = NULL; -#endif +#endif -static int +static int timed_read (int fd, char *buf, int max, int timeout, int one_line) { fd_set rmask; @@ -400,13 +400,13 @@ char c = 0; int nbytes = 0; int r; - + tv.tv_sec = timeout; tv.tv_usec = 0; FD_ZERO(&rmask); FD_SET(fd, &rmask); - + do { r = select(fd + 1, &rmask, NULL, NULL, &tv); @@ -444,8 +444,8 @@ return nbytes; } - - + + /* permitted -- return whether a given host is allowed to connect to the server. @@ -456,7 +456,7 @@ int key; struct entry *entry; - char auth_protocol[128]; + char auth_protocol[128]; char buf[1024]; int auth_data_len; @@ -465,17 +465,17 @@ /* we are checking permission on a real connection */ /* Read auth protocol name */ - + if (timed_read(fd, auth_protocol, AUTH_NAMESZ, AUTH_TIMEOUT, 1) <= 0) return FALSE; if (strcmp (auth_protocol, DEFAUTH_NAME) && strcmp (auth_protocol, MCOOKIE_NAME)) { - printf ("authentication protocol (%s) from client is invalid...\n", + printf ("authentication protocol (%s) from client is invalid...\n", auth_protocol); printf ("... Was the client an old version of gnuclient/gnudoit?\004\n"); - + return FALSE; } @@ -493,17 +493,17 @@ if (timed_read(fd, buf, auth_data_len, AUTH_TIMEOUT, 0) != auth_data_len) return FALSE; - + #ifdef AUTH_MAGIC_COOKIE if (server_xauth && server_xauth->data && !memcmp(buf, server_xauth->data, auth_data_len)) { return TRUE; } -#else +#else printf ("client tried Xauth, but server is not compiled with Xauth\n"); #endif - + /* * auth failed, but allow this to fall through to the GNU_SECURE * protocol.... @@ -512,7 +512,7 @@ printf ("Xauth authentication failed, trying GNU_SECURE auth...\004\n"); } - + /* Other auth protocols go here, and should execute only if the * auth_protocol name matches. */ @@ -521,30 +521,30 @@ /* Now, try the old GNU_SECURE stuff... */ - + /* First find the hash key */ key = HASH(host_addr) % TABLE_SIZE; - + /* Now check the chain for that hash key */ for(entry=permitted_hosts[key]; entry != NULL; entry=entry->next) - if (host_addr == entry->host_addr) + if (host_addr == entry->host_addr) return(TRUE); - + return(FALSE); } /* permitted */ -/* +/* add_host -- add the given host to the list of permitted hosts, provided it isn't already there. -*/ +*/ static void add_host (u_long host_addr) { int key; struct entry *new_entry; - + if (!permitted(host_addr, -1)) { if ((new_entry = (struct entry *) malloc(sizeof(struct entry))) == NULL) { @@ -578,7 +578,7 @@ char hostname[HOSTNAMSZ]; u_int host_addr; int i, hosts=0; - + /* Make sure every entry is null */ for (i=0; is_port; - + /* Create the listen socket. */ if ((ls = socket (AF_INET,SOCK_STREAM, 0)) == -1) { @@ -662,7 +662,7 @@ fprintf(stderr,"%s: unable to create socket\n",progname); exit(1); } /* if */ - + /* Bind the listen address to the socket. */ if (bind(ls,(struct sockaddr *) &server,sizeof(struct sockaddr_in)) == -1) { @@ -672,7 +672,7 @@ } /* if */ /* Initiate the listen on the socket so remote users - * can connect. + * can connect. */ if (listen(ls,20) == -1) { @@ -694,10 +694,10 @@ handle_internet_request (int ls) { int s; - size_t addrlen = sizeof(struct sockaddr_in); + socklen_t addrlen = sizeof (struct sockaddr_in); struct sockaddr_in peer; /* for peer socket address */ - memset((char *)&peer,0,sizeof(struct sockaddr_in)); + memset (&peer, '\0', sizeof (peer)); if ((s = accept(ls,(struct sockaddr *)&peer, &addrlen)) == -1) { @@ -705,7 +705,7 @@ fprintf(stderr,"%s: unable to accept\n",progname); exit(1); } /* if */ - + /* Check that access is allowed - if not return crud to the client */ if (!permitted(peer.sin_addr.s_addr, s)) { @@ -717,7 +717,7 @@ } /* if */ echo_request(s); - + } /* handle_internet_request */ #endif /* INTERNET_DOMAIN_SOCKETS */ @@ -732,7 +732,7 @@ { int ls; /* socket descriptor */ struct sockaddr_un server; /* unix socket address */ - int bindlen; + socklen_t bindlen; if ((ls = socket(AF_UNIX,SOCK_STREAM, 0)) < 0) { @@ -772,7 +772,7 @@ #else bindlen = strlen (server.sun_path) + sizeof (server.sun_family); #endif - + if (bind(ls,(struct sockaddr *)&server,bindlen) < 0) { perror(progname); @@ -791,7 +791,7 @@ /* #### there are also better ways of dealing with this when sigvec() is present. */ #if defined (HAVE_SIGPROCMASK) - { + { sigset_t _mask; sigemptyset (&_mask); sigaddset (&_mask, SIGPIPE); @@ -814,7 +814,7 @@ handle_unix_request (int ls) { int s; - size_t len = sizeof(struct sockaddr_un); + socklen_t len = sizeof (struct sockaddr_un); struct sockaddr_un server; /* for unix socket address */ server.sun_family = AF_UNIX; @@ -826,7 +826,7 @@ } /* if */ echo_request(s); - + } /* handle_unix_request */ #endif /* UNIX_DOMAIN_SOCKETS */ @@ -883,13 +883,13 @@ FD_SET(uls, &rmask); if (ils >= 0) FD_SET(ils, &rmask); - - if (select(max2(fileno(stdin),max2(uls,ils)) + 1, &rmask, + + if (select(max2(fileno(stdin),max2(uls,ils)) + 1, &rmask, (fd_set *)NULL, (fd_set *)NULL, (struct timeval *)NULL) < 0) { perror(progname); fprintf(stderr,"%s: unable to select\n",progname); - exit(1); + return 1; } /* if */ #ifdef UNIX_DOMAIN_SOCKETS @@ -905,9 +905,7 @@ if (FD_ISSET(fileno(stdin), &rmask)) /* from stdin (gnu process) */ handle_response(); #endif /* NOT SYSV_IPC */ - } /* while */ - - return 0; + } /* while (1) */ } /* main */ #endif /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */ diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/gnuserv.h --- a/lib-src/gnuserv.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/gnuserv.h Mon Aug 13 11:35:02 2007 +0200 @@ -36,18 +36,13 @@ #define USE_TMPDIR -#define NO_SHORTNAMES - #define PATCHLEVEL 2 #define NO_SHORTNAMES /* gnuserv should not be compiled using SOCKS */ #define DO_NOT_SOCKSIFY +#define DONT_ENCAPSULATE #include -#undef read -#undef write -#undef open -#undef close #undef signal /* Define the communication method between server and clients: @@ -174,7 +169,7 @@ */ #ifndef DONT_USE_LITOUT #if !defined(HAVE_TERMIO) && !defined(HAVE_TERMIOS) && !defined(VMS) -#if !defined(MSDOS) && !defined(BSD4_1) +#if !defined(BSD4_1) #define USE_LITOUT #endif #endif @@ -216,7 +211,7 @@ void disconnect_from_ipc_server(); #endif #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) -void send_string (int s, CONST char *msg); +void send_string (int s, const char *msg); void disconnect_from_server (int s, int echo); int read_line (int s, char *dest); #endif diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/gnuslib.c --- a/lib-src/gnuslib.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/gnuslib.c Mon Aug 13 11:35:02 2007 +0200 @@ -194,7 +194,7 @@ send_string -- send string to socket. */ void -send_string (int s, CONST char *msg) +send_string (int s, const char *msg) { #if 0 if (send(s,msg,strlen(msg),0) < 0) { diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/hexl.c --- a/lib-src/hexl.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/hexl.c Mon Aug 13 11:35:02 2007 +0200 @@ -4,14 +4,16 @@ #include #include -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE #include #include #endif #if __STDC__ || defined(STDC_HEADERS) #include +#ifdef HAVE_UNISTD_H #include +#endif #include #endif @@ -142,12 +144,12 @@ { char buf[18]; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE _setmode (_fileno (stdout), O_BINARY); #endif for (;;) { - register int i, c, d; + register int i, c = 0, d; #define hexchar(x) (isdigit (x) ? x - '0' : x - 'a' + 10) @@ -185,7 +187,7 @@ } else { -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE _setmode (_fileno (fp), O_BINARY); #endif address = 0; @@ -193,7 +195,7 @@ string[17] = '\0'; for (;;) { - register int i, c; + register int i, c = 0; for (i=0; i < 16; ++i) { @@ -242,8 +244,8 @@ } void -usage () +usage (void) { - (void) fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); + fprintf (stderr, "Usage: %s [-de] [-iso]\n", progname); exit (1); } diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/i.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/i.c Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,185 @@ +/* I-connector utility + Copyright (C) 2000 Kirill M. Katsnelson + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* When run with an argument, i treats it as a command line, and pipes +command stdin, stdout and stderr to its own respective streams. How +silly it should sound, but windowed program in Win32 cannot do output +to the console from which it has been started, and should be run using +this utility. + +This utility is for running [tx]emacs as part of make process so that +its output goes to the same console as the rest of the make output +does. It can be used also when xemacs should be run as a batch +command ina script, especially when its standart output should be +obtained programmatically. */ + +#include +#include +#include +#include + +typedef struct +{ + HANDLE source; + HANDLE drain; +} I_connector; + +/* + * Make new handle as that pointed to by PH but + * inheritable, substitute PH with it, and close the + * original one + */ +static void +make_inheritable (HANDLE* ph) +{ + HANDLE htmp; + DuplicateHandle (GetCurrentProcess(), *ph, GetCurrentProcess(), &htmp, + 0, TRUE, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS); + *ph = htmp; +} + +/* + * Worker thread proc. Reads source, pumps into drain, + * till either clogs. + */ +static DWORD CALLBACK +pump (LPVOID pv_i) +{ + I_connector* pi = (I_connector*) pv_i; + BYTE buffer [256]; + DWORD really_read, unused; + + while (ReadFile (pi->source, buffer, sizeof (buffer), &really_read, NULL) && + WriteFile (pi->drain, buffer, really_read, &unused, NULL)) + ; + + return 0; +} + +/* + * Launch a pump for the given I-connector + */ +static void +start_pump (I_connector* pi) +{ + DWORD unused; + HANDLE h_thread = CreateThread (NULL, 0, pump, (void*)pi, 0, &unused); + CloseHandle (h_thread); +} + +/* + * Get command line, skip over the executable name, return the rest. + */ +static LPTSTR +get_command (void) +{ + LPTSTR cl = GetCommandLine (); + int ix; + + while (1) + { + ix = _tcscspn (cl, _T(" \t\"")); + if (cl[ix] == '\"') + { + cl = _tcschr (cl + ix + 1, '\"'); + if (cl == NULL) + return NULL; /* Unmatched quote */ + cl++; + } + else + { + cl += ix; + cl += _tcsspn (cl, _T(" \t")); + return *cl ? cl : NULL; + } + } +} + +/* + * Brew coffee and bring snickers + */ +void +usage (void) +{ + fprintf (stderr, + "\n" + "usage: i command\n" + "i executes the command and reroutes its standard handles to the calling\n" + "console. Good for seeing output of GUI programs that use standard output." + "\n"); +} + +int +main (void) +{ + STARTUPINFO si; + PROCESS_INFORMATION pi; + I_connector I_in, I_out, I_err; + DWORD exit_code; + + LPTSTR command = get_command (); + if (command == NULL) + { + usage (); + return 1; + } + + ZeroMemory (&si, sizeof (si)); + si.dwFlags = STARTF_USESTDHANDLES; + + I_in.source = GetStdHandle (STD_INPUT_HANDLE); + CreatePipe (&si.hStdInput, &I_in.drain, NULL, 0); + make_inheritable (&si.hStdInput); + + I_out.drain = GetStdHandle (STD_OUTPUT_HANDLE); + CreatePipe (&I_out.source, &si.hStdOutput, NULL, 0); + make_inheritable (&si.hStdOutput); + + I_err.drain = GetStdHandle (STD_ERROR_HANDLE); + CreatePipe (&I_err.source, &si.hStdError, NULL, 0); + make_inheritable (&si.hStdError); + + if (CreateProcess (NULL, command, NULL, NULL, TRUE, 0, + NULL, NULL, &si, &pi) == 0) + { + _ftprintf (stderr, _T("Error %d launching `%s'\n"), + GetLastError (), command); + return 2; + } + + CloseHandle (pi.hThread); + + /* Start pump in each I-connector */ + start_pump (&I_in); + start_pump (&I_out); + start_pump (&I_err); + + /* Wait for the process to complete */ + WaitForSingleObject (pi.hProcess, INFINITE); + GetExitCodeProcess (pi.hProcess, &exit_code); + CloseHandle (pi.hProcess); + + /* Make pump threads eventually die out. Looks rude, I agree */ + CloseHandle (GetStdHandle (STD_INPUT_HANDLE)); + CloseHandle (GetStdHandle (STD_OUTPUT_HANDLE)); + CloseHandle (GetStdHandle (STD_ERROR_HANDLE)); + + return exit_code; +} diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/make-docfile.c --- a/lib-src/make-docfile.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/make-docfile.c Mon Aug 13 11:35:02 2007 +0200 @@ -46,40 +46,38 @@ #include #if __STDC__ || defined(STDC_HEADERS) #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include #endif -#if defined(MSDOS) || defined(__CYGWIN32__) +#ifdef CYGWIN #include -#endif /* MSDOS */ -#ifdef WINDOWSNT +#endif +#ifdef WIN32_NATIVE #include #include #include #include -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ +#ifndef WIN32_NATIVE #include +#endif /* not WIN32_NATIVE */ -#if defined(DOS_NT) || defined(__CYGWIN32__) +#if defined(WIN32_NATIVE) || defined(CYGWIN) #define READ_TEXT "rt" #define READ_BINARY "rb" #define WRITE_BINARY "wb" #define APPEND_BINARY "ab" -#else /* not DOS_NT */ +#else /* not WIN32_NATIVE */ #define READ_TEXT "r" #define READ_BINARY "r" #define WRITE_BINARY "w" #define APPEND_BINARY "a" -#endif /* not DOS_NT */ - -#ifdef MSDOS -/* s/msdos.h defines this as sys_chdir, but we're not linking with the - file where that function is defined. */ -#undef chdir -#endif +#endif /* not WIN32_NATIVE */ /* Stdio stream for output to the DOC file. */ static FILE *outfile; @@ -91,14 +89,14 @@ c_file } Current_file_type; -static int scan_file (CONST char *filename); +static int scan_file (const char *filename); static int read_c_string (FILE *, int, int); -static void write_c_args (FILE *out, CONST char *func, char *buf, int minargs, +static void write_c_args (FILE *out, const char *func, char *buf, int minargs, int maxargs); -static int scan_c_file (CONST char *filename, CONST char *mode); +static int scan_c_file (const char *filename, const char *mode); static void skip_white (FILE *); static void read_lisp_symbol (FILE *, char *); -static int scan_lisp_file (CONST char *filename, CONST char *mode); +static int scan_lisp_file (const char *filename, const char *mode); #define C_IDENTIFIER_CHAR_P(c) \ (('A' <= c && c <= 'Z') || \ @@ -115,7 +113,7 @@ /* Print error message. `s1' is printf control string, `s2' is arg for it. */ static void -error (CONST char *s1, CONST char *s2) +error (const char *s1, const char *s2) { fprintf (stderr, "%s: ", progname); fprintf (stderr, s1, s2); @@ -125,7 +123,7 @@ /* Print error message and exit. */ static void -fatal (CONST char *s1, CONST char *s2) +fatal (const char *s1, const char *s2) { error (s1, s2); exit (1); @@ -191,19 +189,10 @@ outfile = stdout; /* Don't put CRs in the DOC file. */ -#ifdef MSDOS - _fmode = O_BINARY; -#if 0 /* Suspicion is that this causes hanging. - So instead we require people to use -o on MSDOS. */ - (stdout)->_flag &= ~_IOTEXT; - _setmode (fileno (stdout), O_BINARY); -#endif - outfile = 0; -#endif /* MSDOS */ -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE _fmode = O_BINARY; _setmode (fileno (stdout), O_BINARY); -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ /* If first two args are -o FILE, output to FILE. */ i = 1; @@ -274,7 +263,7 @@ /* Return 1 if file is not found, 0 if it is found. */ static int -scan_file (CONST char *filename) +scan_file (const char *filename) { int len = strlen (filename); if (ellcc == 0 && len > 4 && !strcmp (filename + len - 4, ".elc")) @@ -303,48 +292,59 @@ Convert escape sequences \n and \t to newline and tab; discard \ followed by newline. */ +#define MDGET do { prevc = c; c = getc (infile); } while (0) static int read_c_string (FILE *infile, int printflag, int c_docstring) { - register int c; + register int prevc = 0, c = 0; char *p = buf; int start = -1; - c = getc (infile); + MDGET; while (c != EOF) { while ((c_docstring || c != '"') && c != EOF) { - if (start) + if (c == '*') { - if (c == '*') + int cc = getc (infile); + if (cc == '/') { - int cc = getc (infile); - if (cc == '/') - break; - else - ungetc (cc, infile); + if (prevc != '\n') + { + if (printflag > 0) + { + if (ellcc) + fprintf (outfile, "\\n\\"); + putc ('\n', outfile); + } + else if (printflag < 0) + *p++ = '\n'; + } + break; } + else + ungetc (cc, infile); + } - if (start != -1) + if (start == 1) + { + if (printflag > 0) { - if (printflag > 0) - { - if (ellcc) - fprintf (outfile, "\\n\\"); - putc ('\n', outfile); - } - else if (printflag < 0) - *p++ = '\n'; + if (ellcc) + fprintf (outfile, "\\n\\"); + putc ('\n', outfile); } + else if (printflag < 0) + *p++ = '\n'; } if (c == '\\') { - c = getc (infile); + MDGET; if (c == '\n') { - c = getc (infile); + MDGET; start = 1; continue; } @@ -358,32 +358,36 @@ else { start = 0; - if (printflag > 0) { - if (ellcc && c == '"') - putc ('\\', outfile); - putc (c, outfile); - } + if (printflag > 0) + { + if (ellcc && c == '"') + putc ('\\', outfile); + putc (c, outfile); + } else if (printflag < 0) *p++ = c; } - c = getc (infile); + MDGET; } /* look for continuation of string */ if (Current_file_type == c_file) { - while (isspace (c = getc (infile))) - ; + do + { + MDGET; + } + while (isspace (c)); if (c != '"') break; } else { - c = getc (infile); + MDGET; if (c != '"') break; /* If we had a "", concatenate the two strings. */ } - c = getc (infile); + MDGET; } if (printflag < 0) @@ -396,7 +400,7 @@ MINARGS and MAXARGS are the minimum and maximum number of arguments. */ static void -write_c_args (FILE *out, CONST char *func, char *buff, int minargs, +write_c_args (FILE *out, const char *func, char *buff, int minargs, int maxargs) { register char *p; @@ -496,7 +500,7 @@ Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */ static int -scan_c_file (CONST char *filename, CONST char *mode) +scan_c_file (const char *filename, const char *mode) { FILE *infile; register int c; @@ -787,7 +791,7 @@ } static int -scan_lisp_file (CONST char *filename, CONST char *mode) +scan_lisp_file (const char *filename, const char *mode) { FILE *infile; register int c; diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/make-dump-id.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/make-dump-id.c Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,79 @@ +/* Generate a unique dump-id for use with the portable dumper. + Copyright (C) 2000 Olivier Galibert, Martin Buchholz + +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. */ + +#include +#include +#include +#include "../src/systime.h" + +#ifdef WIN32_NATIVE +#include + +/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ +void +gettimeofday (struct timeval *tv, struct timezone *tz) +{ + struct _timeb tb; + _ftime (&tb); + + tv->tv_sec = tb.time; + tv->tv_usec = tb.millitm * 1000L; + if (tz) + { + tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ + tz->tz_dsttime = tb.dstflag; /* type of dst correction */ + } +} +#endif + +/* Generates an (extremely) pseudo random number for the dump-id */ +static unsigned int +generate_dump_id (void) +{ + EMACS_TIME thyme; + EMACS_GET_TIME (thyme); + + return (unsigned int) (EMACS_SECS (thyme) ^ EMACS_USECS (thyme)); +} + +int +main (int argc, char *argv[]) +{ + FILE *f; + + if ((f = fopen ("dump-id.c", "w")) == NULL) + { + perror ("open dump-id.c"); + return EXIT_FAILURE; + } + + fprintf (f, + "#include \n" + "unsigned int dump_id = %uU;\n", + generate_dump_id ()); + + if ((fclose (f)) != 0) + { + perror ("close dump-id.c"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/make-msgfile.c --- a/lib-src/make-msgfile.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/make-msgfile.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,10 +1,10 @@ -/* - - +/* + + PROPOSAL FOR HOW THIS ALL OUGHT TO WORK this isn't implemented yet, but this is the plan-in-progress - + In general, it's accepted that the best way to internationalize is for all messages to be referred to by a symbolic name (or number) and come out of a table or tables, which are easy to change. @@ -54,11 +54,11 @@ something has gone wrong. (Except to do things like remove assumptions about the order of words within a sentence, or how pluralization works.) - There are two parts to the task of displaying translated strings to the + There are two parts to the task of displaying translated strings to the user: the first is to extract the strings which need to be translated from the sources; and the second is to make some call which will translate those strings before they are presented to the user. - + The old way was to use the same form to do both, that is, GETTEXT() was both the tag that we searched for to build a catalog, and was the form which did the translation. The new plan is to separate these two things more: the @@ -66,36 +66,36 @@ already, and the translation will get done in some more centralized, lower level place. - This program (make-msgfile.c) addresses the first part, extracting the + This program (make-msgfile.c) addresses the first part, extracting the strings. - + For the emacs C code, we need to recognize the following patterns: - + message ("string" ... ) error ("string") report_file_error ("string" ... ) signal_simple_error ("string" ... ) signal_simple_error_2 ("string" ... ) - + build_translated_string ("string") #### add this and use it instead of build_string() in some places. - + yes_or_no_p ("string" ... ) #### add this instead of funcalling Qyes_or_no_p directly. barf_or_query_if_file_exists #### restructure this check all callers of Fsignal #### restructure these signal_error (Qerror ... ) #### change all of these to error() - + And we also parse out the `interactive' prompts from DEFUN() forms. - + #### When we've got a string which is a candidate for translation, we should ignore it if it contains only format directives, that is, if there are no alphabetic characters in it that are not a part of a `%' directive. (Careful not to translate either "%s%s" or "%s: ".) For the emacs Lisp code, we need to recognize the following patterns: - + (message "string" ... ) (error "string" ... ) (format "string" ... ) @@ -106,20 +106,20 @@ (read-file-name "string" ... ) (temp-minibuffer-message "string") (query-replace-read-args "string" ... ) - + I expect there will be a lot like the above; basically, any function which is a commonly used wrapper around an eventual call to `message' or `read-from-minibuffer' needs to be recognized by this program. (dgettext "domain-name" "string") #### do we still need this? - + things that should probably be restructured: `princ' in cmdloop.el `insert' in debug.el face-interactive help.el, syntax.el all messed up - + Menu descriptors: one way to extract the strings in menu labels would be to teach this program about "^(defvar .*menu\n" forms; that's probably @@ -128,8 +128,8 @@ "string" ... ;###translate - where the magic token ";###translate" on a line means that the string - constant on this line should go into the message catalog. This is analagous + where the magic token ";###translate" on a line means that the string + constant on this line should go into the message catalog. This is analogous to the magic ";###autoload" comments, and to the magic comments used in the EPSF structuring conventions. @@ -139,7 +139,7 @@ translations, there are hooks in a small number of low level places in emacs. - Assume the existence of a C function gettext(str) which returns the + Assume the existence of a C function gettext(str) which returns the translation of `str' if there is one, otherwise returns `str'. - message() takes a char* as its argument, and always filters it through @@ -174,12 +174,12 @@ Solving the "translating too much" problem: The concern has been raised that in this situation: - "Help" is a string for which we know a translation; - - someone visits a file called Help, and someone does something + - someone visits a file called Help, and someone does something contrived like (error buffer-file-name) then we would display the translation of Help, which would not be correct. We can solve this by adding a bit to Lisp_String objects which identifies them as having been read as literal constants from a .el or .elc file (as - opposed to having been constructed at run time as it would in the above + opposed to having been constructed at run time as it would in the above case.) To solve this: - Fmessage() takes a lisp string as its first argument. @@ -306,7 +306,7 @@ else process_Lisp_file (); fputc ('\n', outfile); - + fclose (infile); } diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/mmencode.c --- a/lib-src/mmencode.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/mmencode.c Mon Aug 13 11:35:02 2007 +0200 @@ -385,7 +385,7 @@ putc(c1<<4 | c2, outfile); } } else { -#ifdef MSDOS +#ifdef WIN32_NATIVE if (*s == '\n') putc('\r', outfile); /* insert CR for binary-mode write */ #endif @@ -442,7 +442,8 @@ OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. */ -#ifdef MSDOS +#ifdef WIN32_NATIVE +#include #include #endif @@ -487,7 +488,7 @@ exit(-1); } } else { -#ifdef MSDOS +#ifdef WIN32_NATIVE if (encode) fp = fopen(argv[i], "rb"); else @@ -497,16 +498,16 @@ } /* else */ #else fp = fopen(argv[i], "r"); -#endif /* MSDOS */ +#endif /* WIN32_NATIVE */ if (!fp) { perror(argv[i]); exit(-1); } } } -#ifdef MSDOS +#ifdef WIN32_NATIVE if (fp == stdin) setmode(fileno(fp), O_BINARY); -#endif /* MSDOS */ +#endif /* WIN32_NATIVE */ if (which == BASE64) { if (encode) { to64(fp, fpo, portablenewlines); diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/movemail.c --- a/lib-src/movemail.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/movemail.c Mon Aug 13 11:35:02 2007 +0200 @@ -69,7 +69,7 @@ #include #include "../src/sysfile.h" #include "../src/syswait.h" -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE #include "../src/systime.h" #endif #include @@ -87,10 +87,6 @@ char * strerror (int errnum); #endif /* HAVE_STRERROR */ -#ifdef MSDOS -#undef access -#endif /* MSDOS */ - #ifndef DIRECTORY_SEP #define DIRECTORY_SEP '/' #endif @@ -98,7 +94,7 @@ #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) #endif -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE #undef access #undef unlink #define fork() 0 @@ -110,7 +106,7 @@ properly - make sure it does before you enable this! */ #define DISABLE_DIRECT_ACCESS #include -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ #if defined (HAVE_UNISTD_H) #include @@ -204,7 +200,9 @@ #define DEFAULT_LOCKING DOTLOCKING #endif +#ifndef DISABLE_DIRECT_ACCESS static void lock_dot(char *); +#endif static void unlock_dot(char *); static int parse_lock_method(char *); static char *unparse_lock_method(int); @@ -341,7 +339,7 @@ exit (retcode); } -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE setuid (getuid ()); #endif #endif /* MAIL_USE_POP */ @@ -566,6 +564,7 @@ static char *dotlock_filename = NULL; +#ifndef DISABLE_DIRECT_ACCESS static void lock_dot(char *filename) { @@ -625,6 +624,7 @@ } strcpy(dotlock_filename, filename); } +#endif /* not DISABLE_DIRECT_ACCESS */ static void unlock_dot(char *filename) @@ -705,7 +705,7 @@ #ifdef MAIL_USE_POP -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE #include #include #include @@ -714,7 +714,7 @@ #include #endif #include -#include +#include "../src/syspwd.h" #define POP_ERROR (-1) #define POP_RETRIEVED (0) @@ -770,7 +770,7 @@ error ("Error in open: %s, %s", strerror (errno), outfile); return (1); } -#if !defined(__CYGWIN32__) && !defined(WINDOWSNT) +#if !defined(CYGWIN) && !defined(WIN32_NATIVE) fchown (mbfi, getuid (), (gid_t) -1); #endif diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/ootags.c --- a/lib-src/ootags.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/ootags.c Mon Aug 13 11:35:02 2007 +0200 @@ -64,31 +64,18 @@ # define DEBUG FALSE #endif -#ifdef MSDOS -# include -# include -# include -# ifndef HAVE_CONFIG_H -# define DOS_NT -# include -# endif -#endif /* MSDOS */ - -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE # include # include # include # include # define MAXPATHLEN _MAX_PATH -# ifdef HAVE_CONFIG_H -# undef HAVE_NTGUI -# else -# define DOS_NT +# ifndef HAVE_CONFIG_H # define HAVE_GETCWD # endif /* not HAVE_CONFIG_H */ -#endif /* WINDOWSNT */ - -#if !defined (WINDOWSNT) && defined (STDC_HEADERS) +#endif /* WIN32_NATIVE */ + +#if !defined (WIN32_NATIVE) && defined (STDC_HEADERS) #include #include #endif @@ -870,9 +857,9 @@ bool got_err; #endif -#ifdef DOS_NT +#ifdef WIN32_NATIVE _fmode = O_BINARY; /* all of files are treated as binary files */ -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ progname = argv[0]; nincluded_files = 0; @@ -1064,12 +1051,12 @@ if (streq (tagfile, "-")) { tagf = stdout; -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Switch redirected `stdout' to binary mode (setting `_fmode' doesn't take effect until after `stdout' is already open). */ if (!isatty (fileno (stdout))) setmode (fileno (stdout), O_BINARY); -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ } else tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); @@ -4960,7 +4947,7 @@ if (p > buffer && p[-1] == '\r') { p -= 1; -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Assume CRLF->LF translation will be performed by Emacs when loading this file, so CRs won't appear in the buffer. It would be cleaner to compensate within Emacs; @@ -5216,19 +5203,6 @@ return path; #else /* not HAVE_GETCWD */ -#ifdef MSDOS - char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ - - getwd (path); - - for (p = path; *p != '\0'; p++) - if (*p == '\\') - *p = '/'; - else - *p = lowcase (*p); - - return strdup (path); -#else /* not MSDOS */ linebuffer path; FILE *pipe; @@ -5239,7 +5213,6 @@ pclose (pipe); return path.buffer; -#endif /* not MSDOS */ #endif /* not HAVE_GETCWD */ } @@ -5289,7 +5262,7 @@ if (filename_is_absolute (file)) res = savestr (file); -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* We don't support non-absolute file names with a drive letter, like `d:NAME' (it's too much hassle). */ else if (file[1] == ':') @@ -5313,8 +5286,8 @@ while (cp >= res && !filename_is_absolute (cp)); if (cp < res) cp = slashp; /* the absolute name begins with "/.." */ -#ifdef DOS_NT - /* Under MSDOS and NT we get `d:/NAME' as absolute +#ifdef WIN32_NATIVE + /* Under Windows we get `d:/NAME' as absolute file name, so the luser could say `d:/../NAME'. We silently treat this as `d:/NAME'. */ else if (cp[0] != '/') @@ -5369,7 +5342,7 @@ char *fn; { return (fn[0] == '/' -#ifdef DOS_NT +#ifdef WIN32_NATIVE || (isalpha(fn[0]) && fn[1] == ':' && fn[2] == '/') #endif ); @@ -5380,7 +5353,7 @@ canonicalize_filename (fn) register char *fn; { -#ifdef DOS_NT +#ifdef WIN32_NATIVE for (; *fn != '\0'; fn++) if (*fn == '\\') *fn = '/'; diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/pop.c --- a/lib-src/pop.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/pop.c Mon Aug 13 11:35:02 2007 +0200 @@ -21,6 +21,7 @@ #ifdef HAVE_CONFIG_H #define NO_SHORTNAMES /* Tell config not to load remap.h */ +#define DONT_ENCAPSULATE #include #else #define MAIL_USE_POP @@ -28,16 +29,8 @@ #ifdef MAIL_USE_POP -#ifdef HAVE_CONFIG_H -/* Cancel these substitutions made in config.h */ -#undef open -#undef read -#undef write -#undef close -#endif - #include -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE #include #undef SOCKET_ERROR #define RECV(s,buf,len,flags) recv(s,buf,len,flags) @@ -67,16 +60,22 @@ extern struct servent *hes_getservbyname (/* char *, char * */); #endif -#include +#include "../src/syspwd.h" +#ifndef WIN32_NATIVE #include +#endif #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include +#ifndef WIN32_NATIVE #include +#endif #include "../src/syswait.h" -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE #include "../src/systime.h" #endif #include @@ -103,7 +102,7 @@ #endif /* ! KRB5 */ #endif /* KERBEROS */ -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE #if !defined(HAVE_H_ERRNO) || !defined(HAVE_CONFIG_H) extern int h_errno; #endif @@ -123,7 +122,7 @@ #define ERROR_MAX 80 /* a pretty arbitrary size */ #define POP_PORT 110 #define KPOP_PORT 1109 -#if defined(WINDOWSNT) || defined(__CYGWIN32__) +#if defined(WIN32_NATIVE) || defined(CYGWIN) #define POP_SERVICE "pop3" /* we don't want the POP2 port! */ #else #define POP_SERVICE "pop" @@ -184,7 +183,7 @@ username = getenv ("USER"); if (! (username && *username)) { -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE username = getlogin (); if (! (username && *username)) { @@ -253,7 +252,7 @@ if ((! password) && (! DONT_NEED_PASSWORD)) { -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE if (! (flags & POP_NO_GETPASS)) { password = getpass ("Enter POP password:"); @@ -932,7 +931,7 @@ return (ret); } -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE static int have_winsock = 0; #endif @@ -977,7 +976,7 @@ int try_count = 0; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE { WSADATA winsockData; if (WSAStartup (0x101, &winsockData) == 0) @@ -1482,7 +1481,7 @@ } } -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE if (have_winsock) WSACleanup (); #endif diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/profile.c --- a/lib-src/profile.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/profile.c Mon Aug 13 11:35:02 2007 +0200 @@ -41,7 +41,7 @@ static int watch_not_started = 1; /* flag */ static char time_string[30]; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE #include /* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ void diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/run.c --- a/lib-src/run.c Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,715 +0,0 @@ -/* run -- Wrapper program for console mode programs under Windows(TM) - * Copyright (C) 1998 Charles S. Wilson - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* - * This program is based on the runemacs.c distributed with XEmacs 21.0 - * - * Simple program to start gnu-win32 X11 programs (and native XEmacs) - * with its console window hidden. - * - * This program is provided purely for convenience, since most users will - * use XEmacs in windowing (GUI) mode, and will not want to have an extra - * console window lying around. Ditto for desktop shortcuts to gnu-win32 - * X11 executables. - */ - - -#define WIN32 - -#include -#include -#include -#include -#include -#include - -#include "run.h" - -#if defined(__CYGWIN__) - #include - #include - #include - #include -WinMainCRTStartup() { mainCRTStartup(); } -#else - #include -#endif - - -char buffer[1024]; - -int WINAPI -WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) -{ - int wait_for_child = FALSE; - int compact_invocation = FALSE; - DWORD ret_code = 0; - - - char execname[FILENAME_MAX]; - char execpath[MAX_PATH]; - char* argv[MAX_ARGS+1]; /* leave extra slot for compact_invocation argv[0] */ - int argc; - int i; - char exec[MAX_PATH + FILENAME_MAX + 100]; - char cmdline2[MAX_ARGS * MAX_PATH]; - -#ifdef Debug - int j; -#endif - - compact_invocation = get_exec_name_and_path(execname,execpath); - - if (compact_invocation) - { - argv[0] = execname; - argc = parse_cmdline_to_arg_array(&(argv[1]),cmdline); - argc++; - } - else - { - argc = parse_cmdline_to_arg_array(argv,cmdline); - if (argc >= 1) - strcpy(execname,argv[0]); - } - /* at this point, execpath is defined, as are argv[] and execname */ -#ifdef DEBUG - j = sprintf(buffer,"\nexecname : %s\nexecpath : %s\n",execname,execpath); - for (i = 0; i < argc; i++) - j += sprintf(buffer+j,"argv[%d]\t: %s\n",i,argv[i]); - Trace((buffer)); -#endif - - if (execname == NULL) - error("you must supply a program name to run"); - -#if defined(__CYGWIN__) - /* this insures that we search for symlinks before .exe's */ - if (compact_invocation) - strip_exe(execname); -#endif - - process_execname(exec,execname,execpath); - Trace(("exec\t%s\nexecname\t%s\nexecpath\t%s\n", - exec,execname,execpath)); - - wait_for_child = build_cmdline(cmdline2,exec,argc,argv); - Trace((cmdline2)); - - xemacs_special(exec); - ret_code = start_child(cmdline2,wait_for_child); - if (compact_invocation) - for (i = 1; i < argc; i++) // argv[0] was not malloc'ed - free(argv[i]); - else - for (i = 0; i < argc; i++) - free(argv[i]); - return (int) ret_code; -} -int start_child(char* cmdline, int wait_for_child) -{ - STARTUPINFO start; - SECURITY_ATTRIBUTES sec_attrs; - PROCESS_INFORMATION child; - int retval; - - memset (&start, 0, sizeof (start)); - start.cb = sizeof (start); - start.dwFlags = STARTF_USESHOWWINDOW; - start.wShowWindow = SW_HIDE; - - sec_attrs.nLength = sizeof (sec_attrs); - sec_attrs.lpSecurityDescriptor = NULL; - sec_attrs.bInheritHandle = FALSE; - - if (CreateProcess (NULL, cmdline, &sec_attrs, NULL, TRUE, 0, - NULL, NULL, &start, &child)) - { - if (wait_for_child) - { - WaitForSingleObject (child.hProcess, INFINITE); - GetExitCodeProcess (child.hProcess, &retval); - } - CloseHandle (child.hThread); - CloseHandle (child.hProcess); - } - else - error("could not start %s",cmdline); - return retval; -} -void xemacs_special(char* exec) -{ - /* - * if we're trying to run xemacs, AND this file was in %emacs_dir%\bin, - * then set emacs_dir environment variable - */ - char* p; - char* p2; - char exec2[MAX_PATH + FILENAME_MAX + 100]; -#if defined(__CYGWIN__) - char tmp[MAX_PATH + FILENAME_MAX + 100]; -#endif - strcpy(exec2,exec); - /* this depends on short-circuit evaluation */ - if ( ((p = strrchr(exec2,'\\')) && stricmp(p,"\\xemacs") == 0) || - ((p = strrchr(exec2,'/')) && stricmp(p,"/xemacs") == 0) || - ((p = strrchr(exec2,'\\')) && stricmp(p,"\\xemacs.exe") == 0) || - ((p = strrchr(exec2,'/')) && stricmp(p,"/xemacs.exe") == 0) ) - { - if ( ((p2 = strrchr(p, '\\')) && stricmp(p2, "\\bin") == 0) || - ((p2 = strrchr(p, '/')) && stricmp(p2, "/bin") == 0) ) - { - *p2 = '\0'; -#if defined(__CYGWIN__) - CYGWIN_CONV_TO_POSIX_PATH((exec2,tmp)); - strcpy(exec2,tmp); -#else /* NATIVE xemacs DOS-style paths with forward slashes */ - for (p = exec2; *p; p++) - if (*p == '\\') *p = '/'; -#endif - SetEnvironmentVariable ("emacs_dir", exec2); - } - } -} -int build_cmdline(char* new_cmdline, char* exec, int argc, char* argv[]) -{ - int retval = FALSE; - int first_arg = 1; - int i; - int char_cnt = 0; - /* - * look for "-wait" as first true argument; we'll apply that ourselves - */ - if ((argc >= 2) && (stricmp(argv[1],"-wait") == 0)) - { - retval = TRUE; - first_arg++; - } - - char_cnt = strlen(exec); - for (i = first_arg; i < argc; i++) - char_cnt += strlen(argv[i]); - if (char_cnt > MAX_ARGS*MAX_PATH) /* then we ran out of room */ - error("command line too long -\n%s",new_cmdline); - - strcpy(new_cmdline,exec); - for (i = first_arg; i < argc; i++) - { - strcat(new_cmdline," "); - strcat(new_cmdline,argv[i]); - } - return retval; -} -/* process exec_arg : if it - * NATIVE: - * 1) starts with '\\' or '/', it's a root-path and leave it alone - * 2) starts with 'x:\\' or 'x:/', it's a root-path and leave it alone - * 3) starts with '.\\' or './', two possible meanings: - * 1) exec is in the current directory - * 2) exec in same directory as this program - * 4) otherwise, search path (and _prepend_ "." to the path!!!) - * 5) convert all '/' to '\\' - * CYGWIN - * 1) starts with '\\' or '/', it's a root-path and leave it alone - * 2) starts with 'x:\\' or 'x:/', it's a root-path and leave it alone - * 3) starts with '.\\' or './', two possible meanings: - * 1) exec is in the current directory - * 2) exec in same directory as this program - * 4) otherwise, search path (and _prepend_ "." to the path!!!) - * 5) convert to cygwin-style path to resolve symlinks within the pathspec - * 6) check filename: if it's a symlink, resolve it by peeking inside - * 7) convert to win32-style path+filename since we're using Windows - * createProcess() to launch - */ -void process_execname(char *exec, const char* execname,const char* execpath ) -{ - char* orig_pathlist; - char* pathlist; - char exec_tmp[MAX_PATH + FILENAME_MAX + 100]; - char exec_tmp2[MAX_PATH + FILENAME_MAX + 100]; - char buf[MAX_PATH + FILENAME_MAX + 100]; - int i,j; - - /* - * STARTS WITH / or \ - * execpath NOT used - */ - if ((execname[0] == '\\') || (execname[0] == '/')) - { -#if defined(__CYGWIN__) - strcpy(exec_tmp,execname); -#else - exec_tmp[0] = ((char) (_getdrive() + ((int) 'A') - 1)); - exec_tmp[1] = ':'; - exec_tmp[2] = '\0'; - strcat(exec_tmp,execname); -#endif - Trace(("/ -\nexec_tmp\t%s\nexecname\t%s\nexecpath\t%s\n", - exec_tmp,execname,execpath)); - if (! fileExistsMulti(exec_tmp2,NULL,exec_tmp,exts,NUM_EXTENSIONS) ) - { - j = 0; - for (i = 0; i < NUM_EXTENSIONS; i++) - j += sprintf(buf + j," [%d]: %s\n",i+1,exts[i]); - error("Couldn't locate %s\nI tried appending the following " - "extensions: \n%s",exec_tmp,buf); - } - Trace((exec_tmp2)); - } - /* - * STARTS WITH x:\ or x:/ - * execpath NOT used - */ - else if ((strlen(execname) > 3) && // avoid boundary errors - (execname[1] == ':') && - ((execname[2] == '\\') || (execname[2] == '/'))) - { - strcpy(exec_tmp,execname); - Trace(("x: -\nexec_tmp\t%s\nexecname\t%s\nexecpath\t%s\n", - exec_tmp,execname,execpath)); - if (! fileExistsMulti(exec_tmp2,NULL,exec_tmp,exts,NUM_EXTENSIONS) ) - { - j = 0; - for (i = 0; i < NUM_EXTENSIONS; i++) - j += sprintf(buf + j," [%d]: %s\n",i+1,exts[i]); - error("Couldn't locate %s\nI tried appending the following " - "extensions: \n%s",exec_tmp,buf); - } - Trace((exec_tmp2)); - } - /* - * STARTS WITH ./ or .\ - */ - else if ((execname[0] == '.') && - ((execname[1] == '\\') || (execname[1] == '/'))) - { - if (((char*) getcwd(exec_tmp,MAX_PATH))==NULL) - error("can't find current working directory"); - if (! fileExistsMulti(exec_tmp2,exec_tmp,&(execname[2]), - exts,NUM_EXTENSIONS) ) - if (! fileExistsMulti(exec_tmp2,execpath,&(execname[2]), - exts,NUM_EXTENSIONS) ) - { - j = 0; - for (i = 0; i < NUM_EXTENSIONS; i++) - j += sprintf(buf + j," [%d]: %s\n",i+1,exts[i]); - error("Couldn't locate %s\n" - "I looked in the following directories:\n [1]: %s\n [2]: %s\n" - "I also tried appending the following " - "extensions: \n%s",execname,exec_tmp,execpath,buf); - } - Trace((exec_tmp2)); - } - /* - * OTHERWISE, SEARCH PATH (prepend '.' and run.exe's directory) - * can't use fileExistsMulti because we want to search entire path - * for exts[0], then for exts[1], etc. - */ - else - { - orig_pathlist = getenv("PATH"); - if ((pathlist = malloc (strlen(orig_pathlist) - + strlen(".") - + strlen(execpath)+ 3)) == NULL) - error("internal error - out of memory"); - strcpy(pathlist,"."); - strcat(pathlist,SEP_CHARS); - strcat(pathlist,execpath); - strcat(pathlist,SEP_CHARS); - strcat(pathlist,orig_pathlist); - - Trace((pathlist)); - for (i = 0; i < NUM_EXTENSIONS; i++) - { - strcpy(exec_tmp,execname); - strcat(exec_tmp,exts[i]); - pfopen(exec_tmp2,exec_tmp,pathlist); - if (fileExists(NULL,NULL,exec_tmp2)) - break; - exec_tmp2[0] = '\0'; - } - Trace(("exec_tmp\t%s\npathlist\t%s\n",exec_tmp2,pathlist)); - - free(pathlist); - if (exec_tmp2[0] == '\0') - { - j = 0; - for (i = 0; i < NUM_EXTENSIONS; i++) - j += sprintf(buf + j," [%d]: %s\n",i+1,exts[i]); - error("Couldn't find %s anywhere.\n" - "I even looked in the PATH \n" - "I also tried appending the following " - "extensions: \n%s",execname,buf); - } - } -/* - * At this point, we know that exec_tmp2 contains a filename - * and we know that exec_tmp2 exists. - */ -#if defined(__CYGWIN__) - { - struct stat stbuf; - char sym_link_name[MAX_PATH+1]; - char real_name[MAX_PATH+1]; - char dummy[MAX_PATH+1]; - - strcpy(exec_tmp,exec_tmp2); - - CYGWIN_CONV_TO_POSIX_PATH((exec_tmp,sym_link_name)); - Trace((sym_link_name)); - - if (lstat(sym_link_name, &stbuf) == 0) - { - if ((stbuf.st_mode & S_IFLNK) == S_IFLNK) - { - if (readlink(sym_link_name, real_name, sizeof(real_name)) == -1) - error("problem reading symbolic link for %s",exec_tmp); - else - { - // if realname starts with '/' it's a rootpath - if (real_name[0] == '/') - strcpy(exec_tmp2,real_name); - else // otherwise, it's relative to the symlink's location - { - CYGWIN_SPLIT_PATH((sym_link_name,exec_tmp2,dummy)); - if (!endsWith(exec_tmp2,PATH_SEP_CHAR_STR)) - strcat(exec_tmp2,PATH_SEP_CHAR_STR); - strcat(exec_tmp2,real_name); - } - } - } - else /* NOT a symlink */ - strcpy(exec_tmp2, sym_link_name); - } - else - error("can't locate executable - %s",sym_link_name); - } - CYGWIN_CONV_TO_FULL_WIN32_PATH((exec_tmp2,exec)); -#else - strcpy (exec, exec_tmp2); -#endif -} -int endsWith(const char* s1, const char* s2) -{ - int len1; - int len2; - int retval = FALSE; - len1 = strlen(s1); - len2 = strlen(s2); - if (len1 - len2 >= 0) - if (stricmp(&(s1[len1-len2]),s2) == 0) - retval = TRUE; - return retval; -}void strip_exe(char* s) -{ - if ((strlen(s) > 4) && // long enough to have .exe extension - // second part not evaluated (short circuit) if exec_arg too short - (stricmp(&(s[strlen(s)-4]),".exe") == 0)) - s[strlen(s)-4] = '\0'; -} -void error(char* fmt, ...) -{ - char buf[4096]; - int j; - va_list args; - va_start(args, fmt); - j = sprintf(buf, "Error: "); - j += vsprintf(buf + j,fmt,args); - j += sprintf(buf + j,"\n"); - va_end(args); - MessageBox(NULL, buf, "Run.exe", MB_ICONSTOP); - exit(1); -} -void message(char* fmt, ...) -{ - char buf[10000]; - int j; - va_list args; - va_start(args, fmt); - j = vsprintf(buf,fmt,args); - j += sprintf(buf + j,"\n"); - va_end(args); - MessageBox(NULL, buf, "Run.exe Message", MB_ICONSTOP); -} -void Trace_(char* fmt, ...) -{ - char buf[10000]; - int j; - va_list args; - va_start(args, fmt); - j = vsprintf(buf,fmt,args); - j += sprintf(buf + j,"\n"); - va_end(args); - MessageBox(NULL, buf, "Run.exe DEBUG", MB_ICONSTOP); -} -/* - * Uses system info to determine the path used to invoke run - * Also attempts to deduce the target execname if "compact_invocation" - * method was used. - * - * returns TRUE if compact_invocation method was used - * (and target execname was deduced successfully) - * otherwise returns FALSE, and execname == run or run.exe - */ -int get_exec_name_and_path(char* execname, char* execpath) -{ - char modname[MAX_PATH]; - char* tmp_execname; - char* p; - int retval = FALSE; - - if (!GetModuleFileName (NULL, modname, MAX_PATH)) - error("internal error - can't find my own name"); - if ((p = strrchr (modname, '\\')) == NULL) - error("internal error - my own name has no path\n%s",modname); - tmp_execname = p + 1; - p[0] = '\0'; - // if invoked by a name like "runxemacs" then strip off - // the "run" and let "xemacs" be execname. - // To check for this, make that: - // 1) first three chars are "run" - // 2) but the string doesn't end there, or start ".exe" - // Also, set "compact_invocation" TRUE - if ( ((tmp_execname[0] == 'r') || (tmp_execname[0] == 'R')) && - ((tmp_execname[1] == 'u') || (tmp_execname[1] == 'U')) && - ((tmp_execname[2] == 'n') || (tmp_execname[2] == 'N')) && - ((tmp_execname[3] != '.') && (tmp_execname[3] != '\0')) ) - { - tmp_execname += 3; - retval = TRUE; - } - else - tmp_execname = NULL; - - if (tmp_execname == NULL) - strcpy(execname,""); - else - strcpy(execname,tmp_execname); -#if defined(__CYGWIN__) - CYGWIN_CONV_TO_POSIX_PATH((modname,execpath)); -#else - strcpy(execpath,modname); -#endif - return retval; -} -/* - * works like strtok, but: - * double quotes (") suspends tokenizing until closing " reached - * CYGWIN ONLY: - * additionally, backslash escapes next character, even if that - * next character is a delimiter. Or a double quote. - * WARNING: this means that backslash may NOT be a delimiter - */ -char* my_strtok(char* s, const char* delim, char** lasts) -{ - char *spanp; - int c, sc; - char *tok; - - if ((s == NULL) && ((s = *lasts) == NULL)) - return NULL; - /* Skip leading delimiters */ -cont: - c = *s++; - for (spanp = (char *)delim; (sc = *spanp++) != 0;) { - if (c == sc) - goto cont; - } - if (c == 0) { /* no non-delimiter characters */ - *lasts = NULL; - return (NULL); - } - tok = s - 1; - /* - * Scan token (scan for delimiters: s += strcspn(s, delim), sort of). - * Note that delim must have one NUL; we stop if we see that, too. - * If we see a double quote, continue until next double quote, then - * start scanning for delimiters again. - * CYGWIN ONLY: if we see a backslash, just copy next character - - * don't consider it as a delimiter even if it is in delim string. - */ - for (;;) { - /* if this c is ", then scan until we find next " */ - if (c == '\"') - while ((c = *s++) != '\"') - if (c == 0) /* oops, forgot to close the ", clean up & return */ - { - s = NULL; - *lasts = s; - return (tok); - } -#if defined(__CYGWIN__) - if (c == '\\') - { - c = *s++; /* skip the backslash */ - if (c == 0) /* if escaped character is end-of-string, clean up & return */ - { - s = NULL; - *lasts = s; - return (tok); - } - c = *s++; /* otherwise, skip the escaped character */ - } -#endif - spanp = (char *)delim; - do { - if ((sc = *spanp++) == c) { - if (c == 0) - s = NULL; - else - s[-1] = 0; - *lasts = s; - return (tok); - } - } while (sc != 0); - c = *s++; - } - /* NOTREACHED */ -} -int parse_cmdline_to_arg_array(char* argv[MAX_ARGS], char* cmdline) -{ - char seps[] = " \t\n"; - char* token; - int argc = 0; - char* lasts; - - token = my_strtok(cmdline, seps, &lasts); - while ((token != NULL) && (argc < MAX_ARGS)) - { - if ((argv[argc] = malloc(strlen(token)+1)) == NULL) - { - error("internal error - out of memory"); - } - strcpy(argv[argc++],token); - token = my_strtok(NULL,seps,&lasts); - } - if (argc >= MAX_ARGS) - error("too many arguments on commandline\n%s",cmdline); - return argc; -} -/* Taken from pfopen.c by David Engel (5-Jul-97). - * Original comments appear below. Superseded by next comment block. - * - * Written and released to the public domain by David Engel. - * - * This function attempts to open a file which may be in any of - * several directories. It is particularly useful for opening - * configuration files. For example, PROG.EXE can easily open - * PROG.CFG (which is kept in the same directory) by executing: - * - * cfg_file = pfopen("PROG.CFG", "r", getenv("PATH")); - * - * NULL is returned if the file can't be opened. - */ - -/* - * This function attempts to locate a file which may be in any of - * several directories. Unlike the original pfopen, it does not - * return a FILE pointer to the opened file, but rather returns - * the fully-qualified filename of the first match found. Returns - * empty string if not found. - */ -char *pfopen(char *retval, const char *name, const char *dirs) -{ - char *ptr; - char *tdirs; - char returnval[MAX_PATH + FILENAME_MAX + 100]; - int foundit = FALSE; - - returnval[0] = '\0'; - - if (dirs == NULL || dirs[0] == '\0') - return NULL; - - if ((tdirs = malloc(strlen(dirs)+1)) == NULL) - return NULL; - - strcpy(tdirs, dirs); - - for (ptr = strtok(tdirs, SEP_CHARS); (foundit == FALSE) && ptr != NULL; - ptr = strtok(NULL, SEP_CHARS)) - { - foundit = fileExists(returnval,ptr,name); - } - - free(tdirs); - if (!foundit) - retval[0] = '\0'; - else - strcpy(retval,returnval); - return retval; -} -int fileExistsMulti(char* fullname, const char* path, - const char* name_noext, const char* exts[], - const int extcnt) -{ - char tryName[MAX_PATH + FILENAME_MAX]; - int i = 0; - int retval = FALSE; - fullname[0] = '\0'; - for (i = 0; i < extcnt; i++) - { - strcpy(tryName,name_noext); - strcat(tryName,exts[i]); - if (fileExists(fullname, path, tryName) == TRUE) - { - retval = TRUE; - break; - } - fullname[0] = '\0'; - } - return retval; -} -int fileExists(char* fullname, const char* path, const char* name) -{ - int retval = FALSE; - FILE* file; - size_t len; - char work[FILENAME_MAX]; - char work2[MAX_PATH + FILENAME_MAX + 100]; - if (path != NULL) - { - strcpy(work, path); - len = strlen(work); - if (len && work[len-1] != '/' && work[len-1] != '\\') - strcat(work, PATH_SEP_CHAR_STR); - } - else - work[0]='\0'; - - strcat(work, name); -#if defined(__CYGWIN__) - CYGWIN_CONV_TO_POSIX_PATH((work, work2)); -#else - strcpy(work2,work); -#endif - -#ifdef DEBUGALL - Trace(("looking for...\t%s\n",work2)); -#endif - - file = fopen(work2, "rb"); - if (file != NULL) - { - if (fullname != NULL) - strcpy(fullname,work2); - retval = TRUE; - fclose(file); - } - return retval; -} diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/run.h --- a/lib-src/run.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -// #define DEBUG -// #define DEBUGALL - -// B19 - egcs automatically defines CYGWIN32 but not CYGWIN -// B20 - egcs automatically defines both CYGWIN32 and CYGWIN -// Bfuture - (???) defines CYGWIN but not CYGWIN32 -#if defined(__CYGWIN32__) -#if !defined(__CYGWIN__) - #define B19 - #define __CYGWIN__ -#else - #define B20 -#endif -#else -#if defined(__CYGWIN__) - #define B21 -#endif -#endif -// Now: use __CYGWIN__ to represent any version -// distinguish using B19, B20, or B21 - -#if defined(__CYGWIN__) -#ifdef B19 -#define CYGWIN_ATTACH_HANDLE_TO_FD(a) cygwin32_attach_handle_to_fd a -#define CYGWIN_CONV_TO_FULL_POSIX_PATH(a) cygwin32_conv_to_full_posix_path a -#define CYGWIN_CONV_TO_FULL_WIN32_PATH(a) cygwin32_conv_to_full_win32_path a -#define CYGWIN_CONV_TO_POSIX_PATH(a) cygwin32_conv_to_posix_path a -#define CYGWIN_CONV_TO_WIN32_PATH(a) cygwin32_conv_to_win32_path a -#define CYGWIN_DETACH_DLL(a) cygwin32_detach_dll a -#define CYGWIN_GETSHARED(a) cygwin32_getshared a -#define CYGWIN_INTERNAL(a) cygwin32_internal a -#define CYGWIN_POSIX_PATH_LIST_P(a) cygwin32_posix_path_list_p a -#define CYGWIN_POSIX_TO_WIN32_PATH_LIST(a) cygwin32_posix_to_win32_path_list a -#define CYGWIN_POSIX_TO_WIN32_PATH_LIST_BUF_SIZE(a) cygwin32_posix_to_win32_path_list_buf_size a -#define CYGWIN_SPLIT_PATH(a) cygwin32_split_path a -#define CYGWIN_WIN32_TO_POSIX_PATH_LIST(a) cygwin32_win32_to_posix_path_list a -#define CYGWIN_WIN32_TO_POSIX_PATH_LIST_BUF_SIZE(a) cygwin32_win32_to_posix_path_list_buf_size a -#define CYGWIN_WINPID_TO_PID(a) cygwin32_winpid_to_pid a -#else -#define CYGWIN_ATTACH_HANDLE_TO_FD(a) cygwin_attach_handle_to_fd a -#define CYGWIN_CONV_TO_FULL_POSIX_PATH(a) cygwin_conv_to_full_posix_path a -#define CYGWIN_CONV_TO_FULL_WIN32_PATH(a) cygwin_conv_to_full_win32_path a -#define CYGWIN_CONV_TO_POSIX_PATH(a) cygwin_conv_to_posix_path a -#define CYGWIN_CONV_TO_WIN32_PATH(a) cygwin_conv_to_win32_path a -#define CYGWIN_DETACH_DLL(a) cygwin_detach_dll a -#define CYGWIN_GETSHARED(a) cygwin_getshared a -#define CYGWIN_INTERNAL(a) cygwin_internal a -#define CYGWIN_POSIX_PATH_LIST_P(a) cygwin_posix_path_list_p a -#define CYGWIN_POSIX_TO_WIN32_PATH_LIST(a) cygwin_posix_to_win32_path_list a -#define CYGWIN_POSIX_TO_WIN32_PATH_LIST_BUF_SIZE(a) cygwin_posix_to_win32_path_list_buf_size a -#define CYGWIN_SPLIT_PATH(a) cygwin_split_path a -#define CYGWIN_WIN32_TO_POSIX_PATH_LIST(a) cygwin_win32_to_posix_path_list a -#define CYGWIN_WIN32_TO_POSIX_PATH_LIST_BUF_SIZE(a) cygwin_win32_to_posix_path_list_buf_size a -#define CYGWIN_WINPID_TO_PID(a) cygwin_winpid_to_pid a -#endif -#endif - -#if defined(__CYGWIN__) - #define PATH_SEP_CHAR_STR "/" - #define SEP_CHARS ":" -#else - #define PATH_SEP_CHAR_STR "\\" - #define SEP_CHARS ";" -#endif - -#ifndef RC_INVOKED - -#define MAX_ARGS 20 - -#ifdef DEBUG - #define Trace(x) Trace_ x -#else - #define Trace(x) -#endif - -#define NUM_EXTENSIONS 2 -const char* exts[NUM_EXTENSIONS] = { "", ".exe" }; - -char* pfopen(char *retval, const char *name, const char *dirs); -void error(char* fmt, ...); -void message(char* fmt, ...); -void Trace_(char* fmt, ...); -int get_exec_name_and_path(char* execname, char* execpath); -char* my_strtok(char* s, const char* delim, char** lasts); -int parse_cmdline_to_arg_array(char* argv[MAX_ARGS], char* cmdline); -void strip_exe(char* s); -int start_child(char* cmdline, int wait_for_child); -void xemacs_special(char* exec); -int build_cmdline(char* new_cmdline, char* exec, int argc, char* argv[]); -void process_execname(char *exec, const char* execname, const char* execpath); -int fileExists(char* fullname, const char* path, const char* name); -int endsWith(const char* s1, const char* s2); -int fileExistsMulti(char* fullname, const char* path, - const char* name_noext, const char* exts[], - const int extcnt); - -#endif /* RC_INVOKED */ - - - diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/run.rc --- a/lib-src/run.rc Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -XEmacs ICON PRELOAD "xemacs.ico" -XEmacsFile ICON "file.ico" -XEmacsLisp ICON "lisp.ico" - -#include -#include "run.h" - -1 VERSIONINFO -FILEVERSION 1, 1, 4, 0 -PRODUCTVERSION 1, 1, 4, 0 -FILEOS VOS_NT_WINDOWS32 -FILETYPE VFT_APP -FILESUBTYPE 0 -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "04090000" - BEGIN - VALUE "CompanyName", "Charles S. Wilson\000" - VALUE "FileDescription", "Runs console-mode programs sans console.\000" - VALUE "FileVersion", "1.1.4\000" - VALUE "InternalName", "run\000" - VALUE "LegalCopyright", "Copyright © 1998 Charles S. Wilson\000" - VALUE "OriginalFilename", "run.exe\000" - VALUE "ProductName","run\000" - VALUE "ProductVersion","1.1.4\000" - VALUE "GPL Copyleft", "Released under the GNU General Public License version 2 --------------------------------------- This program is free software; you can redistribute it and/or modify it under the termms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. --------------------------------------- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. --------------------------------------- You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\000" - END - END -END diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/sorted-doc.c --- a/lib-src/sorted-doc.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/sorted-doc.c Mon Aug 13 11:35:02 2007 +0200 @@ -14,9 +14,6 @@ #include /* for qsort() and malloc() */ #include static void *xmalloc (size_t); -#ifndef CONST -# define CONST const -#endif #define NUL '\0' #define MARKER '\037' @@ -96,7 +93,7 @@ WAITING, BEG_NAME, NAME_GET, BEG_DESC, DESC_GET }; -CONST char *states[] = +const char *states[] = { "WAITING", "BEG_NAME", "NAME_GET", "BEG_DESC", "DESC_GET" }; @@ -201,12 +198,7 @@ /* sort the array by name; within each name, by type */ qsort ((char*)array, cnt, sizeof (DOCSTR*), - /* was cast to (int (*)(CONST void *, CONST void *)) - but that loses on HP because CONST_IS_LOSING. */ - /* This one loses too: (int (*)()) */ - /* Ok, so let's try const instead of CONST. Fuck me!!! */ - (int (*)(const void *, const void *)) - cmpdoc); + (int (*)(const void *, const void *)) cmpdoc); /* write the output header */ diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/update-elc.sh --- a/lib-src/update-elc.sh Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,191 +0,0 @@ -#!/bin/sh -# update-elc.sh --- recompile all missing or out-of-date .elc files - -# Author: Jamie Zawinski, Ben Wing, Martin Buchholz -# Maintainer: Martin Buchholz -# Keywords: recompile byte-compile .el .elc - -# 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. - -### Commentary: -## Recompile all .elc files that need recompilation. Requires a -## working version of "xemacs". Correctly handles the case where the -## .elc files are missing; thus you can execute "rm lisp/*/*.elc" -## before running this script. Run this from the parent of the -## "lisp" directory, or another nearby directory. - -set -e - -# Try to find the lisp directory in several places. -# (Sun workspaces have an "editor" directory) -for dir in . .. ../.. editor ../editor ; do - if test -d $dir/lisp/. ; then cd $dir ; break ; fi -done - -if test ! -d lisp/. ; then - echo "$0: Cannot find the \"lisp\" directory." - exit 1 -fi - -if test -z "$EMACS"; then EMACS="./src/xemacs"; fi -export EMACS - -echo " (using $EMACS)" - -# fuckin' sysv, man... -# Nuke this function... -if [ "`uname -r | sed 's/[^0-9]*\([0-9]*\).*/\1/'`" -gt 4 ]; then - echon() - { - /bin/echo $* '\c' - } -else - echon() - { - echo -n $* - } -fi - -EMACS_DIR=`cd \`dirname $EMACS\` && pwd`; -CANON_PWD=`pwd` -# Account for various system automounter configurations -if test -d "/net"; then - if test -d "/tmp_mnt/net"; then tdir="/tmp_mnt/net"; else tdir="/tmp_mnt"; fi - EMACS_DIR=`echo "$EMACS_DIR" | \ - sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"` - CANON_PWD=`echo "$CANON_PWD" | \ - sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"` -fi -REAL="$EMACS_DIR/`basename $EMACS`" - -echo "Recompiling in $CANON_PWD" -echo " with $REAL..." - -BYTECOMP="$REAL -batch -vanilla " - -$EMACS -batch -vanilla -l $CANON_PWD/lisp/cleantree -f batch-remove-old-elc lisp - -prune_vc="( -name '.*' -o -name SCCS -o -name RCS -o -name CVS ) -prune -o" - -# $els is a list of all .el files -# $elcs is a list of all .elc files -els=/tmp/update-elc-1.$$ elcs=/tmp/update-elc-2.$$ -rm -f $els $elcs -trap "rm -f $els $elcs" 0 1 2 3 15 -find lisp/. $prune_vc -name '*.el' -print | sort > $els -find lisp/. $prune_vc -name '*.elc' -print | sed 's/elc$/el/' | sort > $elcs - - -echon "Deleting .elc files without .el files..." -comm -13 $els $elcs | sed -e '\!/vm.el!d' -e 's/el$/elc/' | \ - while read file ; do echo rm "$file" ; rm "$file" ; done -echo done. - - -# Compute patterns to ignore when searching for files -ignore_dirs="" -ignore_pattern='' - -# Only use Mule XEmacs to compile Mule-specific elisp dirs -echon "Checking for Mule support..." -lisp_prog='(princ (featurep (quote mule)))' -mule_p="`$EMACS -batch -vanilla -eval \"$lisp_prog\"`" -if test "$mule_p" = nil ; then - echo No - ignore_dirs="$ignore_dirs mule" -else - echo Yes -fi - -# first recompile the byte-compiler, so that the other compiles take place -# with the latest version (assuming we're compiling the lisp dir of the emacs -# we're running, which might not be the case, but often is.) -#echo "Checking the byte compiler..." -#$BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp - -# Prepare for byte-compiling directories with directory-specific instructions -# Not necessary any more, but I want to keep the text current to cut & paste -# into the package lisp maintenance tree. -#make_special_commands='' -#make_special () { -# dir="$1"; shift; -# ignore_dirs="$ignore_dirs $dir" -# make_special_commands="$make_special_commands \ -#echo \"Compiling in lisp/$dir\"; \ -#(cd \"lisp/$dir\" && ${MAKE:-make} EMACS=$REAL ${1+$*}); \ -#echo \"lisp/$dir done.\";" -#} - -#if test "$mule_p" != nil; then -# make_special skk all -#fi - -## AUCTeX is a package now -# if test "$mule_p" = nil ; then -# make_special auctex some -# else -# make_special auctex some MULE_ELC=tex-jp.elc -# fi -#make_special cc-mode all -# EFS is now packaged -# make_special efs x20 -#make_special eos -k # not strictly necessary... -## make_special gnus some # Now this is a package. -# hyperbole is now packaged -# make_special hyperbole elc -# We're not ready for the following, yet. -#make_special ilisp XEmacsELC=custom-load.elc elc -# ilisp is now packaged -# make_special ilisp elc -# oobr is now packaged -# make_special oobr HYPB_ELC='' elc -## W3 is a package now. -#make_special w3 xemacs-w3 - -for dir in $ignore_dirs ; do - ignore_pattern="${ignore_pattern}/\\/$dir\\//d -/\\/$dir\$/d -" -done - -# Other special-case filenames that don't get byte-compiled -ignore_pattern="$ignore_pattern"' -\!/,!d -\!/paths.el$!d -\!/loadup.el$!d -\!/loadup-el.el$!d -\!/update-elc.el$!d -\!/dumped-lisp.el$!d -\!/make-docfile.el$!d -\!/site-start.el$!d -\!/site-load.el$!d -\!/site-init.el$!d -\!/version.el$!d -\!/very-early-lisp.el$!d -' - -echo "Compiling files without .elc..." -NUMTOCOMPILE=20 # compile this many files with each invocation -comm -23 $els $elcs | \ - sed "$ignore_pattern" | \ - xargs -t -n$NUMTOCOMPILE $BYTECOMP -f batch-byte-compile -echo "Compiling files without .elc... Done" - -#if test "$mule_p" != nil; then -# eval "$make_special_commands" -#fi diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/wakeup.c --- a/lib-src/wakeup.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/wakeup.c Mon Aug 13 11:35:02 2007 +0200 @@ -4,20 +4,22 @@ #if __STDC__ || defined(STDC_HEADERS) #include +#ifdef HAVE_UNISTD_H #include #endif +#endif #include #include -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE #define WIN32_LEAN_AND_MEAN #include #undef sleep #define sleep(t) Sleep ((t) * 1000) #define getppid() (0) #undef HAVE_SYS_TIME_H -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ #ifdef TIME_WITH_SYS_TIME #include diff -r 72a7cfa4a488 -r abe6d1db359e lib-src/yow.c --- a/lib-src/yow.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/yow.c Mon Aug 13 11:35:02 2007 +0200 @@ -33,7 +33,7 @@ void yow (FILE *fp); void setup_yow (FILE *fp); -#ifdef MSDOS +#ifdef WIN32_NATIVE #define rootrelativepath(rel) \ ({\ static char res[BUFSIZE], *p;\ diff -r 72a7cfa4a488 -r abe6d1db359e lisp/ChangeLog --- a/lisp/ChangeLog Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/ChangeLog Mon Aug 13 11:35:02 2007 +0200 @@ -1,3 +1,2065 @@ +2000-10-04 Martin Buchholz + + * XEmacs 21.2.36 is released. + +2000-09-22 Martin Buchholz + + * byte-optimize.el (byte-optimize-lapcode): Add an optimizer pass. + Optimize the compiled-function-constants vector by byte-code + reference counts. + +2000-09-25 Robert Pluim + + * build-report.el (build-report-delete-regexp): quote value in + defcustom + +2000-09-24 Adrian Aichner + + * build-report.el (build-report): Don't bind srcdir which we don't + use in `multiple-value-bind' to avoid the only byte-compiler + warning. + +2000-09-23 Adrian Aichner + + * build-report.el: Requires cl and custom now. + build-report-version is determined by XEmacs version -- remove + build-report-version*. + * build-report.el (build-report-version): Removed. + * build-report.el (build-report-installation-version-regexp): New. + * build-report.el (build-report-version-file-regexp): New. + * build-report.el (build-report-installation-srcdir-regexp): New. + * build-report.el (build-report-destination): Offer + xemacs-build-reports and xemacs-beta. + * build-report.el (build-report-keep-regexp): Adjusted. + * build-report.el (build-report-delete-regexp): Adjusted. + * build-report.el (build-report-make-output-dir): New. + * build-report.el (build-report-installation-file): Replace use of + `concat' with `expand-file-name'. + * build-report.el (build-report-make-output-file): Removed. + * build-report.el (build-report-make-output-files): New. + * build-report.el (build-report-subject): Identify as + user-variable with "*...". + * build-report.el (build-report-prompts): Ditto. + * build-report.el (build-report-version-file): New. + * build-report.el (build-report-file-encoding): Identify as + user-variable with "*...". + * build-report.el (build-report-make-output-get): New. + * build-report.el (build-report-insert-header): Report + emacs-version and system-configuration instead of + build-report-version. + * build-report.el (build-report-insert-make-output): Add file + argument. + * build-report.el (build-report-insert-installation-file): + Re-indent. + * build-report.el (build-report-keep): Change docstring, + re-indent. + * build-report.el (build-report-delete): Ditto. + * build-report.el (build-report-installation-data): New. + * build-report.el (build-report-version-file-data): New. + +2000-09-20 Martin Buchholz + + * byte-optimize.el (byte-optimize-lapcode): + Fix the optimization of using the first 5 elements of the + constants vector for variables. + (byte-optimize-lapcode): Fix another ancient broken optimization. + +2000-09-19 Martin Buchholz + + * *: Spelling mega-patch + +2000-09-19 Martin Buchholz + + * easymenu.el: doc fixes. + (easy-menu-do-define): Use backquote. + (easy-menu-change): + (easy-menu-add): + `when' seems much clearer than `if' here. + (easy-menu-remove): + (easy-menu-add-item): + (easy-menu-item-present-p): + (easy-menu-remove-item): + Wrap using (when (featurep 'menubar) ...) + +2000-09-16 Martin Buchholz + + * bytecomp.el (displaying-byte-compile-warnings): + Revert Ben's change to this function below so that the compile log + is displayed properly for users of the "popper" package. + +2000-09-12 Martin Buchholz + + * window.el (save-selected-window): Use backquote. + + * bytecomp.el (byte-compile-file-form-defvar-or-defconst): + Renamed from `byte-compile-file-form-defvar'. + * bytecomp.el (byte-compile-defvar-or-defconst): + Only cons onto current-load-list in top-level forms. + Else this leaks a cons cell every time a defun is called. + Renamed from `byte-compile-defvar', for clarity. + Warn when docstring of defvar is not a string. + Use consistent error messages. + Better comments. + +2000-09-11 Martin Buchholz + + * simple.el (set-variable): + Remove unneeded defvar by rearranging order of let* forms. + + * mule/mule-ccl.el (ccl-get-next-code): + * menubar-items.el (bookmark-menu-filter): + (language-environment-menu-filter): + (tutorials-menu-filter): + * toolbar-items.el (toolbar-compile): + * byte-optimize.el (disassemble-offset): + Use (declare (special ...)) instead of `defvar'. + + * cl-macs.el (cl-do-proclaim): + Fix (declare (special ...)) warning suppression syntax. + +2000-07-22 Golubev I. N. + + * info.el (Info-tag-table-marker): + (Info-tag-table-buffer): + (Info-find-file-node): + (Info-read-subfile): + (Info-build-node-completions): + (Info-search): + (Info-mode): + Multiple info buffer support. + +2000-08-28 Oscar Figueiredo + + * ldap.el (ldap-decode-entry): New defun + (ldap-search-entries): Use it in order to decode DN-prefixed + entries properly + +2000-08-23 Daniel Pittman + + * mule/mule-cmds.el (coding-system-change-eol-conversion): + Use `eq', not `=', to compare symbols. + +2000-07-30 Ben Wing + + * bytecomp.el (byte-compile-report-error): + * bytecomp.el (displaying-byte-compile-warnings): + if stack-trace-on-error is set, send out a backtrace when + an error is encountered that stops byte compilation. this + should make it much much easier to track down those curious + problems. also undo the kludge of using a separate "*Show*" + buffer for display when there's a temp-buffer-show-function; + we can avoid this by just being a little smarter. + + * dialog-items.el: + * dialog-items.el (search-dialog-regexp): New. + * dialog-items.el (search-dialog-callback): + * dialog-items.el (make-search-dialog): + add a regexp option to the dialog and clean up a bit. + + * dialog.el: + * dialog.el (yes-or-no-p-dialog-box): + * dialog.el (get-dialog-box-response): + * dialog.el (make-dialog-box): + * dialog.el (dialog-box-finish): New. + * dialog.el (dialog-box-cancel): New. + * dialog.el (internal-make-dialog-box-exit): New. + implement [properly!] the :modal property of the new dialog box + interface. this is the first time xemacs has ever had *proper* + modal dialog boxes, giving the standard window-system feedback. + (e.g. under windows, clicking on a disabled frame causes a beep + and makes the dialog box flash three times.) + + * dragdrop.el: header keyword frobbing. + + * dumped-lisp.el (preloaded-file-list): + renamed winnt.el to win32-native.el. + + * faces.el (face-property): + * faces.el (set-face-property): + * faces.el (frob-face-property): + * faces.el (frob-face-font-2): + * faces.el (make-face-bold): + * faces.el (make-face-italic): + * faces.el (make-face-bold-italic): + * faces.el (make-face-unbold): + * faces.el (make-face-unitalic): + * faces.el (make-face-smaller): + * faces.el (make-face-larger): + clean up the implementation of these so that window-system-specific + methods are called only on objects belonging to that window system. + previously, you could have [e.g.] mswindows-make-face-bold called + on font object of device type `stream', which is not good and + explains the subtle errors Adrian was getting when byte-compiling + something that required 'term. (Adrian, now you can use stack-trace- + on-error to find the exact place where things are going wrong instead + of having to laboriously binary-search your way through.) + + * finder.el (finder-known-keywords): + cleaned up -- properly sorted, clarified the meanings of many of + the keywords, and added a few -- mswin, gui, content, build, www, + user, services. the last two try to distinguish between a package + that's used directly by the user, and a package that provides + support services to other packages. + + * font-lock.el (lisp-font-lock-keywords-2): + update list of lisp control structures to include everything, + including new ones i introduced. + + * gutter.el: header keyword frobbing. + + * isearch-mode.el (isearch-ring-adjust1): M-p to recall the most + recent isearch element was not doing so! you got the second-most- + recent instead. + + * lisp-mode.el (construct-lisp-mode-menu): + more menubar cleanups. + * lisp-mode.el (with-selected-window): + make it indent properly. + + * menubar-items.el (default-menubar): lots of menubar cleanups. + rearranged the options menu the most, e.g. splitting up the + Keyboard/Mouse menu into a new Editing menu and combining the + separate Scrollbar/Gutter/Toolbar submenus into Display. + Got rid of General, moved items to Editing or new Troubleshooting. + Moved Packages to Tools; doesn't seem to belong under Options. + Added stuff to the Cmds menu, e.g. Change Case. + + NB please don't complain about these periodic menubar changes. + Anything like this is necessarily incremental in its construction + -- By constant use you gradually become more and more aware of + better and better ways to group menu items. When we eventually + move the options menu to a property sheet, the existing structure + will probably be preserved fairly well. + + * minibuf.el (next-history-element): fix problems with pressing + down arrow in repeat-complex-command. + + * modeline.el: + * modeline.el (modeline-3d-p): New. + added custom variable for controlling the 3d modeline. the + corresponding Options item has been present for a long time, + but commented out with "fix me!" comments. it's fixed now. + + * obsolete.el (add-menu): + remove bogus gettexts. + + * process.el (shell-quote-argument): + handle this correctly under Windows native with COMMAND.COM/CMD.EXE. + For bash under Windows native, see below. + + * simple.el: + * simple.el (display-warning-buffer): + Fixed the handling of warning display to eliminate the annoying + *Show* buffer, like was done for byte-compiler output above. + + * simple.el (debug-print): New. + Simple function for sending debug messages to the console and/or + other debug places. + + * subr.el (replace-in-string): + Rewrite this function to avoid N^2 behavior with large strings -- + catastrophic with the new Windows selection code! (Apparently the + author of this function didn't realize there was a fun + replace-match that could make his life much easier, because we + duplicated the entire logic. The new version is smaller, easier + to understand, much more robust, and has extended features -- + those of replace-match.) + + * window.el: + * window.el (with-selected-window): New. + An obvious complement to the existing `with-selected-frame' and + `with-current-buffer'. + + * win32-native.el: Renamed from winnt.el. + Added a great deal of stuff for properly handling process quoting, + somewhat modeled on Kirill's original model (which i later threw + away). We should now finally have correctly working process arg + quoting/dequoting so that the final app gets exactly what we + intended. Because the mechanism is in Lisp, it's easily + extendible. (For those running bash and running the native + version, I tried hard to do what I thought was correct. But more + thought is needed, and ideally the volunteer work of people with + these configurations that they generally run on.) + + * x-font-menu.el (x-font-menu-font-data): + Put in defvar's to fix byte-compiler warnings. + +2000-08-01 Alastair J. Houghton + + * select.el (selection-coercion-alist): Initialise. + * select.el (select-coerce-to-text): New. + * select.el (select-coerce): New. + New functions to perform type and value coercion. + + * select.el (select-buffer-killed-default): Keep data if it was + on the clipboard. + +2000-08-02 Martin Buchholz + + * menubar-items.el (default-menubar): Fix typo. + (default-menubar): `lambda' was mispelled as `lamda'. + +2000-07-31 Yoshiki Hayashi + + * window.el (shrink-window-if-larger-than-buffer): Remove + edge checking code. + +2000-07-31 Yoshiki Hayashi + + * paths.el (gnus-local-domain): Removed. + (gnus-local-organization): Ditto. + (gnus-startup-file): Ditto. + +2000-07-13 Yoshiki Hayashi + + * files.el (auto-mode-alist): Add .spec for RPM. + +2000-07-31 Andy Piper + + * gutter-items.el (update-tab-in-gutter): deprecate :properties. + +2000-07-31 Yoshiki Hayashi + + * dragdrop.el (experimental-dragdrop-drop-url-default): Use function + browse-url. + * help.el (xemacs-www-page): Ditto. + (xemacs-www-faq): Ditto. + * menubar-items.el (default-menubar): Ditto. + + * wid-edit.el (widget-url-link-action): Ditto. + From: Kenichi OKADA . + +2000-07-31 Martin Buchholz + + * finder.el (finder-commentary): Add autoload cookie. + +2000-07-28 Adrian Aichner + + * files.el (insert-file-contents-literally): Fix second let + binding for `coding-system-for-read' to `coding-system-for-write' + as suggested by Dan Holmsand . + +1999-06-15 Jan Vroonhof + + * files.el (insert-file-contents-literally): Use binary coding + system (from Morioka san). + (insert-file-contents-literally): Make file-name-handler method. + +2000-07-26 Martin Buchholz + + * cl-macs.el (get-selection): Add defsetf. + +2000-07-25 Steve Youngs + + * x-init.el (x-activate-region-as-selection): replace obsolete + function x-own-selection with own-selection. + (ow-find): replace obsolete functions x-get-selection and + x-get-clipboard with get-selection and get-clipboard. + (init-post-x-win): replace obsolete function x-disown-selection + with disown-selection. + +2000-07-20 Mike Sperber + + * startup.el (load-user-init-file): Only try to load init file if + it exists. + +2000-07-10 Andy Piper + + * dialog-items.el: sync with Ben's patch. + + * gutter-items.el (buffers-tab-switch-to-buffer): remove now-bogus + comment. + (progress-text-glyph): deleted. + (progress-layout-glyph): make completely minimal. + (progress-gauge-glyph): ditto. + (progress-display-style): fix to handle dynamic instantiator + changes. + (progress-text-instantiator): new. + (progress-layout-instantiator): new. + (progress-gauge-instantiator): new. + (set-progress-display-instantiator): renamed and changed from + set-progress-display-style. + (progress-abort-glyph): use instantiator not glyph. + (append-progress-display): use set-progress-display-instantiator + and set-glyph-image. + (abort-progress-display): ditto. + (raw-append-progress-display): ditto. + +2000-07-20 Ben Wing + + * code-files.el: Move Mule-specific code to mule-coding.el. + +2000-07-15 Ben Wing + + * autoload.el: + Fixed comments. + + * cmdloop.el: + * cmdloop.el (yes-or-no-p): + * cmdloop.el (y-or-n-p): + Make these functions use should-use-dialog-box-p and not be + overridden in dialog.el. + + * cus-dep.el: + * cus-dep.el (Custom-make-dependencies): Removed. + * cus-dep.el (Custom-make-dependencies-1): New. + * cus-dep.el (Custom-make-one-dependency): New. + New entry point for use in Makefiles, to avoid excessive + invocations. + + * cus-edit.el (custom-variable-reset-saved): + * cus-edit.el (custom-variable-reset-standard): + * cus-edit.el (custom-save-resets): + Fix bytecompiler warnings. + + * dialog.el: + * dialog.el (yes-or-no-p-dialog-box): + * dialog.el (yes-or-no-p-maybe-dialog-box): Removed. + * dialog.el (y-or-n-p-maybe-dialog-box): Removed. + * dialog.el (get-dialog-box-response): + * dialog.el (message-or-box): + * dialog.el (make-dialog-box): + * dialog.el (popup-dialog-box): New. + Avoid yes-or-no-p bogosities. + Create a general function `make-dialog-box' to encapsulate all + dialog box methods; easily extendible. popup-dialog-box now obsolete. + + * dumped-lisp.el (preloaded-file-list): + Add dialog-items. Clean up. Group files by types. + + * easymenu.el (easy-menu-add): + * easymenu.el (easy-menu-remove): + Account for accelerators. + + * extents.el: + * extents.el (extent-list): New args, like in map-extents. + * extents.el (extent-at-event): New. + * extents.el (extents-at-event): New. + + * font-lock.el: + * font-lock.el (font-lock-mode): + * font-lock.el (font-lock-default-fontify-buffer): + * font-lock.el (font-lock-default-unfontify-region): + * font-lock.el (font-lock-fontify-syntactically-region): + * font-lock.el (font-lock-fontify-keywords-region): + Use new progress-feedback names. + + * font-lock.el (java-font-lock-identifier-regexp): + * font-lock.el (java-font-lock-class-name-regexp): + Fix bytecompiler warnings. + + * gutter-items.el: + * gutter-items.el (progress-display-use-echo-area): Removed. + * gutter-items.el (progress-feedback-use-echo-area): New. + * gutter-items.el (progress-display-popup-period): Removed. + * gutter-items.el (progress-feedback-popup-period): New. + * gutter-items.el (set-progress-display-style): Removed. + * gutter-items.el (set-progress-feedback-style): New. + * gutter-items.el (progress-display-style): Removed. + * gutter-items.el (progress-feedback-style): New. + * gutter-items.el (progress-stack): + * gutter-items.el (progress-displayed-p): Removed. + * gutter-items.el (progress-feedbacked-p): New. + * gutter-items.el (clear-progress-display): Removed. + * gutter-items.el (clear-progress-feedback): New. + * gutter-items.el (progress-display-clear-when-idle): Removed. + * gutter-items.el (progress-feedback-clear-when-idle): New. + * gutter-items.el (remove-progress-display): Removed. + * gutter-items.el (remove-progress-feedback): New. + * gutter-items.el (progress-display-dispatch-non-command-events): Removed. + * gutter-items.el (progress-feedback-dispatch-non-command-events): New. + * gutter-items.el (append-progress-display): Removed. + * gutter-items.el (append-progress-feedback): New. + * gutter-items.el (abort-progress-display): Removed. + * gutter-items.el (abort-progress-feedback): New. + * gutter-items.el (raw-append-progress-display): Removed. + * gutter-items.el (raw-append-progress-feedback): New. + * gutter-items.el (display-progress-display): Removed. + * gutter-items.el (display-progress-feedback): New. + * gutter-items.el (current-progress-display): Removed. + * gutter-items.el (current-progress-feedback): New. + * gutter-items.el (current-progress-display-label): Removed. + * gutter-items.el (current-progress-feedback-label): New. + * gutter-items.el (progress-display): Removed. + * gutter-items.el (progress-feedback): New. + Replace "progress-display" with "progress-feedback" globally. + + * gutter-items.el (lprogress-display): Removed. + * gutter-items.el (progress-feedback-with-label): New. + Rename lprogress-display ==> progress-feedback-with-label. + + * gutter-items.el (search-dialog-direction): Removed. + * gutter-items.el (search-dialog-text): Removed. + * gutter-items.el (search-dialog-callback): Removed. + * gutter-items.el (make-search-dialog): Removed. + Move to dialog-items.el. + + * help.el: + * help.el (help-mode-quit): + * help.el (mode-for-help): New. + * help.el (help-sticky-window): New. + * help.el (help-window-config): New. + * help.el (with-displaying-help-buffer): + * help.el (function-at-event): New. + * help.el (help-symbol-regexp): New. + * help.el (help-symbol-run-function-1): New. + * help.el (help-symbol-run-function): New. + * help.el (help-symbol-function-context-menu): New. + * help.el (help-symbol-variable-context-menu): New. + * help.el (help-symbol-function-and-variable-context-menu): New. + * help.el (frob-help-extents): New. + * help.el (describe-function-1): + * help.el (variable-at-point): + * help.el (variable-at-event): New. + * help.el (describe-variable): + Major overhaul. + - Make functions and variables be mousable. + - Middle button hyperlinks. + - New context-menu entries. + + * keydefs.el: + * keydefs.el (global-map): + New key bindings to move lines up and down. + + * lisp-mode.el: + * lisp-mode.el (construct-lisp-mode-menu): New. + * lisp-mode.el (emacs-lisp-mode-popup-menu): + * lisp-mode.el (lisp-interaction-mode-menubar-menu): + * lisp-mode.el (emacs-lisp-mode-menubar-menu): + * lisp-mode.el (lisp-indent-function): Indent "flet" entries better. + Make popup and menubar menus be different. Popup menu uses + clicked location and automatically assumes symbol under the mouse + for various commands. + + * menubar-items.el: + * menubar-items.el (bookmark-menu-filter): Add accelerators. + * menubar-items.el (buffers-menu-omit-chars-list): Include 'd'. + + * menubar-items.el (global-popup-menu): Removed. + * menubar-items.el (mode-popup-menu): Removed. + * menubar-items.el (activate-popup-menu-hook): Removed. + * menubar-items.el (popup-mode-menu): Removed. + * menubar-items.el (popup-buffer-menu): Removed. + * menubar-items.el (popup-menubar-menu): Removed. + Move to menubar.el. + + * menubar.el: + * menubar.el (global-popup-menu): New. + * menubar.el (mode-popup-menu): New. + * menubar.el (activate-popup-menu-hook): New. + * menubar.el (last-popup-menu-event): New. + * menubar.el (popup-mode-menu): New. + * menubar.el (popup-buffer-menu): New. + * menubar.el (popup-menubar-menu): New. + * menubar.el (menu-call-at-event): New. + Move non-content functions here. Add support for context menu + items on extents. + + * minibuf.el (minibuffer-history-uniquify): + Typo fix. + + * minibuf.el (read-file-name-1): + Call new file dialog box if it exists. + + * minibuf.el (mouse-rfn-setup-vars): + Clean up "chop" action. + + * mouse.el: + * mouse.el (button2): Now bound to mouse-track. + * mouse.el (click-inside-extent-p): + * mouse.el (point-inside-extent-p): + * mouse.el (point-inside-selection-p): + * mouse.el (mouse-drag-or-yank): Removed. + * mouse.el (mouse-begin-drag-n-drop): New. + * mouse.el (mouse-eval-sexp): + * mouse.el (mouse-track-activate-strokes): New. + * mouse.el (mouse-track-do-activate): New. + * mouse.el (mouse-track): + * mouse.el (default-mouse-track-event-is-with-button): New. + * mouse.el (default-mouse-track-cleanup-hook): + * mouse.el (default-mouse-track-drag-hook): + * mouse.el (default-mouse-track-drag-up-hook): + * mouse.el (default-mouse-track-click-hook): + Merge drag-n-drop into mouse-track. + Add general "activate" support to replace specific button2 kludges. + Use "button modifier" support in mouse-track. + + * package-get.el (package-get-dependencies): Fix bytecompiler warnings. + + * package-ui.el: + * package-ui.el (pui-menu): + * package-ui.el (pui-popup-context-sensitive): Removed. + Fix bytecompiler warnings. + Clean up popup code a bit. + + * select.el (get-selection-no-error): Fix bytecompiler warnings. + + * simple.el: + * simple.el (transpose-lines): + * simple.el (transpose-line-up): New. + * simple.el (transpose-line-down): New. + * simple.el (transpose-subr): + * simple.el (transpose-subr-1): Removed. + Clean up, add functions to move lines up and down. + + * startup.el (mail-host-address): + * startup.el (user-mail-address): + Customize. + + * subr.el: + * subr.el (set-symbol-value-in-buffer): New. + * subr.el (error): + * subr.el (check-argument-type): + * subr.el (defined-error-p): New. + Add structured error support. + + * toolbar-items.el (toolbar-compile): + Use new make-dialog-box. + + * update-elc.el: + + * userlock.el (ask-user-about-lock-dbox): + * userlock.el (ask-user-about-supersession-threat-dbox): + * userlock.el (ask-user-about-lock): + * userlock.el (ask-user-about-supersession-threat): + Use new make-dialog-box. + Add safety checks; use should use-dialog-box-p. + + * window-xemacs.el: + * window-xemacs.el (__buffer-dedicated-frame): + * window-xemacs.el (buffer-dedicated-frame): New. + * window-xemacs.el (set-buffer-dedicated-frame): New. + Move dedicated-frame stuff into lisp. + +2000-07-18 Kirill 'Big K' Katsnelson + + * printer.el (generic-print-region): Do not require that + `printer-name' be set. + (printer-name): Commentary clarification. + +2000-07-19 Martin Buchholz + + * XEmacs 21.2.35 is released. + +2000-07-18 Alastair J. Houghton + + * select.el (selection-coercible-types): Initialise. + +2000-07-18 Alastair J. Houghton + + * select.el (own-clipboard): Bug fix. + +2000-07-17 Mike Sperber + + * cus-edit.el (custom-migrate-custom-file): Save init file before + continuing. + +2000-07-16 Mike Sperber + + * startup.el (load-init-file): Remove silly call to + `load-user-custom-file`. + (maybe-migrate-user-init-file): Minor fixes. + +2000-07-16 Martin Buchholz + + * apropos.el (apropos-documentation-check-doc-file): + `doc' variable should be let-bound, as was presumably intended. + + * cus-edit.el (custom-variable-reset-saved): + (custom-variable-reset-standard): + Remove unused variable comment-widget. Twice. + + * toolbar.el (toolbar-blank-press-function): + Add a real defvar with initial value nil and proper docstring. + (press-toolbar-button): No need to check for boundp-ness anymore. + + * rect.el (open-rectangle-line): Remove useless (let) form. + Add defvar for pending-delete-mode. + + * info.el (Info-find-node): This function needs an autoload cookie. + + * mule/mule-x-init.el (x-use-halfwidth-roman-font): + Use let* since the second form referred to the first. + +2000-07-16 Adrian Aichner + + * msw-select.el (mswindows-paste-clipboard): Use `get-clipboard' + instead of removed `mswindows-get-clipboard'. + + +2000-07-15 Alastair J. Houghton + + * select.el (select-convert-from-text): New. + * select.el (select-convert-from-length): New. + * select.el (select-convert-from-integer): New. + * select.el (select-convert-from-identity): New. + * select.el (select-convert-from-filename): New. + * select.el (selection-converter-in-alist): Use them. + New converter functions for X. + + * select.el (get-selection): Removed comment. + + * select.el (own-selection): Removed append code - I thought + I'd already done this, but apparently not... + + * select.el: Changed comment about TIMESTAMP. + + * select.el (select-convert-in): New. + * select.el (select-convert-out): New. + New functions that get used by select.c. + + * select.el (select-buffer-killed-default): New. + * select.el (select-buffer-killed-text): New. + * select.el (selection-buffer-killed-alist): New. + New list and functions that get called if a relevant selection + exists and a buffer gets killed. + + * select.el (select-convert-to-targets): + * select.el (select-convert-to-identity): Removed. + * select.el (select-convert-from-identity): Removed. + * select.el (select-converter-out-alist): + Removed _EMACS_INTERNAL selection type. + + * x-select.el (xselect-kill-buffer-hook): Removed. + * x-select.el (xselect-kill-buffer-hook-1): Removed. + Removed this X-specific nonesense. Use the generic support + in select.el instead. + +2000-07-15 Martin Buchholz + + * mule/mule-category.el (defined-category-hashtable): + Use make-hash-table instead of make-hashtable + + * buff-menu.el: Byte-compiler warning fix. + + * isearch-mode.el (isearch-highlight-all-cleanup): + Remove unused variable `isearch-highlight-all-start'. + + * etags.el (add-to-tag-completion-table): Byte-compiler warning fix. + + * itimer.el (itimer-edit-mode): Byte-compiler warning fixes. + + * cus-dep.el (Custom-make-dependencies): + Add autoload cookie for custom-add-loads to generated custom-load.el. + + * autoload.el (autoload-package-name): Warning suppression. + Move defvar prior to first use. + + * custom.el: Add autoload for custom-declare-face. + Allow `xemacs -no-autoloads -l bytecomp -f batch-byte-compile ...' + * cl.el (cl-hack-byte-compiler): + Allow `xemacs -no-autoloads -l bytecomp -f batch-byte-compile ...' + to work properly. + +2000-07-08 Mike Sperber + + * startup.el (load-home-init-file): Added variable. + (maybe-migrate-user-init-file): Added. + (load-user-init-file): Load custom file if different from init + file. + + * dumped-lisp.el (preloaded-file-list): Added "cus-file" before + "startup." + + * cus-edit.el (custom-migrate-custom-file): Added for migration. + Moved `custom-file'-related code to cus-file.el. + + * cus-file.el: New file. + +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. + + * startup.el (find-user-init-file): Also look for + ~/.xemacs/init.elc? in preference to ~/.emacs. + +2000-07-12 Alastair J. Houghton + + * select.el (own-selection): + * select.el (own-clipboard): Changed `append' parameter to + `how-to-use' parameter. + * select.el (own-selection): Removed icky append code. + * select.el (own-selection, get-selection): Removed extra type + checking. + * select.el (selection-appender-alist): + * select.el (selection-converter-{in|out}-alist): Initialise. + * select.el (select-append-to-*): New. + * select.el (select-convert-from-*): New. New functions to append + data and convert data from external type. + +2000-07-12 Stef Epardaud + + * font-lock.el: Javadoc enhancements. + +2000-07-06 Kirill 'Big K' Katsnelson + + * printer.el (generic-print-region): Compose job name from buffer + name. + +2000-07-06 Yoshiki Hayashi + + * font-lock.el (font-lock-fontify-pending-extents): Call + font-lock-fontify-region instead of font-lock-fontify-buffer + to avoid unnecessary progress gauges. + +2000-07-06 Craig Lanning + + * custom-load.el (faces): + + * finder.el (finder-compile-keywords): from Dan Holmsand, make sure + dir is a regex. + + * process.el (call-process-internal): from Dan Holmsand, use binary + coding systems so that jka-compr works. + +2000-07-07 Ben Wing + + * font-lock.el: Undo previous change. Unfortunately, some + files actually use the variables directly in their init code + without quoting them. + +2000-07-07 Ben Wing + + * font-lock.el (defvar font-lock-*-face): Removed. + + * font-lock.el (font-lock-apply-highlight): Bind these face vars + only when necessary. + +2000-06-30 Charles G Waldman + + * cl-macs.el: fix cl-transform-function-property kludge + so that it does not require a random feature. + +2000-06-09 Karl M. Hegbloom + + * files.el (auto-mode-alist): allow .make extension for Makefiles, + as in Linux kernel "Rules.make". + +2000-06-29 Gunnar Evermann + + * build-report.el (build-report): Add autoload cookie. + +2000-06-21 Charles G Waldman + + * package-ui.el (defgroup pui): Correct a misspelling + (pui-toggle-package-delete): Change `seleted' to `selected' + +2000-06-12 Jan Vroonhof + + * package-get.el (package-get-update-base): + (package-get): Use insert-file-contents-literally always. + (package-get-maybe-save-index): + Force coding system for writing to binary. + +2000-06-08 Mike Alexander + + * code-process.el (call-process-region): If there is no coding + system for the process on process-coding-system-alist use the + coding system of the buffer containing the region. + +2000-06-10 Ben Wing + + * cmdloop.el (command-error): + If debug-on-error and noninteractive, output backtrace. + + * files.el (file-relative-name): + Remove MSDOS references. + + * simple.el (line-number): New function, due to non-obvious + behavior/usage of count-lines. + + * simple.el (count-lines): document non-obvious usage to get + line number. + +2000-06-11 Ben Wing + + * faces.el ((featurep 'xpm)): + * x-faces.el (x-init-face-from-resources): + * x-faces.el (x-init-frame-faces): + * x-misc.el (x-init-specifier-from-resources): + * x-misc.el (x-get-resource-and-bogosity-check): + * x-misc.el (x-get-resource-and-maybe-bogosity-check): + * x-mouse.el (x-init-pointer-shape): + * x-scrollbar.el (x-init-scrollbar-from-resources): + Add sixth argument to x-get-resource calls so as to issue warnings + rather than errors on bogus arguments. + +2000-06-05 Ben Wing + + * compat.el: new file. provides a clean, non-intrusive way to + define compatibility functions. + + * process.el (shell-quote-argument): temporary fix for lack + of nt-quote-process-args. #### I need to put back the overall + structure of that mechanism but redo the guts of it using the + extra intelligence in the C code. + +2000-05-28 Adrian Aichner + + * package-info.el (pi-md5sum): Calculate MD5 sum just like + `package-get' does in package-get.el, instead of using external + "md5sum" program. + + * package-get.el (package-get): Insert package file literally to + make checksum calculation work. + +2000-04-18 Hrvoje Niksic + + * code-files.el (convert-mbox-coding-system): Deleted. + (file-coding-system-alist): Removed reference to + convert-mbox-coding-system. + +2000-05-28 Martin Buchholz + + * XEmacs 21.2.34 is released. + +2000-05-20 Karl M. Hegbloom + + * font-lock.el (font-lock-keywords): Rewrote docstring + +2000-05-22 Karl M. Hegbloom + + * loadhist.el (unload-feature): handle case where x is both boundp + and fboundp + +2000-05-22 Karl M. Hegbloom + + * packages.el: It's ok to use built-in macros, but not lisp + defined ones. + +2000-05-20 Ben Wing + + * font-lock.el: + * font-lock.el (font-lock-message-threshold): + * font-lock.el (font-lock-mode): + * font-lock.el (font-lock-default-fontify-buffer): + * font-lock.el (font-lock-always-fontify-immediately): + * font-lock.el (font-lock-old-extent): Removed. + * font-lock.el (font-lock-old-len): Removed. + * font-lock.el (font-lock-fontify-glumped-region): Removed. + * font-lock.el (font-lock-pending-extent-table): New. + * font-lock.el (font-lock-range-table): New. + * font-lock.el (font-lock-after-change-function): + * font-lock.el (font-lock-after-change-function-1): Removed. + * font-lock.el (font-lock-fontify-pending-extents): New. + * font-lock.el ('font-lock-revert-cleanup): Removed. + * font-lock.el ('font-lock-revert-setup): Removed. + Rewrite deferral code to handle any number of changes, merging + them properly. Remove hacked-up code for revert-buffer, now + unnecessary. + + * menubar-items.el (default-menubar): + In Options->Edit Init File, don't switch to emacs-lisp-mode + unless necessary; doing this turns off font-lock. + +2000-05-15 Yoshiki Hayashi + + * keydefs.el: Define C-x BS to backward-kill-sentence. + +2000-05-15 Yoshiki Hayashi + + * files.el (hack-local-variables-prop-line): Use non-greedy + matching to process -*-texinfo-*- -*-. + +2000-05-11 Jonathan Marten + + * minibuf.el (minibuf-directory-files): new function. + (read-file-name-activate-callback): use minibuf-directory-files. + (read-directory-name-internal): ditto. + (mouse-file-display-completion-list): ditto. + (mouse-directory-display-completion-list): ditto. + (read-file-name-internal): remove "./" from completion list unless + explicitly matched, for consistency. + +2000-05-11 Ben Wing + + * gutter-items.el (gutter-buffers-tab): + * gutter-items.el (add-tab-to-gutter): + * gutter-items.el (update-tab-in-gutter): + * gutter-items.el (remove-buffer-from-gutter-tab): Removed. + * gutter-items.el (append-progress-display): + * gutter-items.el (abort-progress-display): + * gutter-items.el (raw-append-progress-display): + Further fixes. Use set-glyph-image not set-image-instance-property, + to fix problems with multiple windows in a frame. + + * menubar-items.el (tutorials-menu-filter): + Fix typo. + + * startup.el (early-error-handler): + Display message box under windows; otherwise, message will disappear + before it can be viewed. + + * update-elc.el: + Fix bug in NEEDTODUMP processing. + +2000-05-08 Yoshiki Hayashi + + * startup.el (lock-directory): Removed. + (superlock-file): Ditto. + (startup-set-paths): Remove lockdir. + (startup-setup-paths-warning): Remove lock-directory. + + * setup-paths.el (paths-find-lock-directory): Removed. + (paths-find-superlock-file): Ditto. + +2000-05-09 Ben Wing + + * faces.el (set-face-property): + * faces.el (set-face-font): + * faces.el (set-face-foreground): + * faces.el (set-face-background): + * faces.el (set-face-background-pixmap): + * faces.el (set-face-underline-p): + * faces.el (set-face-strikethru-p): + * faces.el (set-face-highlight-p): + * faces.el (set-face-dim-p): + * faces.el (set-face-blinking-p): + * faces.el (set-face-reverse-p): + doc string changes. + + * glyphs.el: + * glyphs.el (make-image-specifier): + * glyphs.el (glyph-property): + * glyphs.el (set-glyph-image): + * glyphs.el (make-glyph): + * glyphs.el (make-pointer-glyph): + * glyphs.el (make-icon-glyph): + * glyphs.el (widget-image-instance-p): New. + authorship info, lots of doc changes. New predicate, inadvertently + omitted. the general principle with specifier docs is now that + the description of instantiators should go with the make-foo-specifier + fun's doc string, rather than in foo-specifier-p. this follows + conventions elsewhere in XEmacs and in general is a lot more obvious + of a place to look. sometimes the make-foo-specifier function needs + to be created in the process. + + * gutter.el: + * gutter.el (make-gutter-specifier): New. + * gutter.el (make-gutter-size-specifier): New. + * gutter.el (make-gutter-visible-specifier): New. + specifier doc updates according to the conventions specified before. + + * objects.el: + * objects.el (make-font-specifier): + * objects.el (make-color-specifier): + * objects.el (make-face-boolean-specifier): New. + specifier doc updates according to the conventions specified before. + + * specifier.el: + * specifier.el (set-specifier): + * specifier.el (make-integer-specifier): New. + * specifier.el (make-boolean-specifier): New. + * specifier.el (make-natnum-specifier): New. + * specifier.el (make-generic-specifier): New. + * specifier.el (make-display-table-specifier): New. + specifier doc updates according to the conventions specified before. + + * toolbar.el: + * toolbar.el (make-toolbar-specifier): New. + specifier doc updates according to the conventions specified before. + +2000-05-09 Ben Wing + + * process.el (call-process-internal): Revert to previous version + because Mike's change clashed with a change I did not long before. + Changed progn to prog1 to fix the bug pointed out by Mike Alexander. + Thanks very much Mike for pointing out the bug and submitting a + patch! + +2000-04-13 Mike Alexander + + * process.el (call-process-internal): Send the correct input buffer + (call-process-internal): Return the exit status of the process + +2000-05-07 Ben Wing + + * winnt.el: + * winnt.el (nt-quote-args-verbatim): Removed. + * winnt.el (nt-quote-args-prefix-quote): Removed. + * winnt.el (nt-quote-args-backslash-quote): Removed. + * winnt.el (nt-quote-args-double-quote): Removed. + * winnt.el (nt-quote-args-functions-alist): Removed. + * winnt.el (nt-quote-process-args): Removed. + Remove all stuff for argument quoting. We borrow the code instead + from Emacs 20.6, which is much more careful in its quoting + (e.g. in handling runs of the escape character) and avoids most of + the need for this Lisp mechanism by checking to see whether we're + running a Cygwin or normal program and doing the appropriate + quoting. If we end up needing such a mechanism, we should add + it by extending the variable `mswindows-quote-process-args' so it + can take an alist of regexps. + +2000-05-07 Ben Wing + + * keydefs.el: + Restore M-up, M-down to 21.1 state. Put *ward-sentence on + C-M-left, C-M-right instead. Define C-M-up, C-M-down to scroll + the window without moving point. + + * simple.el: + * simple.el (scroll-up-one): New. + * simple.el (scroll-down-one): New. + Functions for use with C-M-up/down. + +2000-05-01 Martin Buchholz + + * XEmacs 21.2.33 is released. + +2000-04-29 Martin Buchholz + + * dialog.el (yes-or-no-p-dialog-box): + Fix docstring. + Fix following horrible bug in X11 mode with focus-follows-mouse: + 1. Visit two files in two different frames. + 2. do File->Revert Buffer in one of those frames. + 3. Dialog box appears. + 4. Arrange things so that the mouse passes over the *other* + frame, then to the dialog box, and click on "Yes". + 5. The file contents end up in the *wrong* buffer! + Add TODO comment. + +2000-04-28 Ben Wing + + * help.el (describe-installation): correct typo introduced + in last patch: boundp -> fboundp. + + * etags.el (buffer-tag-table-list): + canonicalize filenames to Unix format so that tag-table-alist + searching works under Windows. + + * autoload.el: + Bowdlerize the supposedly objectionable words + "who couldn't quite manage to cleanly modify batch-update-autoloads". + + * gutter-items.el (set-progress-display-style): + * gutter-items.el (search-dialog-callback): + * gutter-items.el (make-search-dialog): + Change to new callback-ex api. + +2000-04-26 Bjrn Torkelsson + + * help.el: (describe-installation): decode-coding-string is not + defined in a non MULE environment. + +2000-04-28 Ben Wing + + * gutter-items.el (buffer-list-changed-hook): + use it, not record-buffer-hook. + + * subr.el (record-buffer-hook): Removed. + +2000-04-27 Ben Wing + + * gutter-items.el (buffers-tab-switch-to-buffer): do not + use NORECORD option. Andy will not like this, but the existing + gutter behavior is just wrong, as per this comment: + + ;; this used to add the norecord flag to both calls below. + ;; this is bogus because it is a pervasive assumption in XEmacs + ;; that the current buffer is at the front of the buffers list. + ;; for example, select an item and then do M-C-l + ;; (switch-to-other-buffer). Things get way confused. + ;; + ;; Andy, if you want to maintain the current look, you must + ;; *uncouple* the gutter order and buffers order. + + * loaddefs.el (completion-ignored-extensions): unfuckify. + + * bytecomp.el (batch-byte-compile-one-file): new function, used in + xemacs.mak. + + * autoload.el (batch-update-one-directory): new function, used in + xemacs.mak. + + * loadup.el: set gc-cons-threshold very high unless dumping -- + loadup during update-elc is much much much faster. also do this + when quick-building. + + add commented-out code for profiling loadup. + + + * update-elc.el (preloaded-file-list): add bytecomp.el, since it + is required in order to build xemacs. + +2000-04-26 Ben Wing + + * loadup.el: don't garbage collect during loadup if quick-build + compile-time option is set. + +2000-04-23 Ben Wing + + * update-elc.el: compute whether any dumped .el or .elc files + are newer than the dumped exe, and touch the file ../src/NEEDTODUMP + if so. + + * update-elc.el (update-elc-files-to-compile): always change + NOBYTECOMPILE in the src directory rather than current dir, + so it will work under NT. + + * autoload.el (autoload-trim-file-name): canonicalize to slashes so + the form of this file is identical between Unix and Windows. + (autoload-target-directory): Fixed to be lisp/ not lisp/prim/. + Added comment. + (update-autoloads-from-directory): updated doc string. + updated doc strings in a few other places. + +2000-04-18 Yoshiki Hayashi + + * bytecomp.el (byte-force-recompile): Fix argument to + byte-recompile-directory. + +2000-04-17 Yoshiki Hayashi + + * gutter-items.el (progress-display-clear-when-idle): Use + add-one-shot-hook. + * gutter-items.el (clear-progress-display): Adjust number of + arguments. + +2000-04-13 Yoshiki Hayashi + + * dumped-lisp.el (preloaded-file-list): Always dump select.el. + +2000-04-16 Ben Wing + + * printer.el: New file. + + * dumped-lisp.el (preloaded-file-list): Declare printer.el. + + * help.el (describe-installation): Fix decoding for Windows. + + * menubar-items.el: + * menubar-items.el (default-menubar): + * menubar-items.el (tutorials-menu-filter): New. + * menubar-items.el (popup-menubar-menu): + Add authorship. Redo Help menu and Tutorials filter. + + * menubar.el: Correct comment. + + * modeline.el (modeline-buffer-identification): Correct doc string. + + * simple.el: + * simple.el (printing): Removed. + * simple.el (printer-name): Removed. + * simple.el (generic-print-buffer): Removed. + * simple.el (generic-print-region): Removed. + Move generic print code to printer.el. + +2000-04-15 Ben Wing + + * simple.el (generic-print-region): New. + make this function actually work. + (generic-print-buffer): call generic-print-region. + +2000-04-14 Andy Piper + + * gutter-items.el (make-search-dialog): avoid unnecessary futzing + by using the new widget-callback-current-channel. + (search-dialog-callback): ditto. + +2000-04-12 Andy Piper + + * gutter.el (default-gutter-position): moved from gutter-items.el. + (default-gutter-position-changed-hook): ditto. + (gutter-element-visibility-changed-hook): ditto. + (set-gutter-element): ditto. + (remove-gutter-element): ditto. + (set-gutter-element-visible-p): ditto. + (gutter-element-visible-p): ditto. + (init-gutter): ditto. + + * dialog.el (make-dialog-box): renamed and moved from + gutter-items.el + + * gutter-items.el: move various functions elsewhere. + +2000-04-13 Katsumi Yamaoka + + * menubar-items.el: Fixed place of parenthesis. + +2000-04-12 Ben Wing + + * etags.el (find-tag-at-point): New. Lets you do find-tag + without constantly being prompted for the tag. + * simple.el: Added a number of section headings, to clarify the + organization of this file. + * simple.el (activate-region): + * simple.el (region-exists-p): + * simple.el (region-active-p): + Moved these three function down to the other side of + the case-changing functions, so they join the rest of + the region code. + * simple.el (printing): New. + * simple.el (printer-name): New. + * simple.el (generic-print-buffer): New. + New functions, a very simple prototype for a unified + printing interface. + + * process.el (call-process-internal): Real fix for null BUFFER, + other problems with BUFFER specs. + + * menubar-items.el: + Fixed up File->Print to use new printing functions. + Various corrections and expansions to Grep/Compile menus. + New options for Printing. + New options for SMTP Mail, the way to send mail under + MS Windows. (There's also a package patch to make SMTP + Mail be the default under MSWin.) + +2000-04-09 Jeff Miller + + * menubar-items.el: Selecting Rectangle Mousing from menubar + did not work. Needed to quote mouse-track-rectangle-p. + +2000-04-06 Yoshiki Hayashi + + * cl-compat.el (keywordp): Removed. + +2000-04-05 Andy Piper + + * gutter-items.el (progress-layout-glyph): don't initialize here. + (progress-gauge-glyph): use dynamic sizing. + (set-progress-display-style): new function. Set progress glyphs + appropriately depending on the style. + (progress-display-style): new variable. Custom version of + set-progress-display-style. + (progress-abort-glyph): switch to dynamic sizes. + (search-dialog-text): make the edit field active. + +2000-04-04 Andy Piper + + * gutter-items.el (make-search-dialog): need to make the search + dialog visible after creation. + + * menubar-items.el (default-menubar): use the search dialog for + searching. Remove some extraneous search menu items. + + * gutter-items.el (set-gutter-element): allow glyphs to be used as + well as strings. + (make-gutter-only-dialog-frame): allow the user to create the + frame unmapped. Allow the gutter spec to be given as a glyph. + (search-dialog-direction): new variable. + (search-dialog-text): new variable. + (search-dialog-callback): new function. Callback for the search + dialog action. + (make-search-dialog): new function. Create a user-friendly search + dialog. + +2000-04-04 Hrvoje Niksic + + * faces.el (set-face-stipple): Use mswindows-bitmap-file-path + under Windows. + +2000-04-01 Andy Piper + + * font-lock.el (font-lock-fontify-keywords-region): Calculate + progress more accurately. + +2000-02-02 Hirokazu FUKUI + + * finder.el (finder-compile-keywords): Process readable files only. + Because error in process of .#finder-inf.el when compile xemacs + with --with-clash-detection option. + +2000-03-31 Andy Piper + + * gutter-items.el (append-progress-display): don't delay after a + successful font-lock. + (make-gutter-only-dialog-frame): new function. Allow users to + create gutter-only dialogs. + +2000-03-27 Mike Alexander + + * process.el (call-process-internal): Handle a null BUFFER + parameter correctly. + +2000-03-28 Andy Piper + + * gutter-items.el (abort-progress-display): put strings in the + gutter not extents. + (progress-layout-glyph): signal special 'quit callback. + (progress-display-quit-function): deleted. + (progress-display-stop-callback): deleted. + (progress-display-dispatch-command-events): deleted. + (append-progress-display): remove calls to + progress-display-dispatch-command-events. + (raw-append-progress-display): ditto. + +2000-03-23 Hrvoje Niksic + + * faces.el (set-face-stipple): Rewrite to correctly handle PIXMAP + being a list. Actually define `stipple-pixmap-p' which is used as + an error predicate. Correctly handle PIXMAP being either relative + or absolute file name. + +2000-03-24 Andy Piper + + * gutter-items.el (add-tab-to-gutter): use copy-sequence. + (abort-progress-display): ditto. Don't delete the created extent. + (raw-append-progress-display): ditto. + (progress-display-dispatch-non-command-events): new + function. Encapsulates what we want to do when no command input is + required. + (progress-display-dispatch-command-events): likewise, but disable + for now since it causes too many problems. + (append-progress-display): use them. + (raw-append-progress-display): ditto. + (default-gutter-position-changed-hook): set this rather than + default-gutter-position-changed. + (default-gutter-position-changed-hook): lambda with zero arguments + rather than one. + (raw-append-progress-display): trap errors in pending input since + allowing them to signal will hose the gauge well and + truly. Ideally we would like to delay these until we are more able + to cope. + (append-progress-display): ditto. + +2000-03-20 Jeff Miller + + * lisp/make-docfile.el: call-process-internal is now implemented + in process.el. + +2000-03-21 Ben Wing + + * mule\mule-cmds.el (set-language-info-alist): + Fix to correspond to new menu arrangement. + +2000-03-21 Ben Wing + + * process.el: + * process.el (call-process-internal): New. + New implementation of call-process. Only enabled under NT, so far. + stderr handling not implemented yet in CVS'd C code. + +2000-03-20 Ben Wing + + * lisp-mode.el: + * lisp-mode.el (lisp-interaction-mode-menubar-menu): New. + * lisp-mode.el (lisp-interaction-mode): + Put back Lisp Interaction menubar for Jan V's sake. + + * simple.el: + * simple.el (mark-ring): + * simple.el (dont-record-current-mark): New. + * simple.el (in-shifted-motion-command): New. + * simple.el (mark-ring-unrecorded-commands): New. + * simple.el (mark-ring-max): + * simple.el (set-mark-command): + * simple.el (push-mark): + * simple.el (handle-pre-motion-command): + Implement scheme for not recording unimportant marks. + + * subr.el: + * subr.el (function-allows-args): New. + New function function-allows-args. + +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-20 Andy Piper + + * gutter-items.el (update-tab-in-gutter): force selection of the + selected-window if required to do so. + (buffers-tab-items): ditto. + (add-tab-to-gutter): ditto. + (create-frame-hook): use force-selection. + (default-gutter-position-changed): lambdify. + (update-tab-hook): deleted since it was only used in one place. + +2000-03-18 Andy Piper + + * files.el (find-file-noselect): undo change that shouldn't have + gone in. + +2000-03-17 Andy Piper + + * buffer.el (switch-to-buffer): use last-nonminibuf-window instead + of selected-window trickery. + + * gutter-items.el (update-tab-in-gutter): don't give dedicated + frames tabs. + (progress-display-stop-callback): progress -> progress-display + (progress-display-quit-function): ditto. + (clear-progress-display): ditto. + (remove-progress-display): ditto. + (append-progress-display): ditto. + (abort-progress-display): ditto. + (raw-append-progress-display): ditto. + (display-progress-display): ditto. + (current-progress-display-label): ditto. + (current-progress-display): ditto. + (lprogress-display): ditto and save the buffer + (progress-display): ditto. Otherwise the buffer sometimes gets + changed which confuses font-lock. + + * font-lock.el (font-lock-default-fontify-buffer): catch all + errors, not just quit. + (font-lock-mode): progress -> display-progress + (font-lock-default-fontify-buffer): ditto. + (font-lock-fontify-syntactically-region): ditto. + (font-lock-fontify-keywords-region): ditto. + +2000-03-14 Hrvoje Niksic + + * cl.el (gensym): Move to here from cl-macs.el. + (gentemp): Ditto. + +2000-03-16 Andy Piper + + * font-lock.el (font-lock-mode): use lprogress and friends for + progress management. + (font-lock-default-fontify-buffer): ditto. + (font-lock-fontify-syntactically-region): ditto. + (font-lock-fontify-keywords-region): ditto. + (font-lock-revert-cleanup): fix reverting. + (font-lock-revert-setup): ditto. + + * gutter-items.el (progress-use-echo-area): new variable. Use the + echo area for progress gauges if non-nil. + (clear-progress): remove echo area stuff and defer to + clear-message. + (append-progress): dispatch non-command events after each progress + increment. Remove echo area stuff. + (abort-progress): remove echo area stuff and defer to + display-message. + (raw-append-progress): ditto. Dispatch non-command events after + gutter redisplay. + (display-progress): defer echo area stuff to display-message. + + * gutter-items.el (clear-progress): + (abort-progress): indentation changes. + (display-progress): don't clear progress. + (append-progress): compare messages with equal. + (raw-append-progress): use dispatch-non-command-events to flush + widget creation events. + +2000-03-13 Ben Wing + + * abbrev.el: + * abbrev.el (abbrev-string-to-be-defined): New. + * abbrev.el (inverse-abbrev-string-to-be-defined): New. + Changes for use with the menubar. + +2000-03-12 Ben Wing + + * alist.el (vassoc): moved here from font-menu.el. + + * custom.el (defface): typo fix. + + * dialog.el (yes-or-no-p-dialog-box): + * dialog.el (message-box): + * files.el (save-some-buffers-1): + Put accelerators in the button names. + + * font-lock.el (font-lock-comment-face): + * font-lock.el (font-lock-keyword-face): + * font-lock.el (font-lock-function-name-face): + Fixed some of the colors under MS Windows because the existing + default colors were hardly different from black and needed to be + made lighter. + + * font-menu.el: + * font-menu.el (font-menu-split-long-menu): + * font-menu.el (font-menu-family-constructor): + * font-menu.el (font-menu-size-constructor): + * font-menu.el (font-menu-weight-constructor): + * font-menu.el (font-menu-set-font): + vassoc moved to alist.el. + Accelerators added to all menus. + Unused bound var new-props removed. + + * keydefs.el: I did a whole lot of rearranging to put things in a + more consistent order and fixed a number of cases where key + combinations involving up, down, left, right and so on were + defined but the corresponding keypad combinations were not + defined. + + * lisp-mode.el: + * lisp-mode.el (lisp-interaction-mode-popup-menu): + * lisp-mode.el (emacs-lisp-mode): + * lisp-mode.el (lisp-interaction-mode): + * lisp-mode.el (flet): + Added accelerators onto the menus. + Made all the different versions of the let function be indented + the same way. + Undid Steve's easy-menu-ification, because it makes it impossible + to have the menubar and popup menus different. + Cleaned up the menu; added items for find-function &c and some + indenting, and removed debug-on-*. + + * list-mode.el (list-mode-hook): + * list-mode.el (list-mode): + * list-mode.el (completion-setup-hook): + * list-mode.el (display-completion-list): + Added support for the :window-height keyword, which is required + because of other changes that I made for the file dialog box. I + also made the hook variables list-mode-hook and + completion-setup-hook and also minibuffer-setup-hook in + minibuf.el be permanent-local; see comment in list-mode.el. + + * map-ynp.el (map-y-or-n-p): + Added accelerators to the dialog buttons. + + * menubar-items.el (menu-truncate-list): + New internal function. + * menubar-items.el (submenu-generate-accelerator-spec): + * menubar-items.el (menu-item-strip-accelerator-spec): + * menubar-items.el (menu-item-generate-accelerator-spec): + New exported functions, for use in auto-generating accelerator specs. + + * menubar-items.el: + * menubar-items.el (default-menubar): + * menubar-items.el (maybe-add-init-button): + * menubar-items.el (bookmark-menu-filter): + * menubar-items.el (slow-format-buffers-menu-line): + * menubar-items.el (build-buffers-menu-internal): + * menubar-items.el (language-environment-menu-filter): + * menubar-items.el (default-popup-menu): + * menubar-items.el (popup-buffer-menu): + * menubar-items.el (popup-menubar-menu): + Did a major overhaul on this file, and in fact I'm nowhere near + done working on the menubar, and there will be more patches to + come. A basic summary of what I've done: + + a) I added accelerators to all of the menu items. For menus that + are auto-generated, such as the buffers menu, the accelerators are + automatically added to the beginning of each line using the + numbers 1 through 9, then zero, and then letters starting with A, + but omitting the letters that are already in use for the fixed + menu items at the top of the buffers menu. To facilitate adding + accelerators of this kind, I created some new functions + (*-accelerator-spec), which are also being used by other filters + that auto generate lists of things such as ftp sites to download + packages. If people really don't like these accelerators + appearing at the beginning of the menu items, a variable can be + added to optionally turn them off, but I think this is rather + pointless because other menu items have accelerators and many or + most of the menu users will use the accelerators if the support is + there. + + b) I combined the top level Tools and Apps menus into a single + Tools menu, because the distinction between the two is not + obvious, and the items on the menus are not used often enough that + putting some of them onto submenus is a problem. + + c) I created two new top level menus called View and Cmds because + there were too many items on the File and Edit menus, and I'm going + to be adding more items to these menus. In contrast to the Tools + menu, the items on these menus may be used quite often during an + editing session, and so should be available with fewer + keystrokes. + + d) I added a number of options to the options menu, including one + for controlling whether the alt key can be used to traverse to + menu items using the accelerators, one for controlling behavior of + control-k, one for controlling how the kill and yank functions + interact with the clipboard, a few additional buffers-menu + options, and various other things. I also did a bit of + rearranging, for example, combining the keyboard and mouse options + into a single keyboard and mouse submenu to facilitate the + accelerators on that level. + + e) I changed the variable buffers-menu-format-buffer-line-function + to take two arguments instead of one, the second argument being + the line number for use in creating an accelerator. I added a + hack to support existing functions with one argument (although I + doubt that very many of these exist), for backward compatibility. + + f) I moved the top level mule menu to be a submenu of the edit + menu. I think that most of the items on this menu are fairly + useless and there are certainly not enough frequently used items + to justify this being its own top level menu. + + g) I combined most of the items in big-menubar.el into the main menu. + If people think the main menu is too big, it would be possible to + create different configurations, some smaller. + + * menubar.el (check-menu-syntax): + Deleted some syntax checks that were no longer valid, partly + because of changes that were already made a long time ago, and + partly because of a change I made where I allow the name of the + menu item to be an evaluated expression rather than just a string, + similar to all of the other parameters of a menu item. + + * minibuf.el: + * minibuf.el (read-file-name-1): + * minibuf.el (mouse-read-file-name-1): + I made a number of changes to improve the appearance + and functioning of the file dialog box. They include: + + a) Fixing the problem where closing the dialog box by clicking on + the close button of the window didn't properly exit the + minibuffer. + + b) Fixing the problem that if you typed part of a file name, and + then clicked on a completion with the mouse, the file was not + correctly selected. + + c) Changing the title of the dialog box to reflect the operation + being done in accordance with user interface conventions, rather + than the name of the dialog box buffer, which is rather useless. + + d) Remove the words "possible completions are" which didn't + belong. + + e) Fix things so that the completions scroll off the end of the + completions windows only to the right, rather than both to the + right and down, which is in accordance with Windows user interface + conventions. + + * msw-init.el (init-post-mswindows-win): + Added a binding for meta-F4, which is the standard windows binding + for exiting a program. + + * select.el (get-selection-no-error): + * select.el (own-selection): + * select.el (own-clipboard): + Added an optional argument called append to the functions + own-selection and own-clipboard. This adds support for appending + text to the existing selection and allows the function + own-clipboard to be used as the value of the variable + interprogram- cut-function. + + Fixed a bug in own-selection in handling zmacs-region-stays. + + * simple.el (historical-kill-line): New. + + * simple.el (kill-line): + * simple.el (interprogram-cut-function): + * simple.el (interprogram-paste-function): + * simple.el (handle-pre-motion-command): + * simple.el (next-line): + * simple.el (previous-line): + a) Expanded the variable kill-whole-line, so that function + kill-line can be set to delete the entire line always, not just + when cursor is at the beginning of the line. This is controlled + by setting the variable kill-whole-line to the symbol 'always. + This behavior, as well as the existing kill-whole-line behavior, + now only take effect when kill-line is called interactively, + although this is a departure from a previous behavior in the case + of setting this variable kill-whole-line to t. It is almost + certainly what has always been intended, and most likely the old + way of doing things introduced bugs. I also created a function + called historical-kill-line, which ignores the kill-whole-line + setting and always gives the historical behavior of only killing + to the end of the line. I bound this function to shift- control-k + so that the kill to end of line behavior is available, even when + kill-whole-line has been set to change control-k into the simple + delete-whole-line behavior. (This can be set using the options + menu.) + + b) I changed things so that kill and yank now interact with the + clipboard by default under windows. This was done by changing the + default value of interprogram-cut- function and + interprogram-paste-function. You can get the old behavior by + setting these to nil, and there is an option on the options menu + to do this. + + c) I added support for selecting text using shifted motion keys. + This support is on by default and can be controlled by the + variable shifted-motion-keys-select-region. There is also a + variable called unshifted-motion-keys-deselect-region that + controls more specifically how the shifted motion key behavior + works. I did not put an option on the options menu to turn this + off, because I can't imagine why this would be useful. + + * simple.el (forward-block-of-lines): + * simple.el (backward-block-of-lines): + * simple.el (block-movement-size): + New. + + * simple.el (uncapitalized-title-words): + * simple.el (uncapitalized-title-word-regexp): + * simple.el (capitalize-string-as-title): + * simple.el (capitalize-region-as-title): + New. + + + * subr.el (add-hook): + * subr.el (make-local-hook): New. + * subr.el (remove-local-hook): New. + * subr.el (add-one-shot-hook): New. + * subr.el (add-local-one-shot-hook): New. + Added some functions to make using hooks easier. + These include: + + a) Functions add-local-hook and remove-local-hook to make it easy + to use local hooks. + + b) Functions add-one-shot-hook and add-local-one-shot-hook, which + make it possible to add a "one-shot" hook, which is to say a hook + that runs only once, and automatically removes itself after the + first time it has run. + +2000-03-09 Andy Piper + + * files.el (auto-mode-alist): pick up jsp, jhtml and xml files. + +2000-03-09 Yoshiki Hayashi + + * buff-menu.el (buffers-menu-omit-invisible-buffers): + Moved from menubar-items.el. + * dumped-lisp.el: Dump gutter-items regardless of menubar. + +2000-03-08 Andy Piper + + * gutter-items.el (build-buffers-tab-internal): add selected field + to buffers tab spec. + +2000-03-07 Yoshiki Hayashi + + * minibuf.el (last-exact-completion): Initialize to nil. + +2000-03-07 Didier Verna + + * startup.el (command-line-1): remove unused variable + `first-file-buffer'. + +2000-02-29 Hrvoje Niksic + + * loaddefs.el (completion-ignored-extensions): Removed ".log", + which is also used for Web server log files. + +2000-02-03 IKEYAMA Tomonori + + * mule/mule-charset.el: Setup auto-fill-chars. + +2000-03-02 SL Baur + + * subr.el (with-string-as-buffer-contents): Reimplement using + `with-temp-buffer'. Fixes non-unique buffer name problem, fixes + non-deletion of buffer after execution problem. + (with-output-to-string): Use unique buffer name. + +2000-02-29 Stephen J. Turnbull + + * gutter-items.el (buffers-tab-sort-function): New variable. + (buffers-tab-items): Funcall it to sort the buffer tab list. + +2000-02-29 Stephen J. Turnbull + + * startup.el (load-user-init-file): Merge two `if's to one `or'. + +2000-02-28 Martin Buchholz + + * menubar-items.el (maybe-add-init-button): Remove the "Load + .emacs" button from all menubars. + +2000-03-01 Didier Verna + + * rect.el (string-rectangle): depend on `pending-delete-mode' for + region rectangle replacement (from Jan Vroonhof). + (replace-rectangle): new function. + +2000-01-05 Yoshiki Hayashi + + * mule/mule-cmds.el (set-default-coding-systems): Use + set-terminal-coding-system and set-keyboard-coding-system. + * coding.el (set-terminal-coding-system): Use + set-console-tty-output-coding-system. + (set-keyboard-coding-system): Use + set-console-tty-input-coding-system. + +2000-02-21 Yoshiki Hayashi + + * minibuf.el (read-variable): Allow symbol to default argument. + +2000-02-27 Andy Piper + + * gutter-items.el (update-tab-hook): new function to be used for + hooks. + (create-frame-hook): add update-tab-hook. + (record-buffer-hook): ditto. + (default-gutter-position-changed): ditto. + (default-gutter-position): updating the buffers tab is now handled + by a hook. + (default-gutter-position-changed-hook): new variable. + (gutter-element-visibility-changed-hook): ditto. + (set-gutter-element-visible-p): call it. + (set-gutter-element): use modify-specifier-instances. Set extents + as duplicable before using. + (remove-gutter-element): ditto. + (set-gutter-element-visible-p): ditto. + (init-gutter): new function. + (add-tab-to-gutter): use new gutter-element functions rather than + setting specifiers directly. + (clear-progress): ditto. + (abort-progress): ditto. + (gutter-buffers-tab-visible-p): renamed from + default-gutter-visible-p + + * specifier.el (modify-specifier-instances): new function from Jan + Vroonhof. + + * x-init.el (init-post-x-win): call init-gutter. + + * msw-init.el (init-post-mswindows-win): call init-gutter. + + * menubar-items.el (default-menubar): Update to reflect new gutter + variables. + +2000-02-26 Andy Piper + + * gutter-items.el (set-gutter-element): new function. Add gutter + elements to the specified gutter. + (remove-gutter-element): new function. Remove gutter elements from + the specified gutter. + (set-gutter-element-visible-p): new function. Set gutter element + visibility for the provided gutter-visible specifier. + +2000-02-23 Andy Piper + + * gutter-items.el (add-tab-to-gutter): specify dimensions + dynamically. + +2000-02-24 Martin Buchholz + + * gutter-items.el (add-tab-to-gutter): + * package-get.el (package-get-interactive-package-query): + * package-ui.el (pui-directory-exists): + (pui-install-selected-packages): + (pui-list-packages): + Use #'(lambda ...) instead of '(lambda ...). + +2000-02-21 Gregory Neil Shapiro + + * startup.el (load-user-init-file): Check to make sure user + has an init-file before calling load(). + +2000-02-20 Kirill 'Big K' Katsnelson + + * msw-glyphs.el (msgdi-device-p): Added this and 'msgdi specifier tag. + +2000-02-23 Martin Buchholz + + * XEmacs 21.2.31 is released. + +2000-02-21 Mike Sperber + + * loadup.el (really-early-error-handler): + * update-elc.el: + * make-docfile.el: + Remove dependency on EMACSBOOTSTRAP... environment variables. + +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-19 Martin Buchholz + + * byte-optimize.el (byte-optimize-plus): + (byte-optimize-minus): + (byte-optimize-multiply): + Optimize (- 0) to 0, not (-) + Optimize (+ 5 3.0) to 8.0 + Optimize (* 5 3.0) to 15.0 + Improve readability. + +2000-02-21 Jonathan Harris + + * modeline.el: (modeline-scrolling-method): change modeline + mswindows cursor appearance according to the value. + + * msw-faces.el: (mswindows-init-device-faces): Initialise 'default + and 'gui-element face colors and 'gui-element face font to Windows + defaults. + +2000-02-09 Stef Epardaud + + * font-lock.el: Javadoc enhancements + +1999-11-27 Oscar Figueiredo + + * ldap.el (toplevel): Test if LDAP support has been compiled in + (ldap-verbose): New option + (ldap-search-entries): Renamed from the previous ldap-search + Conditionalize message display on ldap-verbose + (ldap-add-entries, ldap-modify-entries, ldap-delete-entries): New + defuns + (ldap-search): Is now defined as an obsolete wrapper calling + ldap-search-basic or ldap-search-entries + + +1999-12-06 Hirokazu FUKUI + Shuhei KOBAYASHI + Jan Vroonhof + + * byte-optimize.el (byte-optimize-form-code-walker): Fixed. + When for-effect is true, didn't call `byte-optimize-form' + in and/or subforms without last. + +1999-12-07 Jan Vroonhof + + * package-get.el (package-get-download-sites): Use correct custom + type. + +2000-02-15 Kirill 'Big K' Katsnelson + + * files.el (write-file): Ask for coding system when compiled with + file-coding. + +2000-02-16 Andy Piper + + * buffer.el (switch-to-buffer): give norecord argument to + set-window-buffer instead of explicitly recording. + + * gutter-items.el (buffers-tab-switch-to-buffer): don't record if + we have to pick a window. + +1999-12-24 Yoshiki Hayashi + + * mule/mule-cmds.el (describe-language-support): Don't add + unexist function to help-map. + (describe-coding-system): Don't use already assigend `C'. + +2000-01-23 Bjrn Torkelsson + + * info.el (Info-save-auto-generated-dir): nil -> 'never to make it + work in custom. + +2000-02-04 Kazuyuki IENAGA + + * about.el: Ienaga's e-mail address change. + +2000-02-16 Samuel Mikes + + * etags.el (find-tag): force new window -- even if buf already + visible -- when other-window is t + +2000-02-16 Martin Buchholz + + * XEmacs 21.2.29 is released. + +2000-02-09 Martin Buchholz + + * cl-extra.el (getf): This is now identical to `plist-get', so + just defalias it. + * cl-macs.el: Make getf an alias to plist-get, at the + byte-compiler level, using define-compiler-macro. + +2000-02-08 Martin Buchholz + + * cl-extra.el (cl-remprop): Remove. remprop is now in C. + +2000-02-07 Kyle Jones + + * lisp/etags.el (find-tag-internal): set exact-tagname to + a regular expression that matches against the tagname + part of the tag entry first instead of only looking in + the context area. + +2000-01-23 Bjrn Torkelsson + + * gutter-items.el: fixed typo(s) in customizing default-gutter-position + * toobar.el: fixed typo(s) in customizing default-toolbar-position + 2000-02-07 Martin Buchholz * XEmacs 21.2.28 is released. @@ -26,7 +2088,7 @@ 2000-02-02 Per Abrahamsen * wid-edit.el (widget-match-inline): An atom never matches a - list. + list. 2000-01-29 Kirill 'Big K' Katsnelson @@ -50,9 +2112,9 @@ 2000-01-28 Martin Buchholz - * coding.el (dontusethis-set-value-file-name-coding-system-handler): - (dontusethis-set-value-terminal-coding-system-handler): - (dontusethis-set-value-keyboard-coding-system-handler): + * coding.el (dontusethis-set-value-file-name-coding-system-handler): + (dontusethis-set-value-terminal-coding-system-handler): + (dontusethis-set-value-keyboard-coding-system-handler): Never undefine coding system aliases. Emergency fix for gnus. 2000-01-26 Hrvoje Niksic @@ -93,20 +2155,20 @@ * process.el (shell-quote-argument): Use (nt-quote-process-args) for windows-nt. - * version.el: - * startup.el (user-init-file-base): - * process.el (call-process-region): - * files.el (make-backup-file-name): - (backup-file-name-p): - (file-relative-name): - (abbreviate-file-name): - (set-auto-mode): + * version.el: + * startup.el (user-init-file-base): + * process.el (call-process-region): + * files.el (make-backup-file-name): + (backup-file-name-p): + (file-relative-name): + (abbreviate-file-name): + (set-auto-mode): * code-process.el (call-process-region): Removed unnecessary branching on 'windows-nt and 'ms-dos system types. Phased 'ms-dos support out of the universe. * process.el: - * code-process.el: + * code-process.el: * bytecomp.el (byte-compile-file): Removed reference to buffer-file-type, and commented usage of binary-process-output NTEmacs variables. @@ -957,7 +3019,7 @@ (ldap-encode-string): Guard against `encode-coding-string' not being defined -1999-08-23 Didier Verna +1999-08-23 Didier Verna * rect.el: Cosmetics suggested by Dave Love . Some doc strings improvements, and add a star to the `interactive' @@ -992,14 +3054,14 @@ * gutter-items.el (remove-buffer-from-gutter-tab): fix *scratch* deletion problem. -1999-07-30 Didier Verna +1999-07-30 Didier Verna * cus-edit.el (custom-save-variables): I said, use prin1 instead of princ to output symbols. (custom-save-face-internal): ditto. (custom-save-resets): ditto. -1999-08-09 Didier Verna +1999-08-09 Didier Verna * gutter-items.el (select-buffers-tab-buffers-by-mode): use `regexp-quote' to protect the major mode name for use as a regular @@ -1571,7 +3633,7 @@ (select-safe-coding-system): New function. (set-language-info): New optional args DESCRIBE-MAP and SETUP-MAP. (set-language-info-alist): New optionla arg PARENTS. Call - set-language-info with apropriate DESCRIBE-MAP and SETUP-MAP args. + set-language-info with appropriate DESCRIBE-MAP and SETUP-MAP args. (set-language-environment-coding-systems): New function. * mule/chinese.el: Remove setting up of @@ -1690,7 +3752,7 @@ doc-directory. From Karl M. Hegbloom -1999-07-19 Didier Verna +1999-07-19 Didier Verna * rect.el: all functions rewritten, except when noted. Below is a list of interface changes. @@ -1741,7 +3803,7 @@ * gui.el (make-dialog-frame): turn off gutters for dialogs. -1999-07-15 Didier Verna +1999-07-15 Didier Verna * cus-edit.el (custom-prompt-variable): optional third arg makes prompt for a comment string. @@ -2454,7 +4516,7 @@ * simple.el (delete-key-deletes-forward): Revert to previous behavior. -1999-01-18 Didier Verna +1999-01-18 Didier Verna * menubar-items.el (xemacs-splash-buffer): handle the case of multiple elements in the splash buffer body. @@ -2492,7 +4554,7 @@ * package-get.el (package-get-custom): don't load package-get-custom as it is auto-generated. Fix group definition. -1999-03-05 Didier Verna +1999-03-05 Didier Verna * cus-dep.el (Custom-make-dependencies): use `prin1-to-string' instead of `symbol-name' (Thanks Kyle). @@ -2514,7 +4576,7 @@ * font-lock.el (font-lock-revert-cleanup): Null out to avoid repeated calls to font-lock during buffer reversion. -1999-02-12 Didier Verna +1999-02-12 Didier Verna * info.el (Info-build-node-completions): unconditionally widen the tag table buffer. @@ -2637,7 +4699,7 @@ * XEmacs 21.2.9 is released -1999-01-19 Didier Verna +1999-01-19 Didier Verna * replace.el (replace-search-function): new variable containing a function to perform a search-forward. @@ -2645,7 +4707,7 @@ to perform a re-search-forward. (perform-replace): use them. -1999-01-25 Didier Verna +1999-01-25 Didier Verna * select.el (selection-owner-p): use the name `XEmacs'. (cut-copy-clear-internal): ditto. @@ -2661,7 +4723,7 @@ * minibuf.el (minibuffer-completion-table): ditto. * cl-macs.el (return-from): ditto. -1999-01-04 Didier Verna +1999-01-04 Didier Verna * replace.el (delete-non-matching-lines): temporarily disable case-folding when called interactively with a regexp containing @@ -2744,7 +4806,7 @@ (pui-list-packages): Add warning when `package-get-remote' is nil. (package-ui-add-site): New function. -1998-12-01 Didier Verna +1998-12-01 Didier Verna * hyper-apropos.el (hyper-where-is): added the missing autoload. @@ -3227,7 +5289,7 @@ * package-get-base.el: removed. -1998-09-23 Didier Verna +1998-09-23 Didier Verna * simple.el (search-caps-disable-folding): moved from isearch-mode.el (no-upper-case-p): new function. @@ -3414,7 +5476,7 @@ Added interactive function `package-get-delete-package', for use by users for deleting a package. - Also modified to not require the prescence of efs. + Also modified to not require the presence of efs. 1998-09-22 Hrvoje Niksic @@ -3525,7 +5587,7 @@ * lisp-mode.el (with-string-as-buffer-contents): Set indentation. -1998-07-17 Didier Verna +1998-07-17 Didier Verna * faces.el (set-face-property): (set-face-dim-p): @@ -3842,7 +5904,7 @@ * find-paths.el (paths-emacs-root-p): Relaxed emacs-root checking of an in-place installation to - also accomodate the flat layout used on MS Windows. + also accommodate the flat layout used on MS Windows. 1998-06-29 John Jones @@ -4123,7 +6185,7 @@ `save-some-buffers'. (save-some-buffers): Force redisplay only if windows were deleted. -1998-06-02 Didier Verna +1998-06-02 Didier Verna * cus-face.el (custom-face-attributes): generalized the use of toggle buttons for boolean attributes. @@ -4225,7 +6287,7 @@ * faces.el: move definition of xpm-color-symbols from x-faces.el to faces. Predicate x-get-resource on the presence of x. - * msw-faces.el: set 3d-object face rather than modeline. Specifiy + * msw-faces.el: set 3d-object face rather than modeline. Specify faces as specfier defaults. * package-get.el: don't use package-admin-add-single-file-package. @@ -4506,7 +6568,7 @@ * simple.el (zap-up-to-char): New function. Behaves like `zap-to-char' in Emacs 18. -1998-05-13 Didier Verna +1998-05-13 Didier Verna * mouse.el (drag-window-divider): give the vertical divider a pressed look when dragging it. @@ -5006,7 +7068,7 @@ * default.el: Removed. * site-start.el: Removed. -1998-04-29 Didier Verna +1998-04-29 Didier Verna * minibuf.el (minibuffer-history-minimum-string-length): Default to nil. @@ -5080,7 +7142,7 @@ * msw-glyphs.el: enable graphics support. -1998-04-23 Didier Verna +1998-04-23 Didier Verna * x-menubar.el (default-menubar): restored the line-number-mode option. @@ -5124,7 +7186,7 @@ * package-get.el (package-get-all): add `\n' separator to interactive specification so that both variables are read -1998-04-22 Didier Verna +1998-04-22 Didier Verna * x-menubar.el: ported the options menu to Custom. Moved the "read only" toggle button to the buffers menu. @@ -5263,7 +7325,7 @@ 1998-04-16 SL Baur * files.el (toggle-read-only): Fix docstring. - From Didier Verna + From Didier Verna 1998-04-14 Michael Sperber [Mr. Preprocessor] @@ -5524,7 +7586,7 @@ 1998-03-27 Kyle Jones - * faces.el: Separated face intializations based on + * faces.el: Separated face initializations based on device classes into device type specific (tag set, instantiator) pairs. @@ -5906,7 +7968,7 @@ windows on the currently selected fgrame before searching other frames. -1998-02-25 Didier Verna +1998-02-25 Didier Verna * modeline.el (modeline-swap-buffers): originally named `mouse-release-modeline'. Whether to actually swap the buffers is @@ -5961,14 +8023,14 @@ 1998-02-21 Greg Klanderman * (with-displaying-help-buffer): there is no need to kill the buffer - if it exists, becasuse with-output-to-temp-buffer will clear it. + if it exists, because with-output-to-temp-buffer will clear it. further, killing the buffer violates the rule that temp-buffer-show-function, if set, has the full responsibility of showing the temp buffer. killing the buffer fucks with the window configuration, hosing temp-buffer-show-function. -1998-02-23 Didier Verna +1998-02-23 Didier Verna * modeline.el (mouse-drag-modeline): - Always scroll the modeline that was originally clicked on. @@ -5977,7 +8039,7 @@ keep on dragging the modeline even if the motion event occurs in another window. -1998-02-23 Didier Verna +1998-02-23 Didier Verna * x-mouse.el (x-init-pointer-shape): use a crossed-arrows cursor glyph on the modeline to indicate that dragging the mouse has an @@ -6004,7 +8066,7 @@ Prevents display flickering when the mouse pointer moves. -1998-02-17 Didier Verna +1998-02-17 Didier Verna * mouse.el (default-mouse-track-set-point-in-window): rewrote this function to handle correctly the case of a toolbar one side of the @@ -6151,7 +8213,7 @@ * loadup.el: test-atoms debugging stuffs removed. -1998-02-03 Martin Buchholz > +1998-02-03 Martin Buchholz * lisp/loaddefs.el (completion-ignored-extensions): Add ".class" @@ -6334,7 +8396,7 @@ * (abbrev-mode): (put)'ed a `:menu-tag' on it and `auto-fill-function'. -1998-01-02 Karl M. Hegbloom <> +1998-01-02 Karl M. Hegbloom * modeline.el (modeline-minor-mode-menu): Changed the string-only menus to :style 'toggle. @@ -6358,7 +8420,7 @@ (toolbar-mail-reader): Add support for `send'. From Jonathan Marten -1998-01-05 Karl M. Hegbloom <> +1998-01-05 Karl M. Hegbloom * info.el (Info-emacs-info-file-name): Add defvar for `Info-emacs-info-file-name' so that `Info-goto-emacs-command-node' @@ -6425,7 +8487,7 @@ * packages.el (package-require): Update to reflect new data format. -1998-01-02 Didier Verna +1998-01-02 Didier Verna * x-menubar.el (default-menubar): make the tutorials available through the menubar. (Plus some compilation warnings cleanup). @@ -6675,7 +8737,7 @@ * cl.el (eql): Compare integers with `eq'. (cl-map-extents): Check for `map-extents' first. -1997-12-17 Didier Verna +1997-12-17 Didier Verna * leim/quail/latin-pre.el ("french-prefix"): doc string cleanup + added the 'numero', 'copyright' and 'trademark' symbols. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/ChangeLog.1 --- a/lisp/ChangeLog.1 Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/ChangeLog.1 Mon Aug 13 11:35:02 2007 +0200 @@ -101,7 +101,7 @@ instead of 1000. (find-tag-internal): Use `letf'. (tags-delete): Removed -- was unused. - (set-buffer-tag-table): Use `expland-file-name'. + (set-buffer-tag-table): Use `expand-file-name'. (get-tag-table-buffer): Use `ecase'. (add-to-tag-completion-table): Mark the filename messages with progress. @@ -130,7 +130,7 @@ 1997-12-07 Hrvoje Niksic - * wid-edit.el (widget-prettyprint-to-string): Nix cl-prettyprint's + * wid-edit.el (widget-prettyprint-to-string): Nix cl-prettyprint's newlines. 1997-12-06 Hrvoje Niksic @@ -151,7 +151,7 @@ 1997-12-07 SL Baur - * egg/egg-cwnn-leim.el (egg-pinyin-activate): New file. Interface + * egg/egg-cwnn-leim.el (egg-pinyin-activate): New file. Interface to Chinese Wnn server. * egg/egg-kwnn-leim.el: New file. Interface to Korean Wnn @@ -237,10 +237,10 @@ 1997-12-05 Mark Borges * mail/mail-extr.el (all-top-level-domains): - Two letter country codes synched with + Two letter country codes synched with http://www.iana.org/in-notes/iana/assignments/country-codes as updated by the RIPE Network Coordination Centre. - Source: ISO 3166 Maintenance Agency + Source: ISO 3166 Maintenance Agency Latest change: Thu Aug 7 17:59:51 MET DST 1997 1997-12-03 Eric Eide @@ -331,7 +331,7 @@ 1997-11-29 SL Baur - * update-elc.el ((preloaded-file-list site-load-packages)): Modify + * update-elc.el ((preloaded-file-list site-load-packages)): Modify error message to be more build-report.el friendly. * dumped-lisp.el (preloaded-file-list): Remove tooltalk/ prefix @@ -367,7 +367,7 @@ * x-menubar.el (default-menubar): Disable WWW items in help menu if no browse-url. - * help.el (xemacs-www-page): Print error message intead of bombing + * help.el (xemacs-www-page): Print error message intead of bombing if not browse-url. (xemacs-www-faq): Ditto. @@ -389,14 +389,14 @@ * x-toolbar.el (pending-delete): Don't (require 'pending-del). * x-menubar.el (pending-delete): Don't (require 'pending-del). - * x-menubar.el (bookmark-menu-filter): Add guards against bookmark + * x-menubar.el (bookmark-menu-filter): Add guards against bookmark package not being loaded. * mule/char-table.el: Imported from tm. * mule/chartblxmas.el: Ditto. * alist.el: Ditto. * overlay.el: Unpackaged for Quail. - + * x-menubar.el (default-menubar): Put guard on evaluation of `ps-paper-type'. (default-menubar): Put guard on `paren-mode'. @@ -427,7 +427,7 @@ * packages.el (packages-useful-lisp): advice.el is a package. - * x-menubar.el (default-menubar): Make `Options ... Color Printing' + * x-menubar.el (default-menubar): Make `Options ... Color Printing' a toggle. 1997-11-26 Kyle Jones @@ -448,7 +448,7 @@ 1997-11-25 Hrvoje Niksic - * custom.el (custom-declare-variable): Attach the symbol to + * custom.el (custom-declare-variable): Attach the symbol to load history. 1997-11-23 SL Baur @@ -505,7 +505,7 @@ 1997-11-17 Marc Paquette * efs/dired.el: Removed special case for windows-nt in - dired-get-filename(); no longer needed because we now do + dired-get-filename(); no longer needed because we now do CRLF->LF conversion upstream. 1997-11-18 Jonathan Harris @@ -657,9 +657,9 @@ 1997-11-12 Greg Klanderman - * packages/compile.el (compilation-build-compilation-error-regexp-alist): + * packages/compile.el (compilation-build-compilation-error-regexp-alist): Added documentation for this function. - + ** (compilation-error-regexp-systems-list): Update documentation to note that `compilation-build-compilation-error-regexp-alist' must be called after changing the value. Update customization to @@ -751,7 +751,7 @@ * utils/shadow.el (list-load-path-shadows): Supress message when no shadowings are found. - * loadup.el: Modify algorithm for finding initial lisp directories + * loadup.el: Modify algorithm for finding initial lisp directories since the search now starts from lisp/ not lisp/prim/. * update-elc.el: Ditto. * make-docfile.el: Ditto. @@ -856,7 +856,7 @@ Reinstated code that uses (mono x) as a specifer tag, but conditioned it on (featurep 'x) because x is not a valid specifier tag under native-win32. - + * Added file headers to: w32-faces.el, w32-init.el @@ -937,7 +937,7 @@ 1997-11-07 Kyle Jones * prim/modeline.el (mouse-drag-modeline): Don't - allow the window size to shrink to a size that is not a + allow the window size to shrink to a size that is not a multiple of the height of the default face's font. * prim/modeline.el (mouse-drag-modeline): Don't @@ -961,12 +961,12 @@ 1997-11-05 Jens-Ulrik Holger Petersen * mule/mule-cmds.el (set-default-coding-systems): Make - add-hook to `comint-exec-hook' be an append, for when the user + add-hook to `comint-exec-hook' be an append, for when the user changes language environment say. 1997-11-05 SL Baur - * prim/winnt.el: Use a cleaner method for getting Text/Binary file + * prim/winnt.el: Use a cleaner method for getting Text/Binary file type in the mode-line for MS Windows. 1997-11-06 Hrvoje Niksic @@ -998,14 +998,14 @@ * modes/lazy-shot.el (lazy-shot-mode): Unstall lazy-shot only if needed. - (lazy-shot-fontify-internal): Functionality put in seperate function. + (lazy-shot-fontify-internal): Functionality put in separate function. (lazy-shot-lock-extent): Use it. (lazy-shot-fontify-region): Dumb implementation added. (lazy-shot-unstall-after-fontify): Needed to disable lazy fontifying after fontify-buffer. (lazy-shot-unstall): Make sure buffer is left in a fontified state if needed. Take optional argument. - + * packages/ps-print.el (ps-print-ensure-fontified): Added temporary support for lazy-shot. @@ -1014,10 +1014,10 @@ * utils/text-props.el (set-text-properties): Updated docstring. -1997-11-04 Didier Verna - - * mule/mule-cmds.el (set-default-coding-systems): - The coding-system argument to comint-exec-hook wasn't evaluated +1997-11-04 Didier Verna + + * mule/mule-cmds.el (set-default-coding-systems): + The coding-system argument to comint-exec-hook wasn't evaluated before building the lambda expression. 1997-11-04 Jens-Ulrik Holger Petersen @@ -1088,7 +1088,7 @@ * shell.el (shell-chdrive-regexp): New for DOS/NT (shell-mode): Added shell-font-lock-keywrods (shell-mode): Use $PWD for ksh - (shell-directory-tracker): Use dirs and dirtrack-toggle. This may + (shell-directory-tracker): Use dirs and dirtrack-toggle. This may cause problems at is interferes with "dired" (shell-snarf-envar): NEW (shell-copy-environment-variable): NEW @@ -1165,7 +1165,7 @@ characters, instead of consing a string each time. (synthesize-keysym): Better error checking. - * prim/keymap.el (synthesize-keysym): Don't bug out when reading a + * prim/keymap.el (synthesize-keysym): Don't bug out when reading a non-character event. 1997-11-02 Tomasz Cholewo @@ -1191,7 +1191,7 @@ * prim/packages.el: Updated commentary. (packages-useful-lisp): Added `cl-macs'. -1997-10-27 Didier Verna +1997-10-27 Didier Verna * prim/help-nomule.el (help-with-tutorial): The 'didactic' blank lines message is now taken directly from each tutorial, and thus @@ -1213,7 +1213,7 @@ Suggested by Michael Kifer * mule/mule-init.el: Remove `help-with-tutorial-for-mule'. - Suggested by Didier Verna + Suggested by Didier Verna * Disable Cyrillic CCL until CCL engine gets fixed. From: Martin Buchholz @@ -1230,7 +1230,7 @@ 1997-10-30 SL Baur - * vm/vm-vars.el (vm-image-directory): Use locate-data-directory if + * vm/vm-vars.el (vm-image-directory): Use locate-data-directory if it exists. * language/european.el: Remove erroneous references to @@ -1438,7 +1438,7 @@ * modes/enriched.el (enriched-face-ans): Use color-name instead of color-instance-name. - color-instance-name will not handle the specifiers that + color-instance-name will not handle the specifiers that are passed as arguments. 1997-10-28 Tomasz Cholewo @@ -1451,14 +1451,14 @@ * pcl-cvs/pcl-cvs-xemacs.el: Add `cvs-mode-update-no-prompt' to menu. From Stig Bjorlykke -1997-10-28 Didier Verna +1997-10-28 Didier Verna * packages/man.el (manual-entry): corrected the `when' form to include 'section' in the buffer name. 1997-10-28 SL Baur - * prim/packages (packages-find-pacakges): Fix test on + * prim/packages (packages-find-pacakges): Fix test on inhibit-package-init 1997-10-27 Tomasz Cholewo @@ -1488,7 +1488,7 @@ * egg/egg-leim.el: Registers EGG/Wnn with LEIM when loaded * egg/egg.el: Bind `toggle-egg-mode' to "\C-\" only if LEIM is - not present when loaded + not present when loaded 1997-10-27 SL Baur @@ -1610,7 +1610,7 @@ 1997-10-23 Per Abrahamsen * custom/cus-edit.el (hook): Use `widget-group-match' instead of - `widget-editable-list-match'. + `widget-editable-list-match'. 1997-10-23 SL Baur @@ -1626,7 +1626,7 @@ 1997-10-20 Jan Vroonhof * extents.c: Renamed shot property to initial-redisplay-function - (extent_fragment_update): Changed the bookkeeping whether an event + (extent_fragment_update): Changed the bookkeeping whether an event has been spawned. The initial-redisplay-function property is no longer set to nil. @@ -1641,7 +1641,7 @@ 1997-10-22 Hrvoje Niksic - * prim/startup.el (command-line-1): Run term-setup-hook regardless + * prim/startup.el (command-line-1): Run term-setup-hook regardless of `input-pending-p'. * custom/cus-edit.el (custom-split-regexp-maybe): Use `split-string'. @@ -1681,7 +1681,7 @@ 1997-10-21 SL Baur - * prim/about.el (about-maintainer-glyph): Pictures have been moved + * prim/about.el (about-maintainer-glyph): Pictures have been moved to photos subdirectory. 1997-10-21 Hrvoje Niksic @@ -1696,7 +1696,7 @@ 1997-10-21 Colin Rafferty * x11/x-menubar.el (default-menubar): Made it use lazy-shot - instead of lazy-lock in "Syntax Highlighting->Lazy". + instead of lazy-lock in "Syntax Highlighting->Lazy". (options-menu-saved-forms): Made it save lazy-shot instead of lazy-lock in the options. @@ -1778,12 +1778,12 @@ * help.el (function-at-point): Use `function-at-point-function'. (function-at-point-function): New variable, formerly - `find-function-function'. + `find-function-function'. (describe-function): Use `function-at-point'. (where-is): Ditto. * find-func.el (find-function-read-function): Use - `function-at-point'. + `function-at-point'. * packages/info.el (Info-elisp-ref): Use `function-at-point'. @@ -1806,7 +1806,7 @@ * prim/packages.el (packages-find-packages-1): New argument: `user-package' non-nil when searching user packages. - Load any autoloads found in user packages. - + 1997-10-17 Karl M. Hegbloom * packages/info.el (Info-insert-dir): Also kill the localdir temp @@ -1817,7 +1817,7 @@ * utils/facemenu.el: autoload the `facemenu-keymap' properly. * mule/mule-cmds.el (read-language-name): Fix typo. - From Didier Verna + From Didier Verna 1997-10-15 Adrian Aichner @@ -1886,7 +1886,7 @@ From Hrvoje Niksic * prim/glyphs.el (init-glyphs): Use different logo for beta XEmacsen. - From Didier Verna + From Didier Verna 1997-10-15 Hrvoje Niksic @@ -1915,7 +1915,7 @@ * custom/wid-edit.el: (widget-glyph-insert-glyph): Use `widget-mouse-help' if necessary. - (widget-documentation-string-value-create): Don't coerce help-echo + (widget-documentation-string-value-create): Don't coerce help-echo WIDGET to widget. (widget-button-keymap): New keymap. (widget-specify-button): Use it. @@ -1985,7 +1985,7 @@ 1997-10-14 SL Baur * default.el: New file. - * site-start.el: New file. XEmacs starts faster if dummy versions + * site-start.el: New file. XEmacs starts faster if dummy versions of these files are found early in the `load-path'. Suggested by Kyle Jones @@ -2049,7 +2049,7 @@ * custom/cus-face.el (custom-face-attributes): Support inverse-video for TTY-s. - * prim/cmdloop.el (keyboard-escape-quit): Abort recursive edit, as + * prim/cmdloop.el (keyboard-escape-quit): Abort recursive edit, as documented. 1997-10-12 Hrvoje Niksic @@ -2103,7 +2103,7 @@ * '' Added toplevel block (when (fboundp 'load-gc) ...to init the Info-def..list from the environment variable INFOPATH at dump time. - + * prim/packages.el (packages-find-packages-1): append the list of packages info directories to `Info-default-directory-list' rather than prepending them. Don't add them if they're already in the @@ -2112,7 +2112,7 @@ * packages/info.el (Info-directory-list): various fixes to the directory list handling. * (Info-localdir-heading-regexp) added. - + * '' removed the unrequired defcustom of `Info-default-directory- list' @@ -2153,7 +2153,7 @@ * packages/bookmark.el: * packages/iswitchb.el: * utils/speedbar.el: - * utils/xemacs-build-report.el: + * utils/xemacs-build-report.el: - change Xemacs --> XEmacs 1997-10-09 Colin Rafferty @@ -2167,7 +2167,7 @@ (describe-function-arglist): Commented out -- seems unused. (find-function): ALL find-function stuff moved to "find-func.el" - * prim/find-func.el: new file created from functions previously in + * prim/find-func.el: new file created from functions previously in "help.el". 1997-10-09 SL Baur @@ -2203,7 +2203,7 @@ Fri Sep 26 23:30:58 1997 Barry A. Warsaw - * cc-mode/cc-menus.el: Patches to Imenu support given by + * cc-mode/cc-menus.el: Patches to Imenu support given by "Masatake (jet) YAMATO" . (Jan Dubois) jan.dubois@ibm.net @@ -2226,9 +2226,9 @@ * x11/x-menubar.el (file-menu-filter): Reverse sense of bounds test. - From: Didier Verna - - * prim/format.el (format-annotate-function): Reverse sync to Emacs + From: Didier Verna + + * prim/format.el (format-annotate-function): Reverse sync to Emacs 19. 1997-10-08 Hrvoje Niksic @@ -2316,7 +2316,7 @@ * mule/mule-cmds.el (read-input-method-name): Use a default if available. - From Didier Verna + From Didier Verna * prim/about.el (about-url-alist): Update jwz's home page. @@ -2346,7 +2346,7 @@ 1997-10-05 Hrvoje Niksic - * prim/simple.el: Minor docstring and comment changes. Customized + * prim/simple.el: Minor docstring and comment changes. Customized some more. 1997-10-04 Hrvoje Niksic @@ -2386,7 +2386,7 @@ * cl/cl-seq.el (remq): Reformat and add doc-string. Suggested by: Karl M. Hegbloom - + 1997-10-03 Karl M. Hegbloom * packages/func-menu.el: change the countups from message's to @@ -2432,7 +2432,7 @@ (custom-declare-face): Don't invoke init-face-from-resources explicitly. - * prim/profile.el (pretty-print-profiling-info): When interactive, + * prim/profile.el (pretty-print-profiling-info): When interactive, use a separate buffer instead of current-buffer. (pretty-print-profiling-info): Prettified output. @@ -2984,7 +2984,7 @@ (widget-text-keymap): Use it. (widget-princ-to-string): Use `with-current-buffer'. (widget-map-buttons): Ditto. - (widget-push-button-gui): Set to value of `widget-glyph-enable' by + (widget-push-button-gui): Set to value of `widget-glyph-enable' by default. (widget-push-button-value-create): Call `widget-specify-button'. @@ -3007,7 +3007,7 @@ * x11/x-menubar.el: Customized. - * custom/cus-face.el (face-spec-set-match-display): Use `warn' for + * custom/cus-face.el (face-spec-set-match-display): Use `warn' for warnings. * x11/x-font-menu.el: Customized. @@ -3123,7 +3123,7 @@ 1997-09-18 Jens-Ulrik Holger Petersen * prim/isearch-mode.el (isearch-message): Display-message as - progress (this way isearch message won't appear in the message + progress (this way isearch message won't appear in the message log). 1997-09-18 Jens-Ulrik Holger Petersen @@ -3149,7 +3149,7 @@ * prim/packages.el (locate-library): Simplify regexp for compression suffixes. Suggested by: Hrvoje Niksic - + 1997-09-17 Karl M. Hegbloom * ilisp/ilisp-out.el (ilisp-scroll-output): bind `scroll-in-place' @@ -3220,7 +3220,7 @@ I don't know if this breaks something else, because I can't figure out why it was commented out in the first place. - + * cc-mode/cc-langs.el: Define `/' in c-mode-base-map since all modes now support c-electric-slash. @@ -3389,7 +3389,7 @@ 1997-09-11 Jens-Ulrik Holger Petersen - * packages/vc.el (vc-default-init-version): Make the default value + * packages/vc.el (vc-default-init-version): Make the default value be `nil'. Improve the docstring. 1997-09-12 SL Baur @@ -3508,7 +3508,7 @@ 1997-09-09 Jens-Ulrik Holger Petersen - * packages/vc.el (vc-register): make the second option arg COMMENT + * packages/vc.el (vc-register): make the second option arg COMMENT do something * packages/vc.el (vc-register): Make the default initial @@ -3522,7 +3522,7 @@ 1997-09-07 Hrvoje Niksic - * utils/edmacro.el (edmacro-parse-word): Accept ^foo (would signal + * utils/edmacro.el (edmacro-parse-word): Accept ^foo (would signal error). (edmacro-format-1): Add SPC after ^. @@ -3535,7 +3535,7 @@ always has directories ending with trailing `/'s. * version.el (emacs-version): Preserve previous matching info. - From Didier Verna + From Didier Verna Wed Sep 3 13:53:10 1997 SL Baur @@ -3571,7 +3571,7 @@ 1997-09-01 SL Baur - * x11/x-menubar.el (default-menubar): Put tetris in the game menu, + * x11/x-menubar.el (default-menubar): Put tetris in the game menu, and move it and the mine game to the top of the menu. 1997-08-29 SL Baur @@ -3881,28 +3881,28 @@ * support for "dir" merging 'ala Emacs-19.34, with fallback to cheap localdir files in the secondary info directories. - + * changed default `Info-annotations-path' from ~/.infonotes to ~/.xemacs/info.notes - + * added `Info-additional-directory-list' - + * changed a call to w3-fetch to browse-url - + * added new variables and functions from GNU Emacs 19.34: `Info-dir-contents', `Info-dir-contents-directory', `Info-dir-file-attributes', and the function `Info-insert-dir' - + * rewrote `Info-suffixed-file' to a cond block rather than nested if's for aesthetic reasons. - + * made the top line get split if it's longer than 79 characters and tweaked fontification to handle that. - + * changed the look of the pop-up mouse menus by utilizing the "--:etchedThing" dividers. - + * several docstring reformats and typo fixes, a few comments deleted. @@ -4006,7 +4006,7 @@ 1997-07-24 SL Baur - * prim/make-docfile.el (docfile-out-of-date): Workaround for NEWOS + * prim/make-docfile.el (docfile-out-of-date): Workaround for NEWOS process exit handling bug. Suggested by Katsumi Yamaoka @@ -4036,7 +4036,7 @@ 1997-07-21 SL Baur - * prim/packages.el (locate-data-directory): New function to search + * prim/packages.el (locate-data-directory): New function to search for directories in the data-directory-list. 1997-07-21 Karl M. Hegbloom @@ -4079,7 +4079,7 @@ (speedbar-get-focus): Autoload. (speedbar): Autoload (correctly). - (speedbar-frame-width): Test liveness of frame + (speedbar-frame-width): Test liveness of frame too. (speedbar-frame-mode): Avoid some Emacs 20 code. From Markus Linnala @@ -4115,7 +4115,7 @@ 1997-07-16 Steven L Baur - * utils/crontab.el (crontab-get): Check for `no crontab for' as an + * utils/crontab.el (crontab-get): Check for `no crontab for' as an error return. Suggested by Jeff Miller @@ -4247,7 +4247,7 @@ * prim/files.el: Use `files' group. - * prim/disp-table.el (describe-display-table): Made it work; don't + * prim/disp-table.el (describe-display-table): Made it work; don't use `describe-vector'. * prim/gui.el: Customized. @@ -4273,7 +4273,7 @@ * packages/igrep.el: Don't insinuate XEmacs when loading. (igrep-insinuate): New function. - * packages/blink-cursor.el (blink-cursor-callback): Don't blink on + * packages/blink-cursor.el (blink-cursor-callback): Don't blink on TTY-s. * prim/console.el (resume-pid-console): Use `eql'. @@ -4342,7 +4342,7 @@ * packages/pending-del.el (pending-delete-pre-hook): Don't quote lambda. (pending-delete-pre-hook): Use `error-message-string'. - (pending-delete): Treat as minor mode; define the standard turn-on + (pending-delete): Treat as minor mode; define the standard turn-on and turn-off functions. (delete-active-region): Simplified. @@ -4353,10 +4353,10 @@ * packages/pending-del.el: Correct typo in Hrvoje's upgrade. * mel/mel-u.el (uuencode-external-decode-region): Force - buffer-read-only nil because it gets changed magically to t during + buffer-read-only nil because it gets changed magically to t during the call to `insert-file-contents'. - * tm/tm-image.el (mime-preview/filter-for-image): Comment out test + * tm/tm-image.el (mime-preview/filter-for-image): Comment out test for invalid glyph. It appears to be non-functional. * modes/lisp-mode.el (lisp-interaction-mode-popup-menu-1): Add @@ -4542,7 +4542,7 @@ * hypberbole/hact.el (action:commandp): Don't reference bytecode objects as vectors. (action:params): Ditto. - + * hyperbole/hypb.el (hypb:function-copy): Don't reference byte code objects as vectors. (hypb:function-symbol-replace): Document as broken. The @@ -4567,7 +4567,7 @@ * utils/easymenu.el (easy-menu-add): Oops, wrong sense in comparison. - * comint/gdb.el (gdb-mode-syntax-table): New variable. Initialize + * comint/gdb.el (gdb-mode-syntax-table): New variable. Initialize with the logic currently in CC Mode 5.11. (gdb-mode): Use it. @@ -4620,7 +4620,7 @@ * prim/cmdloop.el (errors-deactivate-region): Default to existing behavior. - * leim/quail.el (quail-mode): Correct addition of quail minor mode + * leim/quail.el (quail-mode): Correct addition of quail minor mode info to minor-mode-map-alist. (top-level): Ditto. @@ -4678,7 +4678,7 @@ make it look better (and will prevent some consing, but that's being anal). From Hrvoje Niksic - + * prim/simple.el (delete-key-deletes-forward): Mark docstring as an user option. From Gary D. Foster @@ -4688,10 +4688,10 @@ * efs/efs-ovwrt.el (efs-overwrite-fn): efs is manufacturing its own byte code. Whee. - * utils/advice.el (ad-interactive-form): Don't treat bytecode as a + * utils/advice.el (ad-interactive-form): Don't treat bytecode as a vector if it can be avoided. From Kyle Jones - + 1997-06-30 Steven L Baur * prim/files.el (auto-mode-alist): Don't set image-mode by default @@ -4699,7 +4699,7 @@ Sun Jun 29 20:57:15 1997 Kyle Jones - * prim/simple.el: bind inhibit-read-only to t before + * prim/simple.el: bind inhibit-read-only to t before trying to erase or otherwise modify the echo area buffer. 1997-07-01 MORIOKA Tomohiko @@ -4728,7 +4728,7 @@ * src/undo.c (record_extent): If the extent's object is a string, just return. We can't record undo information for strings, and it is - very bad to reference through a string pointer as if it + very bad to reference through a string pointer as if it were a buffer pointer. 1997-06-28 Steven L Baur @@ -4775,7 +4775,7 @@ * utils/autoload.el (batch-update-directory): Kill command line args when done. (autoload-save-customization): Print a warning message with the - offending symbol when we run across the elusive malformed property + offending symbol when we run across the elusive malformed property list ((0 0)). 1997-06-26 Hrvoje Niksic @@ -4784,7 +4784,7 @@ (pretty-print-profiling-info): Allow interactive calls. * prim/overlay.el: Make more FSF compatible. - + 1997-06-27 Steven L Baur * prim/loaddefs.el (debug-ignored-errors): Fix regexps. @@ -4893,7 +4893,7 @@ Mule menu because they bombed after recompilation. * packages/hyper-apropos.el - (hyper-apropos-toggle-programming-flag): Use `with-current-buffer' + (hyper-apropos-toggle-programming-flag): Use `with-current-buffer' instead of `eval-in-buffer'. * term/sun-mouse.el: Remove bogus redefinition of @@ -4904,7 +4904,7 @@ * prim/make-docfile.el: Use princ not print. Suggested by Hrvoje Niksic. - * packages/info.el (Info-select-node): Desensitive case search for + * packages/info.el (Info-select-node): Desensitive case search for Note:. (Info-next-reference): Ditto. * prim/simple.el (kill-region): Adjust endpoints of extent to @@ -4915,7 +4915,7 @@ * prim/subr.el (eval-in-buffer): Make obsolete. Suggested by Hrvoje Niksic. - * packages/hyper-apropos.el (hyper-apropos-faces): Change group to + * packages/hyper-apropos.el (hyper-apropos-faces): Change group to 'faces. Suggested by Per Abrahamsen. @@ -4926,7 +4926,7 @@ - Get keybinding before command is executed. Suggested by Kyle Jones and Steve Baur. - + 1997-06-24 Steven L Baur * packages/gnuserv.el: Make old symbols Obsolete. @@ -4936,7 +4936,7 @@ minibuffer. * prim/minibuf.el (minibuffer-keyboard-quit): Ditto. From Hrvoje Niksic - + * prim/help.el (help-mode-quit): Bury buffer when quitting. From Hrvoje Niksic @@ -4964,7 +4964,7 @@ 1997-06-23 Hrvoje Niksic - * packages/info.el (Info-next-reference): Fix up for M-TAB to work + * packages/info.el (Info-next-reference): Fix up for M-TAB to work correctly. * utils/live-icon.el (live-icon-one-frame): Don't set glyphs to @@ -4990,7 +4990,7 @@ 1997-06-22 Steven L Baur - * x11/x-menubar.el (default-menubar): Make `Jump to bookmark' menu + * x11/x-menubar.el (default-menubar): Make `Jump to bookmark' menu dynamic. From Gary D. Foster @@ -5061,7 +5061,7 @@ * prim/tabify.el (untabify): Return nil. From contributor name lost. - * prim/packages.el (packages-hardcoded-lisp): startup.elc needs to + * prim/packages.el (packages-hardcoded-lisp): startup.elc needs to be scanned for docstrings. 1997-06-21 Hrvoje Niksic @@ -5088,7 +5088,7 @@ 1997-06-20 Steven L Baur - * utils/autoload.el (fixup-autoload-buffer): New function. Insert + * utils/autoload.el (fixup-autoload-buffer): New function. Insert guards so a (load "auto-autoloads") works the same as require. (batch-update-directory): Use it. @@ -5142,11 +5142,11 @@ From Karl M. Hegbloom (archive-mode-map): Bind it to `q'. - * utils/autoload.el (cusload-file-name): Default to custom-load.el + * utils/autoload.el (cusload-file-name): Default to custom-load.el for each individual file. * prim/minibuf.el (minibuffer-max-depth-exceeded): Use - `custom-file' as a location for saving enable multiple minibuffers + `custom-file' as a location for saving enable multiple minibuffers option. * packages/man.el (manual-entry): Don't leave empty buffer if @@ -5168,14 +5168,14 @@ 1997-06-17 Steven L Baur - * prim/files.el (auto-mode-alist): Add /app-defaults/ as candidate + * prim/files.el (auto-mode-alist): Add /app-defaults/ as candidate for xrdb-mode. Suggested by Karl Hegbloom, Regexp by David Moore. - * version.el: Remove variables emacs-version, emacs-major-version, + * version.el: Remove variables emacs-version, emacs-major-version, and emacs-minor-version. - * tooltalk/tooltalk-load.el: Comment as obsolete and move contents + * tooltalk/tooltalk-load.el: Comment as obsolete and move contents to dumped-lisp.el. * prim/make-docfile.el: New file. @@ -5199,7 +5199,7 @@ * prim/dumped-lisp.el: New file. - * prim/update-elc.el (toplevel): Rework using a better function to + * prim/update-elc.el (toplevel): Rework using a better function to determine autoload file locations. * prim/packages.el: New file. @@ -5240,16 +5240,16 @@ as an option. Eliminate XEmacs specific autoloads. From Hrvoje Niksic - + * efs/dired.el (dired-save-excursion): Ebola cleanup. * packages/hyper-apropos.el: Massive cleanup, Customize. - From Hrvoje Niksic + From Hrvoje Niksic Fri Jun 13 13:20:39 1997 Kyle Jones * prim/syntax.el (symbol-near-point): - Check for bobp and avoid (char-syntax (char-before)) if + Check for bobp and avoid (char-syntax (char-before)) if there. 1997-06-13 Steven L Baur @@ -5267,7 +5267,7 @@ * modes/make-mode.el (makefile-browse): Shouldn't be interactive. From Hrvoje Niksic - * prim/files.el (interpreter-mode-alist): ksh-mode is obsoleted by + * prim/files.el (interpreter-mode-alist): ksh-mode is obsoleted by sh-script. From Hrvoje Niksic @@ -5276,7 +5276,7 @@ * prim/subr.el (with-current-buffer): New macro. (with-temp-file): Ditto. - * bytecomp/byte-optimize.el (byte-optimize-form-code-walker): Test + * bytecomp/byte-optimize.el (byte-optimize-form-code-walker): Test for `save-current-buffer'. * bytecomp/bytecomp.el: Recognize `save-current-buffer'. @@ -5358,7 +5358,7 @@ From Heiko Muenkel 1997-06-10 Gary D. Foster - + * modes/view-less.el: Changed \177 bindings to 'delete * modes/help.el: Changed \177 bindings to 'delete @@ -5378,7 +5378,7 @@ * modes/cc-mode.el: * modes/cperl-mode.el: Fixed references to delete functions to use the new names. - + 1997-06-11 Karl M Hegbloom * ilisp/ilisp-def.el (toplevel): Changed `ilisp-prefix' from @@ -5462,7 +5462,7 @@ Change usage of \177 to use keysym 'delete. From Gary D. Foster - * packages/etags.el (tags-loop-scan): Don't pass a straight string + * packages/etags.el (tags-loop-scan): Don't pass a straight string to error as a format string. Reported by Miles Duke @@ -5487,9 +5487,9 @@ 1997-06-04 Gary D. Foster - * modes/cc-mode.el: Modified `c-electric-delete' to honor the + * modes/cc-mode.el: Modified `c-electric-delete' to honor the desired delete direction in both normal and "hungry" modes. - * modes/cperl-mode.el: Modified `cperl-electric-backspace' to + * modes/cperl-mode.el: Modified `cperl-electric-backspace' to honor the desired delete direction. 1997-06-03 MORIOKA Tomohiko @@ -5512,9 +5512,9 @@ * modes/*.el: Removed conflicting \177 bindings. * modes/cc-mode.el: Modified `c-electric-delete' to use new delete bindings. - * modes/cperl-mode.el: Modified `cperl-electric-backspace' to + * modes/cperl-mode.el: Modified `cperl-electric-backspace' to use new delete bindings. - + 1997-06-03 MORIOKA Tomohiko * leim/quail.el: to sync with quail.el of Emacs-19.34.94-epsilon. @@ -5540,7 +5540,7 @@ * prim/about.el: Installed new version 2.1. From Hrvoje Niksic - + * prim/profile.el (pretty-print-profiling-info): Autoload don't dump. Clean up comments. @@ -5586,7 +5586,7 @@ as toolbar callbacks. From weiner@altrasoft.com - * prim/mouse.el (default-mouse-track-cleanup-extent): Correct test + * prim/mouse.el (default-mouse-track-cleanup-extent): Correct test on dead-func extent. * prim/help.el (view-emacs-news): outl-mouse turned off in @@ -5750,7 +5750,7 @@ `icomplete-max-delay-chars' - Maximum number of initial chars to apply icomplete compute delay. - + `icomplete-compute-delay' - Completions-computation stall, used only with large-number completions @@ -5802,7 +5802,7 @@ (insert-parentheses): Let a negative argument enclose preceding sexps. From Erik Naggum - + * prim/window-xemacs.el: New file, split from window.el with XEmacs-specific stuff. @@ -5814,12 +5814,12 @@ * prim/window.el (kill-buffer-and-window): New command. Bind it to C-x 4 0. From Richard Stallman - + * prim/window.el (split-window-vertically): Don't change point in old window if both the original point and the end of the buffer are visible after splitting, when split-window-keep-point is nil. From Noah Friedman - + * prim/files.el (revert-buffer-internal-hook): Declare. * utils/map-ynp.el: Synch with Emacs 19.34.94. @@ -5877,7 +5877,7 @@ standard-value for Custom-1.98. 1997-05-26 Steven L Baur - + * prim/help.el (view-lossage-key-count): New variable. (view-lossage-message-count): New variable. (view-lossage): Use them. @@ -5999,7 +5999,7 @@ Tue May 20 20:32:59 1997 Steven L Baur - * prim/subr.el (buffer-substring-no-properties): Clean out extents + * prim/subr.el (buffer-substring-no-properties): Clean out extents too. Mon May 19 19:48:35 1997 Steven L Baur @@ -6018,10 +6018,10 @@ * prim/files.el (revert-buffer): Add optional third parameter to preserve buffer modes (from Emacs 19.34.94). - (after-find-file): Add optional fifth parameter to preserve buffer + (after-find-file): Add optional fifth parameter to preserve buffer modes (from Emacs 19.34.94). - * packages/vc.el: Synch with Emacs 19.34.94 because our version was + * packages/vc.el: Synch with Emacs 19.34.94 because our version was hopeless. (vc-checkout): Autoload. (vc-find-binary): Ditto. @@ -6031,7 +6031,7 @@ Fri Apr 25 13:21:46 1997 Per Abrahamsen - * apropos.el (apropos): Add support for customization groups. + * apropos.el (apropos): Add support for customization groups. (apropos-print): Ditto. Sat May 17 19:56:31 1997 Glynn Clements @@ -6066,7 +6066,7 @@ * tm/tm-vm.el: Provide for vm-unsaved-message having been removed in recent versions of VM. - + Fri May 9 10:41:44 1997 Steven L Baur * iso/iso-acc.el (iso-accents-compose): Fix XEmacs 19.14 @@ -6085,10 +6085,10 @@ * hm--html-menus/hm--html.el: Define obsolete aliases for the previous function spellings. - * hm--html-menus/hm--html-keys.el: Define obsolete aliases for the + * hm--html-menus/hm--html-keys.el: Define obsolete aliases for the previous variable spellings. - * prim/obsolete.el (define-obsolete-variable-alias): Fix docstring + * prim/obsolete.el (define-obsolete-variable-alias): Fix docstring spelling. (define-compatible-variable-alias): Ditto. @@ -6128,7 +6128,7 @@ Tue Apr 29 18:51:31 1997 Steven L Baur - * mule/mule-files.el (buffer-file-coding-system-alist): Regexp for + * mule/mule-files.el (buffer-file-coding-system-alist): Regexp for handling info files didn't match the right pattern. Sun Apr 27 18:09:48 1997 Steven L Baur @@ -6142,7 +6142,7 @@ Fri Apr 25 08:39:50 1997 Steven L Baur - * modes/sh-script.el (sh-indent-line): Deal with pathological case + * modes/sh-script.el (sh-indent-line): Deal with pathological case of indenting a first line containing a `#' as first non-white space character. @@ -6333,12 +6333,12 @@ * packages/vc.el (vc-directory): Dired requires a list not a string of space separated names. - * utils/live-icon.el (live-icon-colour-name-from-face): `face' may + * utils/live-icon.el (live-icon-colour-name-from-face): `face' may be a list of faces since it is generated by `extent-face'. Fri Apr 11 21:12:57 1997 Steven L Baur - * packages/ispell.el: Don't attempt creation of the menubar unless + * packages/ispell.el: Don't attempt creation of the menubar unless XEmacs has been compiled with menubars. * prim/simple.el (yank-pop): mark-marker needs optional force @@ -6384,7 +6384,7 @@ Tue Apr 8 12:57:05 1997 Steven L Baur * modes/lisp-mode.el (eval-defun): Evaluate defcustom in defconst - style instead of defvar style (patch derived from Emacs 19.35/Lars + style instead of defvar style (patch derived from Emacs 19.35/Lars Magne Ingebrigtsen). Mon Apr 7 16:38:43 1997 Steven L Baur @@ -6402,7 +6402,7 @@ * x11/x-menubar.el (default-menubar): Use xmine not mine. - * prim/help.el (describe-variable): Some doc strings weren't being + * prim/help.el (describe-variable): Some doc strings weren't being terminated with a newline. Sat Apr 5 20:20:00 1997 Steven L Baur @@ -6411,7 +6411,7 @@ Sat Apr 5 13:18:05 1997 Tomasz J. Cholewo - * packages/etags.el (tags-query-replace): Fixed DELIMITED argument + * packages/etags.el (tags-query-replace): Fixed DELIMITED argument bug. `with-caps-disable-folding' moved to isearch-mode.el. * packages/info.el (Info-search): Use `with-caps-disable-folding'. @@ -6506,8 +6506,8 @@ (fancy-diary-display): Use modeline-buffer-identification. * calendar/appt.el (appt-diary-entries): Do not display diary. - (appt-check): Display diary buffer at midnight. - + (appt-check): Display diary buffer at midnight. + Fri Mar 21 19:16:46 1997 Steven L Baur * mule/mule-coding.el (enable-multibyte-characters): MULE @@ -6636,7 +6636,7 @@ * utils/eldoc.el (eldoc-pre-command-refresh-echo-area): Use eldoc-display-message-p, not eldoc-display-message-no-interference-p. - + Sat Mar 8 11:20:47 1997 Steven L Baur * prim/startup.el (startup-splash-frame-body): More text tweaking. @@ -6687,7 +6687,7 @@ * x11/x-menubar.el (default-menubar): Reorganize again undoing previous change. Customize submenu moved to top of options menu. Edit faces restored to edit-faces and renamed to Browse faces. - + Thu Mar 6 08:43:27 1997 Steven L Baur * x11/x-menubar.el (options-menu): New variable. @@ -6743,7 +6743,7 @@ * site-load.el: Move site-packages to the top level. Sun Mar 2 01:37:04 1997 Hrvoje Niksic - + * utils/mail-extr.el (all-top-level-domains): Added "hr" domain. * packages/ps-print.el (ps-print-color-p): Default to nil. @@ -7030,13 +7030,13 @@ Sat Feb 15 11:05:29 1997 Kyle Jones * utils/redo.el: made before and after status messages so that the user is aware if a long action is still being processed. - + rolled version number up to 1.00, since the package seems to be stable. cosmetic changes so the file could be included in the XEmacs distribution. - + Sat Feb 15 11:13:05 1997 Hrvoje Niksic * prim/simple.el (line-move-ignore-invisible): Change default to @@ -7172,7 +7172,7 @@ * packages/ps-print.el: Update maintainer address. Thu Feb 6 12:35:39 1997 Bill Dubuque - + * cl/cl-macs.el (cl-do-proclaim): Correct addition of bound variables to `byte-compile-bound-variables'. @@ -7222,7 +7222,7 @@ * x11/x-toolbar.el (toolbar-mail-commands-alist): Updated with a lot of new mailer possiblities. - + Fri Jan 31 09:28:49 1997 Martin Buchholz * x11/x-font-menu.el (reset-device-font-menus): Correct guard on @@ -7238,7 +7238,7 @@ * packages/compile.el: Speed up regexps. (compilation-parse-errors): replace re-search-forward with something faster. - + Thu Jan 30 20:33:56 1997 Hvoje Niksic * x11/x-toolbar.el @@ -7248,7 +7248,7 @@ (toolbar-mail-commands-alist): New variable. (toolbar-mail-reader): Ditto. (toolbar-mail): Use them. - + * x11/x-menubar.el: Shorten help menu item names. Thu Jan 30 17:22:15 1997 Alexandre Oliva @@ -7306,15 +7306,15 @@ (ps-print-version): Fix value. (cl lisp-float-type): Require them. (ps-number-of-columns ps-*-font-size): Try to select defaults - better suited when `ps-landscape-mode' is non-nil. + better suited when `ps-landscape-mode' is non-nil. (ps-*-faces): Change default for Font Lock mode faces when - `ps-print-color-p' is nil. + `ps-print-color-p' is nil. (ps-right-header): Replace `time-stamp-yy/mm/dd' - by `time-stamp-mon-dd-yyyy'. - (ps-end-file ps-begin-page): Fix bug in page count for Ghostview. + by `time-stamp-mon-dd-yyyy'. + (ps-end-file ps-begin-page): Fix bug in page count for Ghostview. (ps-generate-postscript-with-faces): Replace `ps-sorter' by - `car-less-than-car'. - (ps-plot ps-generate): Replace `%d' by `%3d'. + `car-less-than-car'. + (ps-plot ps-generate): Replace `%d' by `%3d'. Wed Jan 22 15:32:39 1997 Greg Klanderman @@ -7336,7 +7336,7 @@ * mule/mule-init.el (init-mule): Get Japanese man pages working. Fri Jan 17 17:22:54 1997 Hrvoje Niksic - + * man.el (Manual-mode): Don't mess with scrollbars if they aren't present. @@ -7806,7 +7806,7 @@ Let `buffers-menu-submenus-for-groups-p' be an integer : if there are more buffers than this value, use submenus, otherwise not. - + * packages/vc.el (vc-rename-this-file): New function (was missing, but referred to on the menubar). @@ -7871,7 +7871,7 @@ * electric/ebuff-menu.el (electric-buffer-menu-mode-map): Correct bad 19.34 synch patch. - + * utils/pretty-print.el: New File. Sun Dec 8 13:59:40 1996 Steven L Baur @@ -8029,7 +8029,7 @@ evaluated more than once. Comment formatting changes. - + * edebug/advise-eval-region.el: New File. Separate out advise for eval-region so it is only evaluated once. @@ -8037,7 +8037,7 @@ icomplete-exhibit needs to be called in the setup-hook. - * packages/apropos.el: Correct a typo in button binding. + * packages/apropos.el: Correct a typo in button binding. Fixes the bug where if apropos-label-face is actually defined as face, apropos bombs with an error @@ -8050,7 +8050,5 @@ Redefines the default faces for the various apropos faces so they come out in color by default (defaults are based on various standard font-lock faces). - + * version.el: Bumped up to b31. - - diff -r 72a7cfa4a488 -r abe6d1db359e lisp/abbrev.el --- a/lisp/abbrev.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/abbrev.el Mon Aug 13 11:35:02 2007 +0200 @@ -419,6 +419,17 @@ (write-region 1 (point-max) file) (erase-buffer))) +(defun abbrev-string-to-be-defined (arg) + "Return the string for which an abbrev will be defined. +ARG is the argument to `add-global-abbrev' or `add-mode-abbrev'." + (if (and (not arg) (region-active-p)) (setq arg 0) + (setq arg (prefix-numeric-value arg))) + (and (>= arg 0) + (buffer-substring + (point) + (if (= arg 0) (mark) + (save-excursion (forward-word (- arg)) (point)))))) + (defun add-mode-abbrev (arg) "Define mode-specific abbrev for last word(s) before point. Argument is how many words before point form the expansion; @@ -450,13 +461,7 @@ (defun add-abbrev (table type arg) ;; XEmacs change: - (if (and (not arg) (region-active-p)) (setq arg 0) - (setq arg (prefix-numeric-value arg))) - (let ((exp (and (>= arg 0) - (buffer-substring - (point) - (if (= arg 0) (mark) - (save-excursion (forward-word (- arg)) (point)))))) + (let ((exp (abbrev-string-to-be-defined arg)) name) (setq name (read-string (format (if exp "%s abbrev for \"%s\": " @@ -469,6 +474,14 @@ name (abbrev-expansion name table)))) (define-abbrev table (downcase name) exp)))) +(defun inverse-abbrev-string-to-be-defined (arg) + "Return the string for which an inverse abbrev will be defined. +ARG is the argument to `inverse-add-global-abbrev' or +`inverse-add-mode-abbrev'." + (save-excursion + (forward-word (- arg)) + (buffer-substring (point) (progn (forward-word 1) (point))))) + (defun inverse-add-mode-abbrev (arg) "Define last word before point as a mode-specific abbrev. With prefix argument N, defines the Nth word before point. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/about.el --- a/lisp/about.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/about.el Mon Aug 13 11:35:02 2007 +0200 @@ -71,7 +71,7 @@ (jmiller "Jeff Miller" "jmiller@smart.net") (juhp "Jens-Ulrik Holger Petersen" "petersen@kurims.kyoto-u.ac.jp") (jwz "Jamie Zawinski" "jwz@jwz.org") - (kazz "IENAGA Kazuyuki" "ienaga@jsys.co.jp") + (kazz "IENAGA Kazuyuki" "ienaga@xemacs.org") (kyle "Kyle Jones" "kyle_jones@wonderworks.com") (larsi "Lars Magne Ingebrigtsen" "larsi@gnus.org") (marcpa "Marc Paquette" "marcpa@CAM.ORG") diff -r 72a7cfa4a488 -r abe6d1db359e lisp/alist.el --- a/lisp/alist.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/alist.el Mon Aug 13 11:35:02 2007 +0200 @@ -22,7 +22,18 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. -;;; Code: + +;;;###autoload +(defun vassoc (key valist) + "Search VALIST for a vector whose first element is equal to KEY. +See also `assoc'." + ;; by Stig@hackvan.com + (let (el) + (catch 'done + (while (setq el (pop valist)) + (and (equal key (aref el 0)) + (throw 'done el)))))) + ;;;###autoload (defun put-alist (item value alist) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/apropos.el --- a/lisp/apropos.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/apropos.el Mon Aug 13 11:35:02 2007 +0200 @@ -377,7 +377,7 @@ ;; Finds all documentation related to APROPOS-REGEXP in internal-doc-file-name. (defun apropos-documentation-check-doc-file () - (let (type symbol (sepa 2) sepb beg end) + (let (type symbol (sepa 2) sepb beg end doc) (insert ?\^_) (backward-char) (insert-file-contents (concat doc-directory internal-doc-file-name)) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/auto-autoloads.el --- a/lisp/auto-autoloads.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/auto-autoloads.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,5 +1,5 @@ ;;; DO NOT MODIFY THIS FILE -(if (featurep 'Standard-autoloads) (error "Already loaded")) +(if (featurep 'lisp-autoloads) (error "Already loaded")) ;;;### (autoloads nil "abbrev" "lisp/abbrev.el") @@ -12,7 +12,11 @@ ;;;*** -;;;### (autoloads (set-modified-alist modify-alist remove-alist set-alist del-alist put-alist) "alist" "lisp/alist.el") +;;;### (autoloads (set-modified-alist modify-alist remove-alist set-alist del-alist put-alist vassoc) "alist" "lisp/alist.el") + +(autoload 'vassoc "alist" "\ +Search VALIST for a vector whose first element is equal to KEY. +See also `assoc'." nil nil) (autoload 'put-alist "alist" "\ Modify ALIST to set VALUE to ITEM. @@ -71,7 +75,7 @@ ;;;*** -;;;### (autoloads (batch-update-directory batch-update-autoloads update-autoloads-from-directory update-autoloads-here update-file-autoloads generate-file-autoloads) "autoload" "lisp/autoload.el") +;;;### (autoloads (batch-update-one-directory batch-update-directory batch-update-autoloads update-autoloads-from-directory update-autoloads-here update-file-autoloads generate-file-autoloads) "autoload" "lisp/autoload.el") (autoload 'generate-file-autoloads "autoload" "\ Insert at point a loaddefs autoload section for FILE. @@ -83,7 +87,7 @@ (autoload 'update-file-autoloads "autoload" "\ Update the autoloads for FILE in `generated-autoload-file' \(which FILE might bind in its local variables). -This functions refuses to update autoloads files." t nil) +This function refuses to update autoloads files." t nil) (autoload 'update-autoloads-here "autoload" "\ Update sections of the current buffer generated by `update-file-autoloads'." t nil) @@ -91,7 +95,9 @@ (autoload 'update-autoloads-from-directory "autoload" "\ Update `generated-autoload-file' with all the current autoloads from DIR. This runs `update-file-autoloads' on each .el file in DIR. -Obsolete autoload entries for files that no longer exist are deleted." t nil) +Obsolete autoload entries for files that no longer exist are deleted. +Note that, if this function is called from `batch-update-directory', +`generated-autoload-file' was rebound in that function." t nil) (autoload 'batch-update-autoloads "autoload" "\ Update the autoloads for the files or directories on the command line. @@ -103,9 +109,14 @@ on the command line." nil nil) (autoload 'batch-update-directory "autoload" "\ -Update the autoloads for the directory on the command line. -Runs `update-file-autoloads' on each file in the given directory, must -be used only with -batch and kills XEmacs on completion." nil nil) +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." nil nil) + +(autoload 'batch-update-one-directory "autoload" "\ +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." nil nil) ;;;*** @@ -117,7 +128,23 @@ ;;;*** -;;;### (autoloads (batch-byte-recompile-directory batch-byte-recompile-directory-norecurse batch-byte-compile display-call-tree byte-compile-sexp byte-compile compile-defun byte-compile-buffer byte-compile-and-load-file byte-compile-file byte-recompile-file byte-recompile-directory byte-force-recompile) "bytecomp" "lisp/bytecomp.el") +;;;### (autoloads (build-report) "build-report" "lisp/build-report.el") + +(autoload 'build-report "build-report" "\ +Initializes a fresh mail composition buffer using `compose-mail' +with the contents of XEmacs Installation file and excerpts from XEmacs +make output and errors and leaves point at the beginning of the mail text. + See also +`compose-mail', `mail-user-agent', +`build-report-destination', +`build-report-keep-regexp', +`build-report-delete-regexp', +`build-report-make-output-file' and +`build-report-installation-file'." t nil) + +;;;*** + +;;;### (autoloads (batch-byte-recompile-directory batch-byte-recompile-directory-norecurse batch-byte-compile-one-file batch-byte-compile display-call-tree byte-compile-sexp byte-compile compile-defun byte-compile-buffer byte-compile-and-load-file byte-compile-file byte-recompile-file byte-recompile-directory byte-force-recompile) "bytecomp" "lisp/bytecomp.el") (autoload 'byte-force-recompile "bytecomp" "\ Recompile every `.el' file in DIRECTORY that already has a `.elc' file. @@ -194,6 +221,11 @@ Each file is processed even if an error occurred previously. For example, invoke \"xemacs -batch -f batch-byte-compile $emacs/ ~/*.el\"" nil nil) +(autoload 'batch-byte-compile-one-file "bytecomp" "\ +Run `byte-compile-file' on a single file remaining on the command line. +Use this from the command line, with `-batch'; +it won't work in an interactive Emacs." nil nil) + (autoload 'batch-byte-recompile-directory-norecurse "bytecomp" "\ Same as `batch-byte-recompile-directory' but without recursion." nil nil) @@ -204,18 +236,10 @@ ;;;*** -;;;### (autoloads (compiler-macroexpand define-compiler-macro ignore-file-errors ignore-errors assert check-type typep deftype cl-struct-setf-expander defstruct define-modify-macro callf2 callf letf* letf rotatef shiftf remf cl-do-pop psetf setf get-setf-method defsetf define-setf-method declare the locally multiple-value-setq multiple-value-bind lexical-let* lexical-let symbol-macrolet macrolet labels flet progv psetq do-all-symbols do-symbols dotimes dolist do* do loop return-from return block etypecase typecase ecase case load-time-value eval-when destructuring-bind function* defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs" "lisp/cl-macs.el") +;;;### (autoloads (compiler-macroexpand define-compiler-macro ignore-file-errors ignore-errors assert check-type typep deftype cl-struct-setf-expander defstruct define-modify-macro callf2 callf letf* letf rotatef shiftf remf cl-do-pop psetf setf get-setf-method defsetf define-setf-method declare the locally multiple-value-setq multiple-value-bind lexical-let* lexical-let symbol-macrolet macrolet labels flet progv psetq do-all-symbols do-symbols dotimes dolist do* do loop return-from return block etypecase typecase ecase case load-time-value eval-when destructuring-bind function* defmacro* defun* cl-compile-time-init) "cl-macs" "lisp/cl-macs.el") (autoload 'cl-compile-time-init "cl-macs" nil nil nil) -(autoload 'gensym "cl-macs" "\ -Generate a new uninterned symbol. -The name is made by appending a number to PREFIX, default \"G\"." nil nil) - -(autoload 'gentemp "cl-macs" "\ -Generate a new interned symbol with a unique name. -The name is made by appending a number to PREFIX, default \"G\"." nil nil) - (autoload 'defun* "cl-macs" "\ (defun* NAME ARGLIST [DOCSTRING] BODY...): define NAME as a function. Like normal `defun', except ARGLIST allows full Common Lisp conventions, @@ -535,12 +559,6 @@ ;;;*** -;;;### (autoloads (batch-remove-old-elc) "cleantree" "lisp/cleantree.el") - -(autoload 'batch-remove-old-elc "cleantree" nil nil nil) - -;;;*** - ;;;### (autoloads (config-value config-value-hash-table) "config" "lisp/config.el") (autoload 'config-value-hash-table "config" "\ @@ -563,7 +581,7 @@ ;;;*** -;;;### (autoloads (customize-menu-create custom-menu-create custom-save-all customize-save-customized customize-browse custom-buffer-create-other-window custom-buffer-create customize-apropos-groups customize-apropos-faces customize-apropos-options customize-apropos customize-saved customize-customized customize-face-other-window customize-face customize-option-other-window customize-changed-options customize-variable customize-other-window customize customize-save-variable customize-set-variable customize-set-value) "cus-edit" "lisp/cus-edit.el") +;;;### (autoloads (custom-migrate-custom-file customize-menu-create custom-menu-create custom-save-all customize-save-customized customize-browse custom-buffer-create-other-window custom-buffer-create customize-apropos-groups customize-apropos-faces customize-apropos-options customize-apropos customize-saved customize-customized customize-face-other-window customize-face customize-option-other-window customize-changed-options customize-variable customize-other-window customize customize-save-variable customize-set-variable customize-set-value) "cus-edit" "lisp/cus-edit.el") (autoload 'customize-set-value "cus-edit" "\ Set VARIABLE to VALUE. VALUE is a Lisp object. @@ -684,8 +702,6 @@ (autoload 'customize-browse "cus-edit" "\ Create a tree browser for the customize hierarchy." t nil) -(defcustom custom-file "~/.emacs" "File used for storing customization information.\nIf you change this from the default \"~/.emacs\" you need to\nexplicitly load that file for the settings to take effect." :type 'file :group 'customize) - (autoload 'customize-save-customized "cus-edit" "\ Save all user options which have been set in this session." t nil) @@ -702,6 +718,9 @@ Otherwise the menu will be named `Customize'. The format is suitable for use with `easy-menu-define'." nil nil) +(autoload 'custom-migrate-custom-file "cus-edit" "\ +Migrate custom file from home directory." nil nil) + ;;;*** ;;;### (autoloads (custom-reset-faces custom-theme-reset-faces custom-theme-face-value custom-theme-set-faces custom-set-faces custom-set-face-update-spec custom-declare-face) "cus-face" "lisp/cus-face.el") @@ -740,12 +759,28 @@ (autoload 'custom-reset-faces "cus-face" "\ Reset the value of the face to values previously defined. -Assosiate this setting with the 'user' theme. +Associate this setting with the 'user' theme. ARGS is defined as for `custom-theme-reset-faces'" nil nil) ;;;*** +;;;### (autoloads (make-custom-file-name) "cus-file" "lisp/cus-file.el") + +(defconst custom-file-base "custom.el" "\ +Base of file name for storing customization information.") + +(defvar custom-file nil "\ +File used for storing customization information. +If you change this from the default you need to +explicitly load that file for the settings to take effect.") + +(autoload 'make-custom-file-name "cus-file" "\ +Construct the default custom file name from the init file name. +If FORCE-NEW is non-nil, force post-migration location." nil nil) + +;;;*** + ;;;### (autoloads (disassemble) "disass" "lisp/disass.el") (autoload 'disassemble "disass" "\ @@ -799,13 +834,18 @@ ;;;*** -;;;### (autoloads (pop-tag-mark tags-apropos list-tags tags-query-replace tags-search tags-loop-continue next-file tag-complete-symbol find-tag-other-window find-tag visit-tags-table) "etags" "lisp/etags.el") +;;;### (autoloads (pop-tag-mark tags-apropos list-tags tags-query-replace tags-search tags-loop-continue next-file tag-complete-symbol find-tag-other-window find-tag find-tag-at-point visit-tags-table) "etags" "lisp/etags.el") (autoload 'visit-tags-table "etags" "\ Tell tags commands to use tags table file FILE when all else fails. FILE should be the name of a file created with the `etags' program. A directory name is ok too; it means file TAGS in that directory." t nil) +(autoload 'find-tag-at-point "etags" "\ +*Find tag whose name contains TAGNAME. +Identical to `find-tag' but does not prompt for tag when called interactively; +instead, uses tag around or before point." t nil) + (autoload 'find-tag "etags" "\ *Find tag whose name contains TAGNAME. Selects the buffer that the tag is contained in @@ -830,7 +870,7 @@ tag-mark-stack-max how many tags-based hops to remember" t nil) (autoload 'find-tag-other-window "etags" "\ -*Find tag whose name contains TAGNAME. +*Find tag whose name contains TAGNAME, in another window. Selects the buffer that the tag is contained in in another window and puts point at its definition. If TAGNAME is a null string, the expression in the buffer @@ -906,7 +946,11 @@ ;;;*** -;;;### (autoloads (finder-by-keyword) "finder" "lisp/finder.el") +;;;### (autoloads (finder-by-keyword finder-commentary) "finder" "lisp/finder.el") + +(autoload 'finder-commentary "finder" "\ +Display FILE's commentary section. +FILE should be in a form suitable for passing to `locate-library'." t nil) (autoload 'finder-by-keyword "finder" "\ Find packages matching a given keyword." t nil) @@ -932,95 +976,123 @@ (defcustom font-lock-maximum-size (* 250 1024) "*If non-nil, the maximum size for buffers for fontifying.\nOnly buffers less than this can be fontified when Font Lock mode is turned on.\nIf nil, means size is irrelevant.\nIf a list, each element should be a cons pair of the form (MAJOR-MODE . SIZE),\nwhere MAJOR-MODE is a symbol or t (meaning the default). For example:\n ((c++-mode . 256000) (c-mode . 256000) (rmail-mode . 1048576))\nmeans that the maximum size is 250K for buffers in `c++-mode' or `c-mode', one\nmegabyte for buffers in `rmail-mode', and size is irrelevant otherwise." :type '(choice (const :tag "none" nil) (integer :tag "size") (repeat :menu-tag "mode specific" :tag "mode specific" :value ((t)) (cons :tag "Instance" (radio :tag "Mode" (const :tag "all" t) (symbol :tag "name")) (radio :tag "Size" (const :tag "none" nil) (integer :tag "size"))))) :group 'font-lock) (defvar font-lock-keywords nil "\ -A list of the keywords to highlight. -Each element should be of the form: +A list defining the keywords for `font-lock-mode' to highlight. + + FONT-LOCK-KEYWORDS := List of FONT-LOCK-FORM's. + + FONT-LOCK-FORM :== MATCHER + | (MATCHER . MATCH) + | (MATCHER . FACE-FORM) + | (MATCHER . HIGHLIGHT) + | (MATCHER HIGHLIGHT ...) + | (eval . FORM) + + MATCHER :== A string containing a regexp. + | A variable containing a regexp to search for. + | A function to call to make the search. + It is called with one arg, the limit of the search, + and should leave MATCH results in the XEmacs global + match data. + + MATCH :== An integer match subexpression number from MATCHER. + + FACE-FORM :== The symbol naming a defined face. + | Expression whos value is the face name to use. If you + want FACE-FORM to be a symbol that evaluates to a face, + use a form like \"(progn sym)\". + + HIGHLIGHT :== MATCH-HIGHLIGHT + | MATCH-ANCHORED + + FORM :== Expression returning a FONT-LOCK-FORM, evaluated when + the FONT-LOCK-FORM is first used in a buffer. This + feature can be used to provide a FONT-LOCK-FORM that + can only be generated when Font Lock mode is actually + turned on. + + MATCH-HIGHLIGHT :== (MATCH FACE-FORM OVERRIDE LAXMATCH) + + OVERRIDE :== t - overwrite existing fontification + | 'keep - only parts not already fontified are + highlighted. + | 'prepend - merge faces, this fontification has + precedence over existing + | 'append - merge faces, existing fontification has + precedence over + this face. + + LAXMATCH :== If non-nil, no error is signalled if there is no MATCH + in MATCHER. + + MATCH-ANCHORED :== (ANCHOR-MATCHER PRE-MATCH-FORM \\ + POST-MATCH-FORM MATCH-HIGHLIGHT ...) - MATCHER - (MATCHER . MATCH) - (MATCHER . FACENAME) - (MATCHER . HIGHLIGHT) - (MATCHER HIGHLIGHT ...) - (eval . FORM) + ANCHOR-MATCHER :== Like a MATCHER, except that the limit of the search + defaults to the end of the line after PRE-MATCH-FORM + is evaluated. However, if PRE-MATCH-FORM returns a + position greater than the end of the line, that + position is used as the limit of the search. It is + generally a bad idea to return a position greater than + the end of the line, i.e., cause the ANCHOR-MATCHER + search to span lines. + + PRE-MATCH-FORM :== Evaluated before the ANCHOR-MATCHER is used, therefore + can be used to initialize before, ANCHOR-MATCHER is + used. Typically, PRE-MATCH-FORM is used to move to + some position relative to the original MATCHER, before + starting with the ANCHOR-MATCHER. + + POST-MATCH-FORM :== Like PRE-MATCH-FORM, but used to clean up after the + ANCHOR-MATCHER. It might be used to move, before + resuming with MATCH-ANCHORED's parent's MATCHER. + +For example, an element of the first form highlights (if not already highlighted): + + \"\\\\\" Discrete occurrences of \"foo\" in the value + of the variable `font-lock-keyword-face'. -where HIGHLIGHT should be either MATCH-HIGHLIGHT or MATCH-ANCHORED. + (\"fu\\\\(bar\\\\)\" . 1) Substring \"bar\" within all occurrences of + \"fubar\" in the value of + `font-lock-keyword-face'. + + (\"fubar\" . fubar-face) Occurrences of \"fubar\" in the value of + `fubar-face'. + + (\"foo\\\\|bar\" 0 foo-bar-face t) Occurrences of either \"foo\" or \"bar\" in the + value of `foo-bar-face', even if already + highlighted. -FORM is an expression, whose value should be a keyword element, -evaluated when the keyword is (first) used in a buffer. This feature -can be used to provide a keyword that can only be generated when Font -Lock mode is actually turned on. + (fubar-match 1 fubar-face) The first subexpression within all + occurrences of whatever the function + `fubar-match' finds and matches in the value + of `fubar-face'. + + (\"\\\\\" (0 anchor-face) (\"\\\\\" nil nil (0 item-face))) + -------------- --------------- ------------ --- --- ------------- + | | | | | | + MATCHER | ANCHOR-MATCHER | +------+ MATCH-HIGHLIGHT + MATCH-HIGHLIGHT PRE-MATCH-FORM | + POST-MATCH-FORM + + Discrete occurrences of \"anchor\" in the value of `anchor-face', and + subsequent discrete occurrences of \"item\" (on the same line) in the value + of `item-face'. (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil. + Therefore \"item\" is initially searched for starting from the end of the + match of \"anchor\", and searching for subsequent instance of \"anchor\" + resumes from where searching for \"item\" concluded.) For highlighting single items, typically only MATCH-HIGHLIGHT is required. -However, if an item or (typically) items is to be highlighted following the -instance of another item (the anchor) then MATCH-ANCHORED may be required. - -MATCH-HIGHLIGHT should be of the form: - - (MATCH FACENAME OVERRIDE LAXMATCH) - -Where MATCHER can be either the regexp to search for, a variable -containing the regexp to search for, or the function to call to make -the search (called with one argument, the limit of the search). MATCH -is the subexpression of MATCHER to be highlighted. FACENAME is either -a symbol naming a face, or an expression whose value is the face name -to use. If you want FACENAME to be a symbol that evaluates to a face, -use a form like \"(progn sym)\". - -OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification may -be overwritten. If `keep', only parts not already fontified are highlighted. -If `prepend' or `append', existing fontification is merged with the new, in -which the new or existing fontification, respectively, takes precedence. -If LAXMATCH is non-nil, no error is signalled if there is no MATCH in MATCHER. - -For example, an element of the form highlights (if not already highlighted): - - \"\\\\\\=\" Discrete occurrences of \"foo\" in the value of the - variable `font-lock-keyword-face'. - (\"fu\\\\(bar\\\\)\" . 1) Substring \"bar\" within all occurrences of \"fubar\" in - the value of `font-lock-keyword-face'. - (\"fubar\" . fubar-face) Occurrences of \"fubar\" in the value of `fubar-face'. - (\"foo\\\\|bar\" 0 foo-bar-face t) - Occurrences of either \"foo\" or \"bar\" in the value - of `foo-bar-face', even if already highlighted. - -MATCH-ANCHORED should be of the form: - - (MATCHER PRE-MATCH-FORM POST-MATCH-FORM MATCH-HIGHLIGHT ...) - -Where MATCHER is as for MATCH-HIGHLIGHT with one exception; see below. -PRE-MATCH-FORM and POST-MATCH-FORM are evaluated before the first, and after -the last, instance MATCH-ANCHORED's MATCHER is used. Therefore they can be -used to initialize before, and cleanup after, MATCHER is used. Typically, -PRE-MATCH-FORM is used to move to some position relative to the original -MATCHER, before starting with MATCH-ANCHORED's MATCHER. POST-MATCH-FORM might -be used to move, before resuming with MATCH-ANCHORED's parent's MATCHER. - -For example, an element of the form highlights (if not already highlighted): - - (\"\\\\\\=\" (0 anchor-face) (\"\\\\\\=\" nil nil (0 item-face))) - - Discrete occurrences of \"anchor\" in the value of `anchor-face', and subsequent - discrete occurrences of \"item\" (on the same line) in the value of `item-face'. - (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil. Therefore \"item\" is - initially searched for starting from the end of the match of \"anchor\", and - searching for subsequent instance of \"anchor\" resumes from where searching - for \"item\" concluded.) - -The above-mentioned exception is as follows. The limit of the MATCHER search -defaults to the end of the line after PRE-MATCH-FORM is evaluated. -However, if PRE-MATCH-FORM returns a position greater than the position after -PRE-MATCH-FORM is evaluated, that position is used as the limit of the search. -It is generally a bad idea to return a position greater than the end of the -line, i.e., cause the MATCHER search to span lines. - -Note that the MATCH-ANCHORED feature is experimental; in the future, we may -replace it with other ways of providing this functionality. +However, if an item or (typically) several items are to be highlighted +following the instance of another item (the anchor) then MATCH-ANCHORED may be +required. These regular expressions should not match text which spans lines. While -\\[font-lock-fontify-buffer] handles multi-line patterns correctly, updating -when you edit the buffer does not, since it considers text one line at a time. +\\[font-lock-fontify-buffer] handles multi-line patterns correctly, updating when you +edit the buffer does not, since it considers text one line at a time. -Be very careful composing regexps for this list; -the wrong pattern can dramatically slow things down!") +Be very careful composing regexps for this list; the wrong pattern can +dramatically slow things down! +") (make-variable-buffer-local 'font-lock-keywords) @@ -1199,15 +1271,21 @@ ;;;*** -;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-batch-rebuild-dir Info-query info) "info" "lisp/info.el") +;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-batch-rebuild-dir Info-find-node Info-query info) "info" "lisp/info.el") (defvar Info-directory-list nil "\ List of directories to search for Info documentation files. The first directory in this list, the \"dir\" file there will become -the (dir)Top node of the Info documentation tree. If you wish to -modify the info search path, use `M-x customize-variable, -Info-directory-list' to do so.") +the (dir)Top node of the Info documentation tree. + +Note: DO NOT use the `customize' interface to change the value of this +variable. Its value is created dynamically on each startup, depending +on XEmacs packages installed on the system. If you want to change the +search path, make the needed modifications on the variable's value +from .emacs. For instance: + + (setq Info-directory-list (cons \"~/info\" Info-directory-list))") (autoload 'info "info" "\ Enter Info, the documentation browser. @@ -1220,6 +1298,13 @@ (autoload 'Info-query "info" "\ Enter Info, the documentation browser. Prompt for name of Info file." t nil) +(autoload 'Info-find-node "info" "\ +Go to an info node specified as separate FILENAME and NODENAME. +Look for a plausible filename, or if not found then look for URL's and +dispatch to the appropriate fn. NO-GOING-BACK is non-nil if +recovering from an error in this function; it says do not attempt +further (recursive) error recovery. TRYFILE is ??" nil nil) + (autoload 'Info-batch-rebuild-dir "info" "\ (Re)build info `dir' files in the directories remaining on the command line. Use this from the command line, with `-batch'; @@ -1361,7 +1446,7 @@ be lexically ordered. It is debatable if it makes sense to have more than one version of a package available.") -(defcustom package-get-download-sites '(("xemacs.org" "ftp.xemacs.org" "pub/xemacs/packages") ("cso.uiuc.edu" "ftp.cso.uiuc.edu" "pub/packages/xemacs/packages") ("unicamp.br" "ftp.unicamp.br" "pub/xemacs/packages") ("sunsite.cnlab-switch.ch" "sunsite.cnlab-switch.ch" "mirror/xemacs/packages") ("tu-darmstadt.de" "ftp.tu-darmstadt.de" "pub/editors/xemacs/packages") ("sunsite.auc.dk" "sunsite.auc.dk" "pub/emacs/xemacs/packages") ("pasteur.fr" "ftp.pasteur.fr" "pub/computing/xemacs/packages") ("cenatls.cena.dgac.fr" "ftp.cenatls.cena.dgac.fr" "pub/Emacs/xemacs/packages") ("kfki.hu" "ftp.kfki.hu" "pub/packages/xemacs/packages") ("uniroma2.it" "ftp.uniroma2.it" "unix/misc/dist/XEMACS/packages") ("icm.edu.pl" "ftp.icm.edu.pl" "pub/unix/editors/xemacs/packages") ("sunet.se" "ftp.sunet.se" "pub/gnu/xemacs/packages") ("doc.ic.ac.uk" "sunsite.doc.ic.ac.uk" "packages/xemacs/packages") ("srcc.msu.su" "ftp1.srcc.msu.su" "mirror/ftp.xemacs.org/packages") ("usyd.edu.au" "ftp.usyd.edu.au" "pub/Xemacs/packages") ("netlab.is.tsukuba.ac.jp" "ftp.netlab.is.tsukuba.ac.jp" "pub/GNU/xemacs/packages") ("jaist.ac.jp" "ftp.jaist.ac.jp" "pub/GNU/xemacs/packages") ("ring.aist.go.jp" "ring.aist.go.jp" "pub/text/xemacs/packages") ("ring.asahi-net.or.jp" "ring.asahi-net.or.jp" "pub/text/xemacs/packages") ("SunSITE.sut.ac.jp" "SunSITE.sut.ac.jp" "pub/archives/packages/xemacs/packages") ("dti.ad.jp" "ftp.dti.ad.jp" "pub/unix/editor/xemacs/packages") ("kreonet.re.kr" "ftp.kreonet.re.kr" "pub/tools/emacs/xemacs/packages")) "*List of remote sites available for downloading packages.\nList format is '(site-description site-name directory-on-site).\nSITE-DESCRIPTION is a textual description of the site. SITE-NAME\nis the internet address of the download site. DIRECTORY-ON-SITE\nis the directory on the site in which packages may be found.\nThis variable is used to initialize `package-get-remote', the\nvariable actually used to specify package download sites." :tag "Package download sites" :type '(repeat (list hostname directory)) :group 'package-get) +(defcustom package-get-download-sites '(("xemacs.org" "ftp.xemacs.org" "pub/xemacs/packages") ("crc.ca (Canada)" "ftp.crc.ca" "pub/packages/editors/xemacs/packages") ("ualberta.ca (Canada)" "sunsite.ualberta.ca" "pub/Mirror/xemacs/packages") ("uiuc.edu (United States)" "uiarchive.uiuc.edu" "pub/packages/xemacs/packages") ("unc.edu (United States)" "metalab.unc.edu" "pub/packages/editors/xemacs/packages") ("utk.edu (United States)" "ftp.sunsite.utk.edu" "pub/xemacs/packages") ("unicamp.br (Brazil)" "ftp.unicamp.br" "pub/xemacs/packages") ("tuwien.ac.at (Austria)" "gd.tuwien.ac.at" "editors/xemacs/packages") ("auc.dk (Denmark)" "sunsite.auc.dk" "pub/emacs/xemacs/packages") ("doc.ic.ac.uk (England)" "sunsite.doc.ic.ac.uk" "packages/xemacs/packages") ("funet.fi (Finland)" "ftp.funet.fi" "pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/packages") ("cenatls.cena.dgac.fr (France)" "ftp.cenatls.cena.dgac.fr" "Emacs/xemacs/packages") ("pasteur.fr (France)" "ftp.pasteur.fr" "pub/computing/xemacs/packages") ("tu-darmstadt.de (Germany)" "ftp.tu-darmstadt.de" "pub/editors/xemacs/packages") ("kfki.hu (Hungary)" "ftp.kfki.hu" "pub/packages/xemacs/packages") ("eunet.ie (Ireland)" "ftp.eunet.ie" "mirrors/ftp.xemacs.org/pub/xemacs/packages") ("uniroma2.it (Italy)" "ftp.uniroma2.it" "unix/misc/dist/XEMACS/packages") ("uio.no (Norway)" "sunsite.uio.no" "pub/xemacs/packages") ("icm.edu.pl (Poland)" "ftp.icm.edu.pl" "pub/unix/editors/xemacs/packages") ("srcc.msu.su (Russia)" "ftp.srcc.msu.su" "mirror/ftp.xemacs.org/packages") ("sunet.se (Sweden)" "ftp.sunet.se" "pub/gnu/xemacs/packages") ("cnlab-switch.ch (Switzerland)" "sunsite.cnlab-switch.ch" "mirror/xemacs/packages") ("aist.go.jp (Japan)" "ring.aist.go.jp" "pub/text/xemacs/packages") ("asahi-net.or.jp (Japan)" "ring.asahi-net.or.jp" "pub/text/xemacs/packages") ("dti.ad.jp (Japan)" "ftp.dti.ad.jp" "pub/unix/editor/xemacs/packages") ("jaist.ac.jp (Japan)" "ftp.jaist.ac.jp" "pub/GNU/xemacs/packages") ("nucba.ac.jp (Japan)" "mirror.nucba.ac.jp" "mirror/xemacs/packages") ("sut.ac.jp (Japan)" "sunsite.sut.ac.jp" "pub/archives/packages/xemacs/packages") ("tsukuba.ac.jp (Japan)" "ftp.netlab.is.tsukuba.ac.jp" "pub/GNU/xemacs/packages") ("kreonet.re.kr (Korea)" "ftp.kreonet.re.kr" "pub/tools/emacs/xemacs/packages") ("nctu.edu.tw (Taiwan)" "coda.nctu.edu.tw" "Editors/xemacs/packages") ("sun.ac.za (South Africa)" "ftp.sun.ac.za" "xemacs/packages") ("isu.net.sa (Saudi Arabia)" "ftp.isu.net.sa" "pub/mirrors/ftp.xemacs.org/packages") ("aarnet.edu.au (Australia)" "mirror.aarnet.edu.au" "pub/xemacs/packages")) "*List of remote sites available for downloading packages.\nList format is '(site-description site-name directory-on-site).\nSITE-DESCRIPTION is a textual description of the site. SITE-NAME\nis the internet address of the download site. DIRECTORY-ON-SITE\nis the directory on the site in which packages may be found.\nThis variable is used to initialize `package-get-remote', the\nvariable actually used to specify package download sites." :tag "Package download sites" :type '(repeat (list (string :tag "Name") host-name directory)) :group 'package-get) (autoload 'package-get-download-menu "package-get" "\ Build the `Add Download Site' menu." nil nil) @@ -1428,7 +1513,7 @@ INSTALL-DIR, if non-nil, specifies the package directory where fetched packages should be installed. -The value of `package-get-base' is used to determine what files should +The value of `package-get-base' is used to determine what files should be retrieved. The value of `package-get-remote' is used to determine where a package should be retrieved from. The sites are tried in order so one is better off listing easily reached sites first. @@ -1444,7 +1529,7 @@ (autoload 'package-get-package-provider "package-get" "\ Search for a package that provides SYM and return the name and version. Searches in `package-get-base' for SYM. If SYM is a - consp, then it must match a corresponding (provide (SYM VERSION)) from + consp, then it must match a corresponding (provide (SYM VERSION)) from the package. If FORCE-CURRENT is non-nil make sure the database is up to date. This might @@ -1540,18 +1625,7 @@ ;;;*** -;;;### (autoloads (clear-rectangle string-rectangle open-rectangle insert-rectangle yank-rectangle extract-rectangle delete-extract-rectangle delete-rectangle kill-rectangle) "rect" "lisp/rect.el") - -(defvar killed-rectangle nil "\ -Rectangle for `yank-rectangle' to insert.") - -(autoload 'kill-rectangle "rect" "\ -Delete the region-rectangle and save it as the last killed one. -You might prefer to use `delete-extract-rectangle' from a program. - -When called from a program, the rectangle's corners are START and END. -With a prefix (or FILL) argument, also fill lines where nothing has to be -deleted." t nil) +;;;### (autoloads (clear-rectangle string-rectangle open-rectangle insert-rectangle yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle delete-rectangle) "rect" "lisp/rect.el") (autoload 'delete-rectangle "rect" "\ Delete the text in the region-rectangle without saving it. @@ -1573,6 +1647,17 @@ Return the contents of the rectangle with corners at START and END, as a list of strings, one for each line of the rectangle." nil nil) +(defvar killed-rectangle nil "\ +Rectangle for `yank-rectangle' to insert.") + +(autoload 'kill-rectangle "rect" "\ +Delete the region-rectangle and save it as the last killed one. +You might prefer to use `delete-extract-rectangle' from a program. + +When called from a program, the rectangle's corners are START and END. +With a prefix (or FILL) argument, also fill lines where nothing has to be +deleted." t nil) + (autoload 'yank-rectangle "rect" "\ Yank the last killed rectangle with upper left corner at point." t nil) @@ -1593,8 +1678,10 @@ (autoload 'string-rectangle "rect" "\ Insert STRING on each line of the region-rectangle, shifting text right. -The left edge of the rectangle specifies the column for insertion. This -command does not delete or overwrite any existing text. +The left edge of the rectangle specifies the column for insertion. + +If `pending-delete-mode' is active the string replace the region. +Otherwise this command does not delete or overwrite any existing text. When called from a program, the rectangle's corners are START and END." t nil) @@ -1809,7 +1896,7 @@ when they are selected for the first time. If you add fonts to your system, or if you change your font path, you can call this to re-initialize the menus." nil nil) -(defun* x-font-menu-font-data (face dcache) (let* ((case-fold-search t) (domain (if font-menu-this-frame-only-p (selected-frame) (selected-device))) (name (font-instance-name (face-font-instance face domain))) (truename (font-instance-truename (face-font-instance face domain (if (featurep 'mule) 'ascii)))) family size weight entry slant) (when (string-match x-font-regexp-foundry-and-family name) (setq family (capitalize (match-string 1 name))) (setq entry (vassoc family (aref dcache 0)))) (when (and (null entry) (string-match x-font-regexp-foundry-and-family truename)) (setq family (capitalize (match-string 1 truename))) (setq entry (vassoc family (aref dcache 0)))) (when (null entry) (return-from x-font-menu-font-data (make-vector 5 nil))) (when (string-match x-font-regexp name) (setq weight (capitalize (match-string 1 name))) (setq size (string-to-int (match-string 6 name)))) (when (string-match x-font-regexp truename) (when (not (member weight (aref entry 1))) (setq weight (capitalize (match-string 1 truename)))) (when (not (member size (aref entry 2))) (setq size (string-to-int (match-string 6 truename)))) (setq slant (capitalize (match-string 2 truename)))) (vector entry family size weight slant))) +(defun* x-font-menu-font-data (face dcache) (defvar x-font-regexp) (defvar x-font-regexp-foundry-and-family) (let* ((case-fold-search t) (domain (if font-menu-this-frame-only-p (selected-frame) (selected-device))) (name (font-instance-name (face-font-instance face domain))) (truename (font-instance-truename (face-font-instance face domain (if (featurep 'mule) 'ascii)))) family size weight entry slant) (when (string-match x-font-regexp-foundry-and-family name) (setq family (capitalize (match-string 1 name))) (setq entry (vassoc family (aref dcache 0)))) (when (and (null entry) (string-match x-font-regexp-foundry-and-family truename)) (setq family (capitalize (match-string 1 truename))) (setq entry (vassoc family (aref dcache 0)))) (when (null entry) (return-from x-font-menu-font-data (make-vector 5 nil))) (when (string-match x-font-regexp name) (setq weight (capitalize (match-string 1 name))) (setq size (string-to-int (match-string 6 name)))) (when (string-match x-font-regexp truename) (when (not (member weight (aref entry 1))) (setq weight (capitalize (match-string 1 truename)))) (when (not (member size (aref entry 2))) (setq size (string-to-int (match-string 6 truename)))) (setq slant (capitalize (match-string 2 truename)))) (vector entry family size weight slant))) ;;;*** @@ -1825,4 +1912,4 @@ ;;;*** -(provide 'Standard-autoloads) +(provide 'lisp-autoloads) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/autoload.el --- a/lisp/autoload.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/autoload.el Mon Aug 13 11:35:02 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. -;; Copyright (C) 1996 Ben Wing. +;; Copyright (C) 1996, 2000 Ben Wing. ;; Author: Roland McGrath ;; Keywords: maint @@ -87,6 +87,8 @@ (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. @@ -114,9 +116,11 @@ (defun autoload-trim-file-name (file) "Returns a relative pathname of FILE including the last directory." (setq file (expand-file-name file)) - (file-relative-name file (file-name-directory - (directory-file-name - (file-name-directory file))))) + (replace-in-string + (file-relative-name file (file-name-directory + (directory-file-name + (file-name-directory file)))) + "\\\\" "/")) ;;;###autoload (defun generate-file-autoloads (file &optional funlist) @@ -339,7 +343,7 @@ "Generic filename to put autoloads into. Unless you are an XEmacs maintainer, it is probably unwise to change this.") -(defvar autoload-target-directory "../lisp/prim/" +(defvar autoload-target-directory "../lisp/" "Directory to put autoload declaration file into. Unless you know what you're doing, don't mess with this.") @@ -349,11 +353,15 @@ 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.") +autoloads go somewhere else. + +Note that `batch-update-directory' binds this variable to its own value, +generally the file named `autoload-file-name' in the directory being +updated.") (defconst cusload-file-name "custom-load.el" - "Generic filename ot put custom loads into. -Unless you are an XEmacs maintainr, it is probably unwise to change this.") + "Generic filename to put custom loads into. +Unless you are an XEmacs maintainer, it is probably unwise to change this.") ;;;###autoload (defun update-file-autoloads (file) @@ -458,7 +466,9 @@ (defun update-autoloads-from-directory (dir) "Update `generated-autoload-file' with all the current autoloads from DIR. This runs `update-file-autoloads' on each .el file in DIR. -Obsolete autoload entries for files that no longer exist are deleted." +Obsolete autoload entries for files that no longer exist are deleted. +Note that, if this function is called from `batch-update-directory', +`generated-autoload-file' was rebound in that function." (interactive "DUpdate autoloads for directory: ") (setq dir (expand-file-name dir)) (let ((simple-dir (file-name-as-directory @@ -534,18 +544,25 @@ (defvar autoload-package-name nil) +;; #### this function is almost identical to, but subtly different from, +;; batch-update-autoloads. Both of these functions, unfortunately, are +;; used in various build scripts in xemacs-packages. They should be +;; merged. (However, it looks like no scripts pass more than one arg, +;; making merging easy.) --ben + ;;;###autoload (defun batch-update-directory () - "Update the autoloads for the directory on the command line. -Runs `update-file-autoloads' on each file in the given directory, must -be used only with -batch and kills XEmacs on completion." + "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." (unless noninteractive (error "batch-update-directory is to be used only with -batch")) (let ((defdir default-directory) (enable-local-eval nil)) ; Don't query in batch mode. (dolist (arg command-line-args-left) (setq arg (expand-file-name arg defdir)) - (let ((generated-autoload-file (concat arg "/" autoload-file-name))) + (let ((generated-autoload-file (expand-file-name autoload-file-name + arg))) (cond ((file-directory-p arg) (message "Updating autoloads in directory %s..." arg) @@ -561,6 +578,36 @@ ) (setq command-line-args-left nil))) +;; #### i created the following. this one and the last should be merged into +;; batch-update-autoloads and batch-update-one-directory. --ben + +;;;###autoload +(defun batch-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." + (unless noninteractive + (error "batch-update-directory is to be used only with -batch")) + (let ((defdir default-directory) + (enable-local-eval nil)) ; Don't query in batch mode. + (let ((arg (car command-line-args-left))) + (setq command-line-args-left (cdr command-line-args-left)) + (setq arg (expand-file-name arg defdir)) + (let ((generated-autoload-file (expand-file-name autoload-file-name + arg))) + (cond + ((file-directory-p arg) + (message "Updating autoloads in directory %s..." arg) + (update-autoloads-from-directory arg)) + (t (error "No such file or directory: %s" arg))) + (fixup-autoload-buffer (concat (if autoload-package-name + autoload-package-name + (file-name-nondirectory arg)) + "-autoloads")) + (save-some-buffers t)) + ;; (message "Done") + ))) + (provide 'autoload) ;;; autoload.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/buff-menu.el --- a/lisp/buff-menu.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/buff-menu.el Mon Aug 13 11:35:02 2007 +0200 @@ -356,6 +356,8 @@ +(eval-when-compile (autoload 'visit-tags-table "etags")) + (defun Buffer-menu-visit-tags-table () "Visit the tags table in the buffer on this line. See `visit-tags-table'." (interactive) @@ -634,6 +636,11 @@ files-only)) buffer)) +(defun buffers-menu-omit-invisible-buffers (buf) + "For use as a value of `buffers-menu-omit-function'. +Omits normally invisible buffers (those whose name begins with a space)." + (not (null (string-match "\\` " (buffer-name buf))))) + (provide 'buff-menu) ;;; buff-menu.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/buffer.el --- a/lisp/buffer.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/buffer.el Mon Aug 13 11:35:02 2007 +0200 @@ -60,11 +60,7 @@ (set-buffer-major-mode buf)))) (push-window-configuration) (set-buffer buf) - (or norecord (record-buffer buf)) - (set-window-buffer (if (eq (selected-window) (minibuffer-window)) - (next-window (minibuffer-window)) - (selected-window)) - buf) + (set-window-buffer (last-nonminibuf-window) buf norecord) buf)) (defun pop-to-buffer (bufname &optional not-this-window-p on-frame) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/build-report.el --- a/lisp/build-report.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/build-report.el Mon Aug 13 11:35:02 2007 +0200 @@ -3,8 +3,8 @@ ;; Copyright (C) 1997 Adrian Aichner ;; Author: Adrian Aichner -;; Date: Sun., Apr. 20, 1997, 1998, 1999. -;; Version: 1.35 +;; Date: Sun., Apr. 20, 1997-2000. +;; Version: $Revision: 1.5.2.6 $ ;; Keywords: internal ;; This file is part of XEmacs. @@ -48,97 +48,175 @@ ;;; Code: (require 'config) +(require 'custom) +(require 'cl) (provide 'build-report) -;; Due to recommendation by developers on xemacs-beta@xemacs.org, -;; release versions are to be checked out using `co -u -kv ...'. -(defconst build-report-version - "1.35" - "Version number of build-report.") +;;; Constant definitions used internally by `build-report'. These are not +;;; anticipated to be changed by users of `build-report'. +;;; If users do need to change the value of any of these, they need to do +;;; it after `build-report' has been loaded (not just required). Please +;;; report it to the maintainers of `build-report' when you think you +;;; need to do this. +(defconst build-report-installation-version-regexp + "XEmacs\\s-+\\([0-9]+\\)\\.\\([0-9]+\\)\\(\\(-b\\|\\.\\)\\([0-9]+\\)\\)?\\s-+\\\\?\"\\([^\\\"]+\\)\\\\?\"\\s-+configured\\s-+for\\s-+`\\(.+\\)'\\." + "*REGEXP matching XEmacs Beta Version string in +`build-report-installation-file' file. This variable is used by +`build-report-installation-data'.") + +(defconst build-report-version-file-regexp + "emacs_major_version\\s-*=\\s-*\\([0-9]+\\) +emacs_minor_version\\s-*=\\s-*\\([0-9]+\\) +emacs_beta_version\\s-*=\\s-*\\([0-9]+\\)? +xemacs_codename\\s-*=\\s-*\"\\([^\"]+\\)\"" + "*REGEXP matching XEmacs Beta Version variable assignments in +`build-report-version-file' file. This variable is used by +`build-report-version-file-data'.") + +(defconst build-report-installation-srcdir-regexp + "\\s-*Where should the build process find the source code\\?\\s-*\\(.*\\)$" + "REGEXP matching XEmacs Beta srcdir as the first substring match in +`build-report-installation-file' file. This variable is used by +`build-report-installation-data'.") + +;;; Customization support for build-report starts here. (defgroup build-report nil - "Package automating the process of sending XEmacs Build Reports." + "Standardizes the Creation of XEmacs Build Reports." + :load 'build-report :group 'build) (defcustom build-report-destination - "xemacs-build-reports@xemacs.org" - "The mail address XEmacs Build Reports should go to." - :type 'string + (quote ("XEmacs Build Reports List " + "XEmacs Beta List ")) + "*The list of mail addresses XEmacs Build Reports should most likely +go to." + :type '(repeat + :custom-show t + :documentation-shown t + string) :group 'build-report) (defcustom build-report-keep-regexp - (list - "make\\[" - "error" - "warn" - "pure.*\\(space\\|size\\)" - "hides\\b" - "strange" - "shadowings" - "^Compilation" - "not\\s-+found") - "Regexp of make process output lines to keep in the report." - :type '(repeat regexp) + (quote ("^\\(cd\\|n?make\\)\\s-" "errors?" "warnings?" + "pure.*\\(space\\|size\\)" "hides\\b" "strange" "shadowings" + "^Compil\\(ing\\s-+in\\|ation\\)" "^Using" "not\\s-+found" + "^While\\s-+compiling.*\\(\n\\s-+.+\\)*" "^Note:" + "Installing" "[Ff]ile(s) copied" + "\\s-+tests\\s-+")) + "*Regexp of make process output lines to keep in the report." + :type '(repeat + :custom-show t + :documentation-shown t + regexp) :group 'build-report) (defcustom build-report-delete-regexp - (list - "confl.*with.*auto-inlining" - (concat (regexp-quote (gethash 'blddir (config-value-hash-table))) "/lisp/[^ \t\n]+ hides ")) - "Regexp of make process output lines to delete from the report." - :type '(repeat regexp) + (quote ("confl.*with.*auto-inlining" "^Formatting:")) + "*Regexp of make process output lines to delete from the report." + :type '(repeat + :custom-show t + :documentation-shown t + regexp) :group 'build-report) -(defcustom build-report-make-output-file - (concat (gethash 'blddir (config-value-hash-table)) "/beta.err") - "Filename where stdout and stderr of XEmacs make process have been stored. -mk.err will not be created automatically. You'll have to run make with -output redirection. I use an alias +(defcustom build-report-make-output-dir + (cond + ((equal system-type 'windows-nt) + (expand-file-name "nt" + (gethash 'blddir (config-value-hash-table)))) + (t + (gethash 'blddir (config-value-hash-table)))) + "*Directory where the build report file is found. + If this is empty or nil, the default, it is replaced by the value of + the XEmacs build directory." + :type '(directory + :custom-show t + :documentation-shown t) + :group 'build-report) + +(defcustom build-report-make-output-files + (quote ("beta.err")) + "*List of Filenames where stdout and stderr of XEmacs make process +have been stored. These are relative to +`build-report-make-output-dir`. You'll have to run make with output +redirection or use the `build' XEmacs package to save this output. You +may use following alias + alias mk 'make \!* >>&\! \!$.err &' -for that, so that I get beta.err went I run `mk beta'." - :type 'file + +under csh, so that you get beta.err went you run `mk beta'." + :type '(repeat + :custom-show t + :documentation-shown t + file) :group 'build-report) (defcustom build-report-installation-file - (concat (gethash 'blddir (config-value-hash-table)) "/Installation") - "Installation file produced by XEmacs configure process." - :type 'file + (expand-file-name "Installation" + (gethash 'blddir (config-value-hash-table))) + "*Installation file produced by XEmacs configure process." + :type '(file + :custom-show t + :documentation-shown t) :group 'build-report) -(defcustom build-report-installation-insert-all nil - "Tell build-report to insert the whole Installation file -instead of just the last report." +(defcustom build-report-version-file + (expand-file-name + "version.sh" + (gethash 'blddir (config-value-hash-table))) + "*version.sh file identifying XEmacs (Beta) Distribution." + :type '(file + :custom-show t + :documentation-shown t) + :group 'build-report) + +(defcustom build-report-installation-insert-all + nil + "*Tell build-report to insert the whole Installation file + instead of just the last report." :type 'boolean :group 'build-report) (defcustom build-report-subject (concat "[%s] " emacs-version " on " system-configuration) - "XEmacs Build Report Subject Line. %s-sequences will be substituted -with user input through `build-report' according to -`build-report-prompts' using `format'." - :type 'string + "*XEmacs Build Report Subject Line. %s-sequences will be substituted + with user input through `build-report' according to + `build-report-prompts' using `format'." + :type '(string + :custom-show t + :documentation-shown t) :group 'build-report) (defcustom build-report-prompts - '(("Status?: " "Success" "Failure")) - "XEmacs Build Report Prompt(s). This is a list of prompt-string -lists used by `build-report' in conjunction with -`build-report-subject'. Each list consists of a prompt string -followed by any number of strings which can be chosen via the history -mechanism." + (quote (("Status?: " ("Success" "Failure")))) + "*XEmacs Build Report Prompt(s). This is a list of prompt-string + lists used by `build-report' in conjunction with + `build-report-subject'. Each list consists of a prompt string + followed by any number of strings which can be chosen via the history + mechanism." + :type '(repeat + :custom-show t + :documentation-shown t + (list + :tag "Prompt" + string + (repeat + :tag "Values" + string))) :group 'build-report) (defcustom build-report-file-encoding "7bit" - "XEmacs Build Report File Encoding to be used when MIME support is -available." + "*XEmacs Build Report File Encoding to be used when MIME support is + available." :group 'build-report) ;; Symbol Name mappings from TM to SEMI serving as Compatibility ;; Bandaid (when (featurep 'mime-setup) ;; No (defvaralias ...) so far. Thanks to "Didier Verna" - ;; for reporting my incorrect defvaraliasing of + ;; for reporting my incorrect defvaraliasing of ;; `mime-editor/insert-tag'. ;; Thanks to Jens-Ulrik Holger Petersen ;; for suggesting the conditional @@ -151,44 +229,113 @@ (defalias 'mime-edit-insert-binary-file 'mime-editor/insert-binary-file))) +(defun build-report-make-output-get () + "Returns the filename the XEmacs make output is saved in." + (interactive) + (if (or (string-equal build-report-make-output-dir "") + (null build-report-make-output-dir)) + (mapcar + (function + (lambda (f) + (expand-file-name + f + (file-name-as-directory + (gethash 'blddir (config-value-hash-table)))))) + build-report-make-output-files) + (mapcar + (function + (lambda (f) + (expand-file-name + f + (file-name-as-directory build-report-make-output-dir)))) + build-report-make-output-files))) + +;;;###autoload (defun build-report (&rest args) - "Initializes a fresh mail composition buffer using `compose-mail' -with the contents of XEmacs Installation file and excerpts from XEmacs -make output and errors and leaves point at the beginning of the mail text. - See also -`compose-mail', `mail-user-agent', -`build-report-destination', -`build-report-keep-regexp', -`build-report-delete-regexp', -`build-report-make-output-file' and -`build-report-installation-file'." + "Composes a fresh mail message with the contents of the built XEmacs +Installation file and excerpts from XEmacs make output. +`compose-mail' is used to create the mail message. Point is left at +the beginning of the mail text. You may add some personal notes if +you like and send the report. +See also + `compose-mail', `mail-user-agent', + `build-report-destination', + `build-report-keep-regexp', + `build-report-delete-regexp', + `build-report-make-output-dir', + `build-report-make-output-files', and + `build-report-installation-file'." + ;; `interactive' form returns value for formal parameter `args'. (interactive (let (prompt - hist - arg - (prompts build-report-prompts)) + hist + arg + (prompts build-report-prompts)) (progn (while prompts - (defvar hist) - (setq prompt (caar prompts)) - (setq hist (cdar prompts)) - (setq prompts (cdr prompts)) - (setq arg (cons (read-string prompt "" 'hist) arg))) + (defvar hist) + (setq prompt (caar prompts)) + (setq hist (cdar prompts)) + ;; `build-report-prompts' used to be a list of lists, the + ;; first element of each list being the prompt, the rest being + ;; the history. The history is now in a separate list. We + ;; better check for that. + (if (listp (car hist)) + (setq hist (car hist))) + (setq prompts (cdr prompts)) + (setq arg (cons (read-string prompt "" 'hist) arg))) arg))) (save-excursion + (if (file-exists-p build-report-installation-file) + (multiple-value-bind + (major minor beta codename configuration) + (build-report-installation-data build-report-installation-file) + (setq build-report-subject + (format "[%%s] XEmacs %s.%s%s \"%s\", %s" + major minor beta codename configuration))) + (multiple-value-bind + (major minor beta codename) + (build-report-version-file-data build-report-version-file) + (setq build-report-subject + (format "[%%s] XEmacs %s.%s%s \"%s\", %s" + major minor beta codename system-configuration)))) (compose-mail - build-report-destination + ;; `build-report-destination' used to be a single string, so + ;; let's test if we really get a list of destinations. + (if (listp build-report-destination) + (read-string + "Build Report Destination: " + (car build-report-destination) + 'build-report-destination) + (read-string + "Build Report Destination: " + build-report-destination) + ) (apply 'format build-report-subject args) nil nil nil nil nil) - (let ((report-begin (point))) - (insert (build-report-insert-make-output report-begin)) - (insert (build-report-insert-installation-file - report-begin - build-report-installation-insert-all)) + (let* ((report-begin (point)) + (files (reverse (build-report-make-output-get))) + (file (car files))) + (while file + (if (file-exists-p file) + (insert (build-report-insert-make-output report-begin file)) + (insert (format "%s not found!\n" file))) + (insert "\n") + (setq files (cdr files)) + (setq file (car files))) + (if (file-exists-p build-report-installation-file) + (insert (build-report-insert-installation-file + report-begin + build-report-installation-insert-all)) + (insert (format "%s not found!\n" build-report-installation-file))) +;;; (when (and (>= major 21) (>= minor 2) (or (null beta) (>= beta 32))) +;;; (insert "\n") +;;; (insert (build-report-insert-config-inc report-begin))) + (insert "\n") (insert (build-report-insert-header report-begin)) (goto-char report-begin)))) @@ -196,100 +343,187 @@ "Inserts the build-report-header at the point specified by `where'." (goto-char where) (with-temp-buffer - (insert "\n> XEmacs Build Report as generated\n> by" - " build-report-version " - build-report-version " follows:\n\n") + (insert + (format " +> XEmacs Build Report generated by emacs-version +> %s +> with system-configuration +> %s +> follows:\n\n" emacs-version system-configuration)) (buffer-string))) -(defun build-report-insert-make-output (where) - "Inserts the output of the XEmacs Beta make run. +(defun build-report-insert-make-output (where file) + "Inserts the output of the XEmacs Beta make run in the +current buffer at position WHERE. The make process output must have been saved in -`build-report-make-output-file' during the XEmacs Beta building." +`build-report-make-output-files' during the XEmacs Beta building." (goto-char where) (with-temp-buffer - (if (file-exists-p build-report-make-output-file) - (progn - (if (featurep 'mime-setup) - (progn - (mime-edit-insert-tag - "text" - "plain" - (concat - "\nContent-Disposition: attachment;" - " filename=\"" - (file-name-nondirectory - build-report-make-output-file) - "\"")) - (mime-edit-insert-binary-file - build-report-make-output-file - build-report-file-encoding)) - (insert-file-contents build-report-make-output-file)) - (goto-char (point-min)) - (delete-non-matching-lines (build-report-keep)) - (goto-char (point-min)) - (delete-matching-lines (build-report-delete)) - (goto-char (point-min)) - (insert "> Contents of " - build-report-make-output-file - "\n> keeping lines matching\n> \"" - (build-report-keep) - "\"\n> and then deleting lines matching\n> \"" - (build-report-delete) - "\"\n\n")) - (insert "> " build-report-make-output-file - " does not exist!\n\n")) + (if (file-exists-p file) + (progn + (if (featurep 'mime-setup) + (progn + (mime-edit-insert-tag + "text" + "plain" + (concat + "\nContent-Disposition: attachment;" + " filename=\"" + (file-name-nondirectory + file) + "\"")) + (mime-edit-insert-binary-file + file + build-report-file-encoding)) + (insert-file-contents file)) + (when build-report-keep-regexp + (goto-char (point-min)) + (delete-non-matching-lines (build-report-keep))) + (when build-report-delete-regexp + (goto-char (point-min)) + (delete-matching-lines (build-report-delete))) + (goto-char (point-min)) + (if build-report-keep-regexp + (insert + (format + "> keeping lines matching +> \"%s\" +" + (build-report-keep)))) + (if build-report-delete-regexp + (insert + (format + "> %sdeleting lines matching +> \"%s\" +" + (if build-report-keep-regexp + "and then " + "") + (build-report-delete)))) + (insert "\n") + (goto-char (point-min)) + (insert + (format "> Contents of %s\n" file))) + (insert "> " file + " does not exist!\n\n")) (buffer-string))) - + (defun build-report-insert-installation-file (where all) "Inserts the contents of the `build-report-installation-file' created by the XEmacs Beta configure process." (goto-char where) (with-temp-buffer (if (file-exists-p build-report-installation-file) - (let (file-begin last-configure) - (insert "> Contents of " - build-report-installation-file - ":\n") - (insert - (format - "> (Output from %s of ./configure)\n\n" - (if all "all runs" "most recent run"))) - (if (featurep 'mime-setup) - (progn - (mime-edit-insert-tag - "text" - "plain" - (concat - "\nContent-Disposition: attachment;" - " filename=\"" - (file-name-nondirectory - build-report-installation-file) - "\"")) - (mime-edit-insert-binary-file - build-report-installation-file - build-report-file-encoding) - (setq file-begin (mime-edit-content-beginning))) - (setq file-begin (point)) - (insert-file-contents - build-report-installation-file)) - (unless all - (setq last-configure - (search-backward-regexp - "^\\(uname.*\\|osversion\\):\\s-+" file-begin t)) - (if (and file-begin last-configure) - (delete-region file-begin last-configure)))) + (let (file-begin last-configure) + (insert "> Contents of " + build-report-installation-file + ":\n") + (insert + (format + "> (Output from %s of ./configure)\n\n" + (if all "all runs" "most recent run"))) + (if (featurep 'mime-setup) + (progn + (mime-edit-insert-tag + "text" + "plain" + (concat + "\nContent-Disposition: attachment;" + " filename=\"" + (file-name-nondirectory + build-report-installation-file) + "\"")) + (mime-edit-insert-binary-file + build-report-installation-file + build-report-file-encoding) + (setq file-begin (mime-edit-content-beginning))) + (setq file-begin (point)) + (insert-file-contents + build-report-installation-file)) + (unless all + (setq last-configure + (search-backward-regexp + "^\\(uname.*\\|osversion\\|OS\\):\\s-+" file-begin t)) + (if (and file-begin last-configure) + (delete-region file-begin last-configure)))) (insert "> " build-report-installation-file - " does not exist!\n\n")) + " does not exist!\n\n")) (buffer-string))) (defun build-report-keep () - "build-report-internal function of no general value." + "Concatenate elements of `build-report-keep-regexp' and a general +MIME tag REGEXP. The result is a REGEXP string matching either of the +REGEXPs in `build-report-keep-regexp' or a general MIME tag REGEXP." (mapconcat #'identity - (cons "^--\\[\\[\\|\\]\\]$" build-report-keep-regexp) "\\|")) + (cons "^--\\[\\[\\|\\]\\]$" build-report-keep-regexp) "\\|")) (defun build-report-delete () - "build-report-internal function of no general value." - (mapconcat #'identity - build-report-delete-regexp "\\|")) + "Concatenate elements of `build-report-delete-regexp' and a general +MIME tag REGEXP. The result is a REGEXP string matching either of the +REGEXPs in `build-report-delete-regexp' or a general MIME tag REGEXP." + (mapconcat '(lambda (item) item) + build-report-delete-regexp "\\|")) + +(defun build-report-installation-data (&optional file) + "Return a list of XEmacs installation data containing MAJOR_NUMBER +MINOR_NUMBER BETA_STRING CODENAME CONFIGURATION SRCDIR from FILE, +which defaults to `build-report-installation-file'." + (interactive "fInstallation file: ") + (unless file + (setq file build-report-installation-file)) + (let + (major minor beta codename configuration srcdir) + (save-window-excursion + (find-file-read-only file) + (goto-char (point-min)) + (while (< (point) (point-max)) + (cond + ((looking-at build-report-installation-version-regexp) + (goto-char (match-end 0)) + (setq major (match-string 1)) + (setq minor (match-string 2)) + (setq beta (match-string 3)) + (setq codename (match-string 6)) + (setq configuration (match-string 7))) + ((looking-at build-report-installation-srcdir-regexp) + (goto-char (match-end 0)) + (setq srcdir (match-string 1))) + ;; We avoid matching a potentially zero-length string to avoid + ;; infinite looping. + ((looking-at + "^.+$") + (goto-char (match-end 0))) + ((looking-at "\n") + (goto-char (match-end 0))))) + (values major minor (or beta "") codename configuration srcdir)))) + +(defun build-report-version-file-data (&optional file) + "Return a list of XEmacs version information containing +MAJOR_NUMBER MINOR_NUMBER BETA_STRING CODENAME from FILE, which +defaults to `build-report-version-file'." + (interactive "fversion.sh file: ") + (unless file + (setq file build-report-version-file)) + (let + (major minor beta codename) + (save-window-excursion + (find-file-read-only file) + (goto-char (point-min)) + (while (< (point) (point-max)) + (cond + ((looking-at build-report-version-file-regexp) + (goto-char (match-end 0)) + (setq major (match-string 1)) + (setq minor (match-string 2)) + (setq beta (match-string 3)) + (setq codename (match-string 4))) + ;; We avoid matching a potentially zero-length string to avoid + ;; infinite looping. + ((looking-at + "^.+$") + (goto-char (match-end 0))) + ((looking-at "\n") + (goto-char (match-end 0))))) + (values major minor (or beta "") codename)))) ;;; build-report.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/byte-optimize.el --- a/lisp/byte-optimize.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/byte-optimize.el Mon Aug 13 11:35:02 2007 +0200 @@ -473,6 +473,10 @@ (byte-compile-log " all subforms of %s called for effect; deleted" form)) (and backwards + ;; Now optimize the rest of the forms. We need the return + ;; values. We already did the car. + (setcdr backwards + (mapcar 'byte-optimize-form (cdr backwards))) (cons fn (nreverse backwards)))) (cons fn (mapcar 'byte-optimize-form (cdr form))))) @@ -699,33 +703,37 @@ (setq form (byte-optimize-delay-constants-math form 1 '+)) (if (memq 0 form) (setq form (delq 0 (copy-sequence form)))) ;;(setq form (byte-optimize-associative-two-args-math form)) + (case (length (cdr form)) - ((0) + ((0) ; (+) (condition-case () (eval form) (error form))) - ;; `add1' and `sub1' are a marginally fewer instructions - ;; than `plus' and `minus', so use them when possible. - ((2) - (cond - ((eq (nth 1 form) 1) `(1+ ,(nth 2 form))) ; (+ 1 x) --> (1+ x) - ((eq (nth 2 form) 1) `(1+ ,(nth 1 form))) ; (+ x 1) --> (1+ x) - ((eq (nth 1 form) -1) `(1- ,(nth 2 form))) ; (+ -1 x) --> (1- x) - ((eq (nth 2 form) -1) `(1- ,(nth 1 form))) ; (+ x -1) --> (1- x) - (t form))) + ;; It is not safe to delete the function entirely + ;; (actually, it would be safe if we knew the sole arg + ;; is not a marker). + ;; ((1) + ;; (nth 1 form)) - ;; It is not safe to delete the function entirely - ;; (actually, it would be safe if we know the sole arg - ;; is not a marker). - ;; ((null (cdr (cdr form))) (nth 1 form)) - (t form))) + ((2) ; (+ x y) + (byte-optimize-predicate + (cond + ;; `add1' and `sub1' are a marginally fewer instructions + ;; than `plus' and `minus', so use them when possible. + ((eq (nth 1 form) 1) `(1+ ,(nth 2 form))) ; (+ 1 x) --> (1+ x) + ((eq (nth 2 form) 1) `(1+ ,(nth 1 form))) ; (+ x 1) --> (1+ x) + ((eq (nth 1 form) -1) `(1- ,(nth 2 form))) ; (+ -1 x) --> (1- x) + ((eq (nth 2 form) -1) `(1- ,(nth 1 form))) ; (+ x -1) --> (1- x) + (t form)))) + + (t (byte-optimize-predicate form)))) (defun byte-optimize-minus (form) ;; Put constants at the end, except the last constant. (setq form (byte-optimize-delay-constants-math form 2 '+)) - ;; Now only first and last element can be a number. - (let ((last (car (reverse (nthcdr 3 form))))) + ;; Now only first and last element can be an integer. + (let ((last (last (nthcdr 3 form)))) (cond ((eq 0 last) ;; (- x y ... 0) --> (- x y ...) (setq form (copy-sequence form)) @@ -735,54 +743,55 @@ (numberp last)) (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form)) (delq last (copy-sequence (nthcdr 3 form)))))))) - (setq form -;;; It is not safe to delete the function entirely -;;; (actually, it would be safe if we know the sole arg -;;; is not a marker). -;;; (if (eq (nth 2 form) 0) -;;; (nth 1 form) ; (- x 0) --> x - (byte-optimize-predicate - (if (and (null (cdr (cdr (cdr form)))) - (eq (nth 1 form) 0)) ; (- 0 x) --> (- x) - (cons (car form) (cdr (cdr form))) - form)) -;;; ) - ) + + (case (length (cdr form)) + ((0) ; (-) + (condition-case () + (eval form) + (error form))) - ;; `add1' and `sub1' are a marginally fewer instructions than `plus' - ;; and `minus', so use them when possible. - (cond ((and (null (nthcdr 3 form)) - (eq (nth 2 form) 1)) - (list '1- (nth 1 form))) ; (- x 1) --> (1- x) - ((and (null (nthcdr 3 form)) - (eq (nth 2 form) -1)) - (list '1+ (nth 1 form))) ; (- x -1) --> (1+ x) - (t - form)) - ) + ;; It is not safe to delete the function entirely + ;; (actually, it would be safe if we knew the sole arg + ;; is not a marker). + ;; ((1) + ;; (nth 1 form) + + ((2) ; (+ x y) + (byte-optimize-predicate + (cond + ;; `add1' and `sub1' are a marginally fewer instructions than `plus' + ;; and `minus', so use them when possible. + ((eq (nth 2 form) 1) `(1- ,(nth 1 form))) ; (- x 1) --> (1- x) + ((eq (nth 2 form) -1) `(1+ ,(nth 1 form))) ; (- x -1) --> (1+ x) + ((eq (nth 1 form) 0) `(- ,(nth 2 form))) ; (- 0 x) --> (- x) + (t form)))) + + (t (byte-optimize-predicate form)))) (defun byte-optimize-multiply (form) (setq form (byte-optimize-delay-constants-math form 1 '*)) - ;; If there is a constant in FORM, it is now the last element. + ;; If there is a constant integer in FORM, it is now the last element. (cond ((null (cdr form)) 1) ;;; It is not safe to delete the function entirely ;;; (actually, it would be safe if we know the sole arg ;;; is not a marker or if it appears in other arithmetic). ;;; ((null (cdr (cdr form))) (nth 1 form)) - ((let ((last (car (reverse form)))) - (cond ((eq 0 last) (cons 'progn (cdr form))) - ((eq 1 last) (delq 1 (copy-sequence form))) - ((eq -1 last) (list '- (delq -1 (copy-sequence form)))) - ((and (eq 2 last) - (memq t (mapcar 'symbolp (cdr form)))) - (prog1 (setq form (delq 2 (copy-sequence form))) - (while (not (symbolp (car (setq form (cdr form)))))) - (setcar form (list '+ (car form) (car form))))) - (form)))))) + ((let ((last (last form))) + (byte-optimize-predicate + (cond ((eq 0 last) (cons 'progn (cdr form))) + ((eq 1 last) (delq 1 (copy-sequence form))) + ((eq -1 last) (list '- (delq -1 (copy-sequence form)))) + ((and (eq 2 last) + (memq t (mapcar 'symbolp (cdr form)))) + (prog1 (setq form (delq 2 (copy-sequence form))) + (while (not (symbolp (car (setq form (cdr form)))))) + (setcar form (list '+ (car form) (car form))))) + (form))))))) (defun byte-optimize-divide (form) (setq form (byte-optimize-delay-constants-math form 2 '*)) - (let ((last (car (reverse (cdr (cdr form)))))) + ;; If there is a constant integer in FORM, it is now the last element. + (let ((last (last (cdr (cdr form))))) (if (numberp last) (cond ((= (length form) 3) (if (and (numberp (nth 1 form)) @@ -801,13 +810,13 @@ (cond ;;; ((null (cdr (cdr form))) ;;; (nth 1 form)) - ((eq (nth 1 form) 0) - (append '(progn) (cdr (cdr form)) '(0))) - ((eq last -1) - (list '- (if (nthcdr 3 form) - (butlast form) - (nth 1 form)))) - (form)))) + ((eq (nth 1 form) 0) + (append '(progn) (cdr (cdr form)) '(0))) + ((eq last -1) + (list '- (if (nthcdr 3 form) + (butlast form) + (nth 1 form)))) + (form)))) (defun byte-optimize-logmumble (form) (setq form (byte-optimize-delay-constants-math form 1 (car form))) @@ -1219,9 +1228,7 @@ ;; fetch and return the offset for the current opcode. ;; return NIL if this opcode has no offset ;; OP, PTR and BYTES are used and set dynamically - (defvar op) - (defvar ptr) - (defvar bytes) + (declare (special op ptr bytes)) (cond ((< op byte-nth) (let ((tem (logand op 7))) (setq op (logand op 248)) @@ -1455,9 +1462,10 @@ (defun byte-optimize-lapcode (lap &optional for-effect) "Simple peephole optimizer. LAP is both modified and returned." - (let (lap0 ;; off0 unused - lap1 ;; off1 - lap2 ;; off2 + (let (lap0 + lap1 + lap2 + variable-frequency (keep-going 'first-time) (add-depth 0) rest tmp tmp2 tmp3 @@ -1903,28 +1911,29 @@ ;; Rebuild byte-compile-constants / byte-compile-variables. ;; Simple optimizations that would inhibit other optimizations if they ;; were done in the optimizing loop, and optimizations which there is no - ;; need to do more than once. + ;; need to do more than once. (setq byte-compile-constants nil - byte-compile-variables nil) + byte-compile-variables nil + variable-frequency (make-hash-table :test 'eq)) (setq rest lap) (while rest (setq lap0 (car rest) lap1 (nth 1 rest)) - (if (memq (car lap0) byte-constref-ops) - (if (eq (cdr lap0) 'byte-constant) - (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))))) + (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)))) (cond (;; - ;; const-C varset-X const-C --> const-C dup varset-X + ;; const-C varset-X const-C --> const-C dup varset-X ;; const-C varbind-X const-C --> const-C dup varbind-X ;; (and (eq (car lap0) 'byte-constant) (eq (car (nth 2 rest)) 'byte-constant) - (eq (cdr lap0) (car (nth 2 rest))) + (eq (cdr lap0) (cdr (nth 2 rest))) (memq (car lap1) '(byte-varbind byte-varset))) (byte-compile-log-lap " %s %s %s\t-->\t%s dup %s" lap0 lap1 lap0 lap0 lap1) @@ -1960,6 +1969,21 @@ (setcdr lap1 (+ (cdr lap1) (cdr lap0)))) ) (setq rest (cdr rest))) + ;; Since the first 6 entries of the compiled-function constants + ;; vector are most efficient for varref/set/bind ops, we sort by + ;; reference count. This generates maximally space efficient and + ;; pretty time-efficient byte-code. See `byte-compile-constants-vector'. + (setq byte-compile-variables + (sort byte-compile-variables + #'(lambda (v1 v2) + (< (gethash v1 variable-frequency) + (gethash v2 variable-frequency))))) + ;; Another hack - put the most used variable in position 6, for + ;; better locality of reference with adjoining constants. + (let ((tail (last byte-compile-variables 6))) + (setq byte-compile-variables + (append (nbutlast byte-compile-variables 6) + (nreverse tail)))) (setq byte-compile-maxdepth (+ byte-compile-maxdepth add-depth))) lap) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/bytecomp.el --- a/lisp/bytecomp.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/bytecomp.el Mon Aug 13 11:35:02 2007 +0200 @@ -3,13 +3,14 @@ ;;; Copyright (C) 1985-1987, 1991-1994 Free Software Foundation, Inc. ;;; Copyright (C) 1996 Ben Wing. -;; Author: Jamie Zawinski +;; Authors: Jamie Zawinski ;; Hallvard Furuseth -;; Keywords: internal - -;; Subsequently modified by RMS and others. - -(defconst byte-compile-version (purecopy "2.26 XEmacs; 1998-10-07.")) +;; Ben Wing +;; Martin Buchholz +;; Richard Stallman +;; Keywords: internal lisp + +(defconst byte-compile-version (purecopy "2.27 XEmacs; 2000-09-12.")) ;; This file is part of XEmacs. @@ -33,8 +34,15 @@ ;;; Commentary: ;; The Emacs Lisp byte compiler. This crunches lisp source into a -;; sort of p-code which takes up less space and can be interpreted -;; faster. The user entry points are byte-compile-file, +;; sort of p-code (`bytecode') which takes up less space and can be +;; interpreted faster. First, the source code forms are converted to +;; an intermediate form, `lapcode' [`LAP' == `Lisp Assembly Program'] +;; which is much easier to manipulate than bytecode. Then the lapcode +;; is converted to bytecode, which can be considered to be actual +;; machine language. Optimizations can occur at either the source +;; level or the lapcode level. + +;; The user entry points are byte-compile-file, ;; byte-recompile-directory and byte-compile-buffer. ;;; Code: @@ -938,7 +946,9 @@ (concat "!! " (format (if (cdr error-info) "%s (%s)" "%s") (get (car error-info) 'error-message) - (prin1-to-string (cdr error-info)))))) + (prin1-to-string (cdr error-info))))) + (if stack-trace-on-error + (backtrace nil t))) ;;; Used by make-obsolete. (defun byte-compile-obsolete (form) @@ -1320,11 +1330,11 @@ (point-max byte-compile-log-buffer)))) (unwind-protect - (condition-case error-info - (progn ,@body) - (error - (byte-compile-report-error error-info))) - + (call-with-condition-handler + #'(lambda (error-info) + (byte-compile-report-error error-info)) + #'(lambda () + (progn ,@body))) ;; Always set point in log to start of interesting output. (with-current-buffer byte-compile-log-buffer (let ((show-begin @@ -1355,7 +1365,7 @@ "Recompile every `.el' file in DIRECTORY that already has a `.elc' file. Files in subdirectories of DIRECTORY are processed also." (interactive "DByte force recompile (directory): ") - (byte-recompile-directory directory nil t)) + (byte-recompile-directory directory nil nil t)) ;;;###autoload (defun byte-recompile-directory (directory &optional arg norecursion force) @@ -1986,12 +1996,14 @@ ;; No doc string, so we can compile this as a normal form. (byte-compile-keep-pending form 'byte-compile-normal-call))) -(put 'defvar 'byte-hunk-handler 'byte-compile-file-form-defvar) -(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar) -(defun byte-compile-file-form-defvar (form) +(put 'defvar 'byte-hunk-handler 'byte-compile-file-form-defvar-or-defconst) +(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar-or-defconst) +(defun byte-compile-file-form-defvar-or-defconst (form) + ;; (defvar|defconst VAR [VALUE [DOCSTRING]]) (if (> (length form) 4) - (byte-compile-warn "%s used with too many args (%s)" - (car form) (nth 1 form))) + (byte-compile-warn + "%s %s called with %d arguments, but accepts only %s" + (car form) (nth 1 form) (length (cdr form)) 3)) (if (and (> (length form) 3) (not (stringp (nth 3 form)))) (byte-compile-warn "Third arg to %s %s is not a string: %s" (car form) (nth 1 form) (nth 3 form))) @@ -3711,7 +3723,8 @@ (byte-defop-compiler-1 defun) (byte-defop-compiler-1 defmacro) (byte-defop-compiler-1 defvar) -(byte-defop-compiler-1 defconst byte-compile-defvar) +(byte-defop-compiler-1 defvar byte-compile-defvar-or-defconst) +(byte-defop-compiler-1 defconst byte-compile-defvar-or-defconst) (byte-defop-compiler-1 autoload) ;; According to Mly this can go now that lambda is a macro ;(byte-defop-compiler-1 lambda byte-compile-lambda-form) @@ -3739,32 +3752,38 @@ (list 'quote (cons 'macro (eval code)))))) (list 'quote (nth 1 form))))) -(defun byte-compile-defvar (form) - ;; This is not used for file-level defvar/consts with doc strings: - ;; byte-compile-file-form-defvar will be used in that case. - (let ((var (nth 1 form)) +(defun byte-compile-defvar-or-defconst (form) + ;; This is not used for file-level defvar/defconsts with doc strings: + ;; byte-compile-file-form-defvar-or-defconst will be used in that case. + ;; (defvar|defconst VAR [VALUE [DOCSTRING]]) + (let ((fun (nth 0 form)) + (var (nth 1 form)) (value (nth 2 form)) (string (nth 3 form))) - (if (> (length form) 4) - (byte-compile-warn "%s used with too many args" (car form))) - (if (memq 'free-vars byte-compile-warnings) - (setq byte-compile-bound-variables - (cons (cons var byte-compile-global-bit) - byte-compile-bound-variables))) + (when (> (length form) 4) + (byte-compile-warn + "%s %s called with %d arguments, but accepts only %s" + fun var (length (cdr form)) 3)) + (when (memq 'free-vars byte-compile-warnings) + (push (cons var byte-compile-global-bit) byte-compile-bound-variables)) (byte-compile-body-do-effect - (list (if (cdr (cdr form)) - (if (eq (car form) 'defconst) - (list 'setq var value) - (list 'or (list 'boundp (list 'quote var)) - (list 'setq var value)))) - ;; Put the defined variable in this library's load-history entry - ;; just as a real defvar would. - (list 'setq 'current-load-list - (list 'cons (list 'quote var) - 'current-load-list)) - (if string - (list 'put (list 'quote var) ''variable-documentation string)) - (list 'quote var))))) + (list + ;; Put the defined variable in this library's load-history entry + ;; just as a real defvar would, but only in top-level forms. + (when (null byte-compile-current-form) + `(push ',var current-load-list)) + (when (> (length form) 3) + (when (and string (not (stringp string))) + (byte-compile-warn "Third arg to %s %s is not a string: %s" + fun var string)) + `(put ',var 'variable-documentation ,string)) + (if (cdr (cdr form)) ; `value' provided + (if (eq fun 'defconst) + ;; `defconst' sets `var' unconditionally. + `(setq ,var ,value) + ;; `defvar' sets `var' only when unbound. + `(if (not (boundp ',var)) (setq ,var ,value)))) + `',var)))) (defun byte-compile-autoload (form) (and (byte-compile-constp (nth 1 form)) @@ -4037,27 +4056,42 @@ (error "`batch-byte-compile' is to be used only with -batch")) (let ((error nil)) (while command-line-args-left - (if (file-directory-p (expand-file-name (car command-line-args-left))) - (let ((files (directory-files (car command-line-args-left))) - source dest) - (while files - (if (and (string-match emacs-lisp-file-regexp (car files)) - (not (auto-save-file-name-p (car files))) - (setq source (expand-file-name - (car files) - (car command-line-args-left))) - (setq dest (byte-compile-dest-file source)) - (file-exists-p dest) - (file-newer-than-file-p source dest)) - (if (null (batch-byte-compile-1 source)) - (setq error t))) - (setq files (cdr files)))) - (if (null (batch-byte-compile-1 (car command-line-args-left))) - (setq error t))) - (setq command-line-args-left (cdr command-line-args-left))) + (if (null (batch-byte-compile-one-file)) + (setq error t))) (message "Done") (kill-emacs (if error 1 0)))) +;;;###autoload +(defun batch-byte-compile-one-file () + "Run `byte-compile-file' on a single file remaining on the command line. +Use this from the command line, with `-batch'; +it won't work in an interactive Emacs." + ;; command-line-args-left is what is left of the command line (from + ;; startup.el) + (defvar command-line-args-left) ;Avoid 'free variable' warning + (if (not noninteractive) + (error "`batch-byte-compile-one-file' is to be used only with -batch")) + (let (error + (file-to-process (car command-line-args-left))) + (setq command-line-args-left (cdr command-line-args-left)) + (if (file-directory-p (expand-file-name file-to-process)) + (let ((files (directory-files file-to-process)) + source dest) + (while files + (if (and (string-match emacs-lisp-file-regexp (car files)) + (not (auto-save-file-name-p (car files))) + (setq source (expand-file-name + (car files) + file-to-process)) + (setq dest (byte-compile-dest-file source)) + (file-exists-p dest) + (file-newer-than-file-p source dest)) + (if (null (batch-byte-compile-1 source)) + (setq error t))) + (setq files (cdr files))) + (null error)) + (batch-byte-compile-1 file-to-process)))) + (defun batch-byte-compile-1 (file) (condition-case err (progn (byte-compile-file file) t) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cl-compat.el --- a/lisp/cl-compat.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cl-compat.el Mon Aug 13 11:35:02 2007 +0200 @@ -56,8 +56,10 @@ (defmacro defkeyword (x &optional doc) (list* 'defconst x (list 'quote x) (and doc (list doc)))) -(defun keywordp (sym) - (and (symbolp sym) (eq (aref (symbol-name sym) 0) ?\:) (set sym sym))) +;; XEmacs change. +;; We have built-in function. +;;(defun keywordp (sym) +;; (and (symbolp sym) (eq (aref (symbol-name sym) 0) ?\:) (set sym sym))) (defun keyword-of (sym) (or (keywordp sym) (keywordp (intern (format ":%s" sym))))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cl-extra.el --- a/lisp/cl-extra.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cl-extra.el Mon Aug 13 11:35:02 2007 +0200 @@ -638,12 +638,7 @@ ;; XEmacs: our `get' groks DEFAULT. (defalias 'get* 'get) - -(defun getf (plist property &optional default) - "Search PLIST for property PROPERTY; return its value or DEFAULT. -PLIST is a list of the sort returned by `symbol-plist'." - (setplist '--cl-getf-symbol-- plist) - (get '--cl-getf-symbol-- property default)) +(defalias 'getf 'plist-get) (defun cl-set-getf (plist tag val) (let ((p plist)) @@ -655,17 +650,6 @@ (while (and (cdr p) (not (eq (car (cdr p)) tag))) (setq p (cdr (cdr p)))) (and (cdr p) (progn (setcdr p (cdr (cdr (cdr p)))) t)))) -(defun cl-remprop (sym tag) - "Remove from SYMBOL's plist the property PROP and its value." - (let ((plist (symbol-plist sym))) - (if (and plist (eq tag (car plist))) - (progn (setplist sym (cdr (cdr plist))) t) - (cl-do-remf plist tag)))) -(or (and (fboundp 'remprop) (subrp (symbol-function 'remprop))) - (defalias 'remprop 'cl-remprop)) - - - ;;; Hash tables. ;; The `regular' Common Lisp hash-table stuff has been moved into C. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cl-macs.el --- a/lisp/cl-macs.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cl-macs.el Mon Aug 13 11:35:02 2007 +0200 @@ -81,7 +81,7 @@ #'(lambda (n p f) (list 'put (list 'quote n) (list 'quote p) (list 'function (cons 'lambda f)))))) - (car (or features (setq features (list 'cl-kludge)))))) + 'xemacs)) ;;; Initialization. @@ -106,31 +106,6 @@ (run-hooks 'cl-hack-bytecomp-hook)) -;;; Symbols. - -(defvar *gensym-counter*) - -;;;###autoload -(defun gensym (&optional arg) - "Generate a new uninterned symbol. -The name is made by appending a number to PREFIX, default \"G\"." - (let ((prefix (if (stringp arg) arg "G")) - (num (if (integerp arg) arg - (prog1 *gensym-counter* - (setq *gensym-counter* (1+ *gensym-counter*)))))) - (make-symbol (format "%s%d" prefix num)))) - -;;;###autoload -(defun gentemp (&optional arg) - "Generate a new interned symbol with a unique name. -The name is made by appending a number to PREFIX, default \"G\"." - (let ((prefix (if (stringp arg) arg "G")) - name) - (while (intern-soft (setq name (format "%s%d" prefix *gensym-counter*))) - (setq *gensym-counter* (1+ *gensym-counter*))) - (intern name))) - - ;;; Program structure. ;;;###autoload @@ -1438,10 +1413,10 @@ (cond ((eq (car-safe spec) 'special) (if (boundp 'byte-compile-bound-variables) (setq byte-compile-bound-variables - ;; todo: this should compute correct binding bits vs. 0 - (append (mapcar #'(lambda (v) (cons v 0)) - (cdr spec)) - byte-compile-bound-variables)))) + (append + (mapcar #'(lambda (v) (cons v byte-compile-global-bit)) + (cdr spec)) + byte-compile-bound-variables)))) ((eq (car-safe spec) 'inline) (while (setq spec (cdr spec)) @@ -1794,6 +1769,7 @@ (defsetf x-get-cut-buffer x-store-cut-buffer t) ; groan. (defsetf x-get-secondary-selection x-own-secondary-selection t) (defsetf x-get-selection x-own-selection t) +(defsetf get-selection own-selection t) ;;; More complex setf-methods. ;;; These should take &environment arguments, but since full arglists aren't @@ -2747,6 +2723,9 @@ (define-compiler-macro get* (sym prop &optional default) (list 'get sym prop default)) +(define-compiler-macro getf (sym prop &optional default) + (list 'plist-get sym prop default)) + (define-compiler-macro typep (&whole form val type) (if (cl-const-expr-p type) (let ((res (cl-make-type-test val (cl-const-expr-val type)))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cl-seq.el --- a/lisp/cl-seq.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cl-seq.el Mon Aug 13 11:35:02 2007 +0200 @@ -65,6 +65,23 @@ ;;; this file independent from cl-macs. (defmacro cl-parsing-keywords (kwords other-keys &rest body) + "Helper macro for functions with keyword arguments. +This is a temporary solution, until keyword arguments are natively supported. +Declare your function ending with (... &rest cl-keys), then wrap the +function body in a call to `cl-parsing-keywords'. + +KWORDS is a list of keyword definitions. Each definition should be +either a keyword or a list (KEYWORD DEFAULT-VALUE). In the former case, +the default value is nil. The keywords are available in BODY as the name +of the keyword, minus its initial colon and prepended with `cl-'. + +OTHER-KEYS specifies other keywords that are accepted but ignored. It +is either the value 't' (ignore all other keys, equivalent to the +&allow-other-keys argument declaration in Common Lisp) or a list in the +same format as KWORDS. If keywords are given that are not in KWORDS +and not allowed by OTHER-KEYS, an error will normally be signalled; but +the caller can override this by specifying a non-nil value for the +keyword :allow-other-keys (which defaults to t)." (cons 'let* (cons (mapcar @@ -338,7 +355,7 @@ (remove* cl-item cl-seq ':test 'equal)) (defun remq (cl-elt cl-list) - "Remove all occurances of ELT in LIST, comparing with `eq'. + "Remove all occurrences of ELT in LIST, comparing with `eq'. This is a non-destructive function; it makes a copy of LIST to avoid corrupting the original LIST. Also see: `delq', `delete', `delete*', `remove', `remove*'." diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cl.el --- a/lisp/cl.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cl.el Mon Aug 13 11:35:02 2007 +0200 @@ -269,7 +269,7 @@ Otherwise, the macro is expanded and the expansion is considered in place of FORM. When a non-macro-call results, it is returned. -The second optional arg ENVIRONMENT species an environment of macro +The second optional arg ENVIRONMENT specifies an environment of macro definitions to shadow the loaded ones for use in file byte-compilation." (let ((cl-macro-environment cl-env)) (while (progn (setq cl-macro (funcall cl-old-macroexpand cl-macro cl-env)) @@ -317,6 +317,23 @@ (defvar *gensym-counter* (* (logand (cl-random-time) 1023) 100)) +(defun gensym (&optional arg) + "Generate a new uninterned symbol. +The name is made by appending a number to PREFIX, default \"G\"." + (let ((prefix (if (stringp arg) arg "G")) + (num (if (integerp arg) arg + (prog1 *gensym-counter* + (setq *gensym-counter* (1+ *gensym-counter*)))))) + (make-symbol (format "%s%d" prefix num)))) + +(defun gentemp (&optional arg) + "Generate a new interned symbol with a unique name. +The name is made by appending a number to PREFIX, default \"G\"." + (let ((prefix (if (stringp arg) arg "G")) + name) + (while (intern-soft (setq name (format "%s%d" prefix *gensym-counter*))) + (setq *gensym-counter* (1+ *gensym-counter*))) + (intern name))) ;;; Numbers. @@ -733,6 +750,8 @@ (defun cl-hack-byte-compiler () (if (and (not cl-hacked-flag) (fboundp 'byte-compile-file-form)) (progn + (when (not (fboundp 'cl-compile-time-init)) + (load "cl-macs" nil t)) (cl-compile-time-init) ; in cl-macs.el (setq cl-hacked-flag t)))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cleantree.el --- a/lisp/cleantree.el Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -;;; cleantree.el --- Remove out of date .elcs in lisp directories - -;; Copyright (C) 1997 by Free Software Foundation, Inc. - -;; Author: Steven L Baur -;; 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 code is derived from Gnus based on a suggestion by -;; David Moore - -;;; Code: - -(defun remove-old-elc-1 (dir &optional seen) - (setq dir (file-name-as-directory dir)) - ;; Only scan this sub-tree if we haven't been here yet. - (unless (member (file-truename dir) seen) - (push (file-truename dir) seen) - ;; 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) '("." ".."))) - (file-directory-p dir)) - (remove-old-elc-1 dir seen)))) - ;; Do this directory. - (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 file-c) - (delete-file file-c)))))) - -;;;###autoload -(defun batch-remove-old-elc () - (defvar command-line-args-left) - (unless noninteractive - (error "`batch-remove-old-elc' is to be used only with -batch")) - (let ((dir (car command-line-args-left))) - (message "Cleaning out of date .elcs in directory `%s'..." dir) - (remove-old-elc-1 dir) - (message "Cleaning out of date .elcs in directory `%s'...done" dir)) - (setq command-line-args-left nil)) - -;;; cleantree.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cmdloop.el --- a/lisp/cmdloop.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cmdloop.el Mon Aug 13 11:35:02 2007 +0200 @@ -130,9 +130,10 @@ :group 'editing-basics) (defun command-error (error-object) - (let ((inhibit-quit t) - (debug-on-error nil) - (etype (car-safe error-object))) + (let* ((old-debug-on-error debug-on-error) + (inhibit-quit t) + (debug-on-error nil) + (etype (car-safe error-object))) (setq quit-flag nil) (setq standard-output t) (setq standard-input t) @@ -161,7 +162,12 @@ (if (noninteractive) (progn - (message "%s exiting." emacs-program-name) + (if old-debug-on-error + (progn + (message "Backtrace:\n\n") + (backtrace) + (message "\n"))) + (message "%s exiting\n." emacs-program-name) (kill-emacs -1))) t)) @@ -456,9 +462,28 @@ (sleep-for 2)))) ans))) -;; these may be redefined later, but make the original def easily encapsulable -(define-function 'yes-or-no-p 'yes-or-no-p-minibuf) -(define-function 'y-or-n-p 'y-or-n-p-minibuf) +(defun yes-or-no-p (prompt) + "Ask user a yes-or-no question. Return t if answer is yes. +The question is asked with a dialog box or the minibuffer, as appropriate. +Takes one argument, which is the string to display to ask the question. +It should end in a space; `yes-or-no-p' adds `(yes or no) ' to it. +The user must confirm the answer with RET, +and can edit it until it as been confirmed." + (if (should-use-dialog-box-p) + (yes-or-no-p-dialog-box prompt) + (yes-or-no-p-minibuf prompt))) + +(defun y-or-n-p (prompt) + "Ask user a \"y or n\" question. Return t if answer is \"y\". +Takes one argument, which is the string to display to ask the question. +The question is asked with a dialog box or the minibuffer, as appropriate. +It should end in a space; `y-or-n-p' adds `(y or n) ' to it. +No confirmation of the answer is requested; a single character is enough. +Also accepts Space to mean yes, or Delete to mean no." + (if (should-use-dialog-box-p) + (yes-or-no-p-dialog-box prompt) + (y-or-n-p-minibuf prompt))) + (defun read-char () diff -r 72a7cfa4a488 -r abe6d1db359e lisp/code-files.el --- a/lisp/code-files.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/code-files.el Mon Aug 13 11:35:02 2007 +0200 @@ -68,7 +68,13 @@ ("TUTORIAL\\.\\(?:hr\\|pl\\|ro\\)\\'" . iso-8859-2) ;; ("\\.\\(el\\|emacs\\|info\\(-[0-9]+\\)?\\|texi\\)$" . iso-2022-8) ;; ("\\(ChangeLog\\|CHANGES-beta\\)$" . iso-2022-8) - ("/spool/mail/.*$" . convert-mbox-coding-system)) + + ;; This idea is totally broken, and the code didn't work anyway. + ;; Mailboxes should be decoded by mail clients, who actually know + ;; how to deal with them. Otherwise, their contents should be + ;; treated as `binary'. + ;("/spool/mail/.*$" . convert-mbox-coding-system) + ) "Alist to decide a coding system to use for a file I/O operation. The format is ((PATTERN . VAL) ...), where PATTERN is a regular expression matching a file name, @@ -191,22 +197,12 @@ ((find-coding-system codesys)) )))) -(defun convert-mbox-coding-system (filename visit start end) - "Decoding function for Unix mailboxes. -Does separate detection and decoding on each message, since each -message might be in a different encoding." - (let ((buffer-read-only nil)) - (save-restriction - (narrow-to-region start end) - (goto-char (point-min)) - (while (not (eobp)) - (let ((start (point)) - end) - (forward-char 1) - (if (re-search-forward "^From" nil 'move) - (beginning-of-line)) - (setq end (point)) - (decode-coding-region start end 'undecided)))))) +;; This is completely broken, not only in implementation (does not +;; understand MIME), but in concept -- such high-level decoding should +;; be done by mail readers, not by IO code! + +;(defun convert-mbox-coding-system (filename visit start end) +;... (defun find-coding-system-magic-cookie () "Look for the coding-system magic cookie in the current buffer.\n" @@ -555,9 +551,4 @@ start end filename append visit lockname coding-system))) -;;; The following was all that remained in mule-files.el, so I moved it -;;; here for neatness. -sb -(when (featurep 'mule) - (setq-default buffer-file-coding-system 'iso-2022-8)) - ;;; code-files.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/code-process.el --- a/lisp/code-process.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/code-process.el Mon Aug 13 11:35:02 2007 +0200 @@ -125,6 +125,9 @@ (cond ((consp ret) (setq cs-r (car ret) cs-w (cdr ret))) + ((null ret) + (setq cs-r buffer-file-coding-system + cs-w buffer-file-coding-system)) ((find-coding-system ret) (setq cs-r ret cs-w ret)))) @@ -208,7 +211,7 @@ (Transmission Control Protocol) and 'udp (User Datagram Protocol) are supported. When omitted, 'tcp is assumed. -Ouput via `process-send-string' and input via buffer or filter (see +Output via `process-send-string' and input via buffer or filter (see `set-process-filter') are stream-oriented. That means UDP datagrams are not guaranteed to be sent and received in discrete packets. (But small datagrams around 500 bytes that are not truncated by `process-send-string' diff -r 72a7cfa4a488 -r abe6d1db359e lisp/coding.el --- a/lisp/coding.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/coding.el Mon Aug 13 11:35:02 2007 +0200 @@ -104,6 +104,9 @@ (interactive "zkeyboard-coding-system: ") (get-coding-system coding-system) ; correctness check (setq keyboard-coding-system coding-system) + (if (eq (device-type) 'tty) + (set-console-tty-input-coding-system + (device-console) keyboard-coding-system)) (redraw-modeline t)) (defsubst terminal-coding-system () @@ -117,7 +120,8 @@ (setq terminal-coding-system coding-system) ; #### should this affect all current tty consoles ? (if (eq (device-type) 'tty) - (set-console-tty-coding-system (device-console) terminal-coding-system)) + (set-console-tty-output-coding-system + (device-console) terminal-coding-system)) (redraw-modeline t)) (defun set-pathname-coding-system (coding-system) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/compat.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/compat.el Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,198 @@ +;;; compat.el --- Mechanism for non-intrusively providing compatibility funs. + +;; Copyright (C) 2000 Ben Wing. + +;; Author: Ben Wing +;; Maintainer: Ben Wing +;; 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. + +;;; Authorship: + +; Written May 2000 by Ben Wing. + +;;; Commentary: + +;; Typical usage: + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; 1. Wrap modules that define compatibility functions like this: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;(compat-define-group 'fsf-compat) + +;(compat-define-functions 'fsf-compat + +;(defun overlayp (object) +; "Return t if OBJECT is an overlay." +; (and (extentp object) +; (extent-property object 'overlay))) + +;(defun make-overlay (beg end &optional buffer front-advance rear-advance) +; ...) + +;... + +;) ;; end of (compat-define-group 'fsf-compat) + +;;;; overlay.el ends here + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; 2. Wrap modules that use the compatibility functions like this: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;(compat 'fsf-compat + +;(defun random-module-my-fun (bar baz) +; (if (fboundp 'overlays-in) (overlays-in bar baz))) + +;... + +;) ;; end of (compat 'fsf-compat) + +;;;; random-module.el ends here + + +(defun compat-hash-table (group) + (get group 'compat-table)) + +(defun compat-make-hash-table (group) + (put group 'compat-table (make-hash-table))) + +(defmacro compat-define-group (group) + "Define GROUP as a group of compatibility functions. +Individual functions are defined using `compat-define-functions'. +Once defined, the functions can be used by wrapping your code in the +`compat' macro. + +If GROUP is already defined, nothing happens." + (let ((group (eval group))) + (or (hash-table-p (compat-hash-table group)) + (compat-make-hash-table group)))) + +(defmacro compat-clear-functions (group) + "Clear all defined functions and macros out of GROUP." + (let ((group (eval group))) + (clrhash (compat-hash-table group)))) + +(defmacro compat-define-functions (group &rest body) + "Define compatibility functions in GROUP. +You should simply wrap this around the code that defines the functions. +Any functions and macros defined at top level using `defun' or `defmacro' +will be noticed and added to GROUP. Other top-level code will be executed +normally. All code and definitions in this group can safely reference any +other functions in this group -- the code is effectively wrapped in a +`compat' call. You can call `compat-define-functions' more than once, if +necessary, for a single group. + +What actually happens is that the functions and macros defined here are in +fact defined using names prefixed with GROUP. To use these functions, +wrap any calling code with the `compat' macro, which lexically renames +the function and macro calls appropriately." + (let ((group (eval group))) + (let (fundef + (body-tail body)) + (while body-tail + (setq fundef (car body-tail)) + (when (and (consp fundef) (eq (car fundef) 'defun)) + (puthash (second fundef) (third fundef) (compat-hash-table group))) + (when (and (consp fundef) (eq (car fundef) 'defmacro)) + (puthash (second fundef) (third fundef) (compat-hash-table group))) + (setq body-tail (cdr body-tail)))) + (let (fundef + (body-tail body) + result) + (while body-tail + (setq fundef (car body-tail)) + (push + (cond ((and (consp fundef) (eq (car fundef) 'defun)) + (nconc (list 'defun + (intern (concat (symbol-name group) "-" + (symbol-name (second fundef)))) + (third fundef)) + (nthcdr 3 fundef))) + ((and (consp fundef) (eq (car fundef) 'defmacro)) + (nconc (list 'defmacro + (intern (concat (symbol-name group) "-" + (symbol-name (second fundef)))) + (third fundef)) + (nthcdr 3 fundef))) + (t fundef)) + result) + (setq body-tail (cdr body-tail))) + (nconc (list 'compat (list 'quote group)) (nreverse result))))) + +(defvar compat-active-groups nil) + +(defun compat-fboundp (groups fun) + "T if FUN is either `fboundp' or one of the compatibility funs in GROUPS. +GROUPS is a list of compatibility groups as defined using +`compat-define-group'." + (or (fboundp fun) + (block nil + (mapcar #'(lambda (group) + (if (gethash fun (compat-hash-table group)) + (return t))) + groups)))) + +(defmacro compat (group &rest body) + "Make use of compatibility functions and macros in GROUP. +You should simply wrap this around the code that uses the functions +and macros in GROUP. Typically, a call to `compat' should be placed +at the top of an ELisp module, with the closing parenthesis at the +bottom; use this in place of a `require' statement. Wrapped code can +be either function or macro definitions or other ELisp code, and +wrapped function or macro definitions need not be at top level. All +calls to the compatibility functions or macros will be noticed anywhere +within the wrapped code. Calls to `fboundp' within the wrapped code +will also behave correctly when called on compatibility functions and +macros, even though they would return nil elsewhere (including in code +in other modules called dynamically from the wrapped code). + +The functions and macros define in GROUP are actually defined under +prefixed names, to avoid namespace clashes and bad interactions with +other code that calls `fboundp'. All calls inside of the wrapped code +to the compatibility functions and macros in GROUP are lexically +mapped to the prefixed names. Since this is a lexical mapping, code +in other modules that is called by functions in this module will not +be affected." + (let ((group (eval group)) + defs) + (maphash + #'(lambda (fun args) + (push + (list fun args + (nconc + (list 'list + (list 'quote + (intern (concat (symbol-name group) "-" + (symbol-name fun))))) + args)) + defs)) + (compat-hash-table group)) + ;; it would be cleaner to use `lexical-let' instead of `let', but that + ;; causes function definitions to have obnoxious, unreadable junk in + ;; them. #### Move `lexical-let' into C!!! + `(let ((compat-active-groups (cons ',group compat-active-groups))) + (macrolet ((fboundp (fun) `(compat-fboundp ',compat-active-groups ,fun)) + ,@defs) + ,@body)))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cus-dep.el --- a/lisp/cus-dep.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cus-dep.el Mon Aug 13 11:35:02 2007 +0200 @@ -31,7 +31,8 @@ ;;; Commentary: ;; This file generates the custom-load files, loaded by cus-load.el. -;; The only entry point is `Custom-make-dependencies'. +;; Entry points are `Custom-make-dependencies' and +;; `Custom-make-one-dependency'. ;; It works by scanning all the `.el' files in a directory, and ;; evaluates any `defcustom', `defgroup', or `defface' expression that @@ -91,21 +92,7 @@ ;; understand, but is in fact very easy to break. Be sure to read and ;; understand the commentary above! -;;;###autoload -(defun Custom-make-dependencies (&optional subdirs) - "Extract custom dependencies from .el files in SUBDIRS. -SUBDIRS is a list of directories. If it is nil, the command-line -arguments are used. If it is a string, only that directory is -processed. This function is especially useful in batch mode. - -Batch usage: xemacs -batch -l cus-dep.el -f Custom-make-dependencies DIRS" - (interactive "DDirectory: ") - (and (stringp subdirs) - (setq subdirs (list subdirs))) - (or subdirs - ;; Usurp the command-line-args - (setq subdirs command-line-args-left - command-line-args-left nil)) +(defun Custom-make-dependencies-1 (subdirs) (setq subdirs (mapcar #'expand-file-name subdirs)) (with-temp-buffer (let ((enable-local-eval nil) @@ -158,7 +145,8 @@ (with-temp-file cusload-file (insert ";;; " cusload-base-file " --- automatically extracted custom dependencies\n" - "\n;;; Code:\n\n") + "\n;;; Code:\n\n" + "(autoload 'custom-add-loads \"cus-load\")\n\n") (mapatoms (lambda (sym) (let ((members (get sym 'custom-group)) @@ -181,6 +169,31 @@ (insert "\n;;; custom-load.el ends here\n")) (clrhash hash))))))))) +(defun Custom-make-one-dependency () + "Extract custom dependencies from .el files in one dir, on the command line. +Like `Custom-make-dependencies' but snarfs only one command-line argument, +making it useful in a chain of batch commands in a single XEmacs invocation." + (let ((subdir (car command-line-args-left))) + (setq command-line-args-left (cdr command-line-args-left)) + (Custom-make-dependencies-1 (list subdir)))) + +;;;###autoload +(defun Custom-make-dependencies (&optional subdirs) + "Extract custom dependencies from .el files in SUBDIRS. +SUBDIRS is a list of directories. If it is nil, the command-line +arguments are used. If it is a string, only that directory is +processed. This function is especially useful in batch mode. + +Batch usage: xemacs -batch -l cus-dep.el -f Custom-make-dependencies DIRS" + (interactive "DDirectory: ") + (and (stringp subdirs) + (setq subdirs (list subdirs))) + (or subdirs + ;; Usurp the command-line-args + (setq subdirs command-line-args-left + command-line-args-left nil)) + (Custom-make-dependencies-1 subdirs)) + (provide 'cus-dep) ;;; cus-dep.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cus-edit.el --- a/lisp/cus-edit.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cus-edit.el Mon Aug 13 11:35:02 2007 +0200 @@ -55,6 +55,7 @@ (require 'cus-load) (require 'cus-start) +(require 'cus-file) ;; Huh? This looks dirty! (put 'custom-define-hook 'custom-type 'hook) @@ -2225,7 +2226,6 @@ "Restore the saved value for the variable being edited by WIDGET." (let* ((symbol (widget-value widget)) (set (or (get symbol 'custom-set) 'set-default)) - (comment-widget (widget-get widget :comment-widget)) (value (get symbol 'saved-value)) (comment (get symbol 'saved-variable-comment))) (cond ((or value comment) @@ -2244,8 +2244,7 @@ (defun custom-variable-reset-standard (widget) "Restore the standard setting for the variable being edited by WIDGET." (let* ((symbol (widget-value widget)) - (set (or (get symbol 'custom-set) 'set-default)) - (comment-widget (widget-get widget :comment-widget))) + (set (or (get symbol 'custom-set) 'set-default))) (if (get symbol 'standard-value) (funcall set symbol (eval (car (get symbol 'standard-value)))) (signal 'error (list "No standard setting known for variable" symbol))) @@ -3239,15 +3238,6 @@ (widget-put widget :custom-state found))) (custom-magic-reset widget)) -;;; The `custom-save-all' Function. -;;;###autoload -(defcustom custom-file "~/.emacs" - "File used for storing customization information. -If you change this from the default \"~/.emacs\" you need to -explicitly load that file for the settings to take effect." - :type 'file - :group 'customize) - (defun custom-save-delete (symbol) "Delete the call to SYMBOL form in `custom-file'. Leave point at the location of the call, or after the last expression." @@ -3354,6 +3344,7 @@ (defun custom-save-resets (property setter special) (let (started-writing ignored-special) + (setq ignored-special ignored-special) ;; suppress byte-compiler warning ;; (custom-save-delete setter) Done by caller (let ((standard-output (current-buffer)) (mapper `(lambda (object) @@ -3377,7 +3368,8 @@ (setq ignored-special special) (mapatoms mapper) (when started-writing - (princ ")\n"))))) + (princ ")\n")))) + ) (defun custom-save-loaded-themes () @@ -3594,6 +3586,19 @@ (run-hooks 'custom-mode-hook)) +;;;###autoload +(defun custom-migrate-custom-file (new-custom-file-name) + "Migrate custom file from home directory." + (mapc 'custom-save-delete + '(custom-load-themes custom-reset-variables + custom-set-variables + custom-set-faces + custom-reset-faces)) + (with-current-buffer (find-file-noselect custom-file) + (save-buffer)) + (setq custom-file new-custom-file-name) + (custom-save-all)) + ;;; The End. (provide 'cus-edit) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cus-face.el --- a/lisp/cus-face.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cus-face.el Mon Aug 13 11:35:02 2007 +0200 @@ -309,7 +309,7 @@ (defun custom-theme-reset-faces (theme &rest args) (custom-check-theme theme) "Reset the value of the face to values previously defined. -Assosiate this setting with THEME. +Associate this setting with THEME. ARGS is a list of lists of the form @@ -324,7 +324,7 @@ ;;;###autoload (defun custom-reset-faces (&rest args) "Reset the value of the face to values previously defined. -Assosiate this setting with the 'user' theme. +Associate this setting with the 'user' theme. ARGS is defined as for `custom-theme-reset-faces'" (apply #'custom-theme-reset-faces 'user args)) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cus-file.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/cus-file.el Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,59 @@ +;;; cus-file.el --- Manage location of the customize init file + +;; Copyright (C) 2000 by Free Software Foundation, Inc. + +;; Author: Mike Sperber +;; 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 file manages the location of the custom init file without +;; loading all of the custom code itself. + + +;;; Code: +(provide 'cus-file) + +;;;###autoload +(defconst custom-file-base "custom.el" + "Base of file name for storing customization information.") + +;;;###autoload +(defvar custom-file nil + "File used for storing customization information. +If you change this from the default you need to +explicitly load that file for the settings to take effect.") + +;;;###autoload +(defun make-custom-file-name (init-file &optional force-new) + "Construct the default custom file name from the init file name. +If FORCE-NEW is non-nil, force post-migration location." + (let ((init-file (or init-file user-init-file))) + (if (or force-new + (not init-file) + (string= (file-name-directory init-file) + (expand-file-name + (file-name-as-directory user-init-directory)))) + (expand-file-name custom-file-base user-init-directory) + init-file))) + +;;; cus-file.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/cus-start.el --- a/lisp/cus-start.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/cus-start.el Mon Aug 13 11:35:02 2007 +0200 @@ -60,6 +60,7 @@ (visible-bell sound boolean) (x-allow-sendevents x boolean) (zmacs-regions editing-basics boolean) + (load-home-init-file installation boolean) ;; integer (auto-save-interval auto-save integer) (bell-volume sound integer) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/custom-load.el --- a/lisp/custom-load.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/custom-load.el Mon Aug 13 11:35:02 2007 +0200 @@ -2,6 +2,8 @@ ;;; Code: +(autoload 'custom-add-loads "cus-load") + (custom-add-loads 'extensions '("auto-show" "wid-edit")) (custom-add-loads 'info-faces '("info")) (custom-add-loads 'custom-buffer '("cus-edit")) @@ -15,12 +17,12 @@ (custom-add-loads 'menu '("menubar-items")) (custom-add-loads 'minibuffer '("simple" "minibuf")) (custom-add-loads 'log-message '("simple")) -(custom-add-loads 'environment '("frame" "keydefs" "minibuf" "modeline" "window-xemacs" "menubar" "gutter-items" "x-init" "toolbar-items" "cus-edit" "gnuserv" "sound")) +(custom-add-loads 'environment '("frame" "keydefs" "minibuf" "modeline" "window-xemacs" "menubar" "gutter" "toolbar-items" "x-init" "cus-edit" "gnuserv" "sound")) (custom-add-loads 'sound '("sound")) (custom-add-loads 'pui '("package-ui")) (custom-add-loads 'terminals '("gnuserv")) (custom-add-loads 'auto-save '("files" "auto-save")) -(custom-add-loads 'mail '("simple")) +(custom-add-loads 'mail '("simple" "startup")) (custom-add-loads 'custom-menu '("cus-edit")) (custom-add-loads 'docs '("hyper-apropos" "info")) (custom-add-loads 'tools '("etags" "hyper-apropos")) @@ -43,10 +45,11 @@ (custom-add-loads 'comm '("ldap")) (custom-add-loads 'backup '("files")) (custom-add-loads 'frames '("frame" "window-xemacs" "gui" "gnuserv")) -(custom-add-loads 'customize '("cus-edit" "wid-edit")) +(custom-add-loads 'customize '("wid-edit" "cus-edit")) (custom-add-loads 'custom-browse '("cus-edit")) (custom-add-loads 'abbrev '("abbrev" "files")) (custom-add-loads 'programming '("cus-edit")) +(custom-add-loads 'printing '("printer")) (custom-add-loads 'toolbar '("toolbar-items")) (custom-add-loads 'dired '("files")) (custom-add-loads 'dnd-debug '("dragdrop")) @@ -62,19 +65,19 @@ (custom-add-loads 'external '("process" "cus-edit")) (custom-add-loads 'development '("process" "lisp-mode" "cus-edit")) (custom-add-loads 'gnuserv '("gnuserv")) -(custom-add-loads 'gutter '("gutter-items")) +(custom-add-loads 'gutter '("gutter" "gutter-items")) (custom-add-loads 'fill-comments '("simple")) (custom-add-loads 'windows '("window" "window-xemacs")) (custom-add-loads 'widget-faces '("wid-edit")) (custom-add-loads 'languages '("lisp-mode" "cus-edit" "font-lock")) (custom-add-loads 'fill '("simple" "fill")) (custom-add-loads 'custom-magic-faces '("cus-edit")) -(custom-add-loads 'display '("toolbar" "scrollbar" "gutter-items" "auto-show")) +(custom-add-loads 'display '("modeline" "toolbar" "scrollbar" "auto-show")) (custom-add-loads 'faces '("faces" "cus-edit" "font-lock" "font" "hyper-apropos" "info" "wid-edit")) (custom-add-loads 'emacs '("faces" "help" "files" "cus-edit" "package-get")) (custom-add-loads 'processes '("process" "gnuserv")) (custom-add-loads 'hyper-apropos '("hyper-apropos")) -(custom-add-loads 'wp '("cus-edit")) +(custom-add-loads 'wp '("printer" "cus-edit")) (custom-add-loads 'vc '("files")) (custom-add-loads 'isearch '("isearch-mode")) (custom-add-loads 'font-lock-faces '("font-lock")) @@ -83,7 +86,7 @@ (custom-add-loads 'matching '("simple" "isearch-mode" "hyper-apropos")) (custom-add-loads 'i18n '("cus-edit")) (custom-add-loads 'info '("toolbar-items" "info")) -(custom-add-loads 'x '("x-faces" "font-menu")) +(custom-add-loads 'x '("x-faces")) (custom-add-loads 'buffers-tab '("gutter-items")) ;;; custom-load.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/custom.el --- a/lisp/custom.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/custom.el Mon Aug 13 11:35:02 2007 +0200 @@ -38,10 +38,10 @@ ;;; Code: (eval-when-compile - (load "cl-macs")) + (load "cl-macs" nil t)) -(if (not (fboundp 'defun*)) - (autoload 'defun* "cl-macs")) +(autoload 'custom-declare-face "cus-face") +(autoload 'defun* "cl-macs") (require 'widget) @@ -185,7 +185,7 @@ the current value for that symbol. The default is `default-value'. :require VALUE should be a feature symbol. Each feature will be - required after initialization, of the the user have saved this + required after initialization, of the user have saved this option. Read the section about customization in the Emacs Lisp manual for more @@ -227,7 +227,7 @@ match one of the ITEM. The following REQ are defined: `type' (the value of `window-system') - Should be one of `x' or `tty'. + Should be one of `x', `mswindows', or `tty'. `class' (the frame's color support) Should be one of `color', `grayscale', or `mono'. @@ -395,7 +395,7 @@ "(deftheme THEME &optional DOC &key KEYWORDS) Define a theme labeled by SYMBOL THEME. The optional argument DOC is a -doc string describing the the theme. It is optionally followed by the +doc string describing the theme. It is optionally followed by the following keyboard arguments :short-description DESC @@ -535,7 +535,7 @@ (defun custom-theme-load-themes (by-theme &rest body) "Load the themes specified by BODY and record them as required by -theme BY-THEME. BODY is a secuence of +theme BY-THEME. BODY is a sequence of - a SYMBOL require the theme SYMBOL - a list (reset THEME) @@ -565,7 +565,7 @@ (defsubst copy-upto-last (elt list) - "Copy all the elements of the list upto the last occurence of elt" + "Copy all the elements of the list upto the last occurrence of elt" ;; Is it faster to do more work in C than to do less in elisp? (nreverse (cdr (member elt (reverse list))))) @@ -614,7 +614,7 @@ (defun custom-theme-reset-variables (theme &rest args) "Reset the value of the variables to values previously defined. -Assosiate this setting with THEME. +Associate this setting with THEME. ARGS is a list of lists of the form @@ -629,7 +629,7 @@ (defun custom-reset-variables (&rest args) "Reset the value of the variables to values previously defined. -Assosiate this setting with the `user' theme. +Associate this setting with the `user' theme. The ARGS are as in `custom-theme-reset-variables'." (apply #'custom-theme-reset-variables 'user args)) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/dialog-items.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/dialog-items.el Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,115 @@ +;;; dialog-items.el --- Dialog-box content for XEmacs + +;; Copyright (C) 2000 Andy Piper. +;; Copyright (C) 2000 Ben Wing. + +;; Maintainer: XEmacs Development Team +;; Keywords: content, gui, internal, dumped + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the +;; Free Software Foundation, 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Synched up with: Not in FSF. + +;;; Commentary: + +;; +;; Simple search dialog +;; +(defvar search-dialog-direction t) +(defvar search-dialog-regexp nil) +(defvar search-dialog nil) + +(defun search-dialog-callback (parent image-instance event) + (save-selected-frame + (select-frame parent) + (let ((domain (frame-selected-window (event-channel event)))) + (funcall (if search-dialog-direction + (if search-dialog-regexp + 're-search-forward + 'search-forward) + (if search-dialog-regexp + 're-search-backward + 'search-backward)) + (glyph-image-property + (car (glyph-image-property + (nth 1 (glyph-image-property + search-dialog :items domain)) + :items domain)) :text domain)) + (isearch-highlight (match-beginning 0) (match-end 0))))) + +(defun make-search-dialog () + "Popup a search dialog box." + (interactive) + (let ((parent (selected-frame))) + (make-dialog-box + 'general + :parent parent + :title "Search" + :spec + (setq search-dialog + (make-glyph + `[layout + :orientation horizontal :justify left + ;; neither the following height/width nor the identical one + ;; below should be necessary! (see below) + :height 11 :width 40 + :border [string :data "Search"] + :items + ([layout :orientation vertical :justify left + :items + ([string :data "Search for:"] + [button :descriptor "Match Case" + :style toggle + :selected (not case-fold-search) + :callback (setq case-fold-search + (not case-fold-search))] + [button :descriptor "Regular Expression" + :style toggle + :selected search-dialog-regexp + :callback (setq search-dialog-regexp + (not search-dialog-regexp))] + [button :descriptor "Forwards" + :style radio + :selected search-dialog-direction + :callback (setq search-dialog-direction t)] + [button :descriptor "Backwards" + :style radio + :selected (not search-dialog-direction) + :callback (setq search-dialog-direction nil)] + )] + [layout :orientation vertical :justify left + :items + ([edit-field :width 15 :descriptor "" :active t + :face default :initial-focus t] + [button :width 10 :descriptor "Find Next" + :callback-ex + (lambda (image-instance event) + (search-dialog-callback ,parent + image-instance + event))] + [button :width 10 :descriptor "Cancel" + :callback-ex + (lambda (image-instance event) + (isearch-dehighlight) + (delete-frame + (event-channel event)))])])])) + ;; neither this height/width nor the identical one above should + ;; be necessary! (in fact, if you omit the one above, the layout + ;; sizes itself correctly; but the frame as a whole doesn't use + ;; the layout's size, as it should.) + :properties '(height 11 width 40)))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/dialog.el --- a/lisp/dialog.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/dialog.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,7 @@ ;;; dialog.el --- Dialog-box support for XEmacs ;; Copyright (C) 1991-4, 1997 Free Software Foundation, Inc. +;; Copyright (C) 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, internal, dumped @@ -28,66 +29,30 @@ ;; This file is dumped with XEmacs (when dialog boxes are compiled in). +;; Dialog boxes are non-modal at the C level, but made modal at the +;; Lisp level via hacks in functions such as yes-or-no-p-dialog-box +;; below. Perhaps there should be truly modal dialog boxes +;; implemented at the C level for safety. All code using dialog boxes +;; should be careful to assume that the environment, for example the +;; current buffer, might be completely different after returning from +;; yes-or-no-p-dialog-box, but such code is difficult to write and test. + ;;; Code: (defun yes-or-no-p-dialog-box (prompt) - "Ask user a \"y or n\" question with a popup dialog box. -Returns t if answer is \"yes\". + "Ask user a yes-or-no question with a popup dialog box. +Return t if the answer is \"yes\". Takes one argument, which is the string to display to ask the question." - (let ((echo-keystrokes 0) - event) - (popup-dialog-box - ;; "Non-violent language please!" says Robin. - (cons prompt '(["Yes" yes t] ["No" no t] nil ["Cancel" abort t]))) -; (cons prompt '(["Yes" yes t] ["No" no t] nil ["Abort" abort t]))) - (catch 'ynp-done - (while t - (setq event (next-command-event event)) - (cond ((and (misc-user-event-p event) (eq (event-object event) 'yes)) - (throw 'ynp-done t)) - ((and (misc-user-event-p event) (eq (event-object event) 'no)) - (throw 'ynp-done nil)) - ((and (misc-user-event-p event) - (or (eq (event-object event) 'abort) - (eq (event-object event) 'menu-no-selection-hook))) - (signal 'quit nil)) - ((button-release-event-p event) ;; don't beep twice - nil) - (t - (beep) - (message "please answer the dialog box"))))))) + (save-selected-frame + (make-dialog-box 'question + :question prompt + :modal t + :buttons '(["Yes" (dialog-box-finish t)] + ["No" (dialog-box-finish nil)] + nil + ["Cancel" (dialog-box-cancel)])))) -(defun yes-or-no-p-maybe-dialog-box (prompt) - "Ask user a yes-or-no question. Return t if answer is yes. -The question is asked with a dialog box or the minibuffer, as appropriate. -Takes one argument, which is the string to display to ask the question. -It should end in a space; `yes-or-no-p' adds `(yes or no) ' to it. -The user must confirm the answer with RET, -and can edit it until it as been confirmed." - (if (should-use-dialog-box-p) - (yes-or-no-p-dialog-box prompt) - (yes-or-no-p-minibuf prompt))) - -(defun y-or-n-p-maybe-dialog-box (prompt) - "Ask user a \"y or n\" question. Return t if answer is \"y\". -Takes one argument, which is the string to display to ask the question. -The question is asked with a dialog box or the minibuffer, as appropriate. -It should end in a space; `y-or-n-p' adds `(y or n) ' to it. -No confirmation of the answer is requested; a single character is enough. -Also accepts Space to mean yes, or Delete to mean no." - (if (should-use-dialog-box-p) - (yes-or-no-p-dialog-box prompt) - (y-or-n-p-minibuf prompt))) - -(if (fboundp 'popup-dialog-box) - (progn - (fset 'yes-or-no-p 'yes-or-no-p-maybe-dialog-box) - (fset 'y-or-n-p 'y-or-n-p-maybe-dialog-box))) - -;; this is call-compatible with the horribly-named FSF Emacs function -;; `x-popup-dialog'. I refuse to use that name. +;; FSF has a similar function `x-popup-dialog'. (defun get-dialog-box-response (position contents) - ;; by Stig@hackvan.com - ;; modified by pez@atlantic2.sbi.com "Pop up a dialog box and return user's selection. POSITION specifies which frame to use. This is normally an event or a window or frame. @@ -109,21 +74,20 @@ (select-frame position)) ((windowp position) (select-window position))) - (let ((dbox (cons (car contents) - (mapcar #'(lambda (x) - (cond - ((null x) - nil) - ((stringp x) - `[,x 'ignore nil]) ;this will never get - ;selected - (t - `[,(car x) (throw 'result ',(cdr x)) t]))) - (cdr contents)) - ))) - (catch 'result - (popup-dialog-box dbox) - (dispatch-event (next-command-event))))) + (make-dialog-box 'question + :question (car contents) + :modal t + :buttons + (mapcar #'(lambda (x) + (cond + ((null x) + nil) + ((stringp x) + ;;this will never get selected + `[,x 'ignore nil]) + (t + `[,(car x) (dialog-box-finish ',(cdr x)) t]))) + (cdr contents)))) (defun message-box (fmt &rest args) "Display a message, in a dialog box if possible. @@ -138,13 +102,13 @@ nil) (let ((str (apply 'format fmt args))) (if (device-on-window-system-p) - (get-dialog-box-response nil (list str (cons "OK" t))) + (get-dialog-box-response nil (list str (cons "%_OK" t))) (display-message 'message str)) str))) (defun message-or-box (fmt &rest args) - "Display a message in a dialog box or in the echo area.\n\ -If this command was invoked with the mouse, use a dialog box.\n\ + "Display a message in a dialog box or in the echo area. +If this command was invoked with the mouse, use a dialog box. Otherwise, use the echo area. The arguments are the same as to `format'. @@ -154,4 +118,582 @@ (apply 'message-box fmt args) (apply 'message fmt args))) +(defun make-dialog-box (type &rest cl-keys) + "Pop up a dialog box. +TYPE is a symbol, the type of dialog box. Remaining arguments are +keyword-value pairs, specifying the particular characteristics of the +dialog box. The allowed keywords are particular to each type, but +some standard keywords are common to many types: + +:title + The title of the dialog box's window. + +:modal + If true, indicates that XEmacs will wait until the user is \"done\" + with the dialog box (usually, this means that a response has been + given). Typically, the response is returned. NOTE: Some dialog + boxes are always modal. If the dialog box is modal, `make-dialog-box' + returns immediately. The return value will be either nil or a + dialog box handle of some sort, e.g. a frame for type `general'. + +--------------------------------------------------------------------------- + +Recognized types are + +general + A dialog box consisting of an XEmacs glyph, typically a `layout' + widget specifying a dialog box arrangement. This is the most + general and powerful dialog box type, but requires more work than + the other types below. + +question + A simple dialog box that displays a question and contains one or + more user-defined buttons to specify possible responses. (This is + compatible with the old built-in dialog boxes formerly specified + using `popup-dialog-box'.) + +file + A file dialog box, of the type typically used in the window system + XEmacs is running on. + +color + A color picker. + +find + A find dialog box. + +font + A font chooser. + +print + A dialog box used when printing (e.g. number of pages, printer). + +page-setup + A dialog box for setting page options (e.g. margins) for printing. + +replace + A find/replace dialog box. + +mswindows-message + An MS Windows-specific standard dialog box type similar to `question'. + +--------------------------------------------------------------------------- + +For type `general': + +This type creates a frame and puts the specified widget layout in it. +\(Currently this is done by eliminating all areas but the gutter and placing +the layout there; but this is an implementation detail and may change.) + +The keywords allowed for `general' are + +:spec + The widget spec -- anything that can be passed to `make-glyph'. + +:title + The title of the frame. +:parent + The frame is made a child of this frame (defaults to the selected frame). + +:properties + Additional properties of the frame, as well as `dialog-frame-plist'. + +--------------------------------------------------------------------------- + +For type `question': + +The keywords allowed are + +:modal + t or nil. When t, the dialog box callback should exit the dialog box + using the functions `dialog-box-finish' or `dialog-box-cancel'. +:title + The title of the frame. +:question + A string, the question. +:buttons + A list, describing the buttons below the question. Each of these is a + vector, the syntax of which is essentially the same as that of popup menu + items. They may have any of the following forms: + + [ \"name\" callback ] + [ \"name\" callback \"suffix\" ] + [ \"name\" callback : : ... ] + + The name is the string to display on the button; it is filtered through the + resource database, so it is possible for resources to override what string + is actually displayed. + + Accelerators can be indicated in the string by putting the sequence + \"%_\" before the character corresponding to the key that will invoke + the button. Uppercase and lowercase accelerators are equivalent. The + sequence \"%%\" is also special, and is translated into a single %. + + If the `callback' of a button is a symbol, then it must name a command. + It will be invoked with `call-interactively'. If it is a list, then it is + evaluated with `eval'. + + One (and only one) of the buttons may be `nil'. This marker means that all + following buttons should be flushright instead of flushleft. + + Though the keyword/value syntax is supported for dialog boxes just as in + popup menus, the only keyword which is both meaningful and fully implemented + for dialog box buttons is `:active'. + +--------------------------------------------------------------------------- + +For type `file': + +The keywords allowed are + +:initial-filename + The initial filename to be placed in the dialog box (defaults to nothing). +:initial-directory + The initial directory to be selected in the dialog box (defaults to the + current buffer's `default-directory). +:filter-list + A list of (filter-desc filter ...) +:title + The title of the dialog box (defaults to \"Open\"). +:allow-multi-select t or nil +:create-prompt-on-nonexistent t or nil +:overwrite-prompt t or nil +:file-must-exist t or nil +:no-network-button t or nil +:no-read-only-return t or nil + +--------------------------------------------------------------------------- + +For type `print': + +This invokes the Windows standard Print dialog. +This dialog is usually invoked when the user selects the Print command. +After the user presses OK, the program should start actual printout. + +The keywords allowed are + +:device + An 'msprinter device. +:print-settings + A printer settings object. + +Exactly one of these keywords must be given. + +The function brings up the Print dialog, where the user can +select a different printer and/or change printer options. Connection +name can change as a result of selecting a different printer device. If +a printer is specified, then changes are stored into the settings object +currently selected into that printer. If a settings object is supplied, +then changes are recorded into it, and, it it is selected into a +printer, then changes are propagated to that printer +too. + +Return value is nil if the user has canceled the dialog. Otherwise, it +is a new plist, with the following properties: + name Printer device name, even if unchanged by the user. + from-page First page to print, 1-based. If not specified by the user, + then this value is not included in the plist. + to-page Last page to print, inclusive, 1-based. If not specified by + the user, then this value is not included in the plist. + copies Number of copies to print. Always returned. + +The DEVICE is destroyed and an error is signaled in case of +initialization problem with the new printer. + +See also the `page-setup' and `print-setup' dialog boxes. + +--------------------------------------------------------------------------- + +For type `page-setup': + +This invokes the Windows standard Page Setup dialog. +This dialog is usually invoked in response to the Page Setup command, and +used to chose such parameters as page orientation, print margins etc. +Note that this dialog contains the \"Printer\" button, which invokes +the Printer Setup dialog (see `msprinter-print-setup-dialog') so that the +user can update the printer options or even select a different printer +as well. + +The keywords allowed are + +:device + An 'msprinter device. +:print-settings + A printer settings object. +:properties + A plist of job properties. + +Exactly one of these keywords must be given. + +The function brings up the Page Setup dialog, where the user +can select a different printer and/or change printer options. +Connection name can change as a result of selecting a different printer +device. If a printer is specified, then changes are stored into the +settings object currently selected into that printer. If a settings +object is supplied, then changes are recorded into it, and, it it is +selected into a printer, then changes are propagated to that printer +too. + +:properties specifies a plist of job properties; +see `default-msprinter-frame-plist' for the complete list. The plist +is used to initialize the dialog. + +Return value is nil if the user has canceled the dialog. Otherwise, +it is a new plist, containing the new list of properties. + +The DEVICE is destroyed and an error is signaled in case of +initialization problem with the new printer. + +See also the `print' and `print-setup' dialogs. + +--------------------------------------------------------------------------- + +For type `print-setup': + +This invokes the Windows standard Print Setup dialog. +This dialog is usually invoked when the user selects the Printer Setup +command. + +The keywords allowed are + +:device + An 'msprinter device. +:print-settings + A printer settings object. + +Exactly one of these keywords must be given. + +The function brings up the Print Setup dialog, where the user +can select a different printer and/or change printer options. +Connection name can change as a result of selecting a different printer +device. If a printer is specified, then changes are stored into the +settings object currently selected into that printer. If a settings +object is supplied, then changes are recorded into it, and, it it is +selected into a printer, then changes are propagated to that printer +too. + +Return value is nil if the user has canceled the dialog. Otherwise, it +is a new plist, with the following properties: + name Printer device name, even if unchanged by the user. + +The printer device is destroyed and an error is signaled if new printer +is selected by the user, but cannot be initialized. + +See also the `print' and `page-setup' dialogs. + +--------------------------------------------------------------------------- + +For type `mswindows-message': + +The keywords allowed are + +:title + The title of the dialog box. +:message + The string to display. +:flags + A symbol or list of symbols: + + -- To specify the buttons in the message box: + + abortretryignore + The message box contains three push buttons: Abort, Retry, and Ignore. + ok + The message box contains one push button: OK. This is the default. + okcancel + The message box contains two push buttons: OK and Cancel. + retrycancel + The message box contains two push buttons: Retry and Cancel. + yesno + The message box contains two push buttons: Yes and No. + yesnocancel + The message box contains three push buttons: Yes, No, and Cancel. + + + -- To display an icon in the message box: + + iconexclamation, iconwarning + An exclamation-point icon appears in the message box. + iconinformation, iconasterisk + An icon consisting of a lowercase letter i in a circle appears in + the message box. + iconquestion + A question-mark icon appears in the message box. + iconstop, iconerror, iconhand + A stop-sign icon appears in the message box. + + + -- To indicate the default button: + + defbutton1 + The first button is the default button. This is the default. + defbutton2 + The second button is the default button. + defbutton3 + The third button is the default button. + defbutton4 + The fourth button is the default button. + + + -- To indicate the modality of the dialog box: + + applmodal + The user must respond to the message box before continuing work in + the window identified by the hWnd parameter. However, the user can + move to the windows of other applications and work in those windows. + Depending on the hierarchy of windows in the application, the user + may be able to move to other windows within the application. All + child windows of the parent of the message box are automatically + disabled, but popup windows are not. This is the default. + systemmodal + Same as applmodal except that the message box has the WS_EX_TOPMOST + style. Use system-modal message boxes to notify the user of serious, + potentially damaging errors that require immediate attention (for + example, running out of memory). This flag has no effect on the + user's ability to interact with windows other than those associated + with hWnd. + taskmodal + Same as applmodal except that all the top-level windows belonging to + the current task are disabled if the hWnd parameter is NULL. Use + this flag when the calling application or library does not have a + window handle available but still needs to prevent input to other + windows in the current application without suspending other + applications. + + + In addition, you can specify the following flags: + + default-desktop-only + The desktop currently receiving input must be a default desktop; + otherwise, the function fails. A default desktop is one an + application runs on after the user has logged on. + help + Adds a Help button to the message box. Choosing the Help button or + pressing F1 generates a Help event. + right + The text is right-justified. + rtlreading + Displays message and caption text using right-to-left reading order + on Hebrew and Arabic systems. + setforeground + The message box becomes the foreground window. Internally, Windows + calls the SetForegroundWindow function for the message box. + topmost + The message box is created with the WS_EX_TOPMOST window style. + service-notification + Windows NT only: The caller is a service notifying the user of an + event. The function displays a message box on the current active + desktop, even if there is no user logged on to the computer. If + this flag is set, the hWnd parameter must be NULL. This is so the + message box can appear on a desktop other than the desktop + corresponding to the hWnd. + + + The return value is one of the following menu-item values returned by + the dialog box: + + abort + Abort button was selected. + cancel + Cancel button was selected. + ignore + Ignore button was selected. + no + No button was selected. + ok + OK button was selected. + retry + Retry button was selected. + yes + Yes button was selected. + + If a message box has a Cancel button, the function returns the + `cancel' value if either the ESC key is pressed or the Cancel button + is selected. If the message box has no Cancel button, pressing ESC has + no effect." + (flet ((dialog-box-modal-loop (thunk) + (let* ((frames (frame-list)) + (result + ;; ok, this is extremely tricky. normally a modal + ;; dialog will pop itself down using (dialog-box-finish) + ;; or (dialog-box-cancel), which throws back to this + ;; catch. but question dialog boxes pop down themselves + ;; regardless, so a badly written question dialog box + ;; that does not use (dialog-box-finish) could seriously + ;; wedge us. furthermore, we disable all other frames + ;; in order to implement modality; we need to restore + ;; them before the dialog box is destroyed, because + ;; otherwise windows at least will notice that no top- + ;; level window can have the focus and will shift the + ;; focus to a different app, raising it and obscuring us. + ;; so we create `delete-dialog-box-hook', which is + ;; called right *before* the dialog box gets destroyed. + ;; here, we put a hook on it, and when it's our dialog + ;; box and not someone else's that's being destroyed, + ;; we reenable all the frames and remove the hook. + ;; BUT ... we still have to deal with exiting the + ;; modal loop in case it doesn't happen before us. + ;; we can't do this until after the callbacks for this + ;; dialog box get executed, and that doesn't happen until + ;; after the dialog box is destroyed. so to keep things + ;; synchronous, we enqueue an eval event, which goes into + ;; the same queue as the misc-user events encapsulating + ;; the dialog callbacks and will go after it (because + ;; destroying the dialog box happens after processing + ;; its selection). if the dialog boxes are written + ;; properly, we don't see this eval event, because we've + ;; already exited our modal loop. (Thus, we make sure the + ;; function given in this eval event is actually defined + ;; and does nothing.) If we do see it, though, we know + ;; that we encountered a badly written dialog box and + ;; need to exit now. Currently we just return nil, but + ;; maybe we should signal an error or issue a warning. + (catch 'internal-dialog-box-finish + (let ((id (eval thunk)) + (sym (gensym))) + (fset sym + `(lambda (did) + (when (eq ',id did) + (mapc 'enable-frame ',frames) + (enqueue-eval-event + 'internal-make-dialog-box-exit did) + (remove-hook 'delete-dialog-box-hook + ',sym)))) + (add-hook 'delete-dialog-box-hook sym) + (mapc 'disable-frame frames) + (block nil + (while t + (let ((event (next-event))) + (if (and (eval-event-p event) + (eq (event-function event) + 'internal-make-dialog-box-exit) + (eq (event-object event) id)) + (return '(nil)) + (dispatch-event event))))))))) + (if (listp result) + (car result) + (signal 'quit nil))))) + (case type + (general + (cl-parsing-keywords + ((:title "XEmacs") + (:parent (selected-frame)) + :modal + :properties + :spec) + () + (flet ((create-dialog-box-frame () + (let* ((ftop (frame-property cl-parent 'top)) + (fleft (frame-property cl-parent 'left)) + (fwidth (frame-pixel-width cl-parent)) + (fheight (frame-pixel-height cl-parent)) + (fonth (font-height (face-font 'default))) + (fontw (font-width (face-font 'default))) + (cl-properties (append cl-properties + dialog-frame-plist)) + (dfheight (plist-get cl-properties 'height)) + (dfwidth (plist-get cl-properties 'width)) + (unmapped (plist-get cl-properties + 'initially-unmapped)) + (gutter-spec cl-spec) + (name (or (plist-get cl-properties 'name) "XEmacs")) + (frame nil)) + (plist-remprop cl-properties 'initially-unmapped) + ;; allow the user to just provide a glyph + (or (glyphp cl-spec) (setq cl-spec (make-glyph cl-spec))) + (setq gutter-spec (copy-sequence "\n")) + (set-extent-begin-glyph (make-extent 0 1 gutter-spec) + cl-spec) + ;; under FVWM at least, if I don't specify the + ;; initial position, it ends up always at (0, 0). + ;; xwininfo doesn't tell me that there are any + ;; program-specified position hints, so it must be + ;; an FVWM bug. So just be smashing and position in + ;; the center of the selected frame. + (setq frame + (make-frame + (append cl-properties + `(popup ,cl-parent initially-unmapped t + menubar-visible-p nil + has-modeline-p nil + default-toolbar-visible-p nil + top-gutter-visible-p t + top-gutter-height , + (* dfheight fonth) + top-gutter ,gutter-spec + minibuffer none + name ,name + modeline-shadow-thickness 0 + vertical-scrollbar-visible-p nil + horizontal-scrollbar-visible-p nil + unsplittable t + left ,(+ fleft (- (/ fwidth 2) + (/ (* dfwidth + fontw) + 2))) + top ,(+ ftop (- (/ fheight 2) + (/ (* dfheight + fonth) + 2))))))) + (set-face-foreground 'modeline [default foreground] frame) + (set-face-background 'modeline [default background] frame) + (unless unmapped (make-frame-visible frame)) + (let ((newbuf (generate-new-buffer " *dialog box*"))) + (set-buffer-dedicated-frame newbuf frame) + (set-frame-property frame 'dialog-box-buffer newbuf) + (with-current-buffer newbuf + (setq frame-title-format cl-title) + (make-local-hook 'delete-frame-hook) + (add-hook 'delete-frame-hook + #'(lambda (frame) + (kill-buffer + (frame-property + frame + 'dialog-box-buffer)))))) + frame))) + (if cl-modal + (dialog-box-modal-loop '(create-dialog-box-frame)) + (create-dialog-box-frame))))) + (question + (cl-parsing-keywords + ((:modal nil)) + t + (remf cl-keys :modal) + (if cl-modal + (dialog-box-modal-loop `(make-dialog-box-internal ',type + ',cl-keys)) + (make-dialog-box-internal type cl-keys)))) + (t + (make-dialog-box-internal type cl-keys))))) + +(defun dialog-box-finish (result) + "Exit a modal dialog box, returning RESULT. +This is meant to be executed from a dialog box callback function." + (throw 'internal-dialog-box-finish (list result))) + +(defun dialog-box-cancel () + "Cancel a modal dialog box. +This is meant to be executed from a dialog box callback function." + (throw 'internal-dialog-box-finish 'cancel)) + +;; an eval event, used as a trigger inside of the dialog modal loop. +(defun internal-make-dialog-box-exit (did) + nil) + +(make-obsolete 'popup-dialog-box 'make-dialog-box) +(defun popup-dialog-box (desc) + "Obsolete equivalent of (make-dialog-box 'question ...). + +\(popup-dialog-box (QUESTION BUTTONS ...) + +is equivalent to + +\(make-dialog-box 'question :question QUESTION :buttons BUTTONS)" + (check-argument-type 'stringp (car desc)) + (or (consp (cdr desc)) + (error 'syntax-error + "Dialog descriptor must supply at least one button" + desc)) + (make-dialog-box 'question :question (car desc) :buttons (cdr desc))) + ;;; dialog.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/dragdrop.el --- a/lisp/dragdrop.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/dragdrop.el Mon Aug 13 11:35:02 2007 +0200 @@ -3,7 +3,7 @@ ;; Copyright (C) 1998 Oliver Graf ;; Maintainer: XEmacs Development Team, Oliver Graf -;; Keywords: drag, drop, dumped +;; Keywords: mouse, gui, dumped ;; This file is part of XEmacs. @@ -244,8 +244,8 @@ ;; to-do: open ftp URLs with efs... (t ;; some other URL, try to fire up some browser for it - (if (boundp 'browse-url-browser-function) - (funcall browse-url-browser-function (car data)) + (if (fboundp 'browse-url) + (browse-url (car data)) (display-message 'error "Can't show URL, no browser selected")))) (undo-boundary) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/dumped-lisp.el --- a/lisp/dumped-lisp.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/dumped-lisp.el Mon Aug 13 11:35:02 2007 +0200 @@ -49,6 +49,7 @@ ;; After fixing, eos/loaddefs-eos and loaddefs appear identical?!! ;; So just make loaddefs-eos go away... ;;(pureload (if (featurep 'sparcworks) "eos/loaddefs-eos" "loaddefs")) + "cus-file" "startup" ; For initialization of ; `emacs-user-extension-dir' "misc" @@ -80,24 +81,47 @@ "fill" "auto-save" ; Added for 20.4 "movemail" ; Added for 21.2 - (when-feature windows-nt "winnt") + (when-feature windows-nt "win32-native") (when-feature lisp-float-type "float-sup") "itimer" ; for vars auto-save-timeout and ; auto-gc-threshold "itimer-autosave" + "printer" + + ;;;;;;;;;;;;;;;;;; GUI support + (when-feature window-system "gui") + (when-feature window-system "mouse") + (when-feature window-system "mode-motion") (when-feature toolbar "toolbar") (when-feature scrollbar "scrollbar") (when-feature menubar "menubar") (when-feature dialog "dialog") - (when-feature mule "mule-charset") + (when-feature gutter "gutter") + (when-feature dragdrop-api "dragdrop") + "select" + + ;;;;;;;;;;;;;;;;;; Content for GUI's + ;; There used to be window-system inserted in the when-feature, + ;; but IMHO your configure script should turn off the menubar, + ;; toolbar, etc. features when there is no window system. We + ;; should just be able to assume that, if (featurep 'menubar), + ;; the menubar should work and if items are added, they can be + ;; seen clearly and usefully. + (when-feature (and (not infodock) menubar) "menubar-items") + (when-feature (and gutter) "gutter-items") + (when-feature (and (not infodock) toolbar) "toolbar-items") + (when-feature (and (not infodock) dialog) "dialog-items") + + ;;;;;;;;;;;;;;;;;; Coding-system support (when-feature file-coding "coding") - (when-feature mule "mule-coding") -;; Handle I/O of files with extended characters. (when-feature file-coding "code-files") -;; Handle process with encoding/decoding non-ascii coding-system. (when-feature file-coding "code-process") + + ;;;;;;;;;;;;;;;;;; MULE support + (when-feature mule "mule-charset") + (when-feature mule "mule-coding") + ;; All files after this can have extended characters in them. (when-feature mule "mule-help") -;; Load the remaining basic files. (when-feature mule "mule-category") (when-feature mule "mule-ccl") (when-feature mule "mule-misc") @@ -156,16 +180,13 @@ ;; Moved to sunpro-load.el - the default only for Sun. ;;(pureload "mime-setup") ;;; mule-load.el ends here - (when-feature window-system "gui") - (when-feature window-system "mode-motion") - (when-feature window-system "mouse") - (when-feature window-system "select") - (when-feature dragdrop-api "dragdrop") -;; preload the X code, for faster startup. - (when-feature (and (not infodock) - (or x mswindows) menubar) "menubar-items") + +;; preload InfoDock stuff. should almost certainly not be here if +;; id-menus is not here. infodock needs to figure out a clever way to +;; advise this stuff or we need to export a clean way for infodock or +;; others to control this programmatically. (when-feature (and infodock (or x mswindows) menubar) "id-menus") - (when-feature (and gutter menubar window-system) "gutter-items") +;; preload the X code. (when-feature x "x-faces") (when-feature x "x-iso8859-1") (when-feature x "x-mouse") @@ -173,8 +194,6 @@ (when-feature (and x scrollbar) "x-scrollbar") (when-feature x "x-misc") (when-feature x "x-init") - (when-feature (and (not infodock) - window-system toolbar) "toolbar-items") (when-feature x "x-win-xfree86") (when-feature x "x-win-sun") ;; preload the mswindows code. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/easymenu.el --- a/lisp/easymenu.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/easymenu.el Mon Aug 13 11:35:02 2007 +0200 @@ -24,7 +24,7 @@ ;; 02111-1307, USA. ;;; Synched up with: Not synched with FSF but coordinated with the FSF -;;; easymenu maintor for compatibility with FSF 20.4. +;;; easymenu maintainer for compatibility with FSF 20.4. ;;; Please: Coordinate changes with Inge Frick ;; Commentary: @@ -33,30 +33,30 @@ ;; Easymenu allows you to define menus for both Emacs 19 and XEmacs. -;; This file +;; This file ;; The advantages of using easymenu are: ;; - Easier to use than either the Emacs 19 and XEmacs menu syntax. -;; - Common interface for Emacs 18, Emacs 19, and XEmacs. +;; - Common interface for Emacs 18, Emacs 19, and XEmacs. ;; (The code does nothing when run under Emacs 18). ;; The public functions are: ;; - Function: easy-menu-define SYMBOL MAPS DOC MENU ;; SYMBOL is both the name of the variable that holds the menu and -;; the name of a function that will present a the menu. +;; the name of a function that will present the menu. ;; MAPS is a list of keymaps where the menu should appear in the menubar. ;; DOC is the documentation string for the variable. -;; MENU is an XEmacs style menu description. +;; MENU is an XEmacs style menu description. ;; See the documentation for easy-menu-define for details. ;; - Function: easy-menu-change PATH NAME ITEMS ;; Change an existing menu. ;; The menu must already exist and be visible on the menu bar. -;; PATH is a list of strings used for locating the menu on the menu bar. -;; NAME is the name of the menu. +;; PATH is a list of strings used for locating the menu on the menu bar. +;; NAME is the name of the menu. ;; ITEMS is a list of menu items, as defined in `easy-menu-define'. ;; - Function: easy-menu-add MENU [ MAP ] @@ -105,7 +105,7 @@ ENABLE is an expression; the item is enabled for selection whenever this expression's value is non-nil. -Alternatively, a menu item may have the form: +Alternatively, a menu item may have the form: [ NAME CALLBACK [ KEYWORD ARG ] ... ] @@ -125,13 +125,13 @@ NAME is a string; the name of an argument to CALLBACK. :style STYLE - + STYLE is a symbol describing the type of menu item. The following are -defined: +defined: -toggle: A checkbox. +toggle: A checkbox. Currently just prepend the name with the string \"Toggle \". -radio: A radio button. +radio: A radio button. nil: An ordinary menu item. :selected SELECTED @@ -153,15 +153,14 @@ (easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu))) (defun easy-menu-do-define (symbol maps doc menu) - (if (featurep 'menubar) - (progn - (set symbol menu) - (fset symbol (list 'lambda '(e) - doc - '(interactive "@e") - '(run-hooks 'activate-menubar-hook) - '(setq zmacs-region-stays 't) - (list 'popup-menu symbol)))))) + (when (featurep 'menubar) + (set symbol menu) + (fset symbol `(lambda (e) + ,doc + (interactive "@e") + (run-hooks 'activate-menubar-hook) + (setq zmacs-region-stays 't) + (popup-menu ,symbol))))) (defun easy-menu-change (&rest args) (when (featurep 'menubar) @@ -174,42 +173,48 @@ (defun easy-menu-add (menu &optional map) "Add MENU to the current menu bar." - (if (featurep 'menubar) - (progn - (unless (member menu easy-menu-all-popups) - (push menu easy-menu-all-popups)) - (setq mode-popup-menu (if (> (length easy-menu-all-popups) 1) - (cons (easy-menu-title) - (reverse easy-menu-all-popups)) - (car easy-menu-all-popups))) + (when (featurep 'menubar) + (unless (member menu easy-menu-all-popups) + (push menu easy-menu-all-popups)) + (setq mode-popup-menu (if (> (length easy-menu-all-popups) 1) + (cons (easy-menu-title) + (reverse easy-menu-all-popups)) + (let ((same-as-menu + (car easy-menu-all-popups))) + (cons (normalize-menu-item-name + (car same-as-menu)) + (cdr same-as-menu))))) - (cond ((null current-menubar) - ;; Don't add it to a non-existing menubar. - nil) - ((assoc (car menu) current-menubar) - ;; Already present. - nil) - ((equal current-menubar '(nil)) - ;; Set at left if only contains right marker. - (set-buffer-menubar (list menu nil))) - (t - ;; Add at right. - (set-buffer-menubar (copy-sequence current-menubar)) - (add-menu nil (car menu) (cdr menu))))))) + (cond ((null current-menubar) + ;; Don't add it to a non-existing menubar. + nil) + ((assoc (car menu) current-menubar) + ;; Already present. + nil) + ((equal current-menubar '(nil)) + ;; Set at left if only contains right marker. + (set-buffer-menubar (list menu nil))) + (t + ;; Add at right. + (set-buffer-menubar (copy-sequence current-menubar)) + (add-menu nil (car menu) (cdr menu)))))) (defun easy-menu-remove (menu) "Remove MENU from the current menu bar." - (if (featurep 'menubar) - (progn - (setq easy-menu-all-popups (delq menu easy-menu-all-popups) - mode-popup-menu (if (< (length easy-menu-all-popups) 1) - (cons (easy-menu-title) - (reverse easy-menu-all-popups)) - (car easy-menu-all-popups))) + (when (featurep 'menubar) + (setq easy-menu-all-popups (delq menu easy-menu-all-popups) + mode-popup-menu (if (< (length easy-menu-all-popups) 1) + (cons (easy-menu-title) + (reverse easy-menu-all-popups)) + (let ((same-as-menu + (car easy-menu-all-popups))) + (cons (normalize-menu-item-name + (car same-as-menu)) + (cdr same-as-menu))))) - (and current-menubar - (assoc (car menu) current-menubar) - (delete-menu-item (list (car menu))))))) + (and current-menubar + (assoc (car menu) current-menubar) + (delete-menu-item (list (car menu)))))) (defsubst easy-menu-normalize (menu) (if (symbolp menu) @@ -217,14 +222,14 @@ menu)) (defun easy-menu-add-item (menu path item &optional before) - "At the end of the submenu of MENU with path PATH add ITEM. + "At the end of the submenu of MENU with path PATH, add ITEM. If ITEM is already present in this submenu, then this item will be changed. otherwise ITEM will be added at the end of the submenu, unless the optional argument BEFORE is present, in which case ITEM will instead be added before the item named BEFORE. MENU is either a symbol, which have earlier been used as the first argument in a call to `easy-menu-define', or the value of such a symbol -i.e. a menu, or nil which stands for the current menubar. +i.e. a menu, or nil, which stands for the current menubar. PATH is a list of strings for locating the submenu where ITEM is to be added. If PATH is nil, MENU itself is used. Otherwise, the first element should be the name of a submenu directly under MENU. This @@ -232,26 +237,30 @@ ITEM is either defined as in `easy-menu-define', a menu defined earlier by `easy-menu-define' or `easy-menu-create-menu' or an item returned from `easy-menu-item-present-p' or `easy-menu-remove-item'." - (add-menu-button path item before (easy-menu-normalize menu))) + (when (featurep 'menubar) + (add-menu-button path item before (easy-menu-normalize menu)))) (defun easy-menu-item-present-p (menu path name) "In submenu of MENU with path PATH, return true iff item NAME is present. MENU and PATH are defined as in `easy-menu-add-item'. NAME should be a string, the name of the element to be looked for. -The return value can be used as as an argument to `easy-menu-add-item'." - (car (find-menu-item (or (easy-menu-normalize menu) current-menubar) - (append path (list name))))) +The return value can be used as an argument to `easy-menu-add-item'." + (if (featurep 'menubar) + (car (find-menu-item (or (easy-menu-normalize menu) current-menubar) + (append path (list name)))) + nil)) (defun easy-menu-remove-item (menu path name) - "From submenu of MENU with path PATH remove item NAME. + "From submenu of MENU with path PATH, remove item NAME. MENU and PATH are defined as in `easy-menu-add-item'. NAME should be a string, the name of the element to be removed. -The return value can be used as as an argument to `easy-menu-add-item'." - (delete-menu-item (append path (list name)) - (easy-menu-normalize menu))) - +The return value can be used as an argument to `easy-menu-add-item'." + (when (featurep 'menubar) + (delete-menu-item (append path (list name)) + (easy-menu-normalize menu)))) + diff -r 72a7cfa4a488 -r abe6d1db359e lisp/etags.el --- a/lisp/etags.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/etags.el Mon Aug 13 11:35:02 2007 +0200 @@ -190,9 +190,12 @@ (when (file-readable-p parent-tag-file) (push parent-tag-file result))) ;; tag-table-alist - (let ((key (or buffer-file-name - (concat default-directory (buffer-name)))) - expression) + (let* ((key (or buffer-file-name + (concat default-directory (buffer-name)))) + (key (if (eq system-type 'windows-nt) + (replace-in-string key "\\\\" "/") + key)) + expression) (dolist (item tag-table-alist) (setq expression (car item)) ;; If the car of the alist item is a string, apply it as a regexp @@ -502,6 +505,7 @@ ((string-match "\\.scm\\'" filename) 'scheme-mode) (t nil))) + (defvar c-mode-syntax-table) (set-syntax-table (cond ((and (eq file-type 'c-mode) c-mode-syntax-table) c-mode-syntax-table) @@ -638,7 +642,7 @@ (t (setq tag-table-currently-matching-exact t))) ;; \_ in the tagname is used to indicate a symbol boundary. - (setq exact-tagname (concat "\\_" tagname "\\_")) + (setq exact-tagname (format "\C-?\\_%s\\_\C-a\\|\\_%s\\_" tagname tagname)) (while (string-match "\\\\_" exact-tagname) (aset exact-tagname (1- (match-end 0)) ?b)) (save-excursion @@ -671,7 +675,9 @@ ;; tag searches? (while (re-search-forward tag-target nil t) (and (save-match-data - (looking-at "[^\n\C-?]*\C-?")) + (save-excursion + (goto-char (match-beginning 0)) + (looking-at "[^\n\C-?]*\C-?"))) ;; If we're looking for inexact matches, skip ;; exact matches since we've visited them ;; already. @@ -690,6 +696,7 @@ (if next "more " "") (if exact "matching" "containing") tagname)) + (beginning-of-line) (search-forward "\C-?") (setq file (expand-file-name (file-of-tag) ;; In XEmacs, this needs to be @@ -732,6 +739,16 @@ (cons buf startpos)))) ;;;###autoload +(defun find-tag-at-point (tagname &optional other-window) + "*Find tag whose name contains TAGNAME. +Identical to `find-tag' but does not prompt for tag when called interactively; +instead, uses tag around or before point." + (interactive (if current-prefix-arg + '(nil nil) + (list (find-tag-default) nil))) + (find-tag tagname other-window)) + +;;;###autoload (defun find-tag (tagname &optional other-window) "*Find tag whose name contains TAGNAME. Selects the buffer that the tag is contained in @@ -768,7 +785,7 @@ '(find-tag find-tag-other-window tags-loop-continue)))) (push-tag-mark)) (if other-window - (pop-to-buffer tag-buf) + (pop-to-buffer tag-buf t) (switch-to-buffer tag-buf)) (widen) (push-mark) @@ -784,7 +801,7 @@ ;;;###autoload (defun find-tag-other-window (tagname &optional next) - "*Find tag whose name contains TAGNAME. + "*Find tag whose name contains TAGNAME, in another window. Selects the buffer that the tag is contained in in another window and puts point at its definition. If TAGNAME is a null string, the expression in the buffer diff -r 72a7cfa4a488 -r abe6d1db359e lisp/extents.el --- a/lisp/extents.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/extents.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,7 @@ ;;; extents.el --- miscellaneous extent functions not written in C ;; Copyright (C) 1993-4, 1997 Free Software Foundation, Inc. +;; Copyright (C) 2000 Ben Wing. ;; Keywords: internal, dumped @@ -25,7 +26,10 @@ ;;; Commentary: -;; some help from stig@hackvan.com here. +;;; Authorship: + +;; Created 1995 Ben Wing. +;; mapcar-extents (and extent-list?) from stig@hackvan.com, c. 1996. ;;; Code: @@ -53,7 +57,7 @@ buffer-or-string from to nil flags property value) (nreverse *result*))) -(defun extent-list (&optional buffer-or-string from to flags) +(defun extent-list (&optional buffer-or-string from to flags property value) "Return a list of the extents in BUFFER-OR-STRING. BUFFER-OR-STRING defaults to the current buffer if omitted. FROM and TO can be used to limit the range over which extents are @@ -65,11 +69,28 @@ end of BUFFER-OR-STRING, respectively. FLAGS controls how end cases are treated. For a discussion of this, -and exactly what ``overlap'' means, see `map-extents'. +and exactly what ``overlap'' means, see `map-extents'. PROPERTY and VALUE +are also as in `map-extents'. If you want to map a function over the extents in a buffer or string, -consider using `map-extents' or `mapcar-extents' instead." - (mapcar-extents 'identity nil buffer-or-string from to flags)) +consider using `map-extents' or `mapcar-extents' instead. + +See also `extents-at'." + (mapcar-extents 'identity nil buffer-or-string from to flags property value)) + +(defun extent-at-event (event &optional property before at-flag) + "Return the smallest extent under EVENT, if any. +PROPERTY, BEFORE, and AT-FLAG are as in `extent-at'." + (let* ((win (event-window event)) + (p (event-point event))) + (and win p (extent-at p (window-buffer win) property before at-flag)))) + +(defun extents-at-event (event &optional property before at-flag) + "Return a list of all extents under EVENT. +PROPERTY, BEFORE, and AT-FLAG are as in `extent-at'." + (let* ((win (event-window event)) + (p (event-point event))) + (and win p (extents-at p (window-buffer win) property before at-flag)))) (defun extent-string (extent) "Return the string delimited by the bounds of EXTENT." diff -r 72a7cfa4a488 -r abe6d1db359e lisp/faces.el --- a/lisp/faces.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/faces.el Mon Aug 13 11:35:02 2007 +0200 @@ -117,19 +117,20 @@ The specifications in a specifier determine what the value of PROPERTY will be in a particular \"domain\" or set of circumstances, which is typically a particular Emacs window along with the buffer - it contains and the frame and device it lies within. The value - is derived from the instantiator associated with the most specific + it contains and the frame and device it lies within. The value is + derived from the instantiator associated with the most specific locale (in the order buffer, window, frame, device, and 'global) that matches the domain in question. In other words, given a domain - (i.e. an Emacs window, usually), the specifier for PROPERTY will first - be searched for a specification whose locale is the buffer contained - within that window; then for a specification whose locale is the window - itself; then for a specification whose locale is the frame that the - window is contained within; etc. The first instantiator that is - valid for the domain (usually this means that the instantiator is - recognized by the device [i.e. the X server or TTY device] that the - domain is on. The function `face-property-instance' actually does - all this, and is used to determine how to display the face. + (i.e. an Emacs window, usually), the specifier for PROPERTY will + first be searched for a specification whose locale is the buffer + contained within that window; then for a specification whose locale + is the window itself; then for a specification whose locale is the + frame that the window is contained within; etc. The first + instantiator that is valid for the domain (usually this means that + the instantiator is recognized by the device [i.e. MS Windows, the X + server or TTY device] that the domain is on. The function + `face-property-instance' actually does all this, and is used to + determine how to display the face. See `set-face-property' for the built-in property-names." @@ -292,41 +293,41 @@ The following symbols have predefined meanings: foreground The foreground color of the face. - For valid instantiators, see `color-specifier-p'. + For valid instantiators, see `make-color-specifier'. background The background color of the face. - For valid instantiators, see `color-specifier-p'. + For valid instantiators, see `make-color-specifier'. font The font used to display text covered by this face. - For valid instantiators, see `font-specifier-p'. + For valid instantiators, see `make-font-specifier'. display-table The display table of the face. This should be a vector of 256 elements. background-pixmap The pixmap displayed in the background of the face. - Only used by faces on X devices. - For valid instantiators, see `image-specifier-p'. + Only used by faces on X and MS Windows devices. + For valid instantiators, see `make-image-specifier'. underline Underline all text covered by this face. - For valid instantiators, see `face-boolean-specifier-p'. + For valid instantiators, see `make-face-boolean-specifier'. strikethru Draw a line through all text covered by this face. - For valid instantiators, see `face-boolean-specifier-p'. + For valid instantiators, see `make-face-boolean-specifier'. highlight Highlight all text covered by this face. Only used by faces on TTY devices. - For valid instantiators, see `face-boolean-specifier-p'. + For valid instantiators, see `make-face-boolean-specifier'. dim Dim all text covered by this face. - For valid instantiators, see `face-boolean-specifier-p'. + For valid instantiators, see `make-face-boolean-specifier'. blinking Blink all text covered by this face. Only used by faces on TTY devices. - For valid instantiators, see `face-boolean-specifier-p'. + For valid instantiators, see `make-face-boolean-specifier'. reverse Reverse the foreground and background colors. Only used by faces on TTY devices. - For valid instantiators, see `face-boolean-specifier-p'. + For valid instantiators, see `make-face-boolean-specifier'. doc-string Description of what the face's normal use is. NOTE: This is not a specifier, unlike all @@ -433,7 +434,7 @@ FACE may be either a face object or a symbol representing a face. -FONT should be an instantiator (see `font-specifier-p'), a list of +FONT should be an instantiator (see `make-font-specifier'), a list of instantiators, an alist of specifications (each mapping a locale to an instantiator list), or a font specifier object. @@ -490,7 +491,7 @@ FACE may be either a face object or a symbol representing a face. -COLOR should be an instantiator (see `color-specifier-p'), a list of +COLOR should be an instantiator (see `make-color-specifier'), a list of instantiators, an alist of specifications (each mapping a locale to an instantiator list), or a color specifier object. @@ -547,7 +548,7 @@ FACE may be either a face object or a symbol representing a face. -COLOR should be an instantiator (see `color-specifier-p'), a list of +COLOR should be an instantiator (see `make-color-specifier'), a list of instantiators, an alist of specifications (each mapping a locale to an instantiator list), or a color specifier object. @@ -595,7 +596,7 @@ FACE may be either a face object or a symbol representing a face. -PIXMAP should be an instantiator (see `image-specifier-p'), a list +PIXMAP should be an instantiator (see `make-image-specifier'), a list of instantiators, an alist of specifications (each mapping a locale to an instantiator list), or an image specifier object. @@ -652,7 +653,7 @@ how-to-add) "Change the underline property of FACE to UNDERLINE-P. UNDERLINE-P is normally a face-boolean instantiator; see - `face-boolean-specifier-p'. + `make-face-boolean-specifier'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and HOW-TO-ADD arguments." (interactive (face-interactive "underline-p" "underlined")) @@ -667,7 +668,7 @@ how-to-add) "Change whether FACE is strikethru-d (i.e. struck through) in LOCALE. STRIKETHRU-P is normally a face-boolean instantiator; see - `face-boolean-specifier-p'. + `make-face-boolean-specifier'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and HOW-TO-ADD arguments." (interactive (face-interactive "strikethru-p" "strikethru-d")) @@ -682,7 +683,7 @@ how-to-add) "Change whether FACE is highlighted in LOCALE (TTY locales only). HIGHLIGHT-P is normally a face-boolean instantiator; see - `face-boolean-specifier-p'. + `make-face-boolean-specifier'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and HOW-TO-ADD arguments." (interactive (face-interactive "highlight-p" "highlighted")) @@ -696,7 +697,7 @@ (defun set-face-dim-p (face dim-p &optional locale tag-set how-to-add) "Change whether FACE is dimmed in LOCALE. DIM-P is normally a face-boolean instantiator; see - `face-boolean-specifier-p'. + `make-face-boolean-specifier'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and HOW-TO-ADD arguments." (interactive (face-interactive "dim-p" "dimmed")) @@ -711,7 +712,7 @@ how-to-add) "Change whether FACE is blinking in LOCALE (TTY locales only). BLINKING-P is normally a face-boolean instantiator; see - `face-boolean-specifier-p'. + `make-face-boolean-specifier'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and HOW-TO-ADD arguments." (interactive (face-interactive "blinking-p" "blinking")) @@ -725,7 +726,7 @@ (defun set-face-reverse-p (face reverse-p &optional locale tag-set how-to-add) "Change whether FACE is reversed in LOCALE (TTY locales only). REVERSE-P is normally a face-boolean instantiator; see - `face-boolean-specifier-p'. + `make-face-boolean-specifier'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and HOW-TO-ADD arguments." (interactive (face-interactive "reverse-p" "reversed")) @@ -794,7 +795,8 @@ ;; WE DEMAND LEXICAL SCOPING!!! ;; WE DEMAND LEXICAL SCOPING!!! ;; WE DEMAND LEXICAL SCOPING!!! -(defun frob-face-property (face property func &optional locale tags) +(defun frob-face-property (face property func device-tags &optional +locale tags) "Change the specifier for FACE's PROPERTY according to FUNC, in LOCALE. This function is ugly and messy and is primarily used as an internal helper function for `make-face-bold' et al., so you probably don't @@ -813,13 +815,19 @@ first valid instantiator is used), and that result substituted for the specification; otherwise, the process just outlined is iterated over each existing device and the concatenated results -substituted for the specification." +substituted for the specification. + +DEVICE-TAGS is a list of tags that each device must match in order for +the function to be called on it." (let ((sp (face-property face property)) temp-sp) (if (valid-specifier-domain-p locale) ;; this is easy. (let* ((inst (face-property-instance face property locale)) - (name (and inst (funcall func inst (dfw-device locale))))) + (name (and inst + (device-matches-specifier-tag-set-p + (dfw-device locale) device-tags) + (funcall func inst (dfw-device locale))))) (when name (add-spec-to-specifier sp name locale tags))) ;; otherwise, map over all specifications ... @@ -852,10 +860,15 @@ ;; Otherwise map frob-face-property-1 over each device. (result (if device - (list (frob-face-property-1 sp-arg device inst-list func)) + (list (and (device-matches-specifier-tag-set-p + device device-tags) + (frob-face-property-1 sp-arg device inst-list + func))) (mapcar (lambda (device) - (frob-face-property-1 sp-arg device - inst-list func)) + (and (device-matches-specifier-tag-set-p + device device-tags) + (frob-face-property-1 sp-arg device + inst-list func))) (device-list)))) new-result) ;; remove duplicates and nils from the obtained list of @@ -866,7 +879,7 @@ (setq arg (cons tags arg)) (setcar arg (append tags (delete 'default (car arg)))))) - (when (and arg (not (member arg new-result))) + (when (and arg (not (member arg new-result))) (setq new-result (cons arg new-result)))) result) ;; add back in. @@ -895,14 +908,14 @@ (or result first-valid))) (defun frob-face-font-2 (face locale tags unfrobbed-face frobbed-face - tty-thunk x-thunk standard-face-mapping) + tty-thunk ws-thunk standard-face-mapping) ;; another kludge to make things more intuitive. If we're ;; inheriting from a standard face in this locale, frob the - ;; inheritance as appropriate. Else, if, after the first X frobbing - ;; pass, the face hasn't changed and still looks like the standard - ;; unfrobbed face (e.g. 'default), make it inherit from the standard - ;; frobbed face (e.g. 'bold). Regardless of things, do the TTY - ;; frobbing. + ;; inheritance as appropriate. Else, if, after the first + ;; window-system frobbing pass, the face hasn't changed and still + ;; looks like the standard unfrobbed face (e.g. 'default), make it + ;; inherit from the standard frobbed face (e.g. 'bold). Regardless + ;; of things, do the TTY frobbing. ;; yuck -- The LOCALE argument to make-face-bold is not actually a locale, ;; but is a "locale, locale-type, or nil for all". So ... do our extra @@ -930,7 +943,7 @@ (t nil))) (inst (and domain (face-property-instance face 'font domain)))) (funcall tty-thunk) - (funcall x-thunk) + (funcall ws-thunk) ;; If it's reasonable to do the inherit-from-standard-face trick, ;; and it's called for, then do it now. (or (null domain) @@ -946,7 +959,7 @@ (defun make-face-bold (face &optional locale tags) "Make FACE bold in LOCALE, if possible. -This will attempt to make the font bold for X locales and will set the +This will attempt to make the font bold for X/MSW locales and will set the highlight flag for TTY locales. If LOCALE is nil, omitted, or `all', this will attempt to frob all @@ -979,11 +992,13 @@ (when (featurep 'tty) (set-face-highlight-p face t locale (cons 'tty tags)))) (lambda () - ;; handle X specific entries + ;; handle X/MS Windows specific entries (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-bold locale tags)) + (frob-face-property face 'font 'x-make-font-bold + '(x) locale tags)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-bold locale tags)) + (frob-face-property face 'font 'mswindows-make-font-bold + '(mswindows) locale tags)) ) '(([default] . [bold]) ([bold] . t) @@ -992,10 +1007,10 @@ (defun make-face-italic (face &optional locale tags) "Make FACE italic in LOCALE, if possible. -This will attempt to make the font italic for X locales and will set -the underline flag for TTY locales. -See `make-face-bold' for the semantics of the LOCALE argument and -for more specifics on exactly how this function works." +This will attempt to make the font italic for X/MS Windows locales and +will set the underline flag for TTY locales. See `make-face-bold' for +the semantics of the LOCALE argument and for more specifics on exactly +how this function works." (interactive (list (read-face-name "Make which face italic: "))) (frob-face-font-2 face locale tags 'default 'italic @@ -1006,9 +1021,11 @@ (lambda () ;; handle X specific entries (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-italic locale tags)) + (frob-face-property face 'font 'x-make-font-italic + '(x) locale tags)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-italic locale tags)) + (frob-face-property face 'font 'mswindows-make-font-italic + '(mswindows) locale tags)) ) '(([default] . [italic]) ([bold] . [bold-italic]) @@ -1017,10 +1034,10 @@ (defun make-face-bold-italic (face &optional locale tags) "Make FACE bold and italic in LOCALE, if possible. -This will attempt to make the font bold-italic for X locales and will -set the highlight and underline flags for TTY locales. -See `make-face-bold' for the semantics of the LOCALE argument and -for more specifics on exactly how this function works." +This will attempt to make the font bold-italic for X/MS Windows +locales and will set the highlight and underline flags for TTY +locales. See `make-face-bold' for the semantics of the LOCALE +argument and for more specifics on exactly how this function works." (interactive (list (read-face-name "Make which face bold-italic: "))) (frob-face-font-2 face locale tags 'default 'bold-italic @@ -1032,9 +1049,11 @@ (lambda () ;; handle X specific entries (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-bold-italic locale tags)) + (frob-face-property face 'font 'x-make-font-bold-italic + '(x) locale tags)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-bold-italic locale tags)) + (frob-face-property face 'font 'mswindows-make-font-bold-italic + '(mswindows) locale tags)) ) '(([default] . [italic]) ([bold] . [bold-italic]) @@ -1043,10 +1062,10 @@ (defun make-face-unbold (face &optional locale tags) "Make FACE non-bold in LOCALE, if possible. -This will attempt to make the font non-bold for X locales and will -unset the highlight flag for TTY locales. -See `make-face-bold' for the semantics of the LOCALE argument and -for more specifics on exactly how this function works." +This will attempt to make the font non-bold for X/MS Windows locales +and will unset the highlight flag for TTY locales. See +`make-face-bold' for the semantics of the LOCALE argument and for more +specifics on exactly how this function works." (interactive (list (read-face-name "Make which face non-bold: "))) (frob-face-font-2 face locale tags 'bold 'default @@ -1057,9 +1076,11 @@ (lambda () ;; handle X specific entries (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-unbold locale tags)) + (frob-face-property face 'font 'x-make-font-unbold + '(x) locale tags)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-unbold locale tags)) + (frob-face-property face 'font 'mswindows-make-font-unbold + '(mswindows) locale tags)) ) '(([default] . t) ([bold] . [default]) @@ -1068,10 +1089,10 @@ (defun make-face-unitalic (face &optional locale tags) "Make FACE non-italic in LOCALE, if possible. -This will attempt to make the font non-italic for X locales and will -unset the underline flag for TTY locales. -See `make-face-bold' for the semantics of the LOCALE argument and -for more specifics on exactly how this function works." +This will attempt to make the font non-italic for X/MS Windows locales +and will unset the underline flag for TTY locales. See +`make-face-bold' for the semantics of the LOCALE argument and for more +specifics on exactly how this function works." (interactive (list (read-face-name "Make which face non-italic: "))) (frob-face-font-2 face locale tags 'italic 'default @@ -1082,9 +1103,11 @@ (lambda () ;; handle X specific entries (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-unitalic locale tags)) + (frob-face-property face 'font 'x-make-font-unitalic + '(x) locale tags)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-unitalic locale tags)) + (frob-face-property face 'font 'mswindows-make-font-unitalic + '(mswindows) locale tags)) ) '(([default] . t) ([bold] . t) @@ -1103,9 +1126,11 @@ (interactive (list (read-face-name "Shrink which face: "))) ;; handle X specific entries (when (featurep 'x) - (frob-face-property face 'font 'x-find-smaller-font locale)) + (frob-face-property face 'font 'x-find-smaller-font + '(x) locale)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-find-smaller-font locale))) + (frob-face-property face 'font 'mswindows-find-smaller-font + '(mswindows) locale))) (defun make-face-larger (face &optional locale) "Make the font of FACE be larger, if possible. @@ -1113,9 +1138,11 @@ (interactive (list (read-face-name "Enlarge which face: "))) ;; handle X specific entries (when (featurep 'x) - (frob-face-property face 'font 'x-find-larger-font locale)) + (frob-face-property face 'font 'x-find-larger-font + '(x) locale)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-find-larger-font locale))) + (frob-face-property face 'font 'mswindows-find-larger-font + '(mswindows) locale))) (defun invert-face (face &optional locale) "Swap the foreground and background colors of the face." @@ -1248,7 +1275,7 @@ (defvar default-custom-frame-properties nil "The frame properties used for the global faces. -Frames not matching these propertiess should have frame local faces. +Frames not matching these properties should have frame local faces. The value should be nil, if uninitialized, or a plist otherwise. See `defface' for a list of valid keys and values for the plist.") @@ -1589,14 +1616,17 @@ nil 'append)) ) -;; New function with 20.1, suggested by Per Abrahamsen, coded by Kyle Jones. +;; New function with 20.1, suggested by Per Abrahamsen, coded by Kyle +;; Jones and Hrvoje Niksic. (defun set-face-stipple (face pixmap &optional frame) "Change the stipple pixmap of FACE to PIXMAP. This is an Emacs compatibility function; consider using set-face-background-pixmap instead. PIXMAP should be a string, the name of a file of pixmap data. -The directories listed in the `x-bitmap-file-path' variable are searched. +The directories listed in the variables `x-bitmap-file-path' and +`mswindows-bitmap-file-path' under X and MS Windows respectively +are searched. Alternatively, PIXMAP may be a list of the form (WIDTH HEIGHT DATA) where WIDTH and HEIGHT are the size in pixels, and DATA is @@ -1607,20 +1637,33 @@ in that frame; otherwise change each frame." (while (not (find-face face)) (setq face (signal 'wrong-type-argument (list 'facep face)))) - (locate-file pixmap x-bitmap-file-path '(".xbm" "")) - (while (cond ((stringp pixmap) - (unless (file-readable-p pixmap) - (setq pixmap `[xbm :file ,pixmap])) - nil) - ((and (consp pixmap) (= (length pixmap) 3)) - (setq pixmap `[xbm :data ,pixmap]) - nil) - (t t)) - (setq pixmap (signal 'wrong-type-argument - (list 'stipple-pixmap-p pixmap)))) - (while (and frame (not (framep frame))) - (setq frame (signal 'wrong-type-argument (list 'framep frame)))) - (set-face-background-pixmap face pixmap frame)) + (let ((bitmap-path (ecase (console-type) + (x x-bitmap-file-path) + (mswindows mswindows-bitmap-file-path))) + instantiator) + (while + (null + (setq instantiator + (cond ((stringp pixmap) + (let ((file (if (file-name-absolute-p pixmap) + pixmap + (locate-file pixmap bitmap-path + '(".xbm" ""))))) + (and file + `[xbm :file ,file]))) + ((and (listp pixmap) (= (length pixmap) 3)) + `[xbm :data ,pixmap]) + (t nil)))) + ;; We're signaling a continuable error; let's make sure the + ;; function `stipple-pixmap-p' at least exists. + (flet ((stipple-pixmap-p (pixmap) + (or (stringp pixmap) + (and (listp pixmap) (= (length pixmap) 3))))) + (setq pixmap (signal 'wrong-type-argument + (list 'stipple-pixmap-p pixmap))))) + (while (and frame (not (framep frame))) + (setq frame (signal 'wrong-type-argument (list 'framep frame)))) + (set-face-background-pixmap face instantiator frame))) ;; Create the remaining standard faces now. This way, packages that we dump @@ -1745,7 +1788,8 @@ (and (featurep 'x) (x-get-resource "backgroundToolBarColor" - "BackgroundToolBarColor" 'string)) + "BackgroundToolBarColor" 'string + nil nil 'warn)) (face-background 'toolbar)))) (purecopy '("foregroundToolBarColor" @@ -1753,7 +1797,8 @@ (and (featurep 'x) (x-get-resource "foregroundToolBarColor" - "ForegroundToolBarColor" 'string)) + "ForegroundToolBarColor" 'string + nil nil 'warn)) (face-foreground 'toolbar)))) ))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/files.el --- a/lisp/files.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/files.el Mon Aug 13 11:35:02 2007 +0200 @@ -873,23 +873,31 @@ (defun insert-file-contents-literally (filename &optional visit beg end replace) "Like `insert-file-contents', q.v., but only reads in the file. A buffer may be modified in several ways after reading into the buffer due -to advanced Emacs features, such as file-name-handlers, format decoding, -find-file-hooks, etc. +to advanced Emacs features, such as format decoding, character code +conversion,find-file-hooks, automatic uncompression, etc. + This function ensures that none of these modifications will take place." - (let ((file-name-handler-alist nil) - (format-alist nil) - (after-insert-file-functions nil) - (find-buffer-file-type-function - (if (fboundp 'find-buffer-file-type) - (symbol-function 'find-buffer-file-type) - nil))) - (unwind-protect - (progn - (fset 'find-buffer-file-type (lambda (filename) t)) - (insert-file-contents filename visit beg end replace)) - (if find-buffer-file-type-function - (fset 'find-buffer-file-type find-buffer-file-type-function) - (fmakunbound 'find-buffer-file-type))))) + (let ((wrap-func (find-file-name-handler filename + 'insert-file-contents-literally))) + (if wrap-func + (funcall wrap-func 'insert-file-contents-literally filename + visit beg end replace) + (let ((file-name-handler-alist nil) + (format-alist nil) + (after-insert-file-functions nil) + (coding-system-for-read 'binary) + (coding-system-for-write 'binary) + (find-buffer-file-type-function + (if (fboundp 'find-buffer-file-type) + (symbol-function 'find-buffer-file-type) + nil))) + (unwind-protect + (progn + (fset 'find-buffer-file-type (lambda (filename) t)) + (insert-file-contents filename visit beg end replace)) + (if find-buffer-file-type-function + (fset 'find-buffer-file-type find-buffer-file-type-function) + (fmakunbound 'find-buffer-file-type))))))) (defun find-file-noselect (filename &optional nowarn rawfile) "Read file FILENAME into a buffer and return the buffer. @@ -1028,7 +1036,8 @@ (setq buf (current-buffer)))) (t (kill-buffer buf) - (signal (car data) (cdr data)))))) + (signal (car data) (cdr data)))) + )) buf))) ;; FSF has `insert-file-literally' and `find-file-literally' here. @@ -1169,6 +1178,7 @@ ("/\\.\\(?:bash_\\|z\\)?\\(profile\\|login\\|logout\\)\\'" . sh-mode) ("/\\.\\(?:[ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode) ("/\\.\\(?:[kz]shenv\\|xsession\\)\\'" . sh-mode) + ("\\.m?spec$" .sh-mode) ;; The following come after the ChangeLog pattern for the sake of ;; ChangeLog.1, etc. and after the .scm.[0-9] pattern too. ("\\.[12345678]\\'" . nroff-mode) @@ -1193,7 +1203,9 @@ ("\\.lex\\'" . c-mode) ("\\.m\\'" . objc-mode) ("\\.oak\\'" . scheme-mode) - ("\\.s?html?\\'" . html-mode) + ("\\.[sj]?html?\\'" . html-mode) + ("\\.jsp\\'" . html-mode) + ("\\.xml\\'" . xml-mode) ("\\.htm?l?3\\'" . html3-mode) ("\\.\\(?:sgml?\\|dtd\\)\\'" . sgml-mode) ("\\.c?ps\\'" . postscript-mode) @@ -1203,7 +1215,7 @@ ("\\.m4\\'" . autoconf-mode) ("configure\\.in\\'" . autoconf-mode) ("\\.ml\\'" . lisp-mode) - ("\\.ma?k\\'" . makefile-mode) + ("\\.ma?ke?\\'" . makefile-mode) ("[Mm]akefile\\(\\.\\|\\'\\)" . makefile-mode) ("\\.X\\(defaults\\|environment\\|resources\\|modmap\\)\\'" . xrdb-mode) ;; #### The following three are Unix-specific (but do we care?) @@ -1539,7 +1551,7 @@ (cond ((not (search-forward "-*-" end t)) ;; doesn't have one. (setq force t)) - ((looking-at "[ \t]*\\([^ \t\n\r:;]+\\)\\([ \t]*-\\*-\\)") + ((looking-at "[ \t]*\\([^ \t\n\r:;]+?\\)\\([ \t]*-\\*-\\)") ;; Antiquated form: "-*- ModeName -*-". (setq result (list (cons 'mode @@ -1831,7 +1843,7 @@ (buffer-local-variables))) nil nil (buffer-name))) t - (if (and current-prefix-arg (featurep 'mule)) + (if (and current-prefix-arg (featurep 'file-coding)) (read-coding-system "Coding system: ")))) (and (eq (current-buffer) mouse-grabbed-buffer) (error "Can't write minibuffer window")) @@ -2080,9 +2092,8 @@ "Convert FILENAME to be relative to DIRECTORY (default: default-directory). This function returns a relative file name which is equivalent to FILENAME when used with that default directory as the default. -If this is impossible (which can happen on MSDOS and Windows -when the file name and directory use different drive names) -then it returns FILENAME." +If this is impossible (which can happen on MS Windows when the file name +and directory use different drive names) then it returns FILENAME." (save-match-data (let ((fname (expand-file-name filename))) (setq directory (file-name-as-directory @@ -2459,7 +2470,7 @@ (recursive-edit) ;; Return nil to ask about BUF again. nil) - "display the current buffer")))) + "%_Display Buffer")))) (abbrevs-done (and save-abbrevs abbrevs-changed (progn diff -r 72a7cfa4a488 -r abe6d1db359e lisp/find-paths.el --- a/lisp/find-paths.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/find-paths.el Mon Aug 13 11:35:02 2007 +0200 @@ -109,6 +109,10 @@ (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-chase-symlink (file-name) "Chase a symlink until the bitter end." (let ((maybe-symlink (file-symlink-p file-name))) @@ -159,7 +163,8 @@ base)))) (defun paths-find-emacs-directory (roots suffix base - &optional envvar default keep-suffix) + &optional envvar default keep-suffix + in-place-external) "Find a directory in the XEmacs hierarchy. ROOTS must be a list of installation roots. SUFFIX is the subdirectory from there. @@ -168,7 +173,9 @@ specify the directory. DEFAULT is the preferred value. If KEEP-SUFFIX is non-nil, the suffix must be respected in searching -the directory." +the directory. +If IN-PLACE-EXTERNAL is non-nil, the directory might be found outside +an in-place root-hierarchy." (let ((preferred-value (or (and envvar (getenv envvar)) default))) (if (and preferred-value @@ -176,28 +183,39 @@ (file-name-as-directory preferred-value) (catch 'gotcha (while roots - (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)))))) + (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))))) (setq roots (cdr roots))) nil)))) -(defun paths-find-site-directory (roots base &optional envvar default) - "Find a site-specific directory in the XEmacs hierarchy." +(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." (paths-find-emacs-directory roots (file-name-as-directory (paths-construct-path (list "lib" emacs-program-name))) base - envvar default)) + envvar default + nil + in-place-external)) (defun paths-find-version-directory (roots base &optional envvar default enforce-version) @@ -262,7 +280,7 @@ (defun paths-decode-directory-path (string &optional drop-empties) "Split STRING at path separators into a directory list. -Non-\"\" comonents are converted into directory form. +Non-\"\" components are converted into directory form. If DROP-EMPTIES is non-NIL, \"\" components are dropped from the output. Otherwise, they are left alone." (let* ((components (split-path string)) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/finder.el --- a/lisp/finder.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/finder.el Mon Aug 13 11:35:02 2007 +0200 @@ -78,41 +78,48 @@ `( (abbrev . "abbreviation handling, typing shortcuts, macros") (bib . "code related to the `bib' bibliography processor") + (build . "code used to build XEmacs") (c . "C, C++, and Objective-C language support") (calendar . "calendar and time management support") (comm . "communications, networking, remote access to files") + (content . "contains content (menu/dialog box descs, text, images, &c)") (data . "support for editing files of data") - (docs . "support for Emacs documentation") - (dumped . "files preloaded into Emacs") + (docs . "support for XEmacs documentation") + (dumped . "files preloaded into XEmacs") (emulations . "emulations of other editors") (extensions . "Emacs Lisp language extensions") (faces . "support for multiple fonts") - (frames . "support for Emacs frames and window systems") + (frames . "support for XEmacs frames and window systems") (games . "games, jokes and amusements") + (gui . "support for menubars, dialog boxes, and other GUI features") (hardware . "support for interfacing with exotic hardware") (help . "support for on-line help systems") (hypermedia . "support for links between text or other media types") (i18n . "internationalization and alternate character-set support") - (internal . "code for Emacs internals, build process, defaults") + (internal . "code implementing core functionality in XEmacs") (languages . "specialized modes for editing programming languages") (lisp . "Lisp support, including Emacs Lisp") (local . "code local to your site") + (mail . "modes for electronic-mail handling") (maint . "maintenance aids for the Emacs development group") - (mail . "modes for electronic-mail handling") (matching . "various sorts of searching and matching") (mouse . "mouse support") + (mswin . "support for anything running on MS Windows") ,(when (featurep 'mule) (cons 'mule "multi-language extensions")) (news . "support for netnews reading and posting") (oop . "support for object-oriented programming") (outlines . "support for hierarchical outlining") (processes . "process, subshell, compilation, and job control support") + (services . "provides services for use by other programs (cf `user')") (terminals . "support for terminal types") (tex . "code related to the TeX formatter") (tools . "programming tools") (unix . "front-ends/assistants for, or emulators of, UNIX features") + (user . "program interacts directly with the user (cf `services'") (vms . "support code for vms") (wp . "word processing") + (www . "support for the Web (WWW, the World Wide Web)") )) (defvar finder-mode-map nil) @@ -150,7 +157,9 @@ (let ((processed nil) (directory-abbrev-alist (append - (mapcar (function (lambda (dir) (cons dir ""))) + (mapcar (function (lambda (dir) + (cons (concat "^" (regexp-quote dir)) + ""))) finder-abbreviate-directory-list) directory-abbrev-alist)) (using-load-path)) @@ -167,7 +176,7 @@ (lambda (d) (mapcar (lambda (f) - (when (not (member f processed)) + (when (and (not (member f processed)) (file-readable-p f)) (let (summary keystart keywords) (setq processed (cons f processed)) (if (not finder-compile-keywords-quiet) @@ -284,6 +293,7 @@ (setq dirs (cdr dirs))) found))) +;;;###autoload (defun finder-commentary (file) "Display FILE's commentary section. FILE should be in a form suitable for passing to `locate-library'." @@ -395,7 +405,7 @@ "\\\\[finder-select] = select, \\[finder-list-keywords] = keywords, \\[finder-edit] = edit, \\[finder-view] = view, \\[finder-exit] = quit, \\[finder-summary] = help"))) (defun finder-exit () - "Exit Finder mode and kill the buffer" + "Exit Finder mode and kill the buffer." (interactive) ;; XEmacs change (or (one-window-p t 0) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/font-lock.el --- a/lisp/font-lock.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/font-lock.el Mon Aug 13 11:35:02 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1992-1995, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Amdahl Corporation. -;; Copyright (C) 1996 Ben Wing. +;; Copyright (C) 1996, 2000 Ben Wing. ;; Author: Jamie Zawinski , for the LISPM Preservation Society. ;; Minimally merged with FSF 19.34 by Barry Warsaw @@ -178,8 +178,8 @@ but not `font-lock-fontify-buffer'. (In other words, when you first visit a file and it gets fontified, you will see status messages no matter what size the file is. However, if you do something else like paste a -chunk of text or revert a buffer, you will see status messages only if the -changed region is large enough.) +chunk of text, you will see status messages only if the changed region is +large enough.) Note that setting `font-lock-verbose' to nil disables the status messages entirely." @@ -318,95 +318,123 @@ ;;;###autoload (defvar font-lock-keywords nil - "A list of the keywords to highlight. -Each element should be of the form: + "A list defining the keywords for `font-lock-mode' to highlight. + + FONT-LOCK-KEYWORDS := List of FONT-LOCK-FORM's. + + FONT-LOCK-FORM :== MATCHER + | (MATCHER . MATCH) + | (MATCHER . FACE-FORM) + | (MATCHER . HIGHLIGHT) + | (MATCHER HIGHLIGHT ...) + | (eval . FORM) + + MATCHER :== A string containing a regexp. + | A variable containing a regexp to search for. + | A function to call to make the search. + It is called with one arg, the limit of the search, + and should leave MATCH results in the XEmacs global + match data. + + MATCH :== An integer match subexpression number from MATCHER. + + FACE-FORM :== The symbol naming a defined face. + | Expression whos value is the face name to use. If you + want FACE-FORM to be a symbol that evaluates to a face, + use a form like \"(progn sym)\". + + HIGHLIGHT :== MATCH-HIGHLIGHT + | MATCH-ANCHORED + + FORM :== Expression returning a FONT-LOCK-FORM, evaluated when + the FONT-LOCK-FORM is first used in a buffer. This + feature can be used to provide a FONT-LOCK-FORM that + can only be generated when Font Lock mode is actually + turned on. + + MATCH-HIGHLIGHT :== (MATCH FACE-FORM OVERRIDE LAXMATCH) + + OVERRIDE :== t - overwrite existing fontification + | 'keep - only parts not already fontified are + highlighted. + | 'prepend - merge faces, this fontification has + precedence over existing + | 'append - merge faces, existing fontification has + precedence over + this face. + + LAXMATCH :== If non-nil, no error is signalled if there is no MATCH + in MATCHER. + + MATCH-ANCHORED :== (ANCHOR-MATCHER PRE-MATCH-FORM \\ + POST-MATCH-FORM MATCH-HIGHLIGHT ...) - MATCHER - (MATCHER . MATCH) - (MATCHER . FACENAME) - (MATCHER . HIGHLIGHT) - (MATCHER HIGHLIGHT ...) - (eval . FORM) + ANCHOR-MATCHER :== Like a MATCHER, except that the limit of the search + defaults to the end of the line after PRE-MATCH-FORM + is evaluated. However, if PRE-MATCH-FORM returns a + position greater than the end of the line, that + position is used as the limit of the search. It is + generally a bad idea to return a position greater than + the end of the line, i.e., cause the ANCHOR-MATCHER + search to span lines. + + PRE-MATCH-FORM :== Evaluated before the ANCHOR-MATCHER is used, therefore + can be used to initialize before, ANCHOR-MATCHER is + used. Typically, PRE-MATCH-FORM is used to move to + some position relative to the original MATCHER, before + starting with the ANCHOR-MATCHER. + + POST-MATCH-FORM :== Like PRE-MATCH-FORM, but used to clean up after the + ANCHOR-MATCHER. It might be used to move, before + resuming with MATCH-ANCHORED's parent's MATCHER. + +For example, an element of the first form highlights (if not already highlighted): + + \"\\\\\" Discrete occurrences of \"foo\" in the value + of the variable `font-lock-keyword-face'. -where HIGHLIGHT should be either MATCH-HIGHLIGHT or MATCH-ANCHORED. + (\"fu\\\\(bar\\\\)\" . 1) Substring \"bar\" within all occurrences of + \"fubar\" in the value of + `font-lock-keyword-face'. + + (\"fubar\" . fubar-face) Occurrences of \"fubar\" in the value of + `fubar-face'. + + (\"foo\\\\|bar\" 0 foo-bar-face t) Occurrences of either \"foo\" or \"bar\" in the + value of `foo-bar-face', even if already + highlighted. -FORM is an expression, whose value should be a keyword element, -evaluated when the keyword is (first) used in a buffer. This feature -can be used to provide a keyword that can only be generated when Font -Lock mode is actually turned on. + (fubar-match 1 fubar-face) The first subexpression within all + occurrences of whatever the function + `fubar-match' finds and matches in the value + of `fubar-face'. + + (\"\\\\\" (0 anchor-face) (\"\\\\\" nil nil (0 item-face))) + -------------- --------------- ------------ --- --- ------------- + | | | | | | + MATCHER | ANCHOR-MATCHER | +------+ MATCH-HIGHLIGHT + MATCH-HIGHLIGHT PRE-MATCH-FORM | + POST-MATCH-FORM + + Discrete occurrences of \"anchor\" in the value of `anchor-face', and + subsequent discrete occurrences of \"item\" (on the same line) in the value + of `item-face'. (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil. + Therefore \"item\" is initially searched for starting from the end of the + match of \"anchor\", and searching for subsequent instance of \"anchor\" + resumes from where searching for \"item\" concluded.) For highlighting single items, typically only MATCH-HIGHLIGHT is required. -However, if an item or (typically) items is to be highlighted following the -instance of another item (the anchor) then MATCH-ANCHORED may be required. - -MATCH-HIGHLIGHT should be of the form: - - (MATCH FACENAME OVERRIDE LAXMATCH) - -Where MATCHER can be either the regexp to search for, a variable -containing the regexp to search for, or the function to call to make -the search (called with one argument, the limit of the search). MATCH -is the subexpression of MATCHER to be highlighted. FACENAME is either -a symbol naming a face, or an expression whose value is the face name -to use. If you want FACENAME to be a symbol that evaluates to a face, -use a form like \"(progn sym)\". - -OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification may -be overwritten. If `keep', only parts not already fontified are highlighted. -If `prepend' or `append', existing fontification is merged with the new, in -which the new or existing fontification, respectively, takes precedence. -If LAXMATCH is non-nil, no error is signalled if there is no MATCH in MATCHER. - -For example, an element of the form highlights (if not already highlighted): - - \"\\\\\\=\" Discrete occurrences of \"foo\" in the value of the - variable `font-lock-keyword-face'. - (\"fu\\\\(bar\\\\)\" . 1) Substring \"bar\" within all occurrences of \"fubar\" in - the value of `font-lock-keyword-face'. - (\"fubar\" . fubar-face) Occurrences of \"fubar\" in the value of `fubar-face'. - (\"foo\\\\|bar\" 0 foo-bar-face t) - Occurrences of either \"foo\" or \"bar\" in the value - of `foo-bar-face', even if already highlighted. - -MATCH-ANCHORED should be of the form: - - (MATCHER PRE-MATCH-FORM POST-MATCH-FORM MATCH-HIGHLIGHT ...) - -Where MATCHER is as for MATCH-HIGHLIGHT with one exception; see below. -PRE-MATCH-FORM and POST-MATCH-FORM are evaluated before the first, and after -the last, instance MATCH-ANCHORED's MATCHER is used. Therefore they can be -used to initialize before, and cleanup after, MATCHER is used. Typically, -PRE-MATCH-FORM is used to move to some position relative to the original -MATCHER, before starting with MATCH-ANCHORED's MATCHER. POST-MATCH-FORM might -be used to move, before resuming with MATCH-ANCHORED's parent's MATCHER. - -For example, an element of the form highlights (if not already highlighted): - - (\"\\\\\\=\" (0 anchor-face) (\"\\\\\\=\" nil nil (0 item-face))) - - Discrete occurrences of \"anchor\" in the value of `anchor-face', and subsequent - discrete occurrences of \"item\" (on the same line) in the value of `item-face'. - (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil. Therefore \"item\" is - initially searched for starting from the end of the match of \"anchor\", and - searching for subsequent instance of \"anchor\" resumes from where searching - for \"item\" concluded.) - -The above-mentioned exception is as follows. The limit of the MATCHER search -defaults to the end of the line after PRE-MATCH-FORM is evaluated. -However, if PRE-MATCH-FORM returns a position greater than the position after -PRE-MATCH-FORM is evaluated, that position is used as the limit of the search. -It is generally a bad idea to return a position greater than the end of the -line, i.e., cause the MATCHER search to span lines. - -Note that the MATCH-ANCHORED feature is experimental; in the future, we may -replace it with other ways of providing this functionality. +However, if an item or (typically) several items are to be highlighted +following the instance of another item (the anchor) then MATCH-ANCHORED may be +required. These regular expressions should not match text which spans lines. While -\\[font-lock-fontify-buffer] handles multi-line patterns correctly, updating -when you edit the buffer does not, since it considers text one line at a time. +\\[font-lock-fontify-buffer] handles multi-line patterns correctly, updating when you +edit the buffer does not, since it considers text one line at a time. -Be very careful composing regexps for this list; -the wrong pattern can dramatically slow things down!") +Be very careful composing regexps for this list; the wrong pattern can +dramatically slow things down! +") ;;;###autoload (make-variable-buffer-local 'font-lock-keywords) @@ -552,25 +580,55 @@ ;; #### barf gag retch. Horrid FSF lossage that we need to ;; keep around for compatibility with font-lock-keywords that -;; forget to properly quote their faces. +;; forget to properly quote their faces. I tried just let-binding +;; them when we eval the face expression, but that failes because +;; some files actually use the variables directly in their init code +;; without quoting them. --ben (defvar font-lock-comment-face 'font-lock-comment-face - "Don't even think of using this.") + "This variable should not be set. +It is present only for horrid FSF compatibility reasons. +The corresponding face should be set using `edit-faces' or the +`set-face-*' functions.") (defvar font-lock-doc-string-face 'font-lock-doc-string-face - "Don't even think of using this.") + "This variable should not be set. +It is present only for horrid FSF compatibility reasons. +The corresponding face should be set using `edit-faces' or the +`set-face-*' functions.") (defvar font-lock-string-face 'font-lock-string-face - "Don't even think of using this.") + "This variable should not be set. +It is present only for horrid FSF compatibility reasons. +The corresponding face should be set using `edit-faces' or the +`set-face-*' functions.") (defvar font-lock-keyword-face 'font-lock-keyword-face - "Don't even think of using this.") + "This variable should not be set. +It is present only for horrid FSF compatibility reasons. +The corresponding face should be set using `edit-faces' or the +`set-face-*' functions.") (defvar font-lock-function-name-face 'font-lock-function-name-face - "Don't even think of using this.") + "This variable should not be set. +It is present only for horrid FSF compatibility reasons. +The corresponding face should be set using `edit-faces' or the +`set-face-*' functions.") (defvar font-lock-variable-name-face 'font-lock-variable-name-face - "Don't even think of using this.") + "This variable should not be set. +It is present only for horrid FSF compatibility reasons. +The corresponding face should be set using `edit-faces' or the +`set-face-*' functions.") (defvar font-lock-type-face 'font-lock-type-face - "Don't even think of using this.") + "This variable should not be set. +It is present only for horrid FSF compatibility reasons. +The corresponding face should be set using `edit-faces' or the +`set-face-*' functions.") (defvar font-lock-reference-face 'font-lock-reference-face - "Don't even think of using this.") + "This variable should not be set. +It is present only for horrid FSF compatibility reasons. +The corresponding face should be set using `edit-faces' or the +`set-face-*' functions.") (defvar font-lock-preprocessor-face 'font-lock-preprocessor-face - "Don't even think of using this.") + "This variable should not be set. +It is present only for horrid FSF compatibility reasons. +The corresponding face should be set using `edit-faces' or the +`set-face-*' functions.") (defconst font-lock-face-list '(font-lock-comment-face @@ -584,11 +642,10 @@ font-lock-preprocessor-face font-lock-warning-face)) -;; #### There should be an emulation for the old font-lock-use-* -;; settings! - (defface font-lock-comment-face '((((class color) (background dark)) (:foreground "gray80")) + ;; blue4 is hardly different from black on windows. + (((class color) (background light) (type mswindows)) (:foreground "blue")) (((class color) (background light)) (:foreground "blue4")) (((class grayscale) (background light)) (:foreground "DimGray" :bold t :italic t)) @@ -620,6 +677,8 @@ (defface font-lock-keyword-face '((((class color) (background dark)) (:foreground "cyan")) + ;; red4 is hardly different from black on windows. + (((class color) (background light) (type mswindows)) (:foreground "red")) (((class color) (background light)) (:foreground "red4")) (((class grayscale) (background light)) (:foreground "LightGray" :bold t)) (((class grayscale) (background dark)) (:foreground "DimGray" :bold t)) @@ -629,6 +688,11 @@ (defface font-lock-function-name-face '((((class color) (background dark)) (:foreground "aquamarine")) + ;; brown4 is hardly different from black on windows. + ;; I changed it to red because IMO it's pointless and ugly to + ;; use a million slightly different colors for niggly syntactic + ;; differences. --ben + (((class color) (background light) (type mswindows)) (:foreground "red")) (((class color) (background light)) (:foreground "brown4")) (t (:bold t :underline t))) "Font Lock mode face used to highlight function names." @@ -823,28 +887,21 @@ (set (make-local-variable 'font-lock-mode) on-p) (cond (on-p (font-lock-set-defaults-1) - (make-local-hook 'before-revert-hook) - (make-local-hook 'after-revert-hook) - ;; If buffer is reverted, must clean up the state. - (add-hook 'before-revert-hook 'font-lock-revert-setup nil t) - (add-hook 'after-revert-hook 'font-lock-revert-cleanup nil t) (run-hooks 'font-lock-mode-hook) (cond (font-lock-fontified nil) ((or (null maximum-size) (<= (buffer-size) maximum-size)) (font-lock-fontify-buffer)) (font-lock-verbose - (lmessage 'command "Fontifying %s... buffer too big." - (buffer-name))))) + (progress-feedback-with-label + 'font-lock + "Fontifying %s... buffer too big." 'abort + (buffer-name))))) (font-lock-fontified (setq font-lock-fontified nil) - (remove-hook 'before-revert-hook 'font-lock-revert-setup t) - (remove-hook 'after-revert-hook 'font-lock-revert-cleanup t) (font-lock-unfontify-region (point-min) (point-max)) (font-lock-thing-lock-cleanup)) (t - (remove-hook 'before-revert-hook 'font-lock-revert-setup t) - (remove-hook 'after-revert-hook 'font-lock-revert-cleanup t) (font-lock-thing-lock-cleanup))) (redraw-modeline))) @@ -967,45 +1024,46 @@ (defun font-lock-unfontify-region (beg end &optional loudly) (funcall font-lock-unfontify-region-function beg end loudly)) -;; #### In these functions, the FSF is careful to do -;; (save-restriction -;; (widen) -;; before anything else. Should we copy? (defun font-lock-default-fontify-buffer () (interactive) - (let ((was-on font-lock-mode) - (font-lock-verbose (or font-lock-verbose (interactive-p))) - (font-lock-message-threshold 0) - (aborted nil)) - ;; Turn it on to run hooks and get the right font-lock-keywords. - (or was-on (font-lock-mode 1)) - (font-lock-unfontify-region (point-min) (point-max) t) -;; (buffer-syntactic-context-flush-cache) + ;; if we don't widen, then the C code will fail to + ;; realize that we're inside a comment. + (save-restriction + (widen) + (let ((was-on font-lock-mode) + (font-lock-verbose (or font-lock-verbose (interactive-p))) + (font-lock-message-threshold 0) + (aborted nil)) + ;; Turn it on to run hooks and get the right font-lock-keywords. + (or was-on (font-lock-mode 1)) + (font-lock-unfontify-region (point-min) (point-max) t) + ;; (buffer-syntactic-context-flush-cache) - ;; If a ^G is typed during fontification, abort the fontification, but - ;; return normally (do not signal.) This is to make it easy to abort - ;; fontification if it's taking a long time, without also causing the - ;; buffer not to pop up. If a real abort is desired, the user can ^G - ;; again. - ;; - ;; Possibly this should happen down in font-lock-fontify-region instead - ;; of here, but since that happens from the after-change-hook (meaning - ;; much more frequently) I'm afraid of the bad consequences of stealing - ;; the interrupt character at inopportune times. - ;; - (condition-case nil - (save-excursion - (font-lock-fontify-region (point-min) (point-max))) - (quit - (setq aborted t))) + ;; If a ^G is typed during fontification, abort the fontification, but + ;; return normally (do not signal.) This is to make it easy to abort + ;; fontification if it's taking a long time, without also causing the + ;; buffer not to pop up. If a real abort is desired, the user can ^G + ;; again. + ;; + ;; Possibly this should happen down in font-lock-fontify-region instead + ;; of here, but since that happens from the after-change-hook (meaning + ;; much more frequently) I'm afraid of the bad consequences of stealing + ;; the interrupt character at inopportune times. + ;; + (condition-case nil + (save-excursion + (font-lock-fontify-region (point-min) (point-max))) + (t + (setq aborted t))) - (or was-on ; turn it off if it was off. - (let ((font-lock-fontified nil)) ; kludge to prevent defontification - (font-lock-mode 0))) - (set (make-local-variable 'font-lock-fontified) t) - (when (and aborted font-lock-verbose) - (lmessage 'command "Fontifying %s... aborted." (buffer-name)))) - (run-hooks 'font-lock-after-fontify-buffer-hook)) + (or was-on ; turn it off if it was off. + (let ((font-lock-fontified nil)) ; kludge to prevent defontification + (font-lock-mode 0))) + (set (make-local-variable 'font-lock-fontified) t) + (when (and aborted font-lock-verbose) + (progress-feedback-with-label 'font-lock "Fontifying %s... aborted." + 'abort (buffer-name)))) + (run-hooks 'font-lock-after-fontify-buffer-hook))) (defun font-lock-default-unfontify-buffer () (font-lock-unfontify-region (point-min) (point-max)) @@ -1043,7 +1101,8 @@ (defun font-lock-default-unfontify-region (beg end &optional maybe-loudly) (when (and maybe-loudly font-lock-verbose (>= (- end beg) font-lock-message-threshold)) - (lmessage 'progress "Fontifying %s..." (buffer-name))) + (progress-feedback-with-label 'font-lock "Fontifying %s..." 0 + (buffer-name))) (let ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) buffer-file-name buffer-file-truename) @@ -1051,10 +1110,7 @@ (and (not modified) (buffer-modified-p) (set-buffer-modified-p nil)))) ;; Following is the original FSF version (similar to our original -;; version, before all the crap I added below). -;; -;; Probably that crap should either be fixed up so it works better, -;; or tossed away. +;; version, before the deferred stuff was added). ;; ;; I think that lazy-lock v2 tries to do something similar. ;; Those efforts should be merged. @@ -1068,111 +1124,99 @@ ; (progn (goto-char beg) (beginning-of-line) (point)) ; (progn (goto-char end) (forward-line 1) (point)))))) -(defvar font-lock-old-extent nil) -(defvar font-lock-old-len 0) +(defvar font-lock-always-fontify-immediately nil + "Set this to non-nil to disable font-lock deferral. +Otherwise, changes to existing text will not be processed until the +next redisplay cycle, avoiding excessive fontification when many +buffer modifications are performed or a buffer is reverted.") -(defun font-lock-fontify-glumped-region () - ;; even if something goes wrong in the fontification, mark the glumped - ;; region as fontified; otherwise, the same error might get signaled - ;; after every command. - (unwind-protect - ;; buffer/extent may be deleted. - (if (and (extent-live-p font-lock-old-extent) - (buffer-live-p (extent-object font-lock-old-extent))) - (save-excursion - (set-buffer (extent-object font-lock-old-extent)) - (font-lock-after-change-function-1 - (extent-start-position font-lock-old-extent) - (extent-end-position font-lock-old-extent) - font-lock-old-len))) - (detach-extent font-lock-old-extent) - (setq font-lock-old-extent nil))) +(defvar font-lock-pending-extent-table (make-hash-table :weakness 'key)) +(defvar font-lock-range-table (make-range-table)) (defun font-lock-pre-idle-hook () - (condition-case nil - (if font-lock-old-extent - (font-lock-fontify-glumped-region)) - (error (warn "Error caught in `font-lock-pre-idle-hook'")))) - -(defvar font-lock-always-fontify-immediately nil - "Set this to non-nil to disable font-lock deferral.") + (condition-case font-lock-error + (if (> (hash-table-count font-lock-pending-extent-table) 0) + (font-lock-fontify-pending-extents)) + (error (warn "Error caught in `font-lock-pre-idle-hook': %s" + font-lock-error)))) ;;; called when any modification is made to buffer text. This function -;;; attempts to glump adjacent changes together so that excessive -;;; fontification is avoided. This function could easily be adapted -;;; to other after-change-functions. +;;; remembers the changed ranges until the next redisplay, at which point +;;; the extents are merged and pruned, and the resulting ranges fontified. +;;; This function could easily be adapted to other after-change-functions. (defun font-lock-after-change-function (beg end old-len) - (let ((obeg (and font-lock-old-extent - (extent-start-position font-lock-old-extent))) - (oend (and font-lock-old-extent - (extent-end-position font-lock-old-extent))) - (bc-end (+ beg old-len))) - - ;; If this change can't be merged into the glumped one, - ;; we need to fontify the glumped one right now. - (if (and font-lock-old-extent - (or (not (eq (current-buffer) - (extent-object font-lock-old-extent))) - (< bc-end obeg) - (> beg oend))) - (font-lock-fontify-glumped-region)) - - (if font-lock-old-extent - ;; Update glumped region. - (progn - ;; Any characters in the before-change region that are - ;; outside the glumped region go into the glumped - ;; before-change region. - (if (> bc-end oend) - (setq font-lock-old-len (+ font-lock-old-len (- bc-end oend)))) - (if (> obeg beg) - (setq font-lock-old-len (+ font-lock-old-len (- obeg beg)))) - ;; New glumped region is the union of the glumped region - ;; and the new region. - (set-extent-endpoints font-lock-old-extent - (min obeg beg) - (max oend end))) + (when font-lock-mode + (let ((ex (make-extent beg end))) + (set-extent-property ex 'detachable nil) + (set-extent-property ex 'end-open nil) + (let ((exs (gethash (current-buffer) font-lock-pending-extent-table))) + (push ex exs) + (puthash (current-buffer) exs font-lock-pending-extent-table))) + (if font-lock-always-fontify-immediately + (font-lock-fontify-pending-extents)))) - ;; No glumped region, so create one. - (setq font-lock-old-extent (make-extent beg end)) - (set-extent-property font-lock-old-extent 'detachable nil) - (set-extent-property font-lock-old-extent 'end-open nil) - (setq font-lock-old-len old-len)) - - (if font-lock-always-fontify-immediately - (font-lock-fontify-glumped-region)))) - -(defun font-lock-after-change-function-1 (beg end old-len) - (if (null font-lock-mode) - nil - (save-excursion - (save-restriction - ;; if we don't widen, then fill-paragraph (and any command that - ;; operates on a narrowed region) confuses things, because the C - ;; code will fail to realize that we're inside a comment. - (widen) - (save-match-data - (let ((zmacs-region-stays zmacs-region-stays)) ; protect from change! - (goto-char beg) - ;; Maybe flush the internal cache used by syntactically-sectionize. - ;; (It'd be nice if this was more automatic.) Any deletions mean - ;; the cache is invalid, and insertions at beginning or end of line - ;; mean that the bol cache might be invalid. -;; (if (or (> old-len 0) (bobp) (= (preceding-char) ?\n)) -;; (buffer-syntactic-context-flush-cache)) - - ;; Always recompute the whole line. - (goto-char end) - (forward-line 1) - (setq end (point)) - (goto-char beg) - (beginning-of-line) - (setq beg (point)) - ;; Rescan between start of line from `beg' and start of line after - ;; `end'. - (font-lock-fontify-region beg end))))))) - +(defun font-lock-fontify-pending-extents () + ;; ah, the beauty of mapping functions. + ;; this function is actually shorter than the old version, which handled + ;; only one buffer and one contiguous region! + (save-match-data + (maphash + #'(lambda (buffer exs) + ;; remove first, to avoid infinite reprocessing if error + (remhash buffer font-lock-pending-extent-table) + (when (buffer-live-p buffer) + (clear-range-table font-lock-range-table) + (with-current-buffer buffer + (save-excursion + (save-restriction + ;; if we don't widen, then the C code will fail to + ;; realize that we're inside a comment. + (widen) + (let ((zmacs-region-stays + zmacs-region-stays)) ; protect from change! + (mapc + #'(lambda (ex) + ;; paranoia. + (when (and (extent-live-p ex) + (not (extent-detached-p ex))) + ;; first expand the ranges to full lines, because + ;; that is what will be fontified; then use a + ;; range table to merge the ranges. + (let* ((beg (extent-start-position ex)) + (end (extent-end-position ex)) + (beg (progn (goto-char beg) + (beginning-of-line) + (point))) + (end (progn (goto-char end) + (forward-line 1) + (point)))) + (detach-extent ex) + (put-range-table beg end t + font-lock-range-table)))) + exs) + (map-range-table + #'(lambda (beg end val) + ;; Maybe flush the internal cache used by + ;; syntactically-sectionize. (It'd be nice if this + ;; was more automatic.) Any deletions mean the + ;; cache is invalid, and insertions at beginning or + ;; end of line mean that the bol cache might be + ;; invalid. + ;; #### This code has been commented out for some time + ;; now and is bit-rotting. Someone should look into + ;; this. +;; (if (or change-was-deletion (bobp) +;; (= (preceding-char) ?\n)) +;; (buffer-syntactic-context-flush-cache)) + ;; #### This creates some unnecessary progress gauges. +;; (if (and (= beg (point-min)) +;; (= end (point-max))) +;; (font-lock-fontify-buffer) +;; (font-lock-fontify-region beg end))) + (font-lock-fontify-region beg end)) + font-lock-range-table))))))) + font-lock-pending-extent-table))) ;; Syntactic fontification functions. @@ -1305,8 +1349,9 @@ nil (when (and font-lock-verbose (>= (- end start) font-lock-message-threshold)) - (lmessage 'progress "Fontifying %s... (syntactically...)" - (buffer-name))) + (progress-feedback-with-label 'font-lock + "Fontifying %s... (syntactically)" 5 + (buffer-name))) (font-lock-unfontify-region start end loudly) (goto-char start) (if (> end (point-max)) (setq end (point-max))) @@ -1489,18 +1534,22 @@ START should be at the beginning of a line." (let ((loudly (and font-lock-verbose (>= (- end start) font-lock-message-threshold)))) - (let ((case-fold-search font-lock-keywords-case-fold-search) - (keywords (cdr (if (eq (car-safe font-lock-keywords) t) - font-lock-keywords - (font-lock-compile-keywords)))) - (bufname (buffer-name)) (count 0) - keyword matcher highlights) + (let* ((case-fold-search font-lock-keywords-case-fold-search) + (keywords (cdr (if (eq (car-safe font-lock-keywords) t) + font-lock-keywords + (font-lock-compile-keywords)))) + (bufname (buffer-name)) + (progress 5) (old-progress 5) + (iter 0) + (nkeywords (length keywords)) + keyword matcher highlights) ;; ;; Fontify each item in `font-lock-keywords' from `start' to `end'. + ;; In order to measure progress accurately we need to know how + ;; many keywords we have and how big the region is. Then progress + ;; is ((pos - start)/ (end - start) * nkeywords + ;; + iteration / nkeywords) * 100 (while keywords - (when loudly (lmessage 'progress "Fontifying %s... (regexps..%s)" - bufname - (make-string (setq count (1+ count)) ?.))) ;; ;; Find an occurrence of `matcher' from `start' to `end'. (setq keyword (car keywords) matcher (car keyword)) @@ -1509,6 +1558,15 @@ (if (stringp matcher) (re-search-forward matcher end t) (funcall matcher end))) + ;; calculate progress + (setq progress + (+ (/ (* (- (point) start) 95) (* (- end start) nkeywords)) + (/ (* iter 95) nkeywords) 5)) + (when (and loudly (> progress old-progress)) + (progress-feedback-with-label 'font-lock + "Fontifying %s... (regexps)" + progress bufname)) + (setq old-progress progress) ;; Apply each highlight to this instance of `matcher', which may be ;; specific highlights or more keywords anchored to `matcher'. (setq highlights (cdr keyword)) @@ -1522,8 +1580,11 @@ (and end (goto-char end))) (font-lock-fontify-anchored-keywords (car highlights) end)) (setq highlights (cdr highlights)))) + (setq iter (1+ iter)) (setq keywords (cdr keywords)))) - (if loudly (lmessage 'progress "Fontifying %s... done." (buffer-name))))) + (if loudly + (progress-feedback-with-label 'font-lock "Fontifying %s... " 100 + (buffer-name))))) ;; Various functions. @@ -1547,19 +1608,6 @@ ((and (boundp 'lazy-lock-mode) lazy-lock-mode) (lazy-lock-after-fontify-buffer)))) -;; If the buffer is about to be reverted, it won't be fontified afterward. -(defun font-lock-revert-setup () - (setq font-lock-fontified nil)) - -;; If the buffer has just been reverted, normally that turns off -;; Font Lock mode. So turn the mode back on if necessary. -;; sb 1999-03-03 -- The above comment no longer appears to be operative as -;; the first call to normal-mode *will* restore the font-lock state and -;; this call forces a second font-locking to occur when reverting a buffer, -;; which is wasteful at best. -;(defalias 'font-lock-revert-cleanup 'turn-on-font-lock) -(defun font-lock-revert-cleanup ()) - ;; Various functions. @@ -1839,30 +1887,39 @@ ;; ;; Control structures. ELisp and CLisp combined. ;; - ;;(regexp-opt - ;; '("cond" "if" "while" "let" "let*" "prog" "progn" "prog1" - ;; "prog2" "progv" "catch" "throw" "save-restriction" - ;; "save-excursion" "save-window-excursion" - ;; "save-current-buffer" "with-current-buffer" - ;; "with-temp-file" "with-temp-buffer" "with-output-to-string" - ;; "with-string-as-buffer-contents" - ;; "save-selected-window" "save-match-data" "unwind-protect" - ;; "condition-case" "track-mouse" "autoload" - ;; "eval-after-load" "eval-and-compile" "eval-when-compile" - ;; "when" "unless" "do" "dolist" "dotimes" "flet" "labels" - ;; "lambda" "return" "return-from")) (cons (concat "(\\(" - "autoload\\|c\\(atch\\|ond\\(ition-case\\)?\\)\\|do\\(list\\|" - "times\\)?\\|eval-\\(a\\(fter-load\\|nd-compile\\)\\|when-compile\\)\\|" - "flet\\|if\\|l\\(a\\(bels\\|mbda\\)\\|et\\*?\\)\\|" - "prog[nv12\\*]?\\|return\\(-from\\)?\\|save-\\(current-buffer\\|" - "excursion\\|match-data\\|restriction\\|selected-window\\|" - "window-excursion\\)\\|t\\(hrow\\|rack-mouse\\)\\|un\\(less\\|" - "wind-protect\\)\\|w\\(h\\(en\\|ile\\)\\|ith-\\(current-buffer\\|" - "output-to-string\\|string-as-buffer-contents\\|temp-\\(buffer\\|" - "file\\)\\)\\)" + ;; beginning of generated stuff + ;; to regenerate, use the regexp-opt below, then delete the outermost + ;; grouping, then use the macro below to break up the string. + ;; (regexp-opt + ;; '("cond" "if" "while" "let" "let*" "prog" "progn" "prog1" + ;; "prog2" "progv" "catch" "throw" "save-restriction" + ;; "save-excursion" "save-window-excursion" + ;; "save-current-buffer" "with-current-buffer" + ;; "save-selected-window" "with-selected-window" + ;; "save-selected-frame" "with-selected-frame" + ;; "with-temp-file" "with-temp-buffer" "with-output-to-string" + ;; "with-string-as-buffer-contents" + ;; "save-match-data" "unwind-protect" "call-with-condition-handler" + ;; "condition-case" "track-mouse" "autoload" + ;; "eval-after-load" "eval-and-compile" "eval-when-compile" + ;; "when" "unless" "do" "dolist" "dotimes" "flet" "labels" + ;; "lambda" "block" "return" "return-from" "loop") t) + ;; (setq last-kbd-macro + ;; (read-kbd-macro "\" C-7 C-1 C-r \\\\| 3* \" RET")) + "autoload\\|block\\|c\\(?:a\\(?:ll-with-condition-handler\\|tch\\)\\|" + "ond\\(?:ition-case\\)?\\)\\|do\\(?:list\\|times\\)?\\|" + "eval-\\(?:a\\(?:fter-load\\|nd-compile\\)\\|when-compile\\)\\|flet\\|" + "if\\|l\\(?:a\\(?:bels\\|mbda\\)\\|et\\*?\\|oop\\)\\|prog[12nv]?\\|" + "return\\(?:-from\\)?\\|save-\\(?:current-buffer\\|excursion\\|" + "match-data\\|restriction\\|selected-\\(?:frame\\|window\\)\\|" + "window-excursion\\)\\|t\\(?:hrow\\|rack-mouse\\)\\|un\\(?:less\\|" + "wind-protect\\)\\|w\\(?:h\\(?:en\\|ile\\)\\|ith-\\(?:current-buffer\\|" + "output-to-string\\|s\\(?:elected-\\(?:frame\\|window\\)\\|" + "tring-as-buffer-contents\\)\\|temp-\\(?:buffer\\|file\\)\\)\\)" + ;; end of generated stuff "\\)\\>") 1) ;; ;; Feature symbols as references. @@ -2294,19 +2351,19 @@ "\\|long\\|short\\|void\\)\\>") "Regexp which should match a primitive type.") -(let ((capital-letter "A-Z\300-\326\330-\337") - (letter "a-zA-Z_$\300-\326\330-\366\370-\377") - (digit "0-9")) (defvar java-font-lock-identifier-regexp - (concat "\\<\\([" letter "][" letter digit "]*\\)\\>") + (let ((letter "a-zA-Z_$\300-\326\330-\366\370-\377") + (digit "0-9")) + (concat "\\<\\([" letter "][" letter digit "]*\\)\\>")) "Regexp which should match all Java identifiers.") (defvar java-font-lock-class-name-regexp - (concat "\\<\\([" capital-letter "][" letter digit "]*\\)\\>") + (let ((capital-letter "A-Z\300-\326\330-\337") + (letter "a-zA-Z_$\300-\326\330-\366\370-\377") + (digit "0-9")) + (concat "\\<\\([" capital-letter "][" letter digit "]*\\)\\>")) "Regexp which should match a class or an interface name. The name is assumed to begin with a capital letter.") -) - (let ((java-modifier-regexp (concat "\\<\\(abstract\\|const\\|final\\|native\\|" @@ -2339,8 +2396,9 @@ '("\\<\\(false\\|null\\|true\\)\\>" (1 font-lock-keyword-face)) ;; Class names: - (list (concat "\\\\s *" java-font-lock-identifier-regexp) - 1 'font-lock-function-name-face) + (list (concat "\\<\\(class\\|interface\\)\\>\\s *" + java-font-lock-identifier-regexp) + 2 'font-lock-function-name-face) ;; Package declarations: (list (concat "\\<\\(package\\|import\\)\\>\\s *" @@ -2478,8 +2536,8 @@ (list - ;; Java doc tags - '("@\\(author\\|exception\\|throws\\|deprecated\\|param\\|return\\|see\\|since\\|version\\)\\s " + ;; Javadoc tags + '("@\\(author\\|deprecated\\|exception\\|throws\\|param\\|return\\|see\\|since\\|version\\|serial\\|serialData\\|serialField\\)\\s " 0 font-lock-keyword-face t) ;; Doc tag - Parameter identifiers @@ -2487,34 +2545,30 @@ 1 'font-lock-variable-name-face t) ;; Doc tag - Exception types - (list (concat "@exception\\s +" + (list (concat "@\\(exception\\|throws\\)\\s +" java-font-lock-identifier-regexp) - '(1 (if (equal (char-after (match-end 0)) ?.) + '(2 (if (equal (char-after (match-end 0)) ?.) font-lock-reference-face font-lock-type-face) t) (list (concat "\\=\\." java-font-lock-identifier-regexp) '(goto-char (match-end 0)) nil '(1 (if (equal (char-after (match-end 0)) ?.) 'font-lock-reference-face 'font-lock-type-face) t))) - ;; Doc tag - Exception types - (list (concat "@exception\\s +" - java-font-lock-identifier-regexp) - '(1 (if (equal (char-after (match-end 0)) ?.) - font-lock-reference-face font-lock-type-face) t) - (list (concat "\\=\\." java-font-lock-identifier-regexp) - '(goto-char (match-end 0)) nil - '(1 (if (equal (char-after (match-end 0)) ?.) - 'font-lock-reference-face 'font-lock-type-face) t))) - ;; Doc tag - Cross-references, usually to methods '("@see\\s +\\(\\S *[^][ \t\n\r\f(){},.;:]\\)" 1 font-lock-function-name-face t) - ;; Doc tag - Links - '("{@link\\s +\\([^}]*\\)}" + ;; Doc tag - docRoot (1.3) + '("\\({ *@docRoot *}\\)" + 0 font-lock-keyword-face t) + ;; Doc tag - beaninfo, unofficial but widely used, even by Sun + '("\\(@beaninfo\\)" 0 font-lock-keyword-face t) ;; Doc tag - Links - '("{@link\\s +\\(\\S +\\s +\\S +\\)}" + '("{ *@link\\s +\\([^}]+\\)}" + 0 font-lock-keyword-face t) + ;; Doc tag - Links + '("{ *@link\\s +\\(\\(\\S +\\)\\|\\(\\S +\\s +\\S +\\)\\) *}" 1 font-lock-function-name-face t) ))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/font-menu.el --- a/lisp/font-menu.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/font-menu.el Mon Aug 13 11:35:02 2007 +0200 @@ -168,16 +168,6 @@ ((x) . 10))) t) "Scale factor used in defining font sizes.") -(defun vassoc (key valist) - "Search VALIST for a vector whose first element is equal to KEY. -See also `assoc'." - ;; by Stig@hackvan.com - (let (el) - (catch 'done - (while (setq el (pop valist)) - (and (equal key (aref el 0)) - (throw 'done el)))))) - ;; only call XListFonts (and parse) once per device. ;; ( (device . [parsed-list-fonts family-menu size-menu weight-menu]) ...) (defvar device-fonts-cache nil) @@ -207,12 +197,12 @@ (message "Getting list of fonts from server... done."))) (defun font-menu-split-long-menu (menu) - "Split MENU according to `font-menu-max-items'." + "Split MENU according to `font-menu-max-items' and add accelerator specs." (let ((len (length menu))) (if (or (null font-menu-max-items) (null (featurep 'lisp-float-type)) (<= len font-menu-max-items)) - menu + (submenu-generate-accelerator-spec menu) ;; Submenu is max 2 entries longer than menu, never shorter, number of ;; entries in submenus differ by at most one (with longer submenus first) (let* ((outer (floor (sqrt len))) @@ -231,14 +221,20 @@ (setq result (cons (cons (if (stringp font-menu-submenu-name-format) (format font-menu-submenu-name-format - (aref (car sub) 0) (aref to 0)) + (menu-item-strip-accelerator-spec + (aref (car sub) 0)) + (menu-item-strip-accelerator-spec + (aref to 0))) (funcall font-menu-submenu-name-format - (aref (car sub) 0) (aref to 0))) - sub) + (menu-item-strip-accelerator-spec + (aref (car sub) 0)) + (menu-item-strip-accelerator-spec + (aref to 0)))) + (submenu-generate-accelerator-spec sub)) result) rest (1+ rest)) (if (= rest outer) (setq inner (1+ inner))))) - result)))) + (submenu-generate-accelerator-spec result))))) ;;;###autoload (defun font-menu-family-constructor (ignored) @@ -261,7 +257,7 @@ (font-menu-split-long-menu (mapcar (lambda (item) - (setq f (aref item 0) + (setq f (menu-item-strip-accelerator-spec (aref item 0)) entry (vassoc f (aref dcache 0))) (if (and (or (member weight (aref entry 1)) ;; mswindows often allows any weight @@ -309,7 +305,7 @@ (select-toggle-menu-item item) (deselect-toggle-menu-item item)) item) - (aref dcache 2))))) + (submenu-generate-accelerator-spec (aref dcache 2)))))) ;;;###autoload (defun font-menu-weight-constructor (ignored) @@ -338,7 +334,7 @@ (select-toggle-menu-item item) (deselect-toggle-menu-item item)) item) - (aref dcache 3))))) + (submenu-generate-accelerator-spec (aref dcache 3)))))) ;;; Changing font sizes @@ -351,11 +347,10 @@ (font-data (font-menu-font-data 'default dcache)) (from-family (aref font-data 1)) (from-size (aref font-data 2)) - (from-weight (aref font-data 3)) + (from-weight (aref font-data 3)) (from-slant (aref font-data 4)) - (face-list-to-change (delq 'default (face-list))) - new-default-face-font - new-props) + (face-list-to-change (delq 'default (face-list))) + new-default-face-font) (unless from-family (signal 'error '("couldn't parse font name for default face"))) (when weight @@ -396,14 +391,14 @@ (and font-menu-this-frame-only-p (selected-frame))) ;; OK Let Customize do it. (custom-set-face-update-spec 'default - (list (list 'type (device-type))) - (list :family family - :size (concat - (int-to-string - (/ (or size from-size) - (specifier-instance font-menu-size-scaling - (selected-device)))) - "pt"))) + (list (list 'type (device-type))) + (list :family family + :size (concat + (int-to-string + (/ (or size from-size) + (specifier-instance font-menu-size-scaling + (selected-device)))) + "pt"))) (message "Font %s" (face-font-name 'default))))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/frame.el --- a/lisp/frame.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/frame.el Mon Aug 13 11:35:02 2007 +0200 @@ -502,14 +502,14 @@ Emacs uses this to avoid overriding explicit moves and resizings from the user during startup." (setq plist (canonicalize-lax-plist (copy-sequence plist))) - (mapcar #'(lambda (propname) - (if (lax-plist-member plist propname) + (mapcar #'(lambda (property) + (if (lax-plist-member plist property) (progn (setq frame-initial-geometry-arguments - (cons propname - (cons (lax-plist-get plist propname) + (cons property + (cons (lax-plist-get plist property) frame-initial-geometry-arguments))) - (setq plist (lax-plist-remprop plist propname))))) + (setq plist (lax-plist-remprop plist property))))) '(height width top left user-size user-position)) plist) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/glyphs.el --- a/lisp/glyphs.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/glyphs.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,7 +1,7 @@ ;;; glyphs.el --- Lisp interface to C glyphs ;; Copyright (C) 1994, 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 1995, 1996, 2000 Ben Wing. ;; Author: Chuck Thompson , Ben Wing ;; Maintainer: XEmacs Development Team @@ -26,27 +26,287 @@ ;;; Synched up with: Not in FSF. +;;; Authorship: + +;; Prototype created 1995 by Chuck Thompson. +;; Completely rewritten by Ben Wing, 1995. +;; Various cleanups (esp. doc strings) by Ben Wing, May 2000. + ;;; Commentary: ;; This file is dumped with XEmacs. ;;; Code: -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; font specifiers +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; image specifiers (defun make-image-specifier (spec-list) "Return a new `image' specifier object with the specification list SPEC-LIST. SPEC-LIST can be a list of specifications (each of which is a cons of a locale and a list of instantiators), a single instantiator, or a list of instantiators. See `make-specifier' for more information about -specifiers." +specifiers. + +An image specifier is used for images (pixmaps, widgets and the like). +It is used to describe the actual image in a glyph. It is instanced +as an image-instance. Note that \"image\" as used in XEmacs does not +actually refer to what the term \"image\" normally means (a picture, +e.g. in .GIF or .JPG format, and called a \"pixmap\" in XEmacs), but +includes all types of graphical elements, including pixmaps, widgets +\(buttons, sliders, text fields, etc.) and even strings of text. + +Note that, in practice, you rarely, if ever, need to actually create +an image specifier! (The function `make-image-specifier' exists mainly +for completeness.) Pretty much the only use for image specifiers is to +control how glyphs are displayed, and the image specifier associated +with a glyph (the `image' property of a glyph) is created +automatically when a glyph is created (see `make-glyph') and need not +\(and cannot, for that matter) ever be changed. In fact, the design +decision to create a separate image specifier type, rather than make +glyphs themselves be specifiers, is debatable -- the other properties +of glyphs are rarely used and could conceivably have been incorporated +into the glyph's instantiator. The rarely used glyph types (buffer, +pointer, icon) could also have been incorporated into the instantiator. + +Image instantiators come in many formats: `xbm', `xpm', `gif', `jpeg', +etc. This describes the format of the data describing the image. The +resulting image instances also come in many types -- `mono-pixmap', +`color-pixmap', `text', `pointer', etc. This refers to the behavior of +the image and the sorts of places it can appear. (For example, a +color-pixmap image has fixed colors specified for it, while a +mono-pixmap image comes in two unspecified shades \"foreground\" and +\"background\" that are determined from the face of the glyph or +surrounding text; a text image appears as a string of text and has an +unspecified foreground, background, and font; a pointer image behaves +like a mono-pixmap image but can only be used as a mouse pointer +\[mono-pixmap images cannot be used as mouse pointers]; etc.) It is +important to keep the distinction between image instantiator format and +image instance type in mind. Typically, a given image instantiator +format can result in many different image instance types (for example, +`xpm' can be instanced as `color-pixmap', `mono-pixmap', or `pointer'; +whereas `cursor-font' can be instanced only as `pointer'), and a +particular image instance type can be generated by many different +image instantiator formats (e.g. `color-pixmap' can be generated by `xpm', +`gif', `jpeg', etc.). + +See `make-image-instance' for a more detailed discussion of image +instance types. + +An image instantiator should be a string or a vector of the form + + [FORMAT :KEYWORD VALUE ...] + +i.e. a format symbol followed by zero or more alternating keyword-value +pairs. FORMAT should be one of + +'nothing + Don't display anything; no keywords are valid for this. + Can only be instanced as `nothing'. +'string + Display this image as a text string. Can only be instanced + as `text', although support for instancing as `mono-pixmap' + and `color-pixmap' should be added. +'formatted-string + Display this image as a text string, with replaceable fields; + not currently implemented. (It is, instead, equivalent to `string'.) +'xbm + An X bitmap; only if X or MS Windows support was compiled into this + XEmacs. Can be instanced as `mono-pixmap', `color-pixmap', or `pointer'. +'xpm + An XPM pixmap; only if XPM support was compiled into this XEmacs. + Can be instanced as `color-pixmap', `mono-pixmap', or `pointer'. +'xface + An X-Face bitmap, used to encode people's faces in e-mail messages; + only if X-Face support was compiled into this XEmacs. Can be + instanced as `mono-pixmap', `color-pixmap', or `pointer'. +'gif + A GIF87 or GIF89 image; only if GIF support was compiled into this + XEmacs. NOTE: only the first frame of animated gifs will be displayed. + Can be instanced as `color-pixmap'. +'jpeg + A JPEG image; only if JPEG support was compiled into this XEmacs. + Can be instanced as `color-pixmap'. +'png + A PNG image; only if PNG support was compiled into this XEmacs. + Can be instanced as `color-pixmap'. +'tiff + A TIFF image; only if TIFF support was compiled into this XEmacs. + Can be instanced as `color-pixmap'. +'bmp + A MS Windows BMP image; only if MS Windows support was compiled into + this XEmacs. Can be instanced as `color-pixmap'. +'cursor-font + One of the standard cursor-font names, such as \"watch\" or + \"right_ptr\" under X. Under X, this is, more specifically, any + of the standard cursor names from appendix B of the Xlib manual + [also known as the file ] minus the XC_ prefix. + On other window systems, the valid names will be specific to the + type of window system. Can only be instanced as `pointer'. +'mswindows-resource + An MS Windows pointer resource. Specifies a resource to retrieve + directly from the system (an OEM resource) or from a file, particularly + an executable file. If the resource is to be retrieved from a file, use + :file and optionally :resource-id. Otherwise use :resource-id. Always + specify :resource-type to specify the type (cursor, bitmap or icon) of + the resource. Possible values for :resource-id are listed below. Can + be instanced as `pointer' or `color-pixmap'. +'font + A glyph from a font; i.e. the name of a font, and glyph index into it + of the form \"FONT fontname index [[mask-font] mask-index]\". + Currently can only be instanced as `pointer', although this should + probably be fixed. +'subwindow + An embedded windowing system window. Can only be instanced as + `subwindow'. +'button + A button widget; either a push button, radio button or toggle button. + Can only be instanced as `widget'. +'combo-box + A drop list of selectable items in a widget, for editing text. + Can only be instanced as `widget'. +'edit-field + A text editing widget. Can only be instanced as `widget'. +'label + A static, text-only, widget; for displaying text. Can only be instanced + as `widget'. +'layout + A widget for controlling the positioning of children underneath it. + Through the use of nested layouts, a widget hierarchy can be created + which can have the appearance of any standard dialog box or similar + arrangement; all of this is counted as one \"glyph\" and could appear + in many of the places that expect a single glyph. Can only be instanced + as `widget'. +'native-layout + The native version of a layout widget. #### Document me better! + Can only be instanced as `widget'. +'progress-gauge + A sliding widget, for showing progress. Can only be instanced as + `widget'. +'tab-control + A tab widget; a series of user selectable tabs. Can only be instanced + as `widget'. +'tree-view + A folding widget. Can only be instanced as `widget'. +'scrollbar + A scrollbar widget. Can only be instanced as `widget'. +'autodetect + XEmacs tries to guess what format the data is in. If X support + exists, the data string will be checked to see if it names a filename. + If so, and this filename contains XBM or XPM data, the appropriate + sort of pixmap or pointer will be created. [This includes picking up + any specified hotspot or associated mask file.] Otherwise, if `pointer' + is one of the allowable image-instance types and the string names a + valid cursor-font name, the image will be created as a pointer. + Otherwise, the image will be displayed as text. If no X support + exists, the image will always be displayed as text. Can be instanced as + `mono-pixmap', `color-pixmap', `pointer', or `text'. +'inherit + Inherit from the background-pixmap property of a face. Can only be + instanced as `mono-pixmap'. + +The valid keywords are: + +:data + Inline data. For most formats above, this should be a string. For + XBM images, this should be a list of three elements: width, height, and + a string of bit data. This keyword is valid for all of the bitmap/pixmap + formats, as well as `string', `formatted-string', `font', `cursor-font', + and `autodetect'. +:file + Data is contained in a file. The value is the name of this file. + If both :data and :file are specified, the image is created from + what is specified in :data and the string in :file becomes the + value of the `image-instance-file-name' function when applied to + the resulting image-instance. This keyword is valid for all of the + bitmap/pixmap formats as well as `mswindows-resource'. +:foreground +:background + For `xbm', `xface', `cursor-font', `widget' and `font'. These keywords + allow you to explicitly specify foreground and background colors. + The argument should be anything acceptable to `make-color-instance'. + This will cause what would be a `mono-pixmap' to instead be colorized + as a two-color color-pixmap, and specifies the foreground and/or + background colors for a pointer instead of black and white. +:mask-data + For `xbm' and `xface'. This specifies a mask to be used with the + bitmap. The format is a list of width, height, and bits, like for + :data. +:mask-file + For `xbm' and `xface'. This specifies a file containing the mask data. + If neither a mask file nor inline mask data is given for an XBM image, + and the XBM image comes from a file, XEmacs will look for a mask file + with the same name as the image file but with \"Mask\" or \"msk\" + appended. For example, if you specify the XBM file \"left_ptr\" + [usually located in \"/usr/include/X11/bitmaps\"], the associated + mask file \"left_ptrmsk\" will automatically be picked up. +:hotspot-x +:hotspot-y + For `xbm' and `xface'. These keywords specify a hotspot if the image + is instantiated as a `pointer'. Note that if the XBM image file + specifies a hotspot, it will automatically be picked up if no + explicit hotspot is given. +:color-symbols + Only for `xpm'. This specifies an alist that maps strings + that specify symbolic color names to the actual color to be used + for that symbolic color (in the form of a string or a color-specifier + object). If this is not specified, the contents of `xpm-color-symbols' + are used to generate the alist. +:resource-id + Only for `mswindows-resource'. This must be either an integer (which + directly specifies a resource number) or a string. Valid strings are + + -- For bitmaps: + + \"close\", \"uparrow\", \"dnarrow\", \"rgarrow\", \"lfarrow\", + \"reduce\", \"zoom\", \"restore\", \"reduced\", \"zoomd\", + \"restored\", \"uparrowd\", \"dnarrowd\", \"rgarrowd\", \"lfarrowd\", + \"mnarrow\", \"combo\", \"uparrowi\", \"dnarrowi\", \"rgarrowi\", + \"lfarrowi\", \"size\", \"btsize\", \"check\", \"checkboxes\", and + \"btncorners\". + + -- For cursors: + + \"normal\", \"ibeam\", \"wait\", \"cross\", \"up\", \"sizenwse\", + \"sizenesw\", \"sizewe\", \"sizens\", \"sizeall\", and \"no\". + + -- For icons: + + \"sample\", \"hand\", \"ques\", \"bang\", \"note\", and \"winlogo\". +:resource-type + Only for `mswindows-resource'. This must be a symbol, either `cursor', + `icon', or `bitmap', specifying the type of resource to be retrieved. +:face + Only for `inherit'. This specifies the face to inherit from. + For widgets this also specifies the face to use for display. It defaults + to gui-element-face. + +Keywords accepted as menu item specs are also accepted by widgets. +These are `:selected', `:active', `:suffix', `:keys', `:style', +`:filter', `:config', `:included', `:key-sequence', `:accelerator', +`:label' and `:callback'. + +If instead of a vector, the instantiator is a string, it will be +converted into a vector by looking it up according to the specs in the +`console-type-image-conversion-list' (q.v.) for the console type of +the domain (usually a window; sometimes a frame or device) over which +the image is being instantiated. + +If the instantiator specifies data from a file, the data will be read +in at the time that the instantiator is added to the image (which may +be well before when the image is actually displayed), and the +instantiator will be converted into one of the inline-data forms, with +the filename retained using a :file keyword. This implies that the +file must exist when the instantiator is added to the image, but does +not need to exist at any other time (e.g. it may safely be a temporary +file). +" (make-specifier-and-init 'image spec-list)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; glyphs (defconst built-in-glyph-specifiers '(image contrib-p baseline) - "A list of the built-in face properties that are specifiers.") + "A list of the built-in glyph properties that are specifiers.") (defun glyph-property (glyph property &optional locale) "Return GLYPH's value of PROPERTY in LOCALE. @@ -283,11 +543,19 @@ See `glyph-property-instance' for more information." (glyph-property-instance glyph 'image domain default no-fallback)) +(defun glyph-image-property (glyph prop &optional domain default no-fallback) + "Return property PROP of the instance of GLYPH's image in DOMAIN. + +Normally DOMAIN will be a window or nil (meaning the selected window). +The value returned is dependent on the image instance type." + (image-instance-property + (glyph-image-instance glyph domain default no-fallback) prop)) + (defun set-glyph-image (glyph spec &optional locale tag-set how-to-add) "Change the image of GLYPH in LOCALE. SPEC should be an instantiator (a string or vector; see - `image-specifier-p' for a description of possible values here), + `make-image-specifier' for a description of possible values here), a list of (possibly tagged) instantiators, an alist of specifications (each mapping a locale to an instantiator list), or an image specifier object. @@ -380,20 +648,162 @@ (set-glyph-property glyph 'baseline spec locale tag-set how-to-add)) (defun make-glyph (&optional spec-list type) - "Return a new `glyph' object of type TYPE. + "Create a new glyph of type TYPE. + +A glyph in XEmacs does NOT refer to a single unit of textual display (the +XEmacs term for this is \"rune\"), but rather is an object encapsulating +a graphical element, such as an image or widget (an element such as a +button or text field; \"widget\" is the term for this under X Windows, +and it's called a \"control\" under MS Windows). This graphical element +could appear in a buffer, a margin, a gutter, or a toolbar, or as a mouse +pointer or an icon, for example. + +Creating a glyph using `make-glyph' does not specify *where* the glyph +will be used, but it does specify *what* the glyph will look like. In +particular, SPEC-LIST is used to specify this, and it's used to +initialize the glyph's `image' property, which is an image +specifier. (Note that \"image\" as used in the context of a glyph's +`image' property or in the terms \"image specifier\", \"image +instantiator\", or \"image instance\" does not refer to what people +normally think of as an image (which in XEmacs is called a +\"pixmap\"), but to any graphical element -- a pixmap, a widget, or +even a block of text, when used in the places that call for a glyph.) +The format of the SPEC-LIST is typically an image instantiator (a +string or a vector; see `make-image-specifier' for a detailed description +of the valid image instantiators), but can also be a list of such +instantiators (each one in turn is tried until an image is +successfully produced), a cons of a locale (frame, buffer, etc.) and +an instantiator, a list of such conses, or any other form accepted by +`canonicalize-spec-list'. -TYPE should be one of `buffer' (used for glyphs in an extent, the modeline, -the toolbar, or elsewhere in a buffer), `pointer' (used for the mouse-pointer), -or `icon' (used for a frame's icon), and defaults to `buffer'. +If you're not familiar with specifiers, you should be in order to +understand how glyphs work. The clearest introduction to specifiers +is in the Lispref manual, available under Info. (Choose +Help->Info->Info Contents on the menubar or type \\[info].) You can +also see `make-specifier' for a capsule summary. What's important to +keep in mind is that a specifier lets you set a different value for +any particular buffer, window, frame, device, or console. This allows +for a great deal of flexibility; in particular, only one global glyph +needs to exist for a particular purpose (e.g. the icon used to represent +an iconified frame, the mouse pointer used over particular areas of a +frame, etc.), and in these cases you do not create your own glyph, but +rather modify the existing one. + +As well as using SPEC-LIST to initialize the glyph, you can set +specifications using `set-glyph-image'. Note that, due to a possibly +questionable historical design decision, a glyph itself is not +actually a specifier, but rather is an object containing an image +specifier (as well as other, seldom-used properties). Therefore, you +cannot set or access specifications for the glyph's image by directly +using `set-specifier', `specifier-instance' or the like on the glyph; +instead use them on `(glyph-image GLYPH)' or use the convenience +functions `set-glyph-image', `glyph-image-instance', and +`glyph-image'. + +Once you have created a glyph, you specify where it will be used as follows: + +-- To insert a glyph into a buffer, create an extent in the buffer and then + use `set-extent-begin-glyph' or `set-extent-end-glyph' to set a glyph + to be displayed at the corresponding edge of the extent. (It is common + to create zero-width extents for this purpose.) + +-- To insert a glyph into the left or right margin of a buffer, first + make sure the margin is visible by setting a value for the specifiers + `left-margin-width' or `right-margin-width'. (Not strictly necessary + when using margin glyphs with layout policy `whitespace'.) Then follow + the same procedure above for inserting a glyph in a buffer, and then + set a non-default layout policy for the glyph using + `set-extent-begin-glyph-layout' or `set-extent-end-glyph-layout'. + Alternatively, use the high-level annotations API (see + `make-annotation'). (In point of fact, you can also use the annotations + API for glyphs in a buffer, by setting a layout policy of `text'.) + +-- To insert a glyph into the modeline, just put the glyph directly as + one of the modeline elements. (Unfortunately you can't currently + put a begin glyph or end glyph on one of the modeline extents -- + they're ignored.) -SPEC-LIST is used to initialize the glyph's image. It is typically an -image instantiator (a string or a vector; see `image-specifier-p' for -a detailed description of the valid image instantiators), but can also -be a list of such instantiators (each one in turn is tried until an -image is successfully produced), a cons of a locale (frame, buffer, etc.) -and an instantiator, a list of such conses, or any other form accepted -by `canonicalize-spec-list'. See `make-specifier' for more information -about specifiers." +-- To insert a glyph into a toolbar, specify it as part of a toolbar + instantiator (typically set on the specifier `default-toolbar'). + See `default-toolbar' for more information. (Note that it is standard + practice to use a symbol in place of the glyph list in the toolbar + instantiator; the symbol is evalled to get the glyph list. This + facilitates both creating the toolbar instantiator and modifying + individual glyphs in a toolbar later on. For example, you can + change the way that the Mail toolbar button looks by modifying the + value of the variable `toolbar-mail-icon' (in general, `toolbar-*-icon') + and then calling `(set-specifier-dirty-flag default-toolbar)'. + (#### Unfortunately this doesn't quite work the way it should; the + change will appear in new frames, but not existing ones. + +-- To insert a glyph into a gutter, create or modify a gutter instantiator + (typically set on the specifier `default-gutter'). Gutter instantiators + consist of strings or lists of strings, so to insert a glyph, create an + extent over the string, and use `set-extent-begin-glyph' or + `set-extent-end-glyph' to set a glyph to be displayed at the corresponding + edge of the extent, just like for glyphs in a buffer. + +-- To use a glyph as the icon for a frame, you do not actually create a new + glyph; rather, you change the specifications for the existing glyph + `frame-icon-glyph'. (Remember that, because of the specifier nature of + glyphs, you can set different values for any particular buffer or frame.) + +-- To use a glyph as the mouse pointer, in general you do not create a + new glyph, but rather you change the specifications of various existing + glyphs, such as `text-pointer-glyph' for the pointer used over text, + `modeline-pointer-glyph' for the pointer used over the modeline, etc. + Do an apropos over `*-pointer-glyph' to find all of them. (Note also + that you can temporarily set the mouse pointer to some specific shape + by using `set-frame-pointer', which takes an image instance, as obtained + from calling `glyph-image-instance' on a glyph of type `pointer' -- + either one of the above-mentioned variables or one you created yourself. + (See below for what it means to create a glyph of type `pointer'.) + This pointer will last only until the next mouse motion event is + processed or certain other things happen, such as creating or deleting + a window. (In fact, the above-mentioned pointer glyph variables are + implemented as part of the default handler for mouse motion events. + If you want to customize this behavior, take a look at `mode-motion-hook', + or `mouse-motion-handler' if you really want to get low-level.) + +-- To use a glyph to control the shape of miscellaneous redisplay effects + such as the truncation and continuation markers, set the appropriate + existing glyph variables, as for icons and pointers above. See + `continuation-glyph', `control-arrow-glyph', `hscroll-glyph', + `invisible-text-glyph', `octal-escape-glyph', and `truncation-glyph'. + See also `overlay-arrow-string', an odd redisplay leftover which can + be set to a glyph you created, and will cause the glyph to be displayed + on top of the text position specified in the marker stored in + `overlay-arrow-position'. + +-- To use a glyph in a display table (i.e. to control the appearance of + any individual character), create the appropriate character glyphs + and then set a specification for the specifier `current-display-table', + which controls the appearance of characters. You can also set an + overriding display table for use with text displayed in a particular + face; see `set-face-display-table' and `make-display-table'. + #### Note: Display tables do not currently support general Mule + characters. They will be overhauled at some point to support this + and to provide other features required under Mule. + +-- To use a glyph as the background pixmap of a face: Note that the + background pixmap of a face is actually an image specifier -- probably + the only place in XEmacs where an image specifier occurs outside of + a glyph. Similarly to how the glyph's image specifier works, you + don't create your own image specifier, but rather add specifications + to the existing one (using `set-face-background-pixmap'). Note that + the image instance that is generated in order to actually display the + background pixmap is of type `mono-pixmap', meaning that it's a two-color + image and the foreground and background of the image get filled in with + the corresponding colors from the face. + +It is extremely rare that you will ever have to specify a value for TYPE, +which should be one of `buffer' (used for glyphs in an extent, the modeline, +the toolbar, or elsewhere in a buffer), `pointer' (used for the mouse-pointer), +or `icon' (used for a frame's icon), and defaults to `buffer'. The only cases +where it needs to be specified is when creating icon or pointer glyphs, and +in both cases the necessary glyphs have already been created at startup and +are accessed through the appropriate variables, e.g. `text-pointer-glyph' +(or in general, `*-pointer-glyph') and `frame-icon-glyph'." (let ((glyph (make-glyph-internal type))) (and spec-list (set-glyph-image glyph spec-list)) glyph)) @@ -412,38 +822,22 @@ (defun make-pointer-glyph (&optional spec-list) "Return a new `pointer-glyph' object with the specification list SPEC-LIST. - This is equivalent to calling `make-glyph', specifying a type of `pointer'. +See `make-glyph' for more information. -SPEC-LIST is used to initialize the glyph's image. It is typically an -image instantiator (a string or a vector; see `image-specifier-p' for -a detailed description of the valid image instantiators), but can also -be a list of such instantiators (each one in turn is tried until an -image is successfully produced), a cons of a locale (frame, buffer, etc.) -and an instantiator, a list of such conses, or any other form accepted -by `canonicalize-spec-list'. See `make-specifier' for more information -about specifiers. - -You can also create a glyph with an empty SPEC-LIST and add image -instantiators afterwards using `set-glyph-image'." +It is extremely unlikely that you will ever need to create a pointer glyph. +Instead, you probably want to be calling `set-glyph-image' on an existing +glyph, e.g. `text-pointer-glyph'." (make-glyph spec-list 'pointer)) (defun make-icon-glyph (&optional spec-list) "Return a new `icon-glyph' object with the specification list SPEC-LIST. - This is equivalent to calling `make-glyph', specifying a type of `icon'. +See `make-glyph' for more information. -SPEC-LIST is used to initialize the glyph's image. It is typically an -image instantiator (a string or a vector; see `image-specifier-p' for -a detailed description of the valid image instantiators), but can also -be a list of such instantiators (each one in turn is tried until an -image is successfully produced), a cons of a locale (frame, buffer, etc.) -and an instantiator, a list of such conses, or any other form accepted -by `canonicalize-spec-list'. See `make-specifier' for more information -about specifiers. - -You can also create a glyph with an empty SPEC-LIST and add image -instantiators afterwards using `set-glyph-image'." +It is extremely unlikely that you will ever need to create a icon glyph. +Instead, you probably want to be calling `set-glyph-image' on +`frame-icon-glyph'." (make-glyph spec-list 'icon)) (defun nothing-image-instance-p (object) @@ -468,9 +862,12 @@ "Return t if OBJECT is an image instance of type `pointer'." (and (image-instance-p object) (eq 'pointer (image-instance-type object)))) +(defun widget-image-instance-p (object) + "Return t if OBJECT is an image instance of type `widget'." + (and (image-instance-p object) (eq 'widget (image-instance-type object)))) + (defun subwindow-image-instance-p (object) - "Return t if OBJECT is an image instance of type `subwindow'. -Subwindows are not implemented in this version of XEmacs." + "Return t if OBJECT is an image instance of type `subwindow'." (and (image-instance-p object) (eq 'subwindow (image-instance-type object)))) ;;;;;;;;;; the built-in glyphs diff -r 72a7cfa4a488 -r abe6d1db359e lisp/gpm.el --- a/lisp/gpm.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/gpm.el Mon Aug 13 11:35:02 2007 +0200 @@ -72,7 +72,7 @@ (device-console device)))) (turn-off-gpm-mouse-tracking device))) -;; Restore normal mouse behaviour outside Emacs +;; Restore normal mouse behavior outside Emacs (add-hook 'suspend-hook 'turn-off-gpm-mouse-tracking) (add-hook 'suspend-resume-hook 'turn-on-gpm-mouse-tracking) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/gutter-items.el --- a/lisp/gutter-items.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/gutter-items.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,7 +1,8 @@ ;;; gutter-items.el --- Gutter content for XEmacs. ;; Copyright (C) 1999 Free Software Foundation, Inc. -;; Copyright (C) 1999 Andy Piper. +;; Copyright (C) 1999, 2000 Andy Piper. +;; Copyright (C) 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: frames, extensions, internal, dumped @@ -24,41 +25,6 @@ ;; Boston, MA 02111-1307, USA. ;; Some of this is taken from the buffer-menu stuff in menubar-items.el -;; and the custom specs in toolbar.el. - -(defgroup gutter nil - "Input from the gutters." - :group 'environment) - -(defvar gutter-buffers-tab nil - "A tab widget in the gutter for displaying buffers. -Do not set this. Use `glyph-image-instance' and -`set-image-instance-property' to change the properties of the tab.") - -(defcustom gutter-visible-p - (specifier-instance default-gutter-visible-p) - "Whether the default gutter is globally visible. This option can be -customized through the options menu." - :group 'display - :type 'boolean - :set #'(lambda (var val) - (set-specifier default-gutter-visible-p val) - (setq gutter-visible-p val) - (when gutter-buffers-tab (update-tab-in-gutter)))) - -(defcustom default-gutter-position - (default-gutter-position) - "The location of the default gutter. It can be 'top, 'bottom, 'left or -'right. This option can be customized through the options menu." - :group 'display - :type '(choice (const :tag "top" 'top) - (const :tag "bottom" 'bottom) - (const :tag "left" 'left) - (const :tag "right" 'right)) - :set #'(lambda (var val) - (set-default-gutter-position val) - (setq default-gutter-position val) - (when gutter-buffers-tab (update-tab-in-gutter)))) ;;; The Buffers tab @@ -66,6 +32,21 @@ "Customization of `Buffers' tab." :group 'gutter) +(defvar gutter-buffers-tab nil + "A tab widget in the gutter for displaying buffers. +Do not set this. Use `set-glyph-image' to change the properties of the tab.") + +(defcustom gutter-buffers-tab-visible-p + (gutter-element-visible-p default-gutter-visible-p 'buffers-tab) + "Whether the buffers tab is globally visible. +This option should be set through the options menu." + :group 'buffers-tab + :type 'boolean + :set #'(lambda (var val) + (set-gutter-element-visible-p default-gutter-visible-p + 'buffers-tab val) + (setq gutter-buffers-tab-visible-p val))) + (defvar gutter-buffers-tab-orientation 'top "Where the buffers tab currently is. Do not set this.") @@ -109,6 +90,16 @@ function) :group 'buffers-tab) +(defcustom buffers-tab-sort-function nil + "*If non-nil, a function specifying the buffers to select from the +buffers tab. This is passed the buffer list and returns the list in the +order desired for the tab widget. The default value `nil' leaves the +list in `buffer-list' order (usual most-recently-selected-first)." + + :type '(choice (const :tag "None" nil) + function) + :group 'buffers-tab) + (make-face 'buffers-tab "Face for displaying the buffers tab.") (set-face-parent 'buffers-tab 'default) @@ -159,9 +150,14 @@ (defun buffers-tab-switch-to-buffer (buffer) "For use as a value for `buffers-tab-switch-to-buffer-function'." (unless (eq (window-buffer) buffer) + ;; this used to add the norecord flag to both calls below. + ;; this is bogus because it is a pervasive assumption in XEmacs + ;; that the current buffer is at the front of the buffers list. + ;; for example, select an item and then do M-C-l + ;; (switch-to-other-buffer). Things get way confused. (if (> (length (windows-of-buffer buffer)) 0) (select-window (car (windows-of-buffer buffer))) - (switch-to-buffer buffer t)))) + (switch-to-buffer buffer)))) (defun select-buffers-tab-buffers-by-mode (buf1 buf2) "For use as a value of `buffers-tab-selection-function'. @@ -203,16 +199,37 @@ (buffer-name buffer)))) (defsubst build-buffers-tab-internal (buffers) - (let (line) + (let ((selected t)) (mapcar #'(lambda (buffer) - (setq line (funcall buffers-tab-format-buffer-line-function - buffer)) - (vector line (list buffers-tab-switch-to-buffer-function - (buffer-name buffer)))) + (prog1 + (vector + (funcall buffers-tab-format-buffer-line-function + buffer) + (list buffers-tab-switch-to-buffer-function + (buffer-name buffer)) + :selected selected) + (when selected (setq selected nil)))) buffers))) -(defun buffers-tab-items (&optional in-deletion frame) +;;; #### SJT I'd really like this function to have just two hooks: (1) the +;;; buffer filter list and (2) a sort function list. Both should be lists +;;; of functions. Each filter takes two arguments: a buffer and a model +;;; buffer. (The model buffer argument allows selecting according to the +;;; mode or directory of that buffer.) The filter returns t if the buffer +;;; should be listed and nil otherwise. Effectively the filter amounts to +;;; the conjuction of the filter list. (Optionally the filter could take a +;;; frame instead of a buffer or generalize to a locale as in a specifier?) +;;; The filtering is done this way to preserve the ordering imposed by +;;; `buffer-list'. In addition, the in-deletion argument will be used the +;;; same way as in the current design. +;;; The list is checked for length and pruned according to least-recently- +;;; selected. (Optionally there could be some kind of sort function here, +;;; too.) +;;; Finally the list is sorted to gutter display order, and the tab data +;;; structure is created and returned. +;;; #### Docstring isn't very well expressed. +(defun buffers-tab-items (&optional in-deletion frame force-selection) "This is the tab filter for the top-level buffers \"Buffers\" tab. It dynamically creates a list of buffers to use as the contents of the tab. Only the most-recently-used few buffers will be listed on the tab, for @@ -222,160 +239,202 @@ (save-match-data (let* ((buffers (delete-if buffers-tab-omit-function (buffer-list frame))) (first-buf (car buffers))) + ;; maybe force the selected window + (when (and force-selection + (not in-deletion) + (not (eq first-buf (window-buffer (selected-window frame))))) + (setq buffers (cons (window-buffer (selected-window frame)) + (delq first-buf buffers)))) ;; if we're in deletion ignore the current buffer (when in-deletion (setq buffers (delq (current-buffer) buffers)) (setq first-buf (car buffers))) - ;; group buffers by mode + ;; select buffers in group (default is by mode) (when buffers-tab-selection-function (delete-if-not #'(lambda (buf) (funcall buffers-tab-selection-function first-buf buf)) buffers)) + ;; maybe shorten list of buffers (and (integerp buffers-tab-max-size) (> buffers-tab-max-size 1) (> (length buffers) buffers-tab-max-size) - ;; shorten list of buffers (setcdr (nthcdr buffers-tab-max-size buffers) nil)) + ;; sort buffers in group (default is most-recently-selected) + (when buffers-tab-sort-function + (setq buffers (funcall buffers-tab-sort-function buffers))) + ;; convert list of buffers to list of structures used by tab widget (setq buffers (build-buffers-tab-internal buffers)) buffers))) (defun add-tab-to-gutter () "Put a tab control in the gutter area to hold the most recent buffers." (setq gutter-buffers-tab-orientation (default-gutter-position)) - (let ((gutter-string "")) + (let ((gutter-string (copy-sequence "\n"))) (unless gutter-buffers-tab-extent - (setq gutter-buffers-tab-extent (make-extent 0 0 gutter-string))) + (setq gutter-buffers-tab-extent (make-extent 0 1 gutter-string))) (set-extent-begin-glyph gutter-buffers-tab-extent (setq gutter-buffers-tab - (make-glyph - (vector 'tab-control :descriptor "Buffers" :face buffers-tab-face - :orientation gutter-buffers-tab-orientation - :properties (list :items (buffers-tab-items)))))) - ;; This looks better than a 3d border - (mapcar '(lambda (x) - (when (valid-image-instantiator-format-p 'tab-control x) - (set-specifier default-gutter-border-width 0 'global x) - (set-specifier top-gutter nil 'global x) - (set-specifier bottom-gutter nil 'global x) - (set-specifier left-gutter nil 'global x) - (set-specifier right-gutter nil 'global x) - (set-specifier left-gutter-width 0 'global x) - (set-specifier right-gutter-width 0 'global x) - (cond ((eq gutter-buffers-tab-orientation 'top) - (set-specifier top-gutter gutter-string 'global x)) - ((eq gutter-buffers-tab-orientation 'bottom) - (set-specifier bottom-gutter gutter-string 'global x)) - ((eq gutter-buffers-tab-orientation 'left) - (set-specifier left-gutter gutter-string 'global x) - (set-specifier left-gutter-width - (glyph-width gutter-buffers-tab) - 'global x)) - ((eq gutter-buffers-tab-orientation 'right) - (set-specifier right-gutter gutter-string 'global x) - (set-specifier right-gutter-width - (glyph-width gutter-buffers-tab) - 'global x)) - ))) - (console-type-list)))) + (make-glyph))) -(defun update-tab-in-gutter (&optional frame-or-buffer) + ;; Nuke all existing tabs + (remove-gutter-element top-gutter 'buffers-tab) + (remove-gutter-element bottom-gutter 'buffers-tab) + (remove-gutter-element left-gutter 'buffers-tab) + (remove-gutter-element right-gutter 'buffers-tab) + ;; Put tabs into all devices that will be able to display them + (mapcar + #'(lambda (x) + (when (valid-image-instantiator-format-p 'tab-control x) + (cond ((eq gutter-buffers-tab-orientation 'top) + ;; This looks better than a 3d border + (set-specifier top-gutter-border-width 0 'global x) + (set-gutter-element top-gutter 'buffers-tab + gutter-string 'global x)) + ((eq gutter-buffers-tab-orientation 'bottom) + (set-specifier bottom-gutter-border-width 0 'global x) + (set-gutter-element bottom-gutter 'buffers-tab + gutter-string 'global x)) + ((eq gutter-buffers-tab-orientation 'left) + (set-specifier left-gutter-border-width 0 'global x) + (set-gutter-element left-gutter 'buffers-tab + gutter-string 'global x) + (set-specifier left-gutter-width + (glyph-width gutter-buffers-tab) + 'global x)) + ((eq gutter-buffers-tab-orientation 'right) + (set-specifier right-gutter-border-width 0 'global x) + (set-gutter-element right-gutter 'buffers-tab + gutter-string 'global x) + (set-specifier right-gutter-width + (glyph-width gutter-buffers-tab) + 'global x)) + ))) + (console-type-list)))) + +(defun update-tab-in-gutter (frame &optional force-selection) "Update the tab control in the gutter area." - (let ((locale (if (framep frame-or-buffer) frame-or-buffer))) - (when (specifier-instance default-gutter-visible-p locale) - (unless (and gutter-buffers-tab + ;; dedicated frames don't get tabs + (unless (window-dedicated-p (frame-selected-window frame)) + (when (specifier-instance default-gutter-visible-p frame) + (unless (and gutter-buffers-tab (eq (default-gutter-position) gutter-buffers-tab-orientation)) (add-tab-to-gutter)) - (when (valid-image-instantiator-format-p 'tab-control locale) - (let ((inst (glyph-image-instance - gutter-buffers-tab - (when (framep frame-or-buffer) - (last-nonminibuf-window frame-or-buffer))))) - (set-image-instance-property inst :items - (buffers-tab-items - nil locale))))))) + (when (valid-image-instantiator-format-p 'tab-control frame) + (set-glyph-image + gutter-buffers-tab + (vector 'tab-control :descriptor "Buffers" :face buffers-tab-face + :orientation gutter-buffers-tab-orientation + (if (or (eq gutter-buffers-tab-orientation 'top) + (eq gutter-buffers-tab-orientation 'bottom)) + :pixel-width :pixel-height) + (if (or (eq gutter-buffers-tab-orientation 'top) + (eq gutter-buffers-tab-orientation 'bottom)) + '(gutter-pixel-width) '(gutter-pixel-height)) + :items (buffers-tab-items nil frame force-selection)) + frame))))) -(defun remove-buffer-from-gutter-tab () - "Remove the current buffer from the tab control in the gutter area." - (when (and (valid-image-instantiator-format-p 'tab-control) - (specifier-instance default-gutter-visible-p)) - (let ((inst (glyph-image-instance gutter-buffers-tab)) - (buffers (buffers-tab-items t))) - (unless buffers - (setq buffers (build-buffers-tab-internal - (list - (get-buffer-create "*scratch*"))))) - (set-image-instance-property inst :items buffers)))) - -(add-hook 'kill-buffer-hook 'remove-buffer-from-gutter-tab) -(add-hook 'create-frame-hook 'update-tab-in-gutter) -(add-hook 'record-buffer-hook 'update-tab-in-gutter) - +;; A myriad of different update hooks all doing slightly different things +(add-hook 'create-frame-hook + #'(lambda (frame) + (when gutter-buffers-tab (update-tab-in-gutter frame t)))) +(add-hook 'buffer-list-changed-hook 'update-tab-in-gutter) +(add-hook 'default-gutter-position-changed-hook + #'(lambda () + (when gutter-buffers-tab + (mapc #'update-tab-in-gutter (frame-list))))) +(add-hook 'gutter-element-visibility-changed-hook + #'(lambda (prop visible-p) + (when (and (eq prop 'buffers-tab) visible-p) + (mapc #'update-tab-in-gutter (frame-list))))) ;; ;; progress display ;; ripped off from message display ;; +(defcustom progress-feedback-use-echo-area nil + "*Whether progress gauge display should display in the echo area. +If NIL then progress gauges will be displayed with whatever native widgets +are available on the current console. If non-NIL then progress display will be +textual and displayed in the echo area." + :type 'boolean + :group 'gutter) + +(defvar progress-glyph-height 24 + "Height of the progress gauge glyph.") + +(defvar progress-feedback-popup-period 0.5 + "The time that the progress gauge should remain up after completion") + +(defcustom progress-feedback-style 'large + "*Control the appearance of the progress gauge. +If 'large, the default, then the progress-feedback text is displayed +above the gauge itself. If 'small then the gauge and text are arranged +side-by-side." + :group 'gutter + :type '(choice (const :tag "large" large) + (const :tag "small" small))) + +;; private variables +(defvar progress-text-instantiator [string :data ""]) +(defvar progress-layout-glyph (make-glyph)) +(defvar progress-layout-instantiator nil) + +(defvar progress-gauge-instantiator + [progress-gauge + :value 0 + :pixel-height (eval progress-glyph-height) + :pixel-width 250 + :descriptor "Progress"]) + +(defun set-progress-feedback-instantiator (&optional locale) + (cond + ((eq progress-feedback-style 'small) + (setq progress-glyph-height 16) + (setq progress-layout-instantiator + `[layout + :orientation horizontal + :margin-width 4 + :items (,progress-gauge-instantiator + [button + :pixel-height (eval progress-glyph-height) + ;; 'quit is special and acts "asynchronously". + :descriptor "Stop" :callback 'quit] + ,progress-text-instantiator)]) + (set-glyph-image progress-layout-glyph progress-layout-instantiator locale)) + (t + (setq progress-glyph-height 24) + (setq progress-layout-instantiator + `[layout + :orientation vertical :justify left + :margin-width 4 + :items (,progress-text-instantiator + [layout + :orientation horizontal + :items (,progress-gauge-instantiator + [button + :pixel-height (eval progress-glyph-height) + :descriptor " Stop " + ;; 'quit is special and acts "asynchronously". + :callback 'quit])])]) + (set-glyph-image progress-layout-glyph progress-layout-instantiator locale)))) + (defvar progress-stack nil "An alist of label/string pairs representing active progress gauges. The first element in the list is currently displayed in the gutter area. -Do not modify this directly--use the `progress' or -`display-progress'/`clear-progress' functions.") - -(defvar progress-glyph-height 32 - "Height of the gutter area for progress messages.") - -(defvar progress-stop-callback 'progress-quit-function - "Function to call to stop the progress operation.") - -(defun progress-quit-function () - "Default function to call for the stop button in a progress gauge. -This just removes the progress gauge and calls quit." - (interactive) - (clear-progress) - (keyboard-quit)) - -;; private variables -(defvar progress-gauge-glyph - (make-glyph - (vector 'progress-gauge - :pixel-height (- progress-glyph-height 8) - :pixel-width 50 - :descriptor "Progress"))) - -(defvar progress-text-glyph - (make-glyph [string :data ""])) - -(defvar progress-layout-glyph - (make-glyph - (vector - 'layout :orientation 'vertical :justify 'left - :items (list - progress-text-glyph - (make-glyph - (vector - 'layout :pixel-height progress-glyph-height - :orientation 'horizontal - :items (list - progress-gauge-glyph - (vector - 'button :pixel-height (- progress-glyph-height 8) - :descriptor " Stop " - :callback '(funcall progress-stop-callback))))))))) +Do not modify this directly--use the `progress-feedback' or +`display-progress-feedback'/`clear-progress-feedback' functions.") (defvar progress-abort-glyph (make-glyph - (vector 'layout :orientation 'vertical :justify 'left - :items (list progress-text-glyph - (make-glyph - (vector 'layout - :pixel-height progress-glyph-height - :orientation 'horizontal)))))) + `[layout :orientation vertical :justify left + :items (,progress-text-instantiator + [layout + :margin-width 4 + :pixel-height progress-glyph-height + :orientation horizontal])])) -(defvar progress-extent-text "") -(defvar progress-extent nil) - -(defun progress-displayed-p (&optional return-string frame) +(defun progress-feedback-displayed-p (&optional return-string frame) "Return a non-nil value if a progress gauge is presently displayed in the gutter area. If optional argument RETURN-STRING is non-nil, return a string containing the message, otherwise just return t." @@ -387,8 +446,8 @@ ;;; Returns the string which remains in the echo area, or nil if none. ;;; If label is nil, the whole message stack is cleared. -(defun clear-progress (&optional label frame no-restore) - "Remove any progress gauge with the given LABEL from the progress gauge-stack, +(defun clear-progress-feedback (&optional label frame no-restore) + "Remove any progress gauge with LABEL from the progress gauge-stack, erasing it from the gutter area if it's currently displayed there. If a message remains at the head of the progress-stack and NO-RESTORE is nil, it will be displayed. The string which remains in the gutter @@ -397,23 +456,31 @@ Unless you need the return value or you need to specify a label, you should just use (progress nil)." - (or frame (setq frame (selected-frame))) - (remove-progress label frame) - (let ((inhibit-read-only t) - (zmacs-region-stays zmacs-region-stays)) ; preserve from change - (erase-buffer " *Echo Area*") - (erase-buffer (get-buffer-create " *Gutter Area*"))) - (if no-restore - nil ; just preparing to put another msg up - (if progress-stack - (let ((oldmsg (cdr (car progress-stack)))) - (raw-append-progress oldmsg frame) - oldmsg) - ;; nothing to display so get rid of the gauge - (set-specifier bottom-gutter-border-width 0 frame) - (set-specifier bottom-gutter-visible-p nil frame)))) + (if (or (not (valid-image-instantiator-format-p 'progress-gauge frame)) + progress-feedback-use-echo-area) + (clear-message label frame nil no-restore) + (or frame (setq frame (selected-frame))) + (remove-progress-feedback label frame) + (let ((inhibit-read-only t) + (zmacs-region-stays zmacs-region-stays)) ; preserve from change + (erase-buffer (get-buffer-create " *Gutter Area*"))) + (if no-restore + nil ; just preparing to put another msg up + (if progress-stack + (let ((oldmsg (cdr (car progress-stack)))) + (raw-append-progress-feedback oldmsg nil frame) + oldmsg) + ;; nothing to display so get rid of the gauge + (set-specifier bottom-gutter-border-width 0 frame) + (set-gutter-element-visible-p bottom-gutter-visible-p + 'progress nil frame))))) -(defun remove-progress (&optional label frame) +(defun progress-feedback-clear-when-idle (&optional label) + (add-one-shot-hook 'pre-idle-hook + `(lambda () + (clear-progress-feedback ',label)))) + +(defun remove-progress-feedback (&optional label frame) ;; If label is nil, we want to remove all matching progress gauges. (while (and progress-stack (or (null label) ; null label means clear whole stack @@ -427,7 +494,15 @@ (setcdr s (cdr (cdr s)))) (setq s (cdr s))))))) -(defun append-progress (label message &optional value frame) +(defun progress-feedback-dispatch-non-command-events () + ;; don't allow errors to hose things + (condition-case t + ;; (sit-for 0) is too agressive and cause more display than we + ;; want. + (dispatch-non-command-events) + nil)) + +(defun append-progress-feedback (label message &optional value frame) (or frame (setq frame (selected-frame))) ;; Add a new entry to the message-stack, or modify an existing one (let* ((top (car progress-stack)) @@ -435,141 +510,144 @@ (if (eq label (car top)) (progn (setcdr top message) - (if (eq tmsg message) - (set-image-instance-property - (glyph-image-instance progress-gauge-glyph) - :percent value) - (raw-append-progress message value frame)) - (redisplay-gutter-area) - (when (input-pending-p) - (dispatch-event (next-command-event)))) + (if (equal tmsg message) + (progn + (set-instantiator-property progress-gauge-instantiator :value value) + (set-progress-feedback-instantiator (frame-selected-window frame))) + (raw-append-progress-feedback message value frame)) + (redisplay-gutter-area)) (push (cons label message) progress-stack) - (raw-append-progress message value frame)) - (when (eq value 100) - (sit-for 0.5 nil) - (clear-progress label)))) + (raw-append-progress-feedback message value frame)) + (progress-feedback-dispatch-non-command-events) + ;; either get command events or sit waiting for them + (when (eq value 100) +; (sit-for progress-feedback-popup-period nil) + (clear-progress-feedback label)))) -(defun abort-progress (label message &optional frame) - (or frame (setq frame (selected-frame))) - ;; Add a new entry to the message-stack, or modify an existing one - (let* ((top (car progress-stack)) - (inhibit-read-only t) - (zmacs-region-stays zmacs-region-stays)) - (if (eq label (car top)) - (setcdr top message) - (push (cons label message) progress-stack)) - (unless (equal message "") - (insert-string message (get-buffer-create " *Gutter Area*")) - ;; Do what the device is able to cope with. - (if (not (valid-image-instantiator-format-p 'progress-gauge frame)) - (progn - (insert-string message " *Echo Area*") - (if (not executing-kbd-macro) - (redisplay-echo-area))) - ;; do some funky display here. - (unless progress-extent - (setq progress-extent (make-extent 0 0 progress-extent-text))) - (let ((bglyph (extent-begin-glyph progress-extent))) - (set-extent-begin-glyph progress-extent progress-abort-glyph) +(defun abort-progress-feedback (label message &optional frame) + (if (or (not (valid-image-instantiator-format-p 'progress-gauge frame)) + progress-feedback-use-echo-area) + (display-message label (concat message "aborted.") frame) + (or frame (setq frame (selected-frame))) + ;; Add a new entry to the message-stack, or modify an existing one + (let* ((top (car progress-stack)) + (inhibit-read-only t) + (zmacs-region-stays zmacs-region-stays)) + (if (eq label (car top)) + (setcdr top message) + (push (cons label message) progress-stack)) + (unless (equal message "") + (insert-string message (get-buffer-create " *Gutter Area*")) + (let* ((gutter-string (copy-sequence "\n")) + (ext (make-extent 0 1 gutter-string))) + ;; do some funky display here. + (set-extent-begin-glyph ext progress-abort-glyph) ;; fixup the gutter specifiers - (set-specifier bottom-gutter progress-extent-text frame) + (set-gutter-element bottom-gutter 'progress gutter-string frame) (set-specifier bottom-gutter-border-width 2 frame) - (set-image-instance-property - (glyph-image-instance progress-text-glyph) :data message) + (set-instantiator-property progress-text-instantiator :datat message) + (set-progress-feedback-instantiator (frame-selected-window frame)) (set-specifier bottom-gutter-height 'autodetect frame) - (set-specifier bottom-gutter-visible-p t frame) + (set-gutter-element-visible-p bottom-gutter-visible-p + 'progress t frame) ;; we have to do this so redisplay is up-to-date and so ;; redisplay-gutter-area performs optimally. (redisplay-gutter-area) - (sit-for 0.5 nil) - (clear-progress label) - (set-extent-begin-glyph progress-extent bglyph) + (sit-for progress-feedback-popup-period nil) + (clear-progress-feedback label frame) + (set-extent-begin-glyph ext progress-layout-glyph) + (set-gutter-element bottom-gutter 'progress gutter-string frame) ))))) -(defun raw-append-progress (message &optional value frame) +(defun raw-append-progress-feedback (message &optional value frame) (unless (equal message "") - (let ((inhibit-read-only t) + (let* ((inhibit-read-only t) (zmacs-region-stays zmacs-region-stays) - (val (or value 0))) ; preserve from change + (val (or value 0)) + (gutter-string (copy-sequence "\n")) + (ext (make-extent 0 1 gutter-string))) (insert-string message (get-buffer-create " *Gutter Area*")) - ;; Do what the device is able to cope with. - (if (not (valid-image-instantiator-format-p 'progress-gauge frame)) + ;; do some funky display here. + (set-extent-begin-glyph ext progress-layout-glyph) + ;; fixup the gutter specifiers + (set-gutter-element bottom-gutter 'progress gutter-string frame) + (set-specifier bottom-gutter-border-width 2 frame) + (set-instantiator-property progress-gauge-instantiator :value val) + (set-progress-feedback-instantiator (frame-selected-window frame)) + + (set-instantiator-property progress-text-instantiator :data message) + (set-progress-feedback-instantiator (frame-selected-window frame)) + (if (and (eq (specifier-instance bottom-gutter-height frame) + 'autodetect) + (gutter-element-visible-p bottom-gutter-visible-p + 'progress frame)) + ;; if the gauge is already visible then just draw the gutter + ;; checking for user events (progn - (insert-string - (concat message (if (eq val 100) "done.") - (make-string (/ val 5) ?.)) - " *Echo Area*") - (if (not executing-kbd-macro) - (redisplay-echo-area))) - ;; do some funky display here. - (unless progress-extent - (setq progress-extent (make-extent 0 0 progress-extent-text)) - (set-extent-begin-glyph progress-extent progress-layout-glyph)) - ;; fixup the gutter specifiers - (set-specifier bottom-gutter progress-extent-text frame) - (set-specifier bottom-gutter-border-width 2 frame) - (set-image-instance-property - (glyph-image-instance progress-gauge-glyph) :percent val) - (set-image-instance-property - (glyph-image-instance progress-text-glyph) :data message) - (if (and (eq (specifier-instance bottom-gutter-height frame) - 'autodetect) - (specifier-instance bottom-gutter-visible-p frame)) - (progn - ;; if the gauge is already visible then just draw the gutter - ;; checking for user events - (redisplay-gutter-area) - (when (input-pending-p) - (dispatch-event (next-command-event)))) - ;; otherwise make the gutter visible and redraw the frame - (set-specifier bottom-gutter-height 'autodetect frame) - (set-specifier bottom-gutter-visible-p t frame) - ;; we have to do this so redisplay is up-to-date and so - ;; redisplay-gutter-area performs optimally. - (redisplay-frame) - ))))) + (redisplay-gutter-area) + (progress-feedback-dispatch-non-command-events)) + ;; otherwise make the gutter visible and redraw the frame + (set-specifier bottom-gutter-height 'autodetect frame) + (set-gutter-element-visible-p bottom-gutter-visible-p + 'progress t frame) + ;; we have to do this so redisplay is up-to-date and so + ;; redisplay-gutter-area performs optimally. This may also + ;; make sure the frame geometry looks ok. + (progress-feedback-dispatch-non-command-events) + (redisplay-frame frame) + )))) -(defun display-progress (label message &optional value frame) +(defun display-progress-feedback (label message &optional value frame) "Display a progress gauge and message in the bottom gutter area. First argument LABEL is an identifier for this message. MESSAGE is -the string to display. Use `clear-progress' to remove a labelled +the string to display. Use `clear-progress-feedback' to remove a labelled message." - (clear-progress label frame t) - (if (eq value 'abort) - (abort-progress label message frame) - (append-progress label message value frame))) + (cond ((eq value 'abort) + (abort-progress-feedback label message frame)) + ((or (not (valid-image-instantiator-format-p 'progress-gauge frame)) + progress-feedback-use-echo-area) + (display-message label + (concat message (if (eq value 100) "done." + (make-string (/ value 5) ?.))) + frame)) + (t + (append-progress-feedback label message value frame)))) -(defun current-progress (&optional frame) +(defun current-progress-feedback (&optional frame) "Return the current progress gauge in the gutter area, or nil. The FRAME argument is currently unused." (cdr (car progress-stack))) ;;; may eventually be frame-dependent -(defun current-progress-label (&optional frame) +(defun current-progress-feedback-label (&optional frame) (car (car progress-stack))) -(defun progress (fmt &optional value &rest args) +(defun progress-feedback (fmt &optional value &rest args) "Print a progress gauge and message in the bottom gutter area of the frame. The arguments are the same as to `format'. If the only argument is nil, clear any existing progress gauge." - (if (and (null fmt) (null args)) - (prog1 nil - (clear-progress nil)) - (let ((str (apply 'format fmt args))) - (display-progress 'progress str value) - str))) + (save-excursion + (if (and (null fmt) (null args)) + (prog1 nil + (clear-progress-feedback nil)) + (let ((str (apply 'format fmt args))) + (display-progress-feedback 'progress str value) + str)))) -(defun lprogress (label fmt &optional value &rest args) +(defun progress-feedback-with-label (label fmt &optional value &rest args) "Print a progress gauge and message in the bottom gutter area of the frame. First argument LABEL is an identifier for this progress gauge. The rest of the arguments are the same as to `format'." - (if (and (null fmt) (null args)) - (prog1 nil - (clear-progress label nil)) - (let ((str (apply 'format fmt args))) - (display-progress label str value) - str))) + ;; #### sometimes the buffer gets changed temporarily. I don't know + ;; why this is, so protect against it. + (save-excursion + (if (and (null fmt) (null args)) + (prog1 nil + (clear-progress-feedback label nil)) + (let ((str (apply 'format fmt args))) + (display-progress-feedback label str value) + str)))) (provide 'gutter-items) ;;; gutter-items.el ends here. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/gutter.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/gutter.el Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,173 @@ +;;; gutter.el --- Gutter manipulation for XEmacs. + +;; Copyright (C) 1999 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000 Andy Piper. + +;; Maintainer: XEmacs Development Team +;; Keywords: frames, gui, internal, dumped + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with Xmacs; see the file COPYING. If not, write to the +;; Free Software Foundation, 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;; Some of this is taken from the buffer-menu stuff in menubar-items.el +;; and the custom specs in toolbar.el. + +(defgroup gutter nil + "Input from the gutters." + :group 'environment) + +;; Although these customizations appear bogus, they are necessary in +;; order to be able to save options through the options menu. +(defcustom default-gutter-position + (default-gutter-position) + "The location of the default gutter. It can be 'top, 'bottom, 'left or +'right. This option should be customized through the options menu. +To set the gutter position explicitly use `set-default-gutter-position'" + :group 'gutter + :type '(choice (const :tag "top" top) + (const :tag "bottom" bottom) + (const :tag "left" left) + (const :tag "right" right)) + :set #'(lambda (var val) + (set-default-gutter-position val) + (setq default-gutter-position val))) + +;;; Gutter helper functions + +;; called by Fset_default_gutter_position() +(defvar default-gutter-position-changed-hook nil + "Function or functions to be called when the gutter position is changed. +The value of this variable may be buffer-local.") + +;; called by set-gutter-element-visible-p +(defvar gutter-element-visibility-changed-hook nil + "Function or functions to be called when the visibility of an +element in the gutter changes. The value of this variable may be +buffer-local. The gutter element symbol is passed as an argument to +the hook, as is the visibility flag.") + +(defun set-gutter-element (gutter-specifier prop val &optional locale tag-set) + "Set GUTTER-SPECIFIER gutter element PROP to VAL in optional LOCALE. +This is a convenience function for setting gutter elements. +VAL in general must be a string. If VAL is a glyph then a string will be +created to put the glyph into." + (let ((spec val)) + (when (glyphp val) + (setq spec (copy-sequence "\n")) + (set-extent-begin-glyph (make-extent 0 1 spec) val)) + (map-extents #'(lambda (extent arg) + (set-extent-property extent 'duplicable t)) spec) + (modify-specifier-instances gutter-specifier #'plist-put (list prop spec) + 'force nil locale tag-set))) + +(defun remove-gutter-element (gutter-specifier prop &optional locale tag-set) + "Remove gutter element PROP from GUTTER-SPECIFIER in optional LOCALE. +This is a convenience function for removing gutter elements." + (modify-specifier-instances gutter-specifier #'plist-remprop (list prop) + 'force nil locale tag-set)) + +(defun set-gutter-element-visible-p (gutter-visible-specifier-p + prop &optional visible-p + locale tag-set) + "Change the visibility of gutter elements. +Set the visibility of element PROP to VISIBLE-P for +GUTTER-SPECIFIER-VISIBLE-P in optional LOCALE. +This is a convenience function for hiding and showing gutter elements." + (modify-specifier-instances + gutter-visible-specifier-p #'(lambda (spec prop visible-p) + (if (consp spec) + (if visible-p + (if (memq prop spec) spec + (cons prop spec)) + (delq prop spec)) + (if visible-p (list prop)))) + (list prop visible-p) + 'force nil locale tag-set) + (run-hook-with-args 'gutter-element-visibility-changed-hook prop visible-p)) + +(defun gutter-element-visible-p (gutter-visible-specifier-p + prop &optional domain) + "Determine whether a gutter element is visible. +Given GUTTER-VISIBLE-SPECIFIER-P and gutter element PROP, return +non-nil if it is visible in optional DOMAIN." + (let ((spec (specifier-instance gutter-visible-specifier-p domain))) + (or (and (listp spec) (memq 'buffers-tab spec)) + spec))) + +(defun make-gutter-specifier (spec-list) + "Return a new `gutter' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Gutter specifiers are used to specify the format of a gutter. +The values of the variables `default-gutter', `top-gutter', +`left-gutter', `right-gutter', and `bottom-gutter' are always +gutter specifiers. + +Valid gutter instantiators are called \"gutter descriptors\" and are +either strings or property-lists of strings. See `default-gutter' for +a description of the exact format." + (make-specifier-and-init 'gutter spec-list)) + +(defun make-gutter-size-specifier (spec-list) + "Return a new `gutter-size' specifier object with the given spec list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Gutter-size specifiers are used to specify the size of a gutter. The +values of the variables `default-gutter-size', `top-gutter-size', +`left-gutter-size', `right-gutter-size', and `bottom-gutter-size' are +always gutter-size specifiers. + +Valid gutter-size instantiators are either integers or the special +symbol 'autodetect. If a gutter-size is set to 'autodetect them the +size of the gutter will be adjusted to just accommodate the gutters +contents. 'autodetect only works for top and bottom gutters." + (make-specifier-and-init 'gutter-size spec-list)) + +(defun make-gutter-visible-specifier (spec-list) + "Return a new `gutter-visible' specifier object with the given spec list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Gutter-visible specifiers are used to specify the visibility of a +gutter. The values of the variables `default-gutter-visible-p', +`top-gutter-visible-p', `left-gutter-visible-p', +`right-gutter-visible-p', and `bottom-gutter-visible-p' are always +gutter-visible specifiers. + +Valid gutter-visible instantiators are t, nil or a list of symbols. +If a gutter-visible instantiator is set to a list of symbols, and the +corresponding gutter specification is a property-list strings, then +elements of the gutter specification will only be visible if the +corresponding symbol occurs in the gutter-visible instantiator." + (make-specifier-and-init 'gutter-visible spec-list)) + +(defun init-gutter () + "Initialize the gutter." + ;; do nothing as yet. + ) + +;;; gutter.el ends here. + + diff -r 72a7cfa4a488 -r abe6d1db359e lisp/help.el --- a/lisp/help.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/help.el Mon Aug 13 11:35:02 2007 +0200 @@ -240,10 +240,8 @@ otherwise it is killed." (interactive) (let ((buf (current-buffer))) - (cond ((frame-property (selected-frame) 'help-window-config) - (set-window-configuration - (frame-property (selected-frame) 'help-window-config)) - (set-frame-property (selected-frame) 'help-window-config nil)) + (cond (help-window-config + (set-window-configuration help-window-config)) ((not (one-window-p)) (delete-window))) (if bury @@ -480,6 +478,21 @@ ;; another name (which is a shame, because w-d-h-b is a perfect name ;; for a macro) that uses with-displaying-help-buffer internally. +(defcustom mode-for-help 'help-mode + "*Mode that help buffers are put into.") + +(defvar help-sticky-window nil +;; Window into which help buffers will be displayed, rather than +;; always searching for a new one. This is INTERNAL and liable to +;; change its interface and/or name at any moment. It should be +;; bound, not set. +) + +(defvar help-window-config nil) + +(make-variable-buffer-local 'help-window-config) +(put 'help-window-config 'permanent-local t) + (defun with-displaying-help-buffer (thunk &optional name) "Form which makes a help buffer with given NAME and evaluates BODY there. The actual name of the buffer is generated by the function `help-buffer-name'." @@ -492,19 +505,28 @@ (mapcar 'window-frame (windows-of-buffer buffer-name))))))) (help-register-and-maybe-prune-excess buffer-name) - (prog1 (with-output-to-temp-buffer buffer-name - (prog1 (funcall thunk) - (save-excursion - (set-buffer standard-output) - (help-mode)))) + ;; if help-sticky-window is bogus or deleted, get rid of it. + (if (and help-sticky-window (or (not (windowp help-sticky-window)) + (not (window-live-p help-sticky-window)))) + (setq help-sticky-window nil)) + (prog1 + (let ((temp-buffer-show-function + (if help-sticky-window + #'(lambda (buffer) + (set-window-buffer help-sticky-window buffer)) + temp-buffer-show-function))) + (with-output-to-temp-buffer buffer-name + (prog1 (funcall thunk) + (save-excursion + (set-buffer standard-output) + (funcall mode-for-help))))) (let ((helpwin (get-buffer-window buffer-name))) (when helpwin - (with-current-buffer (window-buffer helpwin) - ;; If the *Help* buffer is already displayed on this - ;; frame, don't override the previous configuration - (when help-not-visible - (set-frame-property (selected-frame) - 'help-window-config winconfig))) + ;; If the *Help* buffer is already displayed on this + ;; frame, don't override the previous configuration + (when help-not-visible + (with-current-buffer (window-buffer helpwin) + (setq help-window-config winconfig))) (when help-selects-help-window (select-window helpwin)) (cond ((eq helpwin (selected-window)) @@ -730,7 +752,10 @@ (stringp Installation-string)) (with-displaying-help-buffer (lambda () - (princ Installation-string)) + (princ + (if (fboundp 'decode-coding-string) + (decode-coding-string Installation-string 'automatic-conversion) + Installation-string))) "Installation") (error "No Installation information available."))) @@ -742,16 +767,15 @@ (defun xemacs-www-page () "Go to the XEmacs World Wide Web page." (interactive) - (if (boundp 'browse-url-browser-function) - (funcall browse-url-browser-function "http://www.xemacs.org/") + (if (fboundp 'browse-url) + (browse-url "http://www.xemacs.org/") (error "xemacs-www-page requires browse-url"))) (defun xemacs-www-faq () "View the latest and greatest XEmacs FAQ using the World Wide Web." (interactive) - (if (boundp 'browse-url-browser-function) - (funcall browse-url-browser-function - "http://www.xemacs.org/faq/index.html") + (if (fboundp 'browse-url) + (browse-url "http://www.xemacs.org/faq/index.html") (error "xemacs-www-faq requires browse-url"))) (defun xemacs-local-faq () @@ -919,6 +943,21 @@ (setq obj (read (current-buffer))) (and (symbolp obj) (fboundp obj) obj))))))) +(defun function-at-event (event) + "Return the function whose name is around the position of EVENT. +EVENT should be a mouse event. When calling from a popup or context menu, +use `last-popup-menu-event' to find out where the mouse was clicked. +\(You cannot use (interactive \"e\"), unfortunately. This returns a +misc-user event.) + +If the event contains no position, or the position is not over text, or +there is no function around that point, nil is returned." + (if (and event (event-buffer event) (event-point event)) + (save-excursion + (set-buffer (event-buffer event)) + (goto-char (event-point event)) + (function-at-point)))) + ;; Default to nil for the non-hackers? Not until we find a way to ;; distinguish hackers from non-hackers automatically! (defcustom describe-function-show-arglist t @@ -1062,6 +1101,119 @@ (string-match "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'" doc)) (setq doc (substring doc 0 (match-beginning 0)))) doc)) +; (let ((name-char "[-+a-zA-Z0-9_*]") (sym-char "[-+a-zA-Z0-9_:*]")) +; (list +; ;; +; ;; The symbol itself. +; (list (concat "\\`\\(" name-char "+\\)\\(:\\)?") +; '(1 (if (match-beginning 2) +; 'font-lock-function-name-face +; 'font-lock-variable-name-face) +; nil t)) +; ;; +; ;; Words inside `' which tend to be symbol names. +; (list (concat "`\\(" sym-char sym-char "+\\)'") +; 1 '(prog1 +; 'font-lock-reference-face +; (add-list-mode-item (match-beginning 1) +; (match-end 1) +; nil +; 'help-follow-reference)) +; t) +; ;; +; ;; CLisp `:' keywords as references. +; (list (concat "\\<:" sym-char "+\\>") 0 'font-lock-reference-face t))) + +(defvar help-symbol-regexp + (let ((sym-char "[+a-zA-Z0-9_:*]") + (sym-char-no-dash "[-+a-zA-Z0-9_:*]")) + (concat "\\(" + ;; a symbol with a - in it. + "\\<\\(" sym-char-no-dash "+\\(-" sym-char-no-dash "+\\)+\\)\\>" + "\\|" + "`\\(" sym-char "+\\)'" + "\\)"))) + +(defun help-symbol-run-function-1 (ev ex fun) + (let ((help-sticky-window + ;; if we were called from a help buffer, make sure the new help + ;; goes in the same window. + (if (and (event-buffer ev) + (symbol-value-in-buffer 'help-window-config + (event-buffer ev))) + (event-window ev) + help-sticky-window))) + (funcall fun (extent-property ex 'help-symbol)))) + +(defun help-symbol-run-function (fun) + (let ((ex (extent-at-event last-popup-menu-event 'help-symbol))) + (when ex + (help-symbol-run-function-1 last-popup-menu-event ex fun)))) + +(defvar help-symbol-function-context-menu + '("---" + ["View %_Documentation" (help-symbol-run-function 'describe-function)] + ["Find %_Function Source" (help-symbol-run-function 'find-function)] + )) + +(defvar help-symbol-variable-context-menu + '("---" + ["View %_Documentation" (help-symbol-run-function 'describe-variable)] + ["Find %_Variable Source" (help-symbol-run-function 'find-variable)] + )) + +(defvar help-symbol-function-and-variable-context-menu + '("---" + ["View Function %_Documentation" (help-symbol-run-function + 'describe-function)] + ["View Variable D%_ocumentation" (help-symbol-run-function + 'describe-variable)] + ["Find %_Function Source" (help-symbol-run-function 'find-function)] + ["Find %_Variable Source" (help-symbol-run-function 'find-variable)] + )) + +(defun frob-help-extents (buffer) + ;; Look through BUFFER, starting at the buffer's point and continuing + ;; till end of file, and find documented functions and variables. + ;; any such symbol found is tagged with an extent, that sets up these + ;; properties: + ;; 1. mouse-face is 'highlight (so the extent gets highlighted on mouse over) + ;; 2. help-symbol is the name of the symbol. + ;; 3. context-menu is a list of context menu items, specific to whether + ;; the symbol is a function, variable, or both. + ;; 4. activate-function will cause the function or variable to be described, + ;; replacing the existing help contents. + (save-excursion + (set-buffer buffer) + (let (b e name) + (while (re-search-forward help-symbol-regexp nil t) + (setq b (or (match-beginning 2) (match-beginning 4))) + (setq e (or (match-end 2) (match-end 4))) + (setq name (buffer-substring b e)) + (let* ((sym (intern-soft name)) + (var (and sym (boundp sym) + (documentation-property sym + 'variable-documentation t))) + (fun (and sym (fboundp sym) + (documentation sym t)))) + (when (or var fun) + (let ((ex (make-extent b e))) + (set-extent-property ex 'mouse-face 'highlight) + (set-extent-property ex 'help-symbol sym) + (set-extent-property + ex 'context-menu + (cond ((and var fun) + help-symbol-function-and-variable-context-menu) + (var help-symbol-variable-context-menu) + (fun help-symbol-function-context-menu))) + (set-extent-property + ex 'activate-function + (if fun + #'(lambda (ev ex) + (help-symbol-run-function-1 ev ex 'describe-function)) + #'(lambda (ev ex) + (help-symbol-run-function-1 ev ex 'describe-variable)))) + ))))))) ;; 11 parentheses! (defun describe-function-1 (function &optional nodoc) "This function does the work for `describe-function'." @@ -1158,7 +1310,13 @@ (unless (and obsolete aliases) (let ((doc (function-documentation function t))) (princ "Documentation:\n") - (princ doc) + (let ((oldp (point standard-output)) + newp) + (princ doc) + (setq newp (point standard-output)) + (goto-char oldp standard-output) + (frob-help-extents standard-output) + (goto-char newp standard-output)) (unless (or (equal doc "") (eq ?\n (aref doc (1- (length doc))))) (terpri))))))))) @@ -1172,7 +1330,6 @@ (message nil) (message (function-arglist function))) - (defun variable-at-point () (ignore-errors (with-syntax-table emacs-lisp-mode-syntax-table @@ -1185,6 +1342,21 @@ (let ((obj (read (current-buffer)))) (and (symbolp obj) (boundp obj) obj)))))) +(defun variable-at-event (event) + "Return the variable whose name is around the position of EVENT. +EVENT should be a mouse event. When calling from a popup or context menu, +use `last-popup-menu-event' to find out where the mouse was clicked. +\(You cannot use (interactive \"e\"), unfortunately. This returns a +misc-user event.) + +If the event contains no position, or the position is not over text, or +there is no variable around that point, nil is returned." + (if (and event (event-buffer event) (event-point event)) + (save-excursion + (set-buffer (event-buffer event)) + (goto-char (event-point event)) + (variable-at-point)))) + (defun variable-obsolete-p (variable) "Return non-nil if VARIABLE is obsolete." (not (null (get variable 'byte-obsolete-variable)))) @@ -1313,7 +1485,13 @@ (when (or (not obsolete) (not aliases)) (if doc ;; note: documentation-property calls substitute-command-keys. - (princ doc) + (let ((oldp (point standard-output)) + newp) + (princ doc) + (setq newp (point standard-output)) + (goto-char oldp standard-output) + (frob-help-extents standard-output) + (goto-char newp standard-output)) (princ "not documented as a variable.")))) (terpri))) (format "variable `%s'" variable))) @@ -1446,5 +1624,4 @@ (with-displaying-help-buffer (insert string))))) - ;;; help.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/info.el --- a/lisp/info.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/info.el Mon Aug 13 11:35:02 2007 +0200 @@ -22,7 +22,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -308,7 +308,7 @@ ;; contain none or when it has become older than info files in the same ;; directory. -;; Modified 1998-09-23 by Didier Verna +;; Modified 1998-09-23 by Didier Verna ;; ;; Use the new macro `with-search-caps-disable-folding' @@ -402,10 +402,10 @@ `always' auto-generate a directory listing ignoring existing `dir' and `localdir' files `if-missing', the default, auto-generates a directory listing - if no `dir' or `localdir' file is present. Otherwise the + if no `dir' or `localdir' file is present. Otherwise the contents of any of these files is used instead. `if-outdated' auto-generates a directory listing if the `dir' - and `localdir' are either inexistent or outdated (touched + and `localdir' are either inexistent or outdated (touched less recently than an info file in the same directory)." :type '(choice (const :tag "never" never) (const :tag "always" always) @@ -413,15 +413,15 @@ (const :tag "if-outdated" if-outdated)) :group 'info) -(defcustom Info-save-auto-generated-dir nil +(defcustom Info-save-auto-generated-dir 'never "*Whether an auto-generated info directory listing should be saved. Possible values are: -nil or `never', the default, auto-generated info directory +nil or `never', the default, auto-generated info directory information will never be saved. `always', auto-generated info directory information will be saved to a `dir' file in the same directory overwriting it if it exists `conservative', auto-generated info directory information will be saved - to a `dir' file in the same directory but the user is asked before + to a `dir' file in the same directory but the user is asked before overwriting any existing file." :type '(choice (const :tag "never" never) (const :tag "always" always) @@ -463,7 +463,7 @@ :group 'info-faces) ;; Is this right for NT? .zip, with -c for to stdout, right? -(defvar Info-suffix-list '( ("" . nil) +(defvar Info-suffix-list '( ("" . nil) (".info" . nil) (".info.bz2" . "bzip2 -dc %s") (".info.gz" . "gzip -dc %s") @@ -494,10 +494,12 @@ (defvar Info-current-node nil "Name of node that Info is now looking at, or nil.") -(defvar Info-tag-table-marker (make-marker) +(defvar Info-tag-table-marker nil "Marker pointing at beginning of current Info file's tag table. Marker points nowhere if file has no tag table.") +(defvar Info-tag-table-buffer nil) + (defvar Info-current-file-completions nil "Cached completion list for current Info file.") @@ -537,7 +539,7 @@ looking at that node, which is (dir)Top.  File: dir Node: Top This is the top of the INFO tree - This (the Directory node) gives a menu of major topics. + This (the Directory node) gives a menu of major topics. * Menu: The list of major topics begins on the next line. @@ -592,6 +594,7 @@ (bury-buffer (find-file-noselect (car f)))) (setq f (cdr f))))) +;;;###autoload (defun Info-find-node (filename &optional nodename no-going-back tryfile line) "Go to an info node specified as separate FILENAME and NODENAME. Look for a plausible filename, or if not found then look for URL's and @@ -607,7 +610,7 @@ (Info-find-file-node nil nodename no-going-back tryfile line)) ;; Convert filename to lower case if not found as specified. ;; Expand it, look harder... - ((let (temp temp-downcase found + ((let (temp temp-downcase found (fname (substitute-in-file-name filename))) (let ((dirs (cond ((string-match "^\\./" fname) ; If specified name starts with `./' @@ -628,7 +631,7 @@ ;; Try downcasing, appending a suffix, or both. (setq found (Info-suffixed-file temp temp-downcase)) (setq dirs (cdr dirs))) - (if found + (if found (progn (setq filename (expand-file-name found)) t)))) (Info-find-file-node filename nodename no-going-back tryfile line)) @@ -650,7 +653,8 @@ ;; should be locked up where they can't do any more harm. ;; Go into info buffer. - (switch-to-buffer "*info*") + (or (eq major-mode 'Info-mode) + (switch-to-buffer "*info*")) (buffer-disable-undo (current-buffer)) (run-hooks 'Info-startup-hook) (or (eq major-mode 'Info-mode) @@ -659,7 +663,7 @@ (equal Info-current-file filename) (not Info-novice) (string= "dir" (file-name-nondirectory Info-current-file)) - (if (y-or-n-p-maybe-dialog-box + (if (y-or-n-p (format "Leave Info file `%s'? " (file-name-nondirectory Info-current-file))) (message "") @@ -703,16 +707,20 @@ (looking-at "(Indirect)\n")) ;; It is indirect. Copy it to another buffer ;; and record that the tag table is in that buffer. - (save-excursion - (let ((buf (current-buffer))) - (set-buffer - (get-buffer-create " *info tag table*")) - (buffer-disable-undo (current-buffer)) - (setq case-fold-search t) - (erase-buffer) - (insert-buffer-substring buf) - (set-marker Info-tag-table-marker - (match-end 0)))) + (let ((buf (current-buffer)) + (m Info-tag-table-marker)) + (or + Info-tag-table-buffer + (setq + Info-tag-table-buffer + (generate-new-buffer " *info tag table*"))) + (save-excursion + (set-buffer Info-tag-table-buffer) + (buffer-disable-undo (current-buffer)) + (setq case-fold-search t) + (erase-buffer) + (insert-buffer-substring buf) + (set-marker m (match-end 0)))) (set-marker Info-tag-table-marker pos)))) (setq Info-current-file (file-name-sans-versions buffer-file-name)))) @@ -729,18 +737,21 @@ ;; Also, if this is an indirect info file, ;; read the proper subfile into this buffer. (if (marker-position Info-tag-table-marker) - (save-excursion - (set-buffer (marker-buffer Info-tag-table-marker)) - (goto-char Info-tag-table-marker) - (if (re-search-forward regexp nil t) - (progn - (setq guesspos (read (current-buffer))) - ;; If this is an indirect file, - ;; determine which file really holds this node - ;; and read it in. - (if (not (eq (current-buffer) (get-buffer "*info*"))) - (setq guesspos - (Info-read-subfile guesspos))))))) + (let (foun found-mode (m Info-tag-table-marker)) + (save-excursion + (set-buffer (marker-buffer Info-tag-table-marker)) + (goto-char m) + (setq foun (re-search-forward regexp nil t)) + (if foun + (setq guesspos (read (current-buffer)))) + (setq found-mode major-mode)) + (if foun + ;; If this is an indirect file, + ;; determine which file really holds this node + ;; and read it in. + (if (not (eq major-mode found-mode)) + (setq guesspos + (Info-read-subfile guesspos)))))) (goto-char (max (point-min) (- guesspos 1000))) ;; Now search from our advised position (or from beg of buffer) ;; to find the actual node. @@ -870,7 +881,7 @@ (if (string-match "localdir" file) "localdir" "info dir")))) - (if (not buf) + (if (not buf) (insert-file-contents file)) (if (string-match "localdir" (buffer-name)) (setq lbuffers (cons (current-buffer) lbuffers)) @@ -881,13 +892,13 @@ Info-dir-file-attributes))))))) (or (cdr dirs) (setq Info-dir-contents-directory (car dirs))) (setq dirs (cdr dirs)))) - + ;; ensure that the localdir files are inserted last, and reverse ;; the list of them so that when they get pushed in, they appear ;; in the same order they got specified in the path, from top to ;; bottom. (nconc buffers (reverse lbuffers)) - + (or buffers (error "Can't find the Info directory node")) ;; Distinguish the dir file that comes with Emacs from all the @@ -956,7 +967,7 @@ (setq end (point)) (setq nodes (cons (list nodename other beg end) nodes)))))) (setq others (cdr others)))) - + ;; Add to the main menu a menu item for each other node. (re-search-forward "^\\* Menu:" nil t) (forward-line 1) @@ -1016,7 +1027,7 @@ (if (not (find-buffer-visiting file)) (if (not (file-exists-p file)) (if (or (eq Info-auto-generate-directory 'always) - (eq Info-auto-generate-directory 'if-missing)) + (eq Info-auto-generate-directory 'if-missing)) (Info-build-dir-anew (file-name-directory file))) (if (or (eq Info-auto-generate-directory 'always) (and (eq Info-auto-generate-directory 'if-outdated) @@ -1034,7 +1045,7 @@ f-mod-time newer) (setq Info-dir-newer-info-files nil) - (mapcar + (mapcar #'(lambda (f) (prog2 (setq f-mod-time (nth 5 (file-attributes f))) @@ -1043,7 +1054,7 @@ (> (car (cdr f-mod-time)) (car (cdr dir-mod-time)))))) (if (and (file-readable-p f) newer) - (setq Info-dir-newer-info-files + (setq Info-dir-newer-info-files (cons f Info-dir-newer-info-files))))) (directory-files (file-name-directory file) 'fullname @@ -1082,12 +1093,12 @@ (match-string 1) (downcase (or (match-string 3) (match-string 1))))) - (setq entry - (cons (nreverse - (cdr - (nreverse - (split-string - (buffer-substring + (setq entry + (cons (nreverse + (cdr + (nreverse + (split-string + (buffer-substring (re-search-forward "[ \t]*" nil t) (or (and (re-search-forward "^[^ \t]" nil t) (goto-char (match-beginning 0))) @@ -1108,7 +1119,7 @@ (if (> len description-col) (setq description-col len))) entries) - (setq description-col (+ 5 description-col)) + (setq description-col (+ 5 description-col)) (mapcar #'(lambda (e) (setq e (cdr e)) ; Drop filename (insert "* " (car e) ":" (car (cdr e))) @@ -1123,7 +1134,7 @@ (defun Info-build-dir-anew (directory) "Build info directory information for DIRECTORY. -The generated directory listing may be saved to a `dir' according +The generated directory listing may be saved to a `dir' according to the value of `Info-save-auto-generated-dir'" (save-excursion (let* ((dirfile (expand-file-name "dir" directory)) @@ -1131,7 +1142,7 @@ (eq Info-save-auto-generated-dir 'never) (and (not (file-writable-p dirfile)) (message "File not writable %s. Using temporary." dirfile)))) - (info-files + (info-files (directory-files directory 'fullname ".*\\.info\\(.gz\\|.Z\\|-z\\|.zip\\)?$" @@ -1145,13 +1156,13 @@ (erase-buffer) (insert Info-dir-prologue "Info files in " directory ":\n\n") - (Info-dump-dir-entries - (mapcar + (Info-dump-dir-entries + (mapcar #'(lambda (f) (or (Info-extract-dir-entry-from f) (list 'dummy - (progn - (string-match "\\(.*\\)\\.info\\(.gz\\|.Z\\|-z\\|.zip\\)?$" + (progn + (string-match "\\(.*\\)\\.info\\(.gz\\|.Z\\|-z\\|.zip\\)?$" (file-name-nondirectory f)) (capitalize (match-string 1 (file-name-nondirectory f)))) ":" @@ -1167,10 +1178,10 @@ (defun Info-rebuild-dir (file) "Build info directory information in the directory of dir FILE. -Description of info files are merged from the info files in the +Description of info files are merged from the info files in the directory and the contents of FILE with the description in info files -taking precedence over descriptions in FILE. -The generated directory listing may be saved to a `dir' according to +taking precedence over descriptions in FILE. +The generated directory listing may be saved to a `dir' according to the value of `Info-save-auto-generated-dir' " (save-excursion (save-restriction @@ -1179,7 +1190,7 @@ file-dir-entry mark next-section not-first-section - (to-temp + (to-temp (or (null Info-save-auto-generated-dir) (eq Info-save-auto-generated-dir 'never) (and (eq Info-save-auto-generated-dir 'always) @@ -1188,8 +1199,8 @@ (and (eq Info-save-auto-generated-dir 'conservative) (or (and (not (file-writable-p file)) (message "File not writable %s. Using temporary." file)) - (not (y-or-n-p - (message "%s is outdated. Overwrite ? " + (not (y-or-n-p + (message "%s is outdated. Overwrite ? " file)))))))) (set-buffer (find-file-noselect file t)) (setq buffer-read-only nil) @@ -1232,12 +1243,12 @@ (if file-dir-entry (setq dir-section-contents (cons file-dir-entry dir-section-contents)) - (setq dir-section-contents + (setq dir-section-contents (cons (list 'dummy (capitalize (file-name-sans-extension (file-name-nondirectory file))) ":" - (list Info-no-description-string)) + (list Info-no-description-string)) dir-section-contents)))))) Info-dir-newer-info-files) (delete-region (point-min) (point-max)) @@ -1259,7 +1270,7 @@ (save-buffer) (message "Rebuilding %s...done" file)))))) -;;;###autoload +;;;###autoload (defun Info-batch-rebuild-dir () "(Re)build info `dir' files in the directories remaining on the command line. Use this from the command line, with `-batch'; @@ -1279,7 +1290,7 @@ (car command-line-args-left)) (setq dir (expand-file-name "dir" (car command-line-args-left))) (setq localdir (expand-file-name "localdir" (car command-line-args-left))) - (cond + (cond ((file-exists-p dir) (Info-rebuild-dir dir)) ((file-exists-p localdir) @@ -1310,30 +1321,30 @@ (if p (file-name-nondirectory file) file))) (defun Info-read-subfile (nodepos) - (set-buffer (marker-buffer Info-tag-table-marker)) - (goto-char (point-min)) - (search-forward "\n\^_") (let (lastfilepos lastfilename) - (forward-line 2) - (catch 'foo - (while (not (looking-at "\^_")) - (if (not (eolp)) - (let ((beg (point)) - thisfilepos thisfilename) - (search-forward ": ") - (setq thisfilename (buffer-substring beg (- (point) 2))) - (setq thisfilepos (read (current-buffer))) - ;; read in version 19 stops at the end of number. - ;; Advance to the next line. - (if (eolp) - (forward-line 1)) - (if (> thisfilepos nodepos) - (throw 'foo t)) - (setq lastfilename thisfilename) - (setq lastfilepos thisfilepos)) - (throw 'foo t)))) - (set-buffer (get-buffer "*info*")) + (save-excursion + (set-buffer (marker-buffer Info-tag-table-marker)) + (goto-char (point-min)) + (search-forward "\n\^_") + (forward-line 2) + (catch 'foo + (while (not (looking-at "\^_")) + (if (not (eolp)) + (let ((beg (point)) + thisfilepos thisfilename) + (search-forward ": ") + (setq thisfilename (buffer-substring beg (- (point) 2))) + (setq thisfilepos (read (current-buffer))) + ;; read in version 19 stops at the end of number. + ;; Advance to the next line. + (if (eolp) + (forward-line 1)) + (if (> thisfilepos nodepos) + (throw 'foo t)) + (setq lastfilename thisfilename) + (setq lastfilepos thisfilepos)) + (throw 'foo t))))) (or (equal Info-current-subfile lastfilename) (let ((buffer-read-only nil)) (setq buffer-file-name nil) @@ -1567,14 +1578,15 @@ (defun Info-build-node-completions () (or Info-current-file-completions - (let ((compl (Info-build-annotation-completions))) + (let ((m Info-tag-table-marker) + (compl (Info-build-annotation-completions))) (save-excursion (save-restriction (widen) (if (marker-buffer Info-tag-table-marker) (progn (set-buffer (marker-buffer Info-tag-table-marker)) - (goto-char Info-tag-table-marker) + (goto-char m) (while (re-search-forward "\nNode: \\(.*\\)\177" nil t) (setq compl (cons (list (buffer-substring (match-beginning 1) @@ -1587,7 +1599,7 @@ (forward-line 1) (if (re-search-backward "Node: *\\([^,\n]*\\) *[,\n\t]" beg t) - (setq compl + (setq compl (cons (list (buffer-substring (match-beginning 1) (match-end 1))) compl)))))))) @@ -1625,26 +1637,27 @@ (if (not found) ;can only happen in subfile case -- else would have erred (unwind-protect (let ((list ())) - (set-buffer (marker-buffer Info-tag-table-marker)) - (goto-char (point-min)) - (search-forward "\n\^_\nIndirect:") - (save-restriction - (narrow-to-region (point) - (progn (search-forward "\n\^_") - (1- (point)))) - (goto-char (point-min)) - (search-forward (concat "\n" osubfile ": ")) - (beginning-of-line) - (while (not (eobp)) - (re-search-forward "\\(^.*\\): [0-9]+$") - (goto-char (+ (match-end 1) 2)) - (setq list (cons (cons (read (current-buffer)) - (buffer-substring (match-beginning 1) - (match-end 1))) - list)) - (goto-char (1+ (match-end 0)))) - (setq list (nreverse list) - list (cdr list))) + (save-excursion + (set-buffer (marker-buffer Info-tag-table-marker)) + (goto-char (point-min)) + (search-forward "\n\^_\nIndirect:") + (save-restriction + (narrow-to-region (point) + (progn (search-forward "\n\^_") + (1- (point)))) + (goto-char (point-min)) + (search-forward (concat "\n" osubfile ": ")) + (beginning-of-line) + (while (not (eobp)) + (re-search-forward "\\(^.*\\): [0-9]+$") + (goto-char (+ (match-end 1) 2)) + (setq list (cons (cons (read (current-buffer)) + (buffer-substring (match-beginning 1) + (match-end 1))) + list)) + (goto-char (1+ (match-end 0)))) + (setq list (nreverse list) + list (cdr list)))) (while list (message "Searching subfile %s..." (cdr (car list))) (Info-read-subfile (car (car list))) @@ -1667,7 +1680,7 @@ (Info-history-add ofile onode opoint))))) ;; Extract the value of the node-pointer named NAME. -;; If there is none, use ERRORNAME in the error message; +;; If there is none, use ERRORNAME in the error message; ;; if ERRORNAME is nil, just return nil. (defun Info-extract-pointer (name &optional errorname) (save-excursion @@ -1943,7 +1956,7 @@ ;; there is a problem here in that if several menu items have the same ;; name you can only go to the node of the first with this command. (Info-goto-node (Info-extract-menu-item menu-item) nil t)) - + (defun Info-extract-menu-item (menu-item &optional noerror) (save-excursion (goto-char (point-min)) @@ -2292,7 +2305,7 @@ "Look up an Emacs Lisp function in the Elisp manual in the Info system. This command is designed to be used whether you are already in Info or not." (interactive (let ((fn (function-at-point)) - (enable-recursive-minibuffers t) + (enable-recursive-minibuffers t) val) (setq val (completing-read (format "Look up Emacs Lisp function%s: " @@ -2813,6 +2826,9 @@ (make-local-variable 'Info-current-subfile) (make-local-variable 'Info-current-node) (make-local-variable 'Info-tag-table-marker) + (setq Info-tag-table-marker (make-marker)) + (make-local-variable 'Info-tag-table-buffer) + (setq Info-tag-table-buffer nil) (make-local-variable 'Info-current-file-completions) (make-local-variable 'Info-current-annotation-completions) (make-local-variable 'Info-index-alternatives) @@ -2878,7 +2894,7 @@ (interactive) ;; Do this first, so nothing has changed if user C-g's at query. (and (buffer-modified-p) - (y-or-n-p-maybe-dialog-box "Save the file? ") + (y-or-n-p "Save the file? ") (save-buffer)) (use-local-map Info-mode-map) (setq major-mode 'Info-mode) @@ -2999,7 +3015,7 @@ Used to construct the menubar submenu and popup menu." (or event (setq event (point))) (let ((case-fold-search t) - (xref-regexp (concat "\\*" + (xref-regexp (concat "\\*" (regexp-quote Info-footnote-tag) "[ \n\t]*\\([^:]*\\):")) up-p prev-p next-p menu xrefs subnodes in) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/isearch-mode.el --- a/lisp/isearch-mode.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/isearch-mode.el Mon Aug 13 11:35:02 2007 +0200 @@ -1210,7 +1210,8 @@ (set yank-pointer-name (setq yank-pointer (mod (+ (or yank-pointer 0) - (if advance -1 1)) + ;; XEmacs change + (if advance -1 (if yank-pointer 1 0))) length))) (setq isearch-string (nth yank-pointer ring) isearch-message (mapconcat 'isearch-text-char-description @@ -1883,8 +1884,7 @@ ;; buffer. (mapc #'delete-extent isearch-highlight-extents) (setq isearch-highlight-extents nil) - (setq isearch-highlight-all-start nil - isearch-window-end nil + (setq isearch-window-end nil isearch-highlight-last-string nil)) (defun isearch-highlight-all-update () diff -r 72a7cfa4a488 -r abe6d1db359e lisp/itimer.el --- a/lisp/itimer.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/itimer.el Mon Aug 13 11:35:02 2007 +0200 @@ -505,7 +505,7 @@ tab-stop-list '(22 32 40 60 67)) (abbrev-mode 0) (auto-fill-mode 0) - (buffer-flush-undo (current-buffer)) + (buffer-disable-undo (current-buffer)) (use-local-map itimer-edit-map) (set-syntax-table emacs-lisp-mode-syntax-table)) @@ -714,15 +714,20 @@ (unwind-protect (condition-case condition-data (save-match-data + ;; Suppress warnings - see comment below. + (defvar last-event-time) + (defvar next-wakeup) + (defvar itimer) + (defvar itimers) + (defvar time-elapsed) (let* ((current-itimer itimer) (quit-flag nil) (inhibit-quit nil) ;; for FSF Emacs timer.el emulation under XEmacs. ;; eldoc expect this to be done, apparently. (this-command nil) - ;; bind these variables so that the - ;; itimer function can't screw with - ;; them. + ;; bind these variables so that the itimer + ;; function can't screw with them. last-event-time next-wakeup itimer itimers time-elapsed) (if (itimer-uses-arguments current-itimer) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/keydefs.el --- a/lisp/keydefs.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/keydefs.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,7 @@ ;;; keydefs.el --- Define standard keybindings. ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. +;; Copyright (C) 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: internal, dumped @@ -106,9 +107,6 @@ (define-key global-map "\C-e" 'end-of-line) (define-key global-map "\C-f" 'forward-char-command) (define-key global-map "\C-d" 'delete-char) -(define-key global-map 'delete 'backward-or-forward-delete-char) -(define-key global-map '(meta delete) 'backward-or-forward-kill-word) -(define-key global-map [(control x) (delete)] 'backward-or-forward-kill-sentence) ;; FSFmacs files.el @@ -240,6 +238,7 @@ (define-key global-map '(control meta -) 'negative-argument) (define-key global-map "\C-k" 'kill-line) +(define-key global-map '(control K) 'historical-kill-line) (define-key global-map "\C-w" 'kill-region) (define-key global-map "\M-w" 'kill-ring-save) (define-key global-map "\M-\C-w" 'append-next-kill) @@ -273,6 +272,10 @@ (define-key global-map "\M-\C-t" 'transpose-sexps) (define-key global-map "\C-x\C-t" 'transpose-lines) +;; XEmacs: much more reasonable and useful key definitions. +(define-key global-map '(control T) 'transpose-line-down) +(define-key global-map '(meta T) 'transpose-line-up) + (define-key global-map "\M-;" 'indent-for-comment) (define-key global-map "\M-j" 'indent-new-comment-line) (define-key global-map "\M-\C-j" 'indent-new-comment-line) @@ -305,9 +308,6 @@ (define-key global-map "\M-\)" 'move-past-close-and-reindent) (define-key global-map "\M-\t" 'lisp-complete-symbol) -(define-key global-map '(control meta backspace) 'backward-kill-sexp) -(define-key global-map '(control meta delete) 'backward-or-forward-kill-sexp) - (define-key global-map "\C-x/" 'point-to-register) (define-key global-map "\C-xj" 'jump-to-register) @@ -389,6 +389,7 @@ ;; Default binding of "Control-h" is help. (define-key global-map 'backspace 'delete-backward-char) (define-key global-map '(meta backspace) 'backward-kill-word) +(define-key global-map [(control x) backspace] 'backward-kill-sentence) (define-key global-map "\M-\C-z" 'activate-region) @@ -510,74 +511,73 @@ ;; movement by units (define-key global-map 'left 'backward-char-command) +(define-key global-map 'right 'forward-char-command) (define-key global-map 'up 'previous-line) -(define-key global-map 'right 'forward-char-command) (define-key global-map 'down 'next-line) +(define-key global-map 'kp-left 'backward-char-command) +(define-key global-map 'kp-right 'forward-char-command) +(define-key global-map 'kp-up 'previous-line) +(define-key global-map 'kp-down 'next-line) ;; movement by pages (define-key global-map 'prior 'scroll-down-command) (define-key global-map 'next 'scroll-up-command) - -;; movement to the limits -(define-key global-map 'home 'beginning-of-line) -(define-key global-map 'end 'end-of-line) - -;;; Miscellaneous key bindings -(define-key global-map 'again 'repeat-complex-command) -(define-key global-map 'insert 'overwrite-mode) - -;;; These aren't bound to kbd macros like "\C-b" so that they have the -;; expected behavior even in, for example, vi-mode. - -;; We use here symbolic names, assuming that the corresponding keys will -;; generate these keysyms. This is not true on Suns, but x-win-sun.el -;; fixes that. If it turns out that the semantics of these keys should -;; differ from server to server, this should be moved into server-specific -;; files, but these appear to be the standard Motif and PC bindings. - -;; potential R6isms -(define-key global-map 'kp-left 'backward-char-command) -(define-key global-map 'kp-up 'previous-line) -(define-key global-map 'kp-right 'forward-char-command) -(define-key global-map 'kp-down 'next-line) - - -;; movement by larger blocks -(define-key global-map '(control left) 'backward-word) -(define-key global-map '(control up) #'(lambda () - (interactive "_") - (forward-line -6))) -(define-key global-map '(control right) 'forward-word) -(define-key global-map '(control down) #'(lambda () - (interactive "_") - (forward-line 6))) - -;; context-sensitive movement -(define-key global-map '(meta left) 'backward-sexp) -(define-key global-map '(meta right) 'forward-sexp) -(define-key global-map '(meta up) 'backward-paragraph) -(define-key global-map '(meta down) 'forward-paragraph) - -;; movement by pages (define-key global-map '(control prior) 'scroll-right) (define-key global-map '(control next) 'scroll-left) -;; potential R6isms (define-key global-map 'kp-prior 'scroll-down-command) (define-key global-map 'kp-next 'scroll-up-command) (define-key global-map '(control kp-prior) 'scroll-right) (define-key global-map '(control kp-next) 'scroll-left) - ;; movement to the limits +(define-key global-map 'home 'beginning-of-line) +(define-key global-map 'end 'end-of-line) (define-key global-map '(control home) 'beginning-of-buffer) (define-key global-map '(control end) 'end-of-buffer) +(define-key global-map 'kp-home 'beginning-of-line) +(define-key global-map 'kp-end 'end-of-line) +(define-key global-map '(control kp-home) 'beginning-of-buffer) +(define-key global-map '(control kp-end) 'end-of-buffer) + +;; on which systems do these exist? (define-key global-map 'begin 'beginning-of-line) (define-key global-map '(control begin) 'beginning-of-buffer) -;; potential R6isms -(define-key global-map 'kp-home 'beginning-of-line) -(define-key global-map '(control kp-home) 'beginning-of-buffer) -(define-key global-map 'kp-end 'end-of-line) -(define-key global-map '(control kp-end) 'end-of-buffer) + +;; movement by larger blocks +(define-key global-map '(control left) 'backward-word) +(define-key global-map '(control right) 'forward-word) +(define-key global-map '(control up) 'backward-block-of-lines) +(define-key global-map '(control down) 'forward-block-of-lines) +(define-key global-map '(control kp-left) 'backward-word) +(define-key global-map '(control kp-right) 'forward-word) +(define-key global-map '(control kp-up) 'backward-block-of-lines) +(define-key global-map '(control kp-down) 'forward-block-of-lines) + +;; context-sensitive movement +(define-key global-map '(meta left) 'backward-sexp) +(define-key global-map '(meta right) 'forward-sexp) +(define-key global-map '(meta up) 'backward-paragraph) +(define-key global-map '(meta down) 'forward-paragraph) +(define-key global-map '(meta control left) 'backward-sentence) +(define-key global-map '(meta control right) 'forward-sentence) +(define-key global-map '(meta control up) 'scroll-down-one) +(define-key global-map '(meta control down) 'scroll-up-one) +(define-key global-map '(meta control home) 'beginning-of-defun) +(define-key global-map '(meta control end) 'end-of-defun) +(define-key global-map '(meta control prior) 'backward-page) +(define-key global-map '(meta control next) 'forward-page) +(define-key global-map '(meta kp-left) 'backward-sexp) +(define-key global-map '(meta kp-right) 'forward-sexp) +(define-key global-map '(meta kp-up) 'backward-paragraph) +(define-key global-map '(meta kp-down) 'forward-paragraph) +(define-key global-map '(meta control kp-left) 'backward-sentence) +(define-key global-map '(meta control kp-right) 'forward-sentence) +(define-key global-map '(meta control kp-up) 'scroll-down-one) +(define-key global-map '(meta control kp-down) 'scroll-up-one) +(define-key global-map '(meta control kp-home) 'beginning-of-defun) +(define-key global-map '(meta control kp-end) 'end-of-defun) +(define-key global-map '(meta control kp-prior) 'backward-page) +(define-key global-map '(meta control kp-next) 'forward-page) ;; movement between windows (define-key global-map '(control tab) 'other-window) @@ -588,16 +588,33 @@ (define-key global-map '(meta prior) 'scroll-other-window-down) (define-key global-map '(meta home) 'beginning-of-buffer-other-window) (define-key global-map '(meta end) 'end-of-buffer-other-window) -;; potential R6isms (define-key global-map '(meta kp-next) 'scroll-other-window) (define-key global-map '(meta kp-prior) 'scroll-other-window-down) (define-key global-map '(meta kp-home) 'beginning-of-buffer-other-window) (define-key global-map '(meta kp-end) 'end-of-buffer-other-window) -;; potential R6isms +;; the infamous delete key +(define-key global-map 'delete 'backward-or-forward-delete-char) +(define-key global-map '(meta delete) 'backward-or-forward-kill-word) +(define-key global-map [(control x) (delete)] + 'backward-or-forward-kill-sentence) +(define-key global-map 'kp-delete 'backward-or-forward-delete-char) +(define-key global-map '(meta kp-delete) 'backward-or-forward-kill-word) +(define-key global-map [(control x) (kp-delete)] + 'backward-or-forward-kill-sentence) + +;; don't try this one at home, kids. +(define-key global-map '(control meta delete) 'backward-or-forward-kill-sexp) +(define-key global-map '(control meta kp-delete) 'backward-or-forward-kill-sexp) +;; or this one, either, on Linux. +(define-key global-map '(control meta backspace) 'backward-kill-sexp) + + +;;; Miscellaneous key bindings +(define-key global-map 'insert 'overwrite-mode) +(define-key global-map 'kp-insert 'overwrite-mode) +(define-key global-map 'again 'repeat-complex-command) (define-key global-map 'redo 'repeat-complex-command) -(define-key global-map 'kp-insert 'overwrite-mode) -(define-key global-map 'kp-delete 'backward-delete-char-untabify) (define-key global-map 'kp-enter [return]) ; do whatever RET does now (define-key global-map 'kp-tab [tab]) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/ldap.el --- a/lisp/ldap.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/ldap.el Mon Aug 13 11:35:02 2007 +0200 @@ -5,7 +5,7 @@ ;; Author: Oscar Figueiredo ;; Maintainer: Oscar Figueiredo ;; Created: Jan 1998 -;; Version: $Revision: 1.7.2.6 $ +;; Version: $Revision: 1.7.2.8 $ ;; Keywords: help comm ;; This file is part of XEmacs @@ -35,6 +35,10 @@ ;;; Code: +(eval-when '(load) + (if (not (fboundp 'ldap-open)) + (error "No LDAP support compiled in this XEmacs"))) + (defgroup ldap nil "Lightweight Directory Access Protocol" :group 'comm) @@ -145,6 +149,11 @@ (integer :tag "(number of records)"))))) :group 'ldap) +(defcustom ldap-verbose nil + "*If non-nil, LDAP operations echo progress messages." + :type 'boolean + :group 'ldap) + (defcustom ldap-ignore-attribute-codings nil "*If non-nil, do not perform any encoding/decoding on LDAP attribute values." :type 'boolean @@ -435,9 +444,30 @@ (if decoder (cons name (mapcar decoder values)) attr))) - -(defun ldap-search (filter &optional host attributes attrsonly withdn) +(defun ldap-decode-entry (entry) + "Decode the attributes of ENTRY according to LDAP rules." + (let (dn decoded) + (setq dn (car entry)) + (if (stringp dn) + (setq entry (cdr entry)) + (setq dn nil)) + (setq decoded (mapcar 'ldap-decode-attribute entry)) + (if dn + (cons dn decoded) + decoded))) + +(defun ldap-search (arg1 &rest args) + "Perform an LDAP search." + (apply (if (ldapp arg1) + 'ldap-search-basic + 'ldap-search-entries) arg1 args)) + +(make-obsolete 'ldap-search + "Use `ldap-search-entries' instead or +`ldap-search-basic' for the low-level search API.") + +(defun ldap-search-entries (filter &optional host attributes attrsonly withdn) "Perform an LDAP search. FILTER is the search filter in RFC1558 syntax, i.e., something that looks like \"(cn=John Smith)\". @@ -459,20 +489,134 @@ (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) ldap result) - (message "Opening LDAP connection to %s..." host) + (if ldap-verbose + (message "Opening LDAP connection to %s..." host)) (setq ldap (ldap-open host host-plist)) - (message "Searching with LDAP on %s..." host) - (setq result (ldap-search-internal ldap filter - (plist-get host-plist 'base) - (plist-get host-plist 'scope) - attributes attrsonly withdn)) + (if ldap-verbose + (message "Searching with LDAP on %s..." host)) + (setq result (ldap-search ldap filter + (plist-get host-plist 'base) + (plist-get host-plist 'scope) + attributes attrsonly withdn + ldap-verbose)) (ldap-close ldap) (if ldap-ignore-attribute-codings result - (mapcar (function - (lambda (record) - (mapcar 'ldap-decode-attribute record))) - result)))) + (mapcar 'ldap-decode-entry result)))) + +(defun ldap-add-entries (entries &optional host binddn passwd) + "Add entries to an LDAP directory. +ENTRIES is a list of entry specifications of +the form (DN (ATTR . VALUE) (ATTR . VALUE) ...) where +DN is the distinguished name of an entry to add, the following +are cons cells containing attribute/value string pairs. +HOST is the LDAP host, defaulting to `ldap-default-host' +BINDDN is the DN to bind as to the server +PASSWD is the corresponding password" + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + ldap + (i 1)) + (if (or binddn passwd) + (setq host-plist (copy-seq host-plist))) + (if binddn + (setq host-plist (plist-put host-plist 'binddn binddn))) + (if passwd + (setq host-plist (plist-put host-plist 'passwd passwd))) + (if ldap-verbose + (message "Opening LDAP connection to %s..." host)) + (setq ldap (ldap-open host host-plist)) + (if ldap-verbose + (message "Adding LDAP entries...")) + (mapcar (function + (lambda (thisentry) + (ldap-add ldap (car thisentry) (cdr thisentry)) + (if ldap-verbose + (message "%d added" i)) + (setq i (1+ i)))) + entries) + (ldap-close ldap))) + + +(defun ldap-modify-entries (entry-mods &optional host binddn passwd) + "Modify entries of an LDAP directory. +ENTRY_MODS is a list of entry modifications of the form + (DN MOD-SPEC1 MOD-SPEC2 ...) where DN is the distinguished name of +the entry to modify, the following are modification specifications. +A modification specification is itself a list of the form +(MOD-OP ATTR VALUE1 VALUE2 ...) MOD-OP and ATTR are mandatory, +VALUEs are optional depending on MOD-OP. +MOD-OP is the type of modification, one of the symbols `add', `delete' +or `replace'. ATTR is the LDAP attribute type to modify. +HOST is the LDAP host, defaulting to `ldap-default-host' +BINDDN is the DN to bind as to the server +PASSWD is the corresponding password" + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + ldap + (i 1)) + (if (or binddn passwd) + (setq host-plist (copy-seq host-plist))) + (if binddn + (setq host-plist (plist-put host-plist 'binddn binddn))) + (if passwd + (setq host-plist (plist-put host-plist 'passwd passwd))) + (if ldap-verbose + (message "Opening LDAP connection to %s..." host)) + (setq ldap (ldap-open host host-plist)) + (if ldap-verbose + (message "Modifying LDAP entries...")) + (mapcar (function + (lambda (thisentry) + (ldap-modify ldap (car thisentry) (cdr thisentry)) + (if ldap-verbose + (message "%d modified" i)) + (setq i (1+ i)))) + entry-mods) + (ldap-close ldap))) + + +(defun ldap-delete-entries (dn &optional host binddn passwd) + "Delete an entry from an LDAP directory. +DN is the distinguished name of an entry to delete or +a list of those. +HOST is the LDAP host, defaulting to `ldap-default-host' +BINDDN is the DN to bind as to the server +PASSWD is the corresponding password." + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + ldap) + (if (or binddn passwd) + (setq host-plist (copy-seq host-plist))) + (if binddn + (setq host-plist (plist-put host-plist 'binddn binddn))) + (if passwd + (setq host-plist (plist-put host-plist 'passwd passwd))) + (if ldap-verbose + (message "Opening LDAP connection to %s..." host)) + (setq ldap (ldap-open host host-plist)) + (if (consp dn) + (let ((i 1)) + (if ldap-verbose + (message "Deleting LDAP entries...")) + (mapcar (function + (lambda (thisdn) + (ldap-delete ldap thisdn) + (if ldap-verbose + (message "%d deleted" i)) + (setq i (1+ i)))) + dn)) + (if ldap-verbose + (message "Deleting LDAP entry...")) + (ldap-delete ldap dn)) + (ldap-close ldap))) + (provide 'ldap) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/lisp-mode.el --- a/lisp/lisp-mode.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/lisp-mode.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,7 +1,7 @@ ;;; lisp-mode.el --- Lisp mode, and its idiosyncratic commands. ;; Copyright (C) 1985, 1996, 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995 Tinker Systems +;; Copyright (C) 1995 Tinker Systems. ;; Maintainer: FSF ;; Keywords: lisp, languages, dumped @@ -32,8 +32,6 @@ ;; The base major mode for editing Lisp code (used also for Emacs Lisp). ;; This mode is documented in the Emacs manual -;; July/05/97 slb Converted to use easymenu. - ;;; Code: (defgroup lisp nil @@ -45,56 +43,91 @@ (defvar emacs-lisp-mode-syntax-table nil) (defvar lisp-mode-abbrev-table nil) -;; XEmacs change -(defvar lisp-interaction-mode-popup-menu nil) -(defvar lisp-interaction-mode-popup-menu-1 - (purecopy '("Lisp-Interaction" - ["Evaluate Last S-expression" eval-last-sexp] - ["Evaluate Entire Buffer" eval-current-buffer] - ["Evaluate Region" eval-region - :active (region-exists-p)] - "---" - ["Evaluate This Defun" eval-defun] - ;; FSF says "Instrument Function for Debugging" - ["Debug This Defun" edebug-defun] - "---" - ["Trace a Function" trace-function-background] - ["Untrace All Functions" untrace-all - :active (fboundp 'untrace-all)] - "---" - ["Comment Out Region" comment-region - :active (region-exists-p)] - ["Indent Region" indent-region - :active (region-exists-p)] - ["Indent Line" lisp-indent-line] - "---" - ["Debug On Error" (setq debug-on-error (not debug-on-error)) - :style toggle :selected debug-on-error] - ["Debug On Quit" (setq debug-on-quit (not debug-on-quit)) - :style toggle :selected debug-on-quit] - ["Debug on Signal" (setq debug-on-signal (not debug-on-signal)) - :style toggle :selected debug-on-signal] - ))) +(defun construct-lisp-mode-menu (popup-p emacs-lisp-p) + (flet ((popup-wrap (form) + (if popup-p `(menu-call-at-event ',form) form))) + `(,@(if emacs-lisp-p + `(["%_Byte-Compile This File" ,(popup-wrap + 'emacs-lisp-byte-compile)] + ["B%_yte-Compile/Load This File" + ,(popup-wrap 'emacs-lisp-byte-compile-and-load)] + ["Byte-%_Recompile Directory..." + ,(popup-wrap 'byte-recompile-directory)] + "---")) + ["%_Evaluate Region or Defun" + ,(popup-wrap '(if (region-exists-p) + (call-interactively 'eval-region) + (call-interactively 'eval-defun)))] + ["Evaluate %_Whole Buffer" ,(popup-wrap 'eval-current-buffer)] + ["Evaluate Last %_S-expression" ,(popup-wrap 'eval-last-sexp)] + "---" + ,@(if popup-p + '(["%_Find Function" + (find-function (menu-call-at-event '(function-at-point))) + :suffix (let ((fun (menu-call-at-event '(function-at-point)))) + (if fun (symbol-name fun) "")) + :active (and (fboundp 'find-function) + (menu-call-at-event '(function-at-point)))] + ["%_Find Variable" + (find-variable (menu-call-at-event '(variable-at-point))) + :suffix (let ((fun (menu-call-at-event '(variable-at-point)))) + (if fun (symbol-name fun) "")) + :active (and (fboundp 'find-variable) + (menu-call-at-event '(variable-at-point)))] + ["%_Help on Function" + (describe-function (menu-call-at-event '(function-at-point))) + :suffix (let ((fun (menu-call-at-event '(function-at-point)))) + (if fun (symbol-name fun) "")) + :active (and (fboundp 'describe-function) + (menu-call-at-event '(function-at-point)))] + ["%_Help on Variable" + (describe-variable (menu-call-at-event '(variable-at-point))) + :suffix (let ((fun (menu-call-at-event '(variable-at-point)))) + (if fun (symbol-name fun) "")) + :active (and (fboundp 'describe-variable) + (menu-call-at-event '(variable-at-point)))]) + '(["Find %_Function..." find-function + :active (fboundp 'find-function)] + ["Find %_Variable..." find-variable + :active (fboundp 'find-variable)] + ["%_Help on Function..." describe-function + :active (fboundp 'describe-function)] + ["Hel%_p on Variable..." describe-variable + :active (fboundp 'describe-variable)])) + "---" + ["Instrument This Defun for %_Debugging" ,(popup-wrap 'edebug-defun)] + ["%_Trace Function..." trace-function-background] + ["%_Untrace All Functions" untrace-all + :active (fboundp 'untrace-all)] + "---" + ["%_Comment Out Region" comment-region :active (region-exists-p)] + "---" + ["%_Indent Region or Balanced Expression" + ,(popup-wrap '(if (region-exists-p) + (call-interactively 'indent-region) + (call-interactively 'indent-sexp)))] + ["I%_ndent Defun" + ,(popup-wrap '(progn + (beginning-of-defun) + (indent-sexp)))] + "---" + "Look for debug-on-error under Options->Troubleshooting" + ))) -(defvar emacs-lisp-mode-popup-menu nil) -(defvar emacs-lisp-mode-popup-menu-1 - (purecopy - (nconc - '("Emacs-Lisp" - ["Byte-compile This File" emacs-lisp-byte-compile] - ["Byte-compile/load This" emacs-lisp-byte-compile-and-load] - ["Byte-recompile Directory..." byte-recompile-directory] - "---") - (cdr lisp-interaction-mode-popup-menu-1)))) +(defvar lisp-interaction-mode-popup-menu + (cons "Lisp-Interaction" (construct-lisp-mode-menu t nil))) + +(defvar emacs-lisp-mode-popup-menu + (cons "Emacs-Lisp" (construct-lisp-mode-menu t t))) ;Don't have a menubar entry in Lisp Interaction mode. Otherwise, the ;*scratch* buffer has a Lisp menubar item! Very confusing. -;(defvar lisp-interaction-mode-menubar-menu -; (purecopy (cons "Lisp" (cdr lisp-interaction-mode-popup-menu)))) +;Jan Vroonhof really wants this, so it's back. --ben +(defvar lisp-interaction-mode-menubar-menu + (cons "%_Lisp" (construct-lisp-mode-menu nil nil))) -(defvar emacs-lisp-mode-menubar-menu nil) -(defvar emacs-lisp-mode-menubar-menu-1 - (purecopy (cons "Lisp" (cdr emacs-lisp-mode-popup-menu-1)))) +(defvar emacs-lisp-mode-menubar-menu + (cons "%_Lisp" (construct-lisp-mode-menu nil t))) (if (not emacs-lisp-mode-syntax-table) (let ((i 0)) @@ -274,19 +307,15 @@ (set-syntax-table emacs-lisp-mode-syntax-table) ;; XEmacs changes (setq major-mode 'emacs-lisp-mode - ;; mode-popup-menu emacs-lisp-mode-popup-menu + mode-popup-menu emacs-lisp-mode-popup-menu mode-name "Emacs-Lisp") - ;; (if (and (featurep 'menubar) - ;; current-menubar) - ;; (progn + (if (and (featurep 'menubar) + current-menubar) + (progn ;; make a local copy of the menubar, so our modes don't ;; change the global menubar - ;; (set-buffer-menubar current-menubar) - ;; (add-submenu nil emacs-lisp-mode-menubar-menu))) - (unless emacs-lisp-mode-popup-menu - (easy-menu-define emacs-lisp-mode-popup-menu emacs-lisp-mode-map "" - emacs-lisp-mode-popup-menu-1)) - (easy-menu-add emacs-lisp-mode-popup-menu) + (set-buffer-menubar current-menubar) + (add-submenu nil emacs-lisp-mode-menubar-menu))) (lisp-mode-variables nil) (run-hooks 'emacs-lisp-mode-hook)) @@ -366,15 +395,14 @@ (use-local-map lisp-interaction-mode-map) (setq major-mode 'lisp-interaction-mode) (setq mode-name "Lisp Interaction") - ;; XEmacs change - ;; (setq mode-popup-menu lisp-interaction-mode-popup-menu) - (unless lisp-interaction-mode-popup-menu - (easy-menu-define lisp-interaction-mode-popup-menu - lisp-interaction-mode-map - "" - lisp-interaction-mode-popup-menu-1)) - (easy-menu-add lisp-interaction-mode-popup-menu) - + (setq mode-popup-menu lisp-interaction-mode-popup-menu) + (if (and (featurep 'menubar) + current-menubar) + (progn + ;; make a local copy of the menubar, so our modes don't + ;; change the global menubar + (set-buffer-menubar current-menubar) + (add-submenu nil lisp-interaction-mode-menubar-menu))) (set-syntax-table emacs-lisp-mode-syntax-table) (lisp-mode-variables nil) (run-hooks 'lisp-interaction-mode-hook)) @@ -671,8 +699,16 @@ (let ((function (buffer-substring (point) (progn (forward-sexp 1) (point)))) method) - (setq method (or (get (intern-soft function) 'lisp-indent-function) - (get (intern-soft function) 'lisp-indent-hook))) + (if (condition-case nil + (save-excursion + (backward-up-list 1) + (backward-up-list 1) + (backward-up-list 1) + (looking-at "(flet\\s-")) + (error nil)) + (setq method 'defun) + (setq method (or (get (intern-soft function) 'lisp-indent-function) + (get (intern-soft function) 'lisp-indent-hook)))) (cond ((or (eq method 'defun) (and (null method) (> (length function) 3) @@ -753,6 +789,7 @@ (put 'save-excursion 'lisp-indent-function 0) (put 'save-window-excursion 'lisp-indent-function 0) (put 'save-selected-window 'lisp-indent-function 0) +(put 'with-selected-window 'lisp-indent-function 1) (put 'save-selected-frame 'lisp-indent-function 0) (put 'with-selected-frame 'lisp-indent-function 1) (put 'save-restriction 'lisp-indent-function 0) @@ -760,6 +797,7 @@ (put 'let 'lisp-indent-function 1) (put 'let* 'lisp-indent-function 1) (put 'let-specifier 'lisp-indent-function 1) +(put 'flet 'lisp-indent-function 1) (put 'while 'lisp-indent-function 1) (put 'if 'lisp-indent-function 2) (put 'catch 'lisp-indent-function 1) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/list-mode.el --- a/lisp/list-mode.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/list-mode.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,7 +1,7 @@ ;;; list-mode.el --- Major mode for buffers containing lists of items ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. -;; Copyright (C) 1996 Ben Wing. +;; Copyright (C) 1996, 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, dumped @@ -63,6 +63,32 @@ (dolist (key '(kp-left left (control ?b))) (define-key map key 'previous-list-mode-item)))) +;; #### We make list-mode-hook, as well as completion-setup-hook and +;; minibuffer-setup-hook, permanent-local so that it's possible to create +;; buffers in these modes and then set up some buffer-specific +;; customizations without resorting to awful kludges. (The problem here +;; is that when you switch a buffer into a mode, reset-buffer is usually +;; called, which destroys all buffer-local settings that you carefully +;; tried to set up when you created the buffer. Therefore, the only way +;; to set these variables is to use the setup hooks -- but if they are +;; not declared permanent local, then any local hook functions that you +;; put on them (which is exactly what you want to do) also get removed, +;; so you would have to resort to putting a global hook function on the +;; setup hook, and then making sure it gets removed later. I actually +;; added some support for doing this with one-shot hooks, but this is +;; clearly not the correct way to do things, and it fails in some cases, +;; particularly when the buffer gets put into the mode more than once, +;; which typically happens with completion buffers, for example.) In +;; fact, all setup hooks should be made permanent local, but I didn't +;; feel like making a global change like this quite yet. The proper way +;; to do it would be to declare new def-style forms, such as defhook and +;; define-local-setup-hook, which are used to initialize hooks in place +;; of the current generic defvars. --ben + +(put 'list-mode-hook 'permanent-local t) +(defvar list-mode-hook nil + "Normal hook run when entering List mode.") + (defun list-mode () "Major mode for buffer containing lists of items." (interactive) @@ -70,12 +96,9 @@ (use-local-map list-mode-map) (setq mode-name "List") (setq major-mode 'list-mode) - (make-local-hook 'post-command-hook) - (add-hook 'post-command-hook 'set-list-mode-extent nil t) - (make-local-hook 'pre-command-hook) - (add-hook 'pre-command-hook 'list-mode-extent-pre-hook nil t) - (make-local-variable 'next-line-add-newlines) - (setq next-line-add-newlines nil) + (add-local-hook 'post-command-hook 'set-list-mode-extent) + (add-local-hook 'pre-command-hook 'list-mode-extent-pre-hook) + (set (make-local-variable 'next-line-add-newlines) nil) (setq list-mode-extent nil) ;; It is visually disconcerting to have the text cursor disappear within list ;; buffers, especially when moving from window to window, so leave it @@ -226,8 +249,11 @@ If the variable in not t or nil, the string is taken as a regexp to match for end of highlight") +;; see comment at list-mode-hook. +(put 'completion-setup-hook 'permanent-local t) (defvar completion-setup-hook nil - "Normal hook run at the end of setting up the text of a completion buffer.") + "Normal hook run at the end of setting up the text of a completion buffer. +When run, the completion buffer is the current buffer.") ; Unnecessary FSFmacs crock. We frob the extents directly in ; display-completion-list, so no "heuristics" like this are necessary. @@ -265,6 +291,9 @@ :window-width If non-nil, width to use in displaying the list, instead of the actual window's width. + :window-height + If non-nil, use no more than this many lines, and extend line width as + necessary. :help-string (default is the value of `completion-default-help-string') Form to evaluate to get a string to insert at the beginning of the completion list buffer. This is evaluated when that buffer @@ -288,7 +317,8 @@ :reference-buffer (:help-string completion-default-help-string) (:completion-string "Possible completions are:") - :window-width) + :window-width + :window-height) () (let ((old-buffer (current-buffer)) (bufferp (bufferp standard-output))) @@ -315,7 +345,8 @@ (selected-frame))) 80)))) (let ((count 0) - (max-width 0)) + (max-width 0) + old-max-width) ;; Find longest completion (let ((tail completions)) (while tail @@ -336,6 +367,7 @@ tail (cdr tail))))) (setq max-width (+ 2 max-width)) ; at least two chars between cols + (setq old-max-width max-width) (let ((rows (let ((cols (min (/ win-width max-width) count))) (if (<= cols 1) count @@ -345,8 +377,15 @@ (if (/= (% count cols) 0) ; want ceiling... (1+ (/ count cols)) (/ count cols))))))) - (if (stringp cl-completion-string) - (princ (gettext cl-completion-string))) + (when + (and cl-window-height + (> rows cl-window-height)) + (setq max-width old-max-width) + (setq rows cl-window-height)) + (when (and (stringp cl-completion-string) + (> (length cl-completion-string) 0)) + (princ (gettext cl-completion-string)) + (terpri)) (let ((tail completions) (r 0) (regexp-string @@ -355,7 +394,7 @@ "[ \t]" completion-highlight-first-word-only))) (while (< r rows) - (terpri) + (and (> r 0) (terpri)) (let ((indent 0) (column 0) (tail2 tail)) @@ -425,7 +464,9 @@ ;; (put-text-property beg (point) 'list-mode-item t) ;; (goto-char end))))) )) - (run-hooks 'completion-setup-hook))) + (save-excursion + (set-buffer standard-output) + (run-hooks 'completion-setup-hook)))) (defvar completion-display-completion-list-function 'display-completion-list "Function to set up the list of completions in the completion buffer. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/loaddefs.el --- a/lisp/loaddefs.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/loaddefs.el Mon Aug 13 11:35:02 2007 +0200 @@ -86,10 +86,23 @@ ;; making it more likely you will get a unique match. (setq completion-ignored-extensions (mapcar 'purecopy - '(".o" ".elc" "~" ".bin" ".lbin" ".fasl" - ".dvi" ".toc" ".log" ".aux" ".a" ".ln" - ".lof" ".blg" ".bbl" ".glo" ".idx" ".lot" ".fmt" - ".diff" ".oi" ".class"))) + ;; this is way way way bogus. + ;; completely wtf? + ;; the only things that should be here are those that are + ;; (a) universally recognizable, and + ;; (b) obvious backup files, or + ;; (c) obvious binary files that are generated on a + ;; PER-SOURCE-FILE basis, so that they will actually + ;; cause annoyance. This includes .exe files, e.g. +; '(".o" ".elc" "~" ".bin" ".lbin" ".fasl" +; ".dvi" ".toc" ;".log" +; ".aux" ".a" ".ln" +; ".lof" ".blg" ".bbl" ".glo" ".idx" ".lot" ".fmt" +; ".diff" ".oi" ".class"))) + '(".o" ".obj" ".elc" "~" + ".bin" ".lbin" ;; #### these are doubtful, esp. the latter. + ".dvi";; possibly doubtful, too. + ".class"))) ;; This needs to be redone better. -slb diff -r 72a7cfa4a488 -r abe6d1db359e lisp/loadhist.el --- a/lisp/loadhist.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/loadhist.el Mon Aug 13 11:35:02 2007 +0200 @@ -123,7 +123,11 @@ (when dependents (error "Loaded libraries %s depend on %s" (prin1-to-string dependents) file)))) - (let* ((flist (feature-symbols feature)) (file (car flist))) + (let* ((flist (feature-symbols feature)) + (file (car flist))) + (flet ((reset-aload (x) + (let ((aload (get x 'autoload))) + (if aload (fset x (cons 'autoload aload)))))) (mapcar #'(lambda (x) (cond ((stringp x) nil) @@ -131,12 +135,17 @@ ;; Remove any feature names that this file provided. (if (eq (car x) 'provide) (setq features (delq (cdr x) features)))) - ((boundp x) (makunbound x)) + ((and (boundp x) + (fboundp x)) + (makunbound x) + (fmakunbound x) + (reset-aload x)) + ((boundp x) + (makunbound x)) ((fboundp x) (fmakunbound x) - (let ((aload (get x 'autoload))) - (if aload (fset x (cons 'autoload aload))))))) - (cdr flist)) + (reset-aload x)))) + (cdr flist))) ;; Delete the load-history element for this file. (let ((elt (assoc file load-history))) (setq load-history (delq elt load-history))))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/loadup.el --- a/lisp/loadup.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/loadup.el Mon Aug 13 11:35:02 2007 +0200 @@ -45,7 +45,14 @@ (defvar Installation-string nil "Description of XEmacs installation.") -(let ((gc-cons-threshold 30000)) +;(start-profiling) + +(let ((gc-cons-threshold + ;; setting it low makes loadup incredibly fucking slow. + ;; no need to do it when not dumping. + (if (and purify-flag + (not (memq 'quick-build internal-error-checking))) + 30000 3000000))) ;; This is awfully damn early to be getting an error, right? (call-with-condition-handler 'really-early-error-handler @@ -65,8 +72,9 @@ (prog1 (buffer-substring) (kill-buffer (current-buffer))))) - (setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH"))) - (setq module-load-path (split-path (getenv "EMACSBOOTSTRAPMODULEPATH"))) + (let ((build-root (expand-file-name ".." invocation-directory))) + (setq load-path (list (expand-file-name "lisp" build-root))) + (setq module-load-path (list (expand-file-name "modules" build-root)))) ;; message not defined yet ... (external-debugging-output (format "\nUsing load-path %s" load-path)) @@ -109,7 +117,9 @@ (if full-path (prog1 (load full-path) - (garbage-collect)) + ;; but garbage collection really slows down loading. + (unless (memq 'quick-build internal-error-checking) + (garbage-collect))) (external-debugging-output (format "\nLoad file %s: not found\n" file)) ;; Uncomment in case of trouble @@ -155,7 +165,8 @@ ;; is generated. For VMS, you must edit ../../vms/makedoc.com. ;; For other systems, you must edit ../../src/Makefile.in.in. (when (load "site-load" t) - (garbage-collect)) + (garbage-collect) +) ;;FSFmacs randomness ;;(if (fboundp 'x-popup-menu) @@ -192,6 +203,71 @@ ) ;; frequent garbage collection +;(stop-profiling) + +;; yuck! need to insert the function def here, and rewrite the dolist +;; loop below. + +;(defun loadup-profile-results (&optional info stream) +; "Print profiling info INFO to STREAM in a pretty format. +;If INFO is omitted, the current profiling info is retrieved using +; `get-profiling-info'. +;If STREAM is omitted, either a *Profiling Results* buffer or standard +; output are used, depending on whether the function was called +; interactively or not." +; (interactive) +; (setq info (if info +; (copy-alist info) +; (get-profiling-info))) +; (when (and (not stream) +; (interactive-p)) +; (pop-to-buffer (get-buffer-create "*Profiling Results*")) +; (erase-buffer)) +; (let ((standard-output (or stream (if (interactive-p) +; (current-buffer) +; standard-output))) +; ;; Calculate the longest function +; (maxfunlen (apply #'max +; (length "Function Name") +; (mapcar +; (lambda (el) +; ;; Functions longer than 50 characters (usually +; ;; anonymous functions) don't qualify +; (let ((l (length (format "%s" (car el))))) +; (if (< l 50) +; l 0))) +; info)))) +; (princ (format "%-*s Ticks %%/Total Call Count\n" +; maxfunlen "Function Name")) +; (princ (make-string maxfunlen ?=)) +; (princ " ===== ======= ==========\n") +; (let ((sum (float (apply #'+ (mapcar #'cdr info))))) +; (let (entry +; (entry-list (nreverse (sort info #'cdr-less-than-cdr)))) +; (while entry-list +; (setq entry (car entry-list)) +; (princ (format "%-*s %-5d %-6.3f %s\n" +; maxfunlen (car entry) (cdr entry) +; (* 100 (/ (cdr entry) sum)) +; (or (gethash (car entry) call-count-profile-table) +; ""))) +; (setq entry-list (cdr entry-list)))) +; (princ (make-string maxfunlen ?-)) +; (princ "---------------------------------\n") +; (princ (format "%-*s %-5d %-6.2f\n" maxfunlen "Total" sum 100.0)) +; (princ (format "\n\nOne tick = %g ms\n" +; (/ default-profiling-interval 1000.0))) +; (and (boundp 'internal-error-checking) +; internal-error-checking +; (princ " +;WARNING: Error checking is turned on in this XEmacs. This might make +; the measurements very unreliable.\n")))) +; (when (and (not stream) +; (interactive-p)) +; (goto-char (point-min)))) + +;(loadup-profile-results nil 'external-debugging-output) + ;; Dump into the name `xemacs' (only) (when (member "dump" command-line-args) (message "Dumping under the name xemacs") diff -r 72a7cfa4a488 -r abe6d1db359e lisp/make-docfile.el --- a/lisp/make-docfile.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/make-docfile.el Mon Aug 13 11:35:02 2007 +0200 @@ -75,7 +75,8 @@ (setq command-line-args (cdr command-line-args))) ;; Then process the list of Lisp files. -(setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH"))) +(let ((build-root (expand-file-name ".." invocation-directory))) + (setq load-path (list (expand-file-name "lisp" build-root)))) (load "very-early-lisp" nil t) @@ -85,10 +86,8 @@ (load "packages.el") (load "setup-paths.el") (load "dump-paths.el") - -(setq - load-path - (nconc load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH")))) +(require 'custom) +(load "process") (let (preloaded-file-list) (load (expand-file-name "../lisp/dumped-lisp.el")) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/map-ynp.el --- a/lisp/map-ynp.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/map-ynp.el Mon Aug 13 11:35:02 2007 +0200 @@ -104,7 +104,7 @@ ;; (objects (capitalize (or (nth 1 help) "objects"))) ;; (action (capitalize (or (nth 2 help) "act on"))) ) - (setq map `(("Yes" . act) ("No" . skip) + (setq map `(("%_Yes" . act) ("%_No" . skip) ; bogus crap. --ben ; ((, (if help ; (capitalize @@ -119,9 +119,9 @@ ; ((, (capitalize ; (or (and help (nth 5 help)) "Quit"))) ; . exit) - ("Yes All" . automatic) - ("No All" . exit) - ("Cancel" . quit) + ("Yes %_All" . automatic) + ("No A%_ll" . exit) + ("%_Cancel" . quit) ,@(mapcar #'(lambda (elt) (cons (capitalize (nth 2 elt)) (vector (nth 1 elt)))) @@ -231,7 +231,8 @@ (lambda (elt) (format "%c to %s" (nth 0 elt) - (nth 2 elt)))) + (normalize-menu-item-name + (nth 2 elt))))) action-alist ";\n") (if action-alist ";\n") diff -r 72a7cfa4a488 -r abe6d1db359e lisp/menubar-items.el --- a/lisp/menubar-items.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/menubar-items.el Mon Aug 13 11:35:02 2007 +0200 @@ -3,8 +3,8 @@ ;; Copyright (C) 1991-1995, 1997-1998 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. ;; Copyright (C) 1995 Sun Microsystems. -;; Copyright (C) 1995, 1996 Ben Wing. -;; Copyright (C) 1997 MORIOKA Tomohiko +;; Copyright (C) 1995, 1996, 2000 Ben Wing. +;; Copyright (C) 1997 MORIOKA Tomohiko. ;; Maintainer: XEmacs Development Team ;; Keywords: frames, extensions, internal, dumped @@ -26,6 +26,27 @@ ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;;; Authorship: + +;; Created c. 1991 for Lucid Emacs. Originally called x-menubar.el. +;; Contained four menus -- File, Edit, Buffers, Help. +;; Dynamic menu changes possible only through activate-menubar-hook. +;; Also contained menu manipulation funs, e.g. find-menu-item, add-menu. +;; Options menu added for 19.9 by Jamie Zawinski, late 1993. +;; Major reorganization c. 1994 by Ben Wing; added many items and moved +;; some items to two new menus, Apps and Tools. (for 19.10?) +;; Generic menubar functions moved to new file, menubar.el, by Ben Wing, +;; 1995, for 19.12; also, creation of current buffers menu options, +;; and buffers menu changed from purely most-recent to sorted alphabetical, +;; by mode. Also added mode-popup-menu support. +;; New API (add-submenu, add-menu-button) and menu filter support added +;; late summer 1995 by Stig, for 19.13. Also popup-menubar-menu. +;; Renamed to menubar-items.el c. 1998, with MS Win support. +;; Options menu rewritten to use custom c. 1999 by ? (Jan Vroonhof?). +;; Major reorganization Mar. 2000 by Ben Wing; added many items and changed +;; top-level menus to File, Edit, View, Cmds, Tools, Options, Buffers. +;; Accelerator spec functionality added Mar. 2000 by Ben Wing. + ;;; Commentary: ;; This file is dumped with XEmacs (when window system and menubar support is @@ -33,68 +54,118 @@ ;;; Code: -;;; Warning-free compile -(eval-when-compile - (defvar language-environment-list) - (defvar bookmark-alist) - (defvar language-info-alist) - (defvar current-language-environment) - (defvar tutorial-supported-languages)) +(defun menu-truncate-list (list n) + (if (<= (length list) n) + list + (butlast list (- (length list) n)))) + +(defun submenu-generate-accelerator-spec (list &optional omit-chars-list) + "Add auto-generated accelerator specifications to a submenu. +This can be used to add accelerators to the return value of a menu filter +function. It correctly ignores unselectable items. It will destructively +modify the list passed to it. If an item already has an auto-generated +accelerator spec, this will be removed before the new one is added, making +this function idempotent. + +If OMIT-CHARS-LIST is given, it should be a list of lowercase characters, +which will not be used as accelerators." + (let ((n 0)) + (dolist (item list list) + (cond + ((vectorp item) + (setq n (1+ n)) + (aset item 0 + (concat + (menu-item-generate-accelerator-spec n omit-chars-list) + (menu-item-strip-accelerator-spec (aref item 0))))) + ((consp item) + (setq n (1+ n)) + (setcar item + (concat + (menu-item-generate-accelerator-spec n omit-chars-list) + (menu-item-strip-accelerator-spec (car item))))))))) + +(defun menu-item-strip-accelerator-spec (item) + "Strip an auto-generated accelerator spec off of ITEM. +ITEM should be a string. This removes specs added by +`menu-item-generate-accelerator-spec' and `submenu-generate-accelerator-spec'." + (if (string-match "%_. " item) + (substring item 4) + item)) + +(defun menu-item-generate-accelerator-spec (n &optional omit-chars-list) + "Return an accelerator specification for use with auto-generated menus. +This should be concat'd onto the beginning of each menu line. The spec +allows the Nth line to be selected by the number N. '0' is used for the +10th line, and 'a' through 'z' are used for the following 26 lines. + +If OMIT-CHARS-LIST is given, it should be a list of lowercase characters, +which will not be used as accelerators." + (cond ((< n 10) (concat "%_" (int-to-string n) " ")) + ((= n 10) "%_0 ") + ((<= n 36) + (setq n (- n 10)) + (let ((m 0)) + (while (> n 0) + (setq m (1+ m)) + (while (memq (int-to-char (+ m (- (char-to-int ?a) 1))) + omit-chars-list) + (setq m (1+ m))) + (setq n (1- n))) + (if (<= m 26) + (concat + "%_" + (char-to-string (int-to-char (+ m (- (char-to-int ?a) 1)))) + " ") + ""))) + (t ""))) (defconst default-menubar (purecopy-menubar ;; note backquote. `( - ("File" - ["Open..." find-file] - ["Open in Other Window..." find-file-other-window] - ["Open in New Frame..." find-file-other-frame] - ["Insert File..." insert-file] - ["View File..." view-file] + ("%_File" + ["%_Open..." find-file] + ["Open in Other %_Window..." find-file-other-window] + ["Open in New %_Frame..." find-file-other-frame] + ["%_Hex Edit File..." hexl-find-file + :active (fboundp 'hexl-find-file)] + ["%_Insert File..." insert-file] + ["%_View File..." view-file] "------" - ["Save" save-buffer + ["%_Save" save-buffer :active (buffer-modified-p) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Save As..." write-file] - ["Save Some Buffers" save-some-buffers] + ["Save %_As..." write-file] + ["Save So%_me Buffers" save-some-buffers] "-----" - ["Print Buffer" lpr-buffer - :active (fboundp 'lpr-buffer) - :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Pretty-Print Buffer" ps-print-buffer-with-faces + ["%_Print" generic-print-buffer + :active (or (valid-specifier-tag-p 'msprinter) + (and (not (eq system-type 'windows-nt)) + (fboundp 'lpr-buffer))) + :suffix (if put-buffer-names-in-file-menu (concat (buffer-name) "...") + "...")] + ["Prett%_y-Print" ps-print-buffer-with-faces :active (fboundp 'ps-print-buffer-with-faces) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] "-----" - ["New Frame" make-frame] - ["Frame on Other Display..." make-frame-on-display] - ["Delete Frame" delete-frame - :active (not (eq (next-frame (selected-frame) 'nomini 'window-system) - (selected-frame)))] - "-----" - ["Split Window" split-window-vertically] - ["Un-Split (Keep This)" delete-other-windows - :active (not (one-window-p t))] - ["Un-Split (Keep Others)" delete-window - :active (not (one-window-p t))] - "-----" - ["Revert Buffer" revert-buffer + ["%_Revert Buffer" revert-buffer :active (or buffer-file-name revert-buffer-function) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Delete Buffer" kill-this-buffer - :active t - :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] + ["Re%_cover File..." recover-file] + ["Recover S%_ession..." recover-session] "-----" - ["Exit XEmacs" save-buffers-kill-emacs] + ["E%_xit XEmacs" save-buffers-kill-emacs] ) - ("Edit" - ["Undo" advertised-undo + ("%_Edit" + ["%_Undo" advertised-undo :active (and (not (eq buffer-undo-list t)) (or buffer-undo-list pending-undo-list)) :suffix (if (or (eq last-command 'undo) (eq last-command 'advertised-undo)) "More" "")] - ["Redo" redo + ["%_Redo" redo :included (fboundp 'redo) :active (not (or (eq buffer-undo-list t) (eq last-buffer-undo-list nil) @@ -105,274 +176,641 @@ (or (eq buffer-undo-list pending-undo-list) (eq (cdr buffer-undo-list) pending-undo-list)))) :suffix (if (eq last-command 'redo) "More" "")] - ["Cut" kill-primary-selection - :active (selection-owner-p)] - ["Copy" copy-primary-selection + "----" + ["Cu%_t" kill-primary-selection :active (selection-owner-p)] - ["Paste" yank-clipboard-selection + ["%_Copy" copy-primary-selection + :active (selection-owner-p)] + ["%_Paste" yank-clipboard-selection :active (selection-exists-p 'CLIPBOARD)] - ["Clear" delete-primary-selection + ["%_Delete" delete-primary-selection :active (selection-owner-p)] "----" - ["Search..." isearch-forward] - ["Search Backward..." isearch-backward] - ["Replace..." query-replace] - "----" - ["Search (Regexp)..." isearch-forward-regexp] - ["Search Backward (Regexp)..." isearch-backward-regexp] - ["Replace (Regexp)..." query-replace-regexp] - "----" - ["Goto Line..." goto-line] - ["What Line" what-line] - ("Bookmarks" - :filter bookmark-menu-filter) + ["Select %_All" mark-whole-buffer] + ["Select Pa%_ge" mark-page] "----" - ["Start Macro Recording" start-kbd-macro - :active (not defining-kbd-macro)] - ["End Macro Recording" end-kbd-macro - :active defining-kbd-macro] - ["Execute Last Macro" call-last-kbd-macro - :active last-kbd-macro] - "----" - ["Show Message Log" show-message-log] - ) - - ,@(when (featurep 'mule) - '(("Mule" - ("Describe language support") - ("Set language environment") + ["%_Find..." make-search-dialog] + ["R%_eplace..." query-replace] + ["Replace (Rege%_xp)..." query-replace-regexp] + ["%_List Matching Lines..." list-matching-lines] + ,@(when (featurep 'mule) + '("----" + ("%_Multilingual (\"Mule\")" + ("%_Describe Language Support") + ("%_Set Language Environment") "--" - ["Toggle input method" toggle-input-method] - ["Select input method" set-input-method] - ["Describe input method" describe-input-method] + ["T%_oggle Input Method" toggle-input-method] + ["Select %_Input Method" set-input-method] + ["D%_escribe Input Method" describe-input-method] "--" - ["Describe current coding systems" + ["Describe Current %_Coding Systems" describe-current-coding-system] - ["Set coding system of buffer file" + ["Set Coding System of %_Buffer File..." set-buffer-file-coding-system] ;; not implemented yet - ["Set coding system of terminal" + ["Set Coding System of %_Terminal..." set-terminal-coding-system :active nil] ;; not implemented yet - ["Set coding system of keyboard" + ["Set Coding System of %_Keyboard..." set-keyboard-coding-system :active nil] - ["Set coding system of process" + ["Set Coding System of %_Process..." set-buffer-process-coding-system :active (get-buffer-process (current-buffer))] "--" - ["Show character table" view-charset-by-menu] + ["Show Cha%_racter Table" view-charset-by-menu] ;; not implemented yet - ["Show diagnosis for MULE" mule-diag :active nil] - ["Show many languages" view-hello-file]))) + ["Show Dia%_gnosis for MULE" mule-diag :active nil] + ["Show \"%_hello\" in Many Languages" view-hello-file])) + ) + ) - ("Apps" - ["Read Mail (VM)..." vm - :active (fboundp 'vm)] - ["Read Mail (MH)..." (mh-rmail t) - :active (fboundp 'mh-rmail)] - ["Send mail..." compose-mail - :active (fboundp 'compose-mail)] - ["Usenet News" gnus - :active (fboundp 'gnus)] - ["Browse the Web" w3 - :active (fboundp 'w3)] + ("%_View" + ["%_New Frame" make-frame] + ["Frame on Other Displa%_y..." make-frame-on-display] + ["%_Delete Frame" delete-frame + :active (not (eq (next-frame (selected-frame) 'nomini 'window-system) + (selected-frame)))] + "-----" + ["%_Split Window" split-window-vertically] + ["S%_plit Window (Side by Side)" split-window-horizontally] + ["%_Un-Split (Keep This)" delete-other-windows + :active (not (one-window-p t))] + ["Un-Split (Keep %_Others)" delete-window + :active (not (one-window-p t))] "----" - ["Spell-Check Buffer" ispell-buffer - :active (fboundp 'ispell-buffer)] - ["Toggle VI emulation" toggle-viper-mode - :active (fboundp 'toggle-viper-mode)] + ("N%_arrow" + ["%_Narrow to Region" narrow-to-region :active (region-exists-p)] + ["Narrow to %_Page" narrow-to-page] + ["Narrow to %_Defun" narrow-to-defun] + "----" + ["%_Widen" widen :active (or (/= (point-min) 1) + (/= (point-max) (1+ (buffer-size))))] + ) "----" - ("Calendar" - ["3-Month Calendar" calendar - :active (fboundp 'calendar)] - ["Diary" diary - :active (fboundp 'diary)] - ["Holidays" holidays - :active (fboundp 'holidays)] - ;; we're all pagans at heart ... - ["Phases of the Moon" phases-of-moon - :active (fboundp 'phases-of-moon)] - ["Sunrise/Sunset" sunrise-sunset - :active (fboundp 'sunrise-sunset)]) + ["Show Message %_Log" show-message-log] + "----" + ["%_Goto Line..." goto-line] + ["%_What Line" what-line] + ("%_Bookmarks" + :filter bookmark-menu-filter) + "----" + ["%_Jump to Previous Mark" (set-mark-command t) + :active (mark t)] + ) - ("Games" - ["Mine Game" xmine - :active (fboundp 'xmine)] - ["Tetris" tetris - :active (fboundp 'tetris)] - ["Sokoban" sokoban - :active (fboundp 'sokoban)] - ["Quote from Zippy" yow - :active (fboundp 'yow)] - ["Psychoanalyst" doctor - :active (fboundp 'doctor)] - ["Psychoanalyze Zippy!" psychoanalyze-pinhead - :active (fboundp 'psychoanalyze-pinhead)] - ["Random Flames" flame - :active (fboundp 'flame)] - ["Dunnet (Adventure)" dunnet - :active (fboundp 'dunnet)] - ["Towers of Hanoi" hanoi - :active (fboundp 'hanoi)] - ["Game of Life" life - :active (fboundp 'life)] - ["Multiplication Puzzle" mpuz - :active (fboundp 'mpuz)])) + ("C%_mds" + ["Repeat %_Last Complex Command..." repeat-complex-command] + ["E%_valuate Lisp Expression..." eval-expression] + ["Execute %_Named Command..." execute-extended-command] + "----" + ["Start %_Macro Recording" start-kbd-macro + :included (not defining-kbd-macro)] + ["End %_Macro Recording" end-kbd-macro + :included defining-kbd-macro] + ["E%_xecute Last Macro" call-last-kbd-macro + :active last-kbd-macro] + ("%_Other Macro" + ["%_Append to Last Macro" (start-kbd-macro t) + :active (and (not defining-kbd-macro) last-kbd-macro)] + ["%_Query User During Macro" kbd-macro-query + :active defining-kbd-macro] + ["Enter %_Recursive Edit During Macro" (kbd-macro-query t) + :active defining-kbd-macro] + "---" + ["E%_xecute Last Macro on Region Lines" + :active (and last-kbd-macro (region-exists-p))] + "---" + ["%_Name Last Macro..." name-last-kbd-macro + :active last-kbd-macro] + ["Assign Last Macro to %_Key..." assign-last-kbd-macro-to-key + :active (and last-kbd-macro + (fboundp 'assign-last-kbd-macro-to-key))] + "---" + ["%_Edit Macro..." edit-kbd-macro] + ["Edit %_Last Macro" edit-last-kbd-macro + :active last-kbd-macro] + "---" + ["%_Insert Named Macro into Buffer..." insert-kbd-macro] + ["Read Macro from Re%_gion" read-kbd-macro + :active (region-exists-p)] + ) + "----" + ("%_Abbrev" + ["D%_ynamic Abbrev Expand" dabbrev-expand] + ["Dynamic Abbrev %_Complete" dabbrev-completion] + ["Dynamic Abbrev Complete in %_All Buffers" (dabbrev-completion 16)] + "----" + "----" + ["%_Define Global Abbrev for " add-global-abbrev + :suffix (abbrev-string-to-be-defined nil) + :active abbrev-mode] + ["Define %_Mode-Specific Abbrev for " add-mode-abbrev + :suffix (abbrev-string-to-be-defined nil) + :active abbrev-mode] + ["Define Global Ex%_pansion for " inverse-add-global-abbrev + :suffix (inverse-abbrev-string-to-be-defined 1) + :active abbrev-mode] + ["Define Mode-Specific Expa%_nsion for " inverse-add-mode-abbrev + :suffix (inverse-abbrev-string-to-be-defined 1) + :active abbrev-mode] + "---" + ["E%_xpand Abbrev" expand-abbrev] + ["Expand Abbrevs in Re%_gion" expand-region-abbrevs + :active (region-exists-p)] + ["%_Unexpand Last Abbrev" unexpand-abbrev + :active (and (stringp last-abbrev-text) + (> last-abbrev-location 0))] + "---" + ["%_Kill All Abbrevs" kill-all-abbrevs] + ["%_Insert All Abbrevs into Buffer" insert-abbrevs] + ["%_List Abbrevs" list-abbrevs] + "---" + ["%_Edit Abbrevs" edit-abbrevs] + ["%_Redefine Abbrevs from Buffer" edit-abbrevs-redefine + :active (eq major-mode 'edit-abbrevs-mode)] + "---" + ["%_Save Abbrevs As..." write-abbrev-file] + ["L%_oad Abbrevs..." read-abbrev-file] + ) + ("%_Register" + ["%_Copy to Register..." copy-to-register :active (region-exists-p)] + ["%_Paste Register..." insert-register] + "---" + ["%_Save Point to Register" point-to-register] + ["%_Jump to Register" register-to-point] + ) + ("R%_ectangles" + ["%_Kill Rectangle" kill-rectangle] + ["%_Yank Rectangle" yank-rectangle] + ["Rectangle %_to Register" copy-rectangle-to-register] + ["Rectangle %_from Register" insert-register] + ["%_Clear Rectangle" clear-rectangle] + ["%_Open Rectangle" open-rectangle] + ["%_Prefix Rectangle..." string-rectangle] + ["Rectangle %_Mousing" + (customize-set-variable 'mouse-track-rectangle-p + (not mouse-track-rectangle-p)) + :style toggle :selected mouse-track-rectangle-p] + ) + ("%_Sort" + ["%_Lines in Region" sort-lines :active (region-exists-p)] + ["%_Paragraphs in Region" sort-paragraphs :active (region-exists-p)] + ["P%_ages in Region" sort-pages :active (region-exists-p)] + ["%_Columns in Region" sort-columns :active (region-exists-p)] + ["%_Regexp..." sort-regexp-fields :active (region-exists-p)] + ) + ("%_Change Case" + ["%_Upcase Region" upcase-region :active (region-exists-p)] + ["%_Downcase Region" downcase-region :active (region-exists-p)] + ["%_Capitalize Region" capitalize-region :active (region-exists-p)] + ["%_Title-Case Region" capitalize-region-as-title + :active (region-exists-p)] + ) + ("Ce%_nter" + ["%_Line" center-line] + ["%_Paragraph" center-paragraph] + ["%_Region" center-region :active (region-exists-p)] + ) + ("%_Indent" + ["%_As Previous Line" indent-relative] + ["%_To Column..." indent-to-column] + "---" + ["%_Region" indent-region :active (region-exists-p)] + ["%_Balanced Expression" indent-sexp] + ["%_C Expression" indent-c-exp] + ) + ("S%_pell-Check" + ["%_Buffer" ispell-buffer + :active (fboundp 'ispell-buffer)] + "---" + ["%_Word" ispell-word] + ["%_Complete Word" ispell-complete-word] + ["%_Region" ispell-region] + ) + ) - ("Options" - ("Customize" - ("Emacs" :filter (lambda (&rest junk) - (cdr (custom-menu-create 'emacs)))) - ["Group..." customize-group] - ["Variable..." customize-variable] - ["Face..." customize-face] - ["Saved..." customize-saved] - ["Set..." customize-customized] - ["Apropos..." customize-apropos] - ["Browse..." customize-browse]) - - ("Manage Packages" - ("Add Download Site" + ("%_Tools" + ("%_Packages" + ("%_Add Download Site" :filter (lambda (&rest junk) - (package-get-download-menu))) - ["Update Package Index" package-get-update-base] - ["List & Install" pui-list-packages] - ["Update Installed Packages" package-get-update-all] + (submenu-generate-accelerator-spec + (package-get-download-menu)))) + ["%_Update Package Index" package-get-update-base] + ["%_List and Install" pui-list-packages] + ["U%_pdate Installed Packages" package-get-update-all] ;; hack-o-matic, we can't force a load of package-base here ;; since it triggers dialog box interactions which we can't ;; deal with while using a menu - ("Using Custom" + ("Using %_Custom" :filter (lambda (&rest junk) (if package-get-base - (cdr (custom-menu-create 'packages)) - '(["Please load Package Index" (lamda (&rest junk) ()) nil])))) + (submenu-generate-accelerator-spec + (cdr (custom-menu-create 'packages))) + '("Please load Package Index")))) - ["Help" (Info-goto-node "(xemacs)Packages")]) + ["%_Help" (Info-goto-node "(xemacs)Packages")]) + ("%_Internet" + ["Read Mail %_1 (VM)..." vm + :active (fboundp 'vm)] + ["Read Mail %_2 (MH)..." (mh-rmail t) + :active (fboundp 'mh-rmail)] + ["Send %_Mail..." compose-mail + :active (fboundp 'compose-mail)] + ["Usenet %_News" gnus + :active (fboundp 'gnus)] + ["Browse the %_Web" w3 + :active (fboundp 'w3)]) + "---" + ("%_Grep" + :filter + (lambda (menu) + (if (or (not (boundp 'grep-history)) (null grep-history)) + menu + (let ((items + (submenu-generate-accelerator-spec + (mapcar #'(lambda (string) + (vector string + (list 'grep string))) + (menu-truncate-list grep-history 10))))) + (append menu '("---") items)))) + ["%_Grep..." grep :active (fboundp 'grep)] + ["%_Kill Grep" kill-compilation + :active (and (fboundp 'kill-compilation) + (fboundp 'compilation-find-buffer) + (let ((buffer (condition-case nil + (compilation-find-buffer) + (error nil)))) + (and buffer (get-buffer-process buffer))))] + "---" + ["Grep %_All Files in Current Directory..." + (progn + (require 'compile) + (let ((grep-command + (cons (concat grep-command " *") + (length grep-command)))) + (call-interactively 'grep))) + :active (fboundp 'grep)] + ["Grep %_C and C Header Files in Current Directory..." + (progn + (require 'compile) + (let ((grep-command + (cons (concat grep-command " *.[chCH]" + ; i wanted to also use *.cc and *.hh. + ; see long comment below under Perl. + ) + (length grep-command)))) + (call-interactively 'grep))) + :active (fboundp 'grep)] + ["Grep C Hea%_der Files in Current Directory..." + (progn + (require 'compile) + (let ((grep-command + (cons (concat grep-command " *.[hH]" + ; i wanted to also use *.hh. + ; see long comment below under Perl. + ) + (length grep-command)))) + (call-interactively 'grep))) + :active (fboundp 'grep)] + ["Grep %_E-Lisp Files in Current Directory..." + (progn + (require 'compile) + (let ((grep-command + (cons (concat grep-command " *.el") + (length grep-command)))) + (call-interactively 'grep))) + :active (fboundp 'grep)] + ["Grep %_Perl Files in Current Directory..." + (progn + (require 'compile) + (let ((grep-command + (cons (concat grep-command " *.pl" + ; i wanted to use this: + ; " *.pl *.pm *.am" + ; but grep complains if it can't + ; match anything in a glob, and + ; that screws other things up. + ; perhaps we need to first scan + ; each separate glob in the directory + ; to see if there are any files in + ; that glob, and if not, omit it. + ) + (length grep-command)))) + (call-interactively 'grep))) + :active (fboundp 'grep)] + ["Grep %_HTML Files in Current Directory..." + (progn + (require 'compile) + (let ((grep-command + (cons (concat grep-command " *.*htm*") + (length grep-command)))) + (call-interactively 'grep))) + :active (fboundp 'grep)] + "---" + ["%_Next Match" next-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["Pre%_vious Match" previous-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["%_First Match" first-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["G%_oto Match" compile-goto-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + "---" + ["%_Set Grep Command..." + (progn + (require 'compile) + (customize-set-variable + 'grep-command + (read-shell-command "Default Grep Command: " grep-command))) + :active (fboundp 'grep) + ] + ) + ("%_Compile" + :filter + (lambda (menu) + (if (or (not (boundp 'compile-history)) (null compile-history)) + menu + (let ((items + (submenu-generate-accelerator-spec + (mapcar #'(lambda (string) + (vector string + (list 'compile string))) + (menu-truncate-list compile-history 10))))) + (append menu '("---") items)))) + ["%_Compile..." compile :active (fboundp 'compile)] + ["%_Repeat Compilation" recompile :active (fboundp 'recompile)] + ["%_Kill Compilation" kill-compilation + :active (and (fboundp 'kill-compilation) + (fboundp 'compilation-find-buffer) + (let ((buffer (condition-case nil + (compilation-find-buffer) + (error nil)))) + (and buffer (get-buffer-process buffer))))] + "---" + ["%_Next Error" next-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["Pre%_vious Error" previous-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["%_First Error" first-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["G%_oto Error" compile-goto-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ) + ("%_Debug" + ["%_GDB..." gdb + :active (fboundp 'gdb)] + ["%_DBX..." dbx + :active (fboundp 'dbx)]) + ("%_Shell" + ["%_Shell" shell + :active (fboundp 'shell)] + ["S%_hell Command..." shell-command + :active (fboundp 'shell-command)] + ["Shell Command on %_Region..." shell-command-on-region + :active (and (fboundp 'shell-command-on-region) (region-exists-p))]) - "---" + ("%_Tags" + ["%_Find Tag..." find-tag] + ["Find %_Other Window..." find-tag-other-window] + ["%_Next Tag..." (find-tag nil)] + ["N%_ext Other Window..." (find-tag-other-window nil)] + ["Next %_File" next-file] + "-----" + ["Tags %_Search..." tags-search] + ["Tags %_Replace..." tags-query-replace] + ["%_Continue Search/Replace" tags-loop-continue] + "-----" + ["%_Pop stack" pop-tag-mark] + ["%_Apropos..." tags-apropos] + "-----" + ["%_Set Tags Table File..." visit-tags-table] + ) + + "----" + + ("Ca%_lendar" + ["%_3-Month Calendar" calendar + :active (fboundp 'calendar)] + ["%_Diary" diary + :active (fboundp 'diary)] + ["%_Holidays" holidays + :active (fboundp 'holidays)] + ;; we're all pagans at heart ... + ["%_Phases of the Moon" phases-of-moon + :active (fboundp 'phases-of-moon)] + ["%_Sunrise/Sunset" sunrise-sunset + :active (fboundp 'sunrise-sunset)]) - ("Editing Options" - ["Overstrike" + ("Ga%_mes" + ["%_Mine Game" xmine + :active (fboundp 'xmine)] + ["%_Tetris" tetris + :active (fboundp 'tetris)] + ["%_Sokoban" sokoban + :active (fboundp 'sokoban)] + ["Quote from %_Zippy" yow + :active (fboundp 'yow)] + ["%_Psychoanalyst" doctor + :active (fboundp 'doctor)] + ["Ps%_ychoanalyze Zippy!" psychoanalyze-pinhead + :active (fboundp 'psychoanalyze-pinhead)] + ["%_Random Flames" flame + :active (fboundp 'flame)] + ["%_Dunnet (Adventure)" dunnet + :active (fboundp 'dunnet)] + ["Towers of %_Hanoi" hanoi + :active (fboundp 'hanoi)] + ["Game of %_Life" life + :active (fboundp 'life)] + ["M%_ultiplication Puzzle" mpuz + :active (fboundp 'mpuz)]) + + "----" + ) + + ("%_Options" + ("%_Advanced (Customize)" + ("%_Emacs" :filter (lambda (&rest junk) + (cdr (custom-menu-create 'emacs)))) + ["%_Group..." customize-group] + ["%_Variable..." customize-variable] + ["%_Face..." customize-face] + ["%_Saved..." customize-saved] + ["Se%_t..." customize-customized] + ["%_Apropos..." customize-apropos] + ["%_Browse..." customize-browse]) + "---" + ("%_Editing" + ["This Buffer %_Read Only" (toggle-read-only) + :style toggle :selected buffer-read-only] + ["%_Yank/Kill Interact With Clipboard" + (if (eq interprogram-cut-function 'own-clipboard) + (progn + (customize-set-variable 'interprogram-cut-function nil) + (customize-set-variable 'interprogram-paste-function nil)) + (customize-set-variable 'interprogram-cut-function 'own-clipboard) + (customize-set-variable 'interprogram-paste-function 'get-clipboard)) + :style toggle + :selected (eq interprogram-cut-function 'own-clipboard)] + ["%_Overstrike" (progn (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual)) (customize-set-variable 'overwrite-mode overwrite-mode)) :style toggle :selected overwrite-mode] - ["Case Sensitive Search" + ["%_Abbrev Mode" + (customize-set-variable 'abbrev-mode + (not (default-value 'abbrev-mode))) + :style toggle + :selected (default-value 'abbrev-mode)] + ["Active Re%_gions" + (customize-set-variable 'zmacs-regions (not zmacs-regions)) + :style toggle :selected zmacs-regions] + "---" + ["%_Case Sensitive Search" (customize-set-variable 'case-fold-search (setq case-fold-search (not case-fold-search))) :style toggle :selected (not case-fold-search)] - ["Case Matching Replace" + ["Case %_Matching Replace" (customize-set-variable 'case-replace (not case-replace)) :style toggle :selected case-replace] - ["Auto Delete Selection" + "---" + ("%_Newline at End of File..." + ["%_Don't Require" + (customize-set-variable 'require-final-newline nil) + :style radio :selected (not require-final-newline)] + ["%_Require" + (customize-set-variable 'require-final-newline t) + :style radio :selected (eq require-final-newline t)] + ["%_Ask" + (customize-set-variable 'require-final-newline 'ask) + :style radio :selected (and require-final-newline + (not (eq require-final-newline t)))]) + ["Add Newline When Moving Past %_End" + (customize-set-variable 'next-line-add-newlines + (not next-line-add-newlines)) + :style toggle :selected next-line-add-newlines]) + ("%_Keyboard and Mouse" + ["%_Delete Key Deletes Selection" (customize-set-variable 'pending-delete-mode (not pending-delete-mode)) :style toggle :selected (and (boundp 'pending-delete-mode) pending-delete-mode) :active (boundp 'pending-delete-mode)] - ["Active Regions" - (customize-set-variable 'zmacs-regions (not zmacs-regions)) - :style toggle :selected zmacs-regions] - ["Mouse Paste At Text Cursor" + ("`%_kill-line' Behavior..." + ["Kill %_Whole Line" + (customize-set-variable 'kill-whole-line 'always) + :style radio :selected (eq kill-whole-line 'always)] + ["Kill to %_End of Line" + (customize-set-variable 'kill-whole-line nil) + :style radio :selected (eq kill-whole-line nil)] + ["Kill Whole Line at %_Beg, Otherwise to End" + (customize-set-variable 'kill-whole-line t) + :style radio :selected (eq kill-whole-line t)]) + ["Size for %_Block-Movement Commands..." + (customize-set-variable 'block-movement-size + (read-number "Block Movement Size: " + t block-movement-size))] + ["%_VI Emulation" + (progn + (toggle-viper-mode) + (customize-set-variable 'viper-mode viper-mode)) + :style toggle :selected (and (boundp 'viper-mode) viper-mode) + :active (fboundp 'toggle-viper-mode)] + "----" + ["%_Set Key..." global-set-key] + ["%_Unset Key..." global-unset-key] + "---" + ["%_Mouse Paste at Text Cursor (not Clicked Location)" (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point)) :style toggle :selected mouse-yank-at-point] - ("Newline at end of file..." - ["Don't require" - (customize-set-variable 'require-final-newline nil) - :style radio :selected (not require-final-newline)] - ["Require" - (customize-set-variable 'require-final-newline t) - :style radio :selected (eq require-final-newline t)] - ["Ask" - (customize-set-variable 'require-final-newline 'ask) - :style radio :selected (and require-final-newline - (not (eq require-final-newline t)))]) - ["Add Newline When Moving Past End" - (customize-set-variable 'next-line-add-newlines - (not next-line-add-newlines)) - :style toggle :selected next-line-add-newlines] - ) - ("General Options" - ["Teach Extended Commands" + "---" + ["%_Teach Extended Commands" (customize-set-variable 'teach-extended-commands-p (not teach-extended-commands-p)) :style toggle :selected teach-extended-commands-p] - ["Debug On Error" - (customize-set-variable 'debug-on-error (not debug-on-error)) - :style toggle :selected debug-on-error] - ["Debug On Quit" - (customize-set-variable 'debug-on-quit (not debug-on-quit)) - :style toggle :selected debug-on-quit] ) - ("Printing Options" - ["Command-Line Switches for `lpr'/`lp'..." + ("%_Printing" + ["Set Printer %_Name for Generic Print Support..." + (customize-set-variable + 'printer-name + (read-string "Set printer name: " printer-name))] + "---" + ["Command-Line %_Switches for `lpr'/`lp'..." ;; better to directly open a customization buffer, since the value ;; must be a list of strings, which is somewhat complex to prompt for. (customize-variable 'lpr-switches) (boundp 'lpr-switches)] - ("Pretty-Print Paper Size" - ["Letter" + ("%_Pretty-Print Paper Size" + ["%_Letter" (customize-set-variable 'ps-paper-type 'letter) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter)) :active (boundp 'ps-paper-type)] - ["Letter-small" + ["Lette%_r-Small" (customize-set-variable 'ps-paper-type 'letter-small) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter-small)) :active (boundp 'ps-paper-type)] - ["Legal" + ["Le%_gal" (customize-set-variable 'ps-paper-type 'legal) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'legal)) :active (boundp 'ps-paper-type)] - ["Statement" + ["%_Statement" (customize-set-variable 'ps-paper-type 'statement) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'statement)) :active (boundp 'ps-paper-type)] - ["Executive" + ["%_Executive" (customize-set-variable 'ps-paper-type 'executive) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'executive)) :active (boundp 'ps-paper-type)] - ["Tabloid" + ["%_Tabloid" (customize-set-variable 'ps-paper-type 'tabloid) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'tabloid)) :active (boundp 'ps-paper-type)] - ["Ledger" + ["Le%_dger" (customize-set-variable 'ps-paper-type 'ledger) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'ledger)) :active (boundp 'ps-paper-type)] - ["A3" + ["A%_3" (customize-set-variable 'ps-paper-type 'a3) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a3)) :active (boundp 'ps-paper-type)] - ["A4" + ["%_A4" (customize-set-variable 'ps-paper-type 'a4) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4)) :active (boundp 'ps-paper-type)] - ["A4small" + ["A4s%_mall" (customize-set-variable 'ps-paper-type 'a4small) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4small)) :active (boundp 'ps-paper-type)] - ["B4" + ["B%_4" (customize-set-variable 'ps-paper-type 'b4) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b4)) :active (boundp 'ps-paper-type)] - ["B5" + ["%_B5" (customize-set-variable 'ps-paper-type 'b5) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b5)) :active (boundp 'ps-paper-type)] ) - ["Color Printing" + ["%_Color Printing" (cond (ps-print-color-p (customize-set-variable 'ps-print-color-p nil) ;; I'm wondering whether all this muck is useful. @@ -387,67 +825,437 @@ :style toggle :selected (and (boundp 'ps-print-color-p) ps-print-color-p) :active (boundp 'ps-print-color-p)]) - ("\"Other Window\" Location" - ["Always in Same Frame" + ("%_Internet" + ("%_Compose Mail With" + ["Default Emacs Mailer" + (customize-set-variable 'mail-user-agent 'sendmail-user-agent) + :style radio + :selected (eq mail-user-agent 'sendmail-user-agent)] + ["MH" + (customize-set-variable 'mail-user-agent 'mh-e-user-agent) + :style radio + :selected (eq mail-user-agent 'mh-e-user-agent) + :active (get 'mh-e-user-agent 'composefunc)] + ["GNUS" + (customize-set-variable 'mail-user-agent 'message-user-agent) + :style radio + :selected (eq mail-user-agent 'message-user-agent) + :active (get 'message-user-agent 'composefunc)] + ) + ["Set My %_Email Address..." + (customize-set-variable + 'user-mail-address + (read-string "Set email address: " user-mail-address))] + ["Set %_Machine Email Name..." (customize-set-variable - 'get-frame-for-buffer-default-instance-limit nil) - :style radio - :selected (null get-frame-for-buffer-default-instance-limit)] - ["Other Frame (2 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 2) - :style radio - :selected (eq 2 get-frame-for-buffer-default-instance-limit)] - ["Other Frame (3 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 3) - :style radio - :selected (eq 3 get-frame-for-buffer-default-instance-limit)] - ["Other Frame (4 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 4) - :style radio - :selected (eq 4 get-frame-for-buffer-default-instance-limit)] - ["Other Frame (5 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 5) - :style radio - :selected (eq 5 get-frame-for-buffer-default-instance-limit)] - ["Always Create New Frame" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 0) - :style radio - :selected (eq 0 get-frame-for-buffer-default-instance-limit)] - "-----" - ["Temp Buffers Always in Same Frame" - (customize-set-variable 'temp-buffer-show-function - 'show-temp-buffer-in-current-frame) - :style radio - :selected (eq temp-buffer-show-function - 'show-temp-buffer-in-current-frame)] - ["Temp Buffers Like Other Buffers" - (customize-set-variable 'temp-buffer-show-function nil) - :style radio - :selected (null temp-buffer-show-function)] - "-----" - ["Make current frame gnuserv target" - (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil t)) + 'mail-host-address + (read-string "Set machine email name: " mail-host-address))] + ["Set %_SMTP Server..." + (progn + (require 'smtpmail) + (customize-set-variable + 'smtpmail-smtp-server + (read-string "Set SMTP server: " smtpmail-smtp-server))) + :active (and (boundp 'send-mail-function) + (eq send-mail-function 'smtpmail-send-it))] + ["SMTP %_Debug Info" + (progn + (require 'smtpmail) + (customize-set-variable 'smtpmail-debug-info + (not smtpmail-debug-info))) :style toggle - :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t)) - :active (boundp 'gnuserv-frame)] + :selected (and (boundp 'smtpmail-debug-info) smtpmail-debug-info) + :active (and (boundp 'send-mail-function) + (eq send-mail-function 'smtpmail-send-it))] + "---" + ("%_Open URLs With" + ["%_Emacs-W3" + (customize-set-variable 'browse-url-browser-function 'browse-url-w3) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-w3)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-w3) + (fboundp 'w3-fetch))] + ["%_Netscape" + (customize-set-variable 'browse-url-browser-function + 'browse-url-netscape) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-netscape)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-netscape))] + ["%_Mosaic" + (customize-set-variable 'browse-url-browser-function + 'browse-url-mosaic) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-mosaic)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-mosaic))] + ["Mosaic (%_CCI)" + (customize-set-variable 'browse-url-browser-function 'browse-url-cci) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-cci)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-cci))] + ["%_IXI Mosaic" + (customize-set-variable 'browse-url-browser-function + 'browse-url-iximosaic) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-iximosaic)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-iximosaic))] + ["%_Lynx (xterm)" + (customize-set-variable 'browse-url-browser-function + 'browse-url-lynx-xterm) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-lynx-xterm)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-lynx-xterm))] + ["L%_ynx (xemacs)" + (customize-set-variable 'browse-url-browser-function + 'browse-url-lynx-emacs) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-lynx-emacs)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-lynx-emacs))] + ["%_Grail" + (customize-set-variable 'browse-url-browser-function + 'browse-url-grail) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-grail)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-grail))] + ["%_Kfm" + (customize-set-variable 'browse-url-browser-function + 'browse-url-kfm) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-kfm)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-kfm))] + )) + ("%_Troubleshooting" + ["%_Debug on Error" + (customize-set-variable 'debug-on-error (not debug-on-error)) + :style toggle :selected debug-on-error] + ["Debug on %_Quit" + (customize-set-variable 'debug-on-quit (not debug-on-quit)) + :style toggle :selected debug-on-quit] + ["Debug on S%_ignal" + (customize-set-variable 'debug-on-signal (not debug-on-signal)) + :style toggle :selected debug-on-signal] + ["%_Stack Trace on Error" + (customize-set-variable 'stack-trace-on-error + (not stack-trace-on-error)) + :style toggle :selected stack-trace-on-error] + ["Stack Trace on Si%_gnal" + (customize-set-variable 'stack-trace-on-signal + (not stack-trace-on-signal)) + :style toggle :selected stack-trace-on-signal] ) "-----" - ("Syntax Highlighting" - ["In This Buffer" - (progn ;; becomes buffer local + ("%_Display" + ,@(if (featurep 'scrollbar) + '(["%_Scrollbars" + (customize-set-variable 'scrollbars-visible-p + (not scrollbars-visible-p)) + :style toggle + :selected scrollbars-visible-p])) + ["%_3D Modeline" + (customize-set-variable 'modeline-3d-p + (not modeline-3d-p)) + :style toggle + :selected modeline-3d-p] + ["%_Wrap Long Lines" + (progn;; becomes buffer-local + (setq truncate-lines (not truncate-lines)) + (customize-set-variable 'truncate-lines truncate-lines)) + :style toggle + :selected (not truncate-lines)] + ,@(if (featurep 'toolbar) + '("---" + ["%_Toolbars Visible" + (customize-set-variable 'toolbar-visible-p + (not toolbar-visible-p)) + :style toggle + :selected toolbar-visible-p] + ["Toolbars Ca%_ptioned" + (customize-set-variable 'toolbar-captioned-p + (not toolbar-captioned-p)) + :style toggle + :active toolbar-visible-p + :selected toolbar-captioned-p] + ("Default Toolba%_r Location" + ["%_Top" + (customize-set-variable 'default-toolbar-position 'top) + :style radio + :active toolbar-visible-p + :selected (eq default-toolbar-position 'top)] + ["%_Bottom" + (customize-set-variable 'default-toolbar-position 'bottom) + :style radio + :active toolbar-visible-p + :selected (eq default-toolbar-position 'bottom)] + ["%_Left" + (customize-set-variable 'default-toolbar-position 'left) + :style radio + :active toolbar-visible-p + :selected (eq default-toolbar-position 'left)] + ["%_Right" + (customize-set-variable 'default-toolbar-position 'right) + :style radio + :active toolbar-visible-p + :selected (eq default-toolbar-position 'right)] + ) + )) + ,@(if (featurep 'gutter) + '("---" + ["B%_uffers Tab Visible" + (customize-set-variable 'gutter-buffers-tab-visible-p + (not gutter-buffers-tab-visible-p)) + :style toggle + :selected gutter-buffers-tab-visible-p] + ("Default %_Gutter Location" + ["%_Top" + (customize-set-variable 'default-gutter-position 'top) + :style radio + :selected (eq default-gutter-position 'top)] + ["%_Bottom" + (customize-set-variable 'default-gutter-position 'bottom) + :style radio + :selected (eq default-gutter-position 'bottom)] + ["%_Left" + (customize-set-variable 'default-gutter-position 'left) + :style radio + :selected (eq default-gutter-position 'left)] + ["%_Right" + (customize-set-variable 'default-gutter-position 'right) + :style radio + :selected (eq default-gutter-position 'right)] + ) + )) + "-----" + ["%_Blinking Cursor" + (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode)) + :style toggle + :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode) + :active (boundp 'blink-cursor-mode)] + ["Bl%_ock Cursor" + (progn + (customize-set-variable 'bar-cursor nil) + (force-cursor-redisplay)) + :style radio + :selected (null bar-cursor)] + ["Bar Cursor (%_1 Pixel)" + (progn + (customize-set-variable 'bar-cursor t) + (force-cursor-redisplay)) + :style radio + :selected (eq bar-cursor t)] + ["Bar Cursor (%_2 Pixels)" + (progn + (customize-set-variable 'bar-cursor 2) + (force-cursor-redisplay)) + :style radio + :selected (and bar-cursor (not (eq bar-cursor t)))] + "----" + ("Pa%_ren Highlighting" + ["%_None" + (customize-set-variable 'paren-mode nil) + :style radio + :selected (and (boundp 'paren-mode) (not paren-mode)) + :active (boundp 'paren-mode)] + ["%_Blinking Paren" + (customize-set-variable 'paren-mode 'blink-paren) + :style radio + :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren)) + :active (boundp 'paren-mode)] + ["%_Steady Paren" + (customize-set-variable 'paren-mode 'paren) + :style radio + :selected (and (boundp 'paren-mode) (eq paren-mode 'paren)) + :active (boundp 'paren-mode)] + ["%_Expression" + (customize-set-variable 'paren-mode 'sexp) + :style radio + :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp)) + :active (boundp 'paren-mode)] + ;; ["Nes%_ted Shading" + ;; (customize-set-variable 'paren-mode 'nested) + ;; :style radio + ;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested)) + ;; :active (boundp 'paren-mode)] + ) + "------" + ["%_Line Numbers" + (progn + (customize-set-variable 'line-number-mode (not line-number-mode)) + (redraw-modeline)) + :style toggle :selected line-number-mode] + ["%_Column Numbers" + (progn + (customize-set-variable 'column-number-mode + (not column-number-mode)) + (redraw-modeline)) + :style toggle :selected column-number-mode] + + ("\"Other %_Window\" Location" + ["%_Always in Same Frame" + (customize-set-variable + 'get-frame-for-buffer-default-instance-limit nil) + :style radio + :selected (null get-frame-for-buffer-default-instance-limit)] + ["Other Frame (%_2 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit + 2) + :style radio + :selected (eq 2 get-frame-for-buffer-default-instance-limit)] + ["Other Frame (%_3 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit + 3) + :style radio + :selected (eq 3 get-frame-for-buffer-default-instance-limit)] + ["Other Frame (%_4 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit + 4) + :style radio + :selected (eq 4 get-frame-for-buffer-default-instance-limit)] + ["Other Frame (%_5 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit + 5) + :style radio + :selected (eq 5 get-frame-for-buffer-default-instance-limit)] + ["Always Create %_New Frame" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit + 0) + :style radio + :selected (eq 0 get-frame-for-buffer-default-instance-limit)] + "-----" + ["%_Temp Buffers Always in Same Frame" + (customize-set-variable 'temp-buffer-show-function + 'show-temp-buffer-in-current-frame) + :style radio + :selected (eq temp-buffer-show-function + 'show-temp-buffer-in-current-frame)] + ["Temp Buffers %_Like Other Buffers" + (customize-set-variable 'temp-buffer-show-function nil) + :style radio + :selected (null temp-buffer-show-function)] + "-----" + ["%_Make Current Frame Gnuserv Target" + (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil + t)) + :style toggle + :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t)) + :active (boundp 'gnuserv-frame)] + ) + ) + ("%_Menubars" + ["%_Frame-Local Font Menu" + (customize-set-variable 'font-menu-this-frame-only-p + (not font-menu-this-frame-only-p)) + :style toggle + :selected (and (boundp 'font-menu-this-frame-only-p) + font-menu-this-frame-only-p)] + ["%_Alt/Meta Selects Menu Items" + (if (eq menu-accelerator-enabled 'menu-force) + (customize-set-variable 'menu-accelerator-enabled nil) + (customize-set-variable 'menu-accelerator-enabled 'menu-force)) + :style toggle + :selected (eq menu-accelerator-enabled 'menu-force)] + "----" + ["Buffers Menu %_Length..." + (customize-set-variable + 'buffers-menu-max-size + ;; would it be better to open a customization buffer ? + (let ((val + (read-number + "Enter number of buffers to display (or 0 for unlimited): "))) + (if (eq val 0) nil val)))] + ["%_Multi-Operation Buffers Sub-Menus" + (customize-set-variable 'complex-buffers-menu-p + (not complex-buffers-menu-p)) + :style toggle + :selected complex-buffers-menu-p] + ["S%_ubmenus for Buffer Groups" + (customize-set-variable 'buffers-menu-submenus-for-groups-p + (not buffers-menu-submenus-for-groups-p)) + :style toggle + :selected buffers-menu-submenus-for-groups-p] + ["%_Verbose Buffer Menu Entries" + (if (eq buffers-menu-format-buffer-line-function + 'slow-format-buffers-menu-line) + (customize-set-variable 'buffers-menu-format-buffer-line-function + 'format-buffers-menu-line) + (customize-set-variable 'buffers-menu-format-buffer-line-function + 'slow-format-buffers-menu-line)) + :style toggle + :selected (eq buffers-menu-format-buffer-line-function + 'slow-format-buffers-menu-line)] + ("Buffers Menu %_Sorting" + ["%_Most Recently Used" + (progn + (customize-set-variable 'buffers-menu-sort-function nil) + (customize-set-variable 'buffers-menu-grouping-function nil)) + :style radio + :selected (null buffers-menu-sort-function)] + ["%_Alphabetically" + (progn + (customize-set-variable 'buffers-menu-sort-function + 'sort-buffers-menu-alphabetically) + (customize-set-variable 'buffers-menu-grouping-function nil)) + :style radio + :selected (eq 'sort-buffers-menu-alphabetically + buffers-menu-sort-function)] + ["%_By Major Mode, Then Alphabetically" + (progn + (customize-set-variable + 'buffers-menu-sort-function + 'sort-buffers-menu-by-mode-then-alphabetically) + (customize-set-variable + 'buffers-menu-grouping-function + 'group-buffers-menu-by-mode-then-alphabetically)) + :style radio + :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically + buffers-menu-sort-function)]) + "---" + ["%_Ignore Scaled Fonts" + (customize-set-variable 'font-menu-ignore-scaled-fonts + (not font-menu-ignore-scaled-fonts)) + :style toggle + :selected (and (boundp 'font-menu-ignore-scaled-fonts) + font-menu-ignore-scaled-fonts)] + ) + ("S%_yntax Highlighting" + ["%_In This Buffer" + (progn;; becomes buffer local (font-lock-mode) (customize-set-variable 'font-lock-mode font-lock-mode)) :style toggle :selected (and (boundp 'font-lock-mode) font-lock-mode) :active (boundp 'font-lock-mode)] - ["Automatic" + ["%_Automatic" (customize-set-variable 'font-lock-auto-fontify (not font-lock-auto-fontify)) :style toggle :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify) :active (fboundp 'font-lock-mode)] "-----" - ["Fonts" + ["Force %_Rehighlight in this Buffer" + (customize-set-variable 'font-lock-auto-fontify + (not font-lock-auto-fontify)) + :style toggle + :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify) + :active (fboundp 'font-lock-mode)] + "-----" + ["%_Fonts" (progn (require 'font-lock) (font-lock-use-default-fonts) @@ -457,7 +1265,7 @@ :style radio :selected (and (boundp 'font-lock-use-fonts) font-lock-use-fonts) :active (fboundp 'font-lock-mode)] - ["Colors" + ["%_Colors" (progn (require 'font-lock) (font-lock-use-default-colors) @@ -468,7 +1276,7 @@ :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors) :active (boundp 'font-lock-mode)] "-----" - ["Least" + ["%_1 Least" (progn (require 'font-lock) (if (or (and (not (integerp font-lock-maximum-decoration)) @@ -480,12 +1288,12 @@ (font-lock-recompute-variables))) :style radio :active (fboundp 'font-lock-mode) - :selected (and (boundp 'font-lock-maximium-decoration) + :selected (and (boundp 'font-lock-maximum-decoration) (or (and (not (integerp font-lock-maximum-decoration)) (not (eq t font-lock-maximum-decoration))) (and (integerp font-lock-maximum-decoration) (<= font-lock-maximum-decoration 0))))] - ["More" + ["%_2 More" (progn (require 'font-lock) (if (and (integerp font-lock-maximum-decoration) @@ -495,10 +1303,10 @@ (font-lock-recompute-variables))) :style radio :active (fboundp 'font-lock-mode) - :selected (and (boundp 'font-lock-maximium-decoration) + :selected (and (boundp 'font-lock-maximum-decoration) (integerp font-lock-maximum-decoration) (= 1 font-lock-maximum-decoration))] - ["Even More" + ["%_3 Even More" (progn (require 'font-lock) (if (and (integerp font-lock-maximum-decoration) @@ -511,7 +1319,7 @@ :selected (and (boundp 'font-lock-maximum-decoration) (integerp font-lock-maximum-decoration) (= 2 font-lock-maximum-decoration))] - ["Most" + ["%_4 Most" (progn (require 'font-lock) (if (or (eq font-lock-maximum-decoration t) @@ -527,8 +1335,20 @@ (and (integerp font-lock-maximum-decoration) (>= font-lock-maximum-decoration 3))))] "-----" - ["Lazy" - (progn ;; becomes buffer local + ["Lazy %_Lock" + (progn;; becomes buffer local + (lazy-lock-mode) + (customize-set-variable 'lazy-lock-mode lazy-lock-mode) + ;; this shouldn't be necessary so there has to + ;; be a redisplay bug lurking somewhere (or + ;; possibly another event handler bug) + (redraw-modeline)) + :active (and (boundp 'font-lock-mode) (boundp 'lazy-lock-mode) + font-lock-mode) + :style toggle + :selected (and (boundp 'lazy-lock-mode) lazy-lock-mode)] + ["Lazy %_Shot" + (progn;; becomes buffer local (lazy-shot-mode) (customize-set-variable 'lazy-shot-mode lazy-shot-mode) ;; this shouldn't be necessary so there has to @@ -539,8 +1359,8 @@ font-lock-mode) :style toggle :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)] - ["Caching" - (progn ;; becomes buffer local + ["Cac%_hing" + (progn;; becomes buffer local (fast-lock-mode) (customize-set-variable 'fast-lock-mode fast-lock-mode) ;; this shouldn't be necessary so there has to @@ -552,453 +1372,106 @@ :style toggle :selected (and (boundp 'fast-lock-mode) fast-lock-mode)] ) - ("Paren Highlighting" - ["None" - (customize-set-variable 'paren-mode nil) - :style radio - :selected (and (boundp 'paren-mode) (not paren-mode)) - :active (boundp 'paren-mode)] - ["Blinking Paren" - (customize-set-variable 'paren-mode 'blink-paren) - :style radio - :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren)) - :active (boundp 'paren-mode)] - ["Steady Paren" - (customize-set-variable 'paren-mode 'paren) - :style radio - :selected (and (boundp 'paren-mode) (eq paren-mode 'paren)) - :active (boundp 'paren-mode)] - ["Expression" - (customize-set-variable 'paren-mode 'sexp) - :style radio - :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp)) - :active (boundp 'paren-mode)] -;; ["Nested Shading" -;; (customize-set-variable 'paren-mode 'nested) -;; :style radio -;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested)) -;; :active (boundp 'paren-mode)] - ) + ("%_Font" :filter font-menu-family-constructor) + ("Font Si%_ze" :filter font-menu-size-constructor) + ;; ("Font Weig%_ht" :filter font-menu-weight-constructor) + ["Edit Fa%_ces..." (customize-face nil)] "-----" - ("Frame Appearance" - ["Frame-Local Font Menu" - (customize-set-variable 'font-menu-this-frame-only-p - (not font-menu-this-frame-only-p)) - :style toggle - :selected (and (boundp 'font-menu-this-frame-only-p) - font-menu-this-frame-only-p)] - ,@(if (featurep 'scrollbar) - '(["Scrollbars" - (customize-set-variable 'scrollbars-visible-p - (not scrollbars-visible-p)) - :style toggle - :selected scrollbars-visible-p])) - ;; I don't think this is of any interest. - dverna apr. 98 - ;; #### I beg to differ! Many FSFmacs converts hate the 3D - ;; modeline, and it was perfectly fine to be able to turn them - ;; off through the Options menu. I would have uncommented this - ;; source, but the code for saving options would not save the - ;; modeline 3D-ness. Grrr. --hniksic -;; ["3D Modeline" -;; (progn -;; (if (zerop (specifier-instance modeline-shadow-thickness)) -;; (set-specifier modeline-shadow-thickness 2) -;; (set-specifier modeline-shadow-thickness 0)) -;; (redraw-modeline t)) -;; :style toggle -;; :selected (let ((thickness -;; (specifier-instance modeline-shadow-thickness))) -;; (and (integerp thickness) -;; (> thickness 0)))] - ["Truncate Lines" - (progn ;; becomes buffer-local - (setq truncate-lines (not truncate-lines)) - (customize-set-variable 'truncate-lines truncate-lines)) - :style toggle - :selected truncate-lines] - ["Blinking Cursor" - (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode)) - :style toggle - :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode) - :active (boundp 'blink-cursor-mode)] - "-----" - ["Block cursor" - (progn - (customize-set-variable 'bar-cursor nil) - (force-cursor-redisplay)) - :style radio - :selected (null bar-cursor)] - ["Bar cursor (1 pixel)" - (progn - (customize-set-variable 'bar-cursor t) - (force-cursor-redisplay)) - :style radio - :selected (eq bar-cursor t)] - ["Bar cursor (2 pixels)" - (progn - (customize-set-variable 'bar-cursor 2) - (force-cursor-redisplay)) - :style radio - :selected (and bar-cursor (not (eq bar-cursor t)))] - "------" - ["Line Numbers" - (progn - (customize-set-variable 'line-number-mode (not line-number-mode)) - (redraw-modeline)) - :style toggle :selected line-number-mode] - ["Column Numbers" - (progn - (customize-set-variable 'column-number-mode - (not column-number-mode)) - (redraw-modeline)) - :style toggle :selected column-number-mode] - ) - ("Menubar Appearance" - ["Buffers Menu Length..." - (customize-set-variable - 'buffers-menu-max-size - ;; would it be better to open a customization buffer ? - (let ((val - (read-number - "Enter number of buffers to display (or 0 for unlimited): "))) - (if (eq val 0) nil val)))] - ["Multi-Operation Buffers Sub-Menus" - (customize-set-variable 'complex-buffers-menu-p - (not complex-buffers-menu-p)) - :style toggle - :selected complex-buffers-menu-p] - ("Buffers Menu Sorting" - ["Most Recently Used" - (progn - (customize-set-variable 'buffers-menu-sort-function nil) - (customize-set-variable 'buffers-menu-grouping-function nil)) - :style radio - :selected (null buffers-menu-sort-function)] - ["Alphabetically" - (progn - (customize-set-variable 'buffers-menu-sort-function - 'sort-buffers-menu-alphabetically) - (customize-set-variable 'buffers-menu-grouping-function nil)) - :style radio - :selected (eq 'sort-buffers-menu-alphabetically - buffers-menu-sort-function)] - ["By Major Mode, Then Alphabetically" - (progn - (customize-set-variable - 'buffers-menu-sort-function - 'sort-buffers-menu-by-mode-then-alphabetically) - (customize-set-variable - 'buffers-menu-grouping-function - 'group-buffers-menu-by-mode-then-alphabetically)) - :style radio - :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically - buffers-menu-sort-function)]) - ["Submenus for Buffer Groups" - (customize-set-variable 'buffers-menu-submenus-for-groups-p - (not buffers-menu-submenus-for-groups-p)) - :style toggle - :selected buffers-menu-submenus-for-groups-p] - "---" - ["Ignore Scaled Fonts" - (customize-set-variable 'font-menu-ignore-scaled-fonts - (not font-menu-ignore-scaled-fonts)) - :style toggle - :selected (and (boundp 'font-menu-ignore-scaled-fonts) - font-menu-ignore-scaled-fonts)] - ) - ,@(if (featurep 'toolbar) - '(("Toolbar Appearance" - ["Visible" - (customize-set-variable 'toolbar-visible-p - (not toolbar-visible-p)) - :style toggle - :selected toolbar-visible-p] - ["Captioned" - (customize-set-variable 'toolbar-captioned-p - (not toolbar-captioned-p)) - :style toggle - :selected toolbar-captioned-p] - ("Default Location" - ["Top" - (customize-set-variable 'default-toolbar-position 'top) - :style radio - :selected (eq default-toolbar-position 'top)] - ["Bottom" - (customize-set-variable 'default-toolbar-position 'bottom) - :style radio - :selected (eq default-toolbar-position 'bottom)] - ["Left" - (customize-set-variable 'default-toolbar-position 'left) - :style radio - :selected (eq default-toolbar-position 'left)] - ["Right" - (customize-set-variable 'default-toolbar-position 'right) - :style radio - :selected (eq default-toolbar-position 'right)] - ) - ))) - ,@(if (featurep 'gutter) - '(("Gutter Appearance" - ["Visible" - (customize-set-variable 'gutter-visible-p - (not gutter-visible-p)) - :style toggle - :selected gutter-visible-p] - ("Default Location" - ["Top" - (customize-set-variable 'default-gutter-position 'top) - :style radio - :selected (eq default-gutter-position 'top)] - ["Bottom" - (customize-set-variable 'default-gutter-position 'bottom) - :style radio - :selected (eq default-gutter-position 'bottom)] - ["Left" - (customize-set-variable 'default-gutter-position 'left) - :style radio - :selected (eq default-gutter-position 'left)] - ["Right" - (customize-set-variable 'default-gutter-position 'right) - :style radio - :selected (eq default-gutter-position 'right)] - ) - ))) - ("Mouse" - ["Avoid Text..." - (customize-set-variable 'mouse-avoidance-mode - (if mouse-avoidance-mode nil 'banish)) - :style toggle - :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode) - :active (and (boundp 'mouse-avoidance-mode) - (device-on-window-system-p))] - ["strokes-mode" - (customize-set-variable 'strokes-mode (not strokes-mode)) - :style toggle - :selected (and (boundp 'strokes-mode) strokes-mode) - :active (and (boundp 'strokes-mode) - (device-on-window-system-p))] - ) - ("Open URLs With" - ["Emacs-W3" - (customize-set-variable 'browse-url-browser-function 'browse-url-w3) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-w3)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-w3) - (fboundp 'w3-fetch))] - ["Netscape" - (customize-set-variable 'browse-url-browser-function - 'browse-url-netscape) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-netscape)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-netscape))] - ["Mosaic" - (customize-set-variable 'browse-url-browser-function - 'browse-url-mosaic) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-mosaic)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-mosaic))] - ["Mosaic (CCI)" - (customize-set-variable 'browse-url-browser-function 'browse-url-cci) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-cci)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-cci))] - ["IXI Mosaic" - (customize-set-variable 'browse-url-browser-function - 'browse-url-iximosaic) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-iximosaic)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-iximosaic))] - ["Lynx (xterm)" - (customize-set-variable 'browse-url-browser-function - 'browse-url-lynx-xterm) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-lynx-xterm)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-lynx-xterm))] - ["Lynx (xemacs)" - (customize-set-variable 'browse-url-browser-function - 'browse-url-lynx-emacs) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-lynx-emacs)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-lynx-emacs))] - ["Grail" - (customize-set-variable 'browse-url-browser-function - 'browse-url-grail) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-grail)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-grail))] - ["Kfm" - (customize-set-variable 'browse-url-browser-function - 'browse-url-kfm) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-kfm)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-kfm))] - ) - "-----" - ["Edit Faces..." (customize-face nil)] - ("Font" :filter font-menu-family-constructor) - ("Size" :filter font-menu-size-constructor) -; ("Weight" :filter font-menu-weight-constructor) - "-----" - ["Save Options" customize-save-customized] + ["Edit I%_nit File" + ;; #### there should be something that holds the name that the init + ;; file should be created as, when it's not present. + (progn (find-file (or user-init-file "~/.xemacs/init.el")) + (or (eq major-mode 'emacs-lisp-mode) + (emacs-lisp-mode)))] + ["%_Save Options to Init File" customize-save-customized] + ) + + ("%_Buffers" + :filter buffers-menu-filter + ["Go To %_Previous Buffer" switch-to-other-buffer] + ["Go To %_Buffer..." switch-to-buffer] + "----" + ["%_List All Buffers" list-buffers] + ["%_Delete Buffer" kill-this-buffer + :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] + "----" ) - ("Buffers" - :filter buffers-menu-filter - ["Read Only" (toggle-read-only) - :style toggle :selected buffer-read-only] - ["List All Buffers" list-buffers] - "--" - ) + nil ; the partition: menus after this are flushright - ("Tools" - ["Grep..." grep - :active (fboundp 'grep)] - ["Compile..." compile - :active (fboundp 'compile)] - ["Shell" shell - :active (fboundp 'shell)] - ["Shell Command..." shell-command - :active (fboundp 'shell-command)] - ["Shell Command on Region..." shell-command-on-region - :active (and (fboundp 'shell-command-on-region) (region-exists-p))] - ["Debug (GDB)..." gdb - :active (fboundp 'gdb)] - ["Debug (DBX)..." dbx - :active (fboundp 'dbx)] + ("%_Help" + ["%_About XEmacs..." about-xemacs] + "-----" + ["XEmacs %_News" view-emacs-news] + ["%_Obtaining XEmacs" describe-distribution] "-----" - ("Tags" - ["Find Tag..." find-tag] - ["Find Other Window..." find-tag-other-window] - ["Next Tag..." (find-tag nil)] - ["Next Other Window..." (find-tag-other-window nil)] - ["Next File" next-file] - "-----" - ["Tags Search..." tags-search] - ["Tags Replace..." tags-query-replace] - ["Continue Search/Replace" tags-loop-continue] + ("%_Info (Online Docs)" + ["%_Info Contents" info] + ["Lookup %_Key Binding..." Info-goto-emacs-key-command-node] + ["Lookup %_Command..." Info-goto-emacs-command-node] + ["Lookup %_Function..." Info-elisp-ref] + ["Lookup %_Topic..." Info-query]) + ("XEmacs %_FAQ" + ["%_FAQ (local)" xemacs-local-faq] + ["FAQ via %_WWW" xemacs-www-faq + :active (fboundp 'browse-url)] + ["%_Home Page" xemacs-www-page + :active (fboundp 'browse-url)]) + ("%_Tutorials" + :filter tutorials-menu-filter) + ("%_Samples" + ["Sample .%_emacs" + (find-file (locate-data-file "sample.emacs")) + :active (locate-data-file "sample.emacs")] + ["Sample .%_Xdefaults" + (find-file (locate-data-file "sample.Xdefaults")) + :active (locate-data-file "sample.Xdefaults")] + ["Sample e%_nriched" + (find-file (locate-data-file "enriched.doc")) + :active (locate-data-file "enriched.doc")]) + ("%_Commands & Keys" + ["%_Mode" describe-mode] + ["%_Apropos..." hyper-apropos] + ["Apropos %_Docs..." apropos-documentation] "-----" - ["Pop stack" pop-tag-mark] - ["Apropos..." tags-apropos] + ["%_Key..." describe-key] + ["%_Bindings" describe-bindings] + ["%_Mouse Bindings" describe-pointer] + ["%_Recent Keys" view-lossage] "-----" - ["Set Tags Table File..." visit-tags-table] - )) - - nil ; the partition: menus after this are flushright - - ("Help" - ["About XEmacs..." about-xemacs] - ("Basics" - ["Installation" describe-installation + ["%_Function..." describe-function] + ["%_Variable..." describe-variable] + ["%_Locate Command..." where-is]) + "-----" + ["%_Recent Messages" view-lossage] + ("%_Misc" + ["%_Current Installation Info" describe-installation :active (boundp 'Installation-string)] - ;; Tutorials. - ,(if (featurep 'mule) - ;; Mule tutorials. - (let ((lang language-info-alist) - submenu tut) - (while lang - (and (setq tut (assq 'tutorial (car lang))) - (not (string= (caar lang) "ASCII")) - (setq - submenu - (cons - `[,(caar lang) (help-with-tutorial nil ,(cdr tut))] - submenu))) - (setq lang (cdr lang))) - (append `("Tutorials" - :filter tutorials-menu-filter - ["Default" help-with-tutorial t - ,(concat "(" current-language-environment ")")]) - submenu)) - ;; Non mule tutorials. - (let ((lang tutorial-supported-languages) - submenu) - (while lang - (setq submenu - (cons - `[,(caar lang) - (help-with-tutorial ,(format "TUTORIAL.%s" - (cadr (car lang))))] - submenu)) - (setq lang (cdr lang))) - (append '("Tutorials" - ["English" help-with-tutorial]) - submenu))) - ["News" view-emacs-news] - ["Packages" finder-by-keyword] - ["Splash" xemacs-splash-buffer]) - "-----" - ("XEmacs FAQ" - ["FAQ (local)" xemacs-local-faq] - ["FAQ via WWW" xemacs-www-faq (boundp 'browse-url-browser-function)] - ["Home Page" xemacs-www-page (boundp 'browse-url-browser-function)]) - ("Samples" - ["Sample .emacs" (find-file (locate-data-file "sample.emacs")) (locate-data-file "sample.emacs")] - ["Sample .Xdefaults" (find-file (locate-data-file "sample.Xdefaults")) (locate-data-file "sample.Xdefaults")] - ["Sample enriched" (find-file (locate-data-file "enriched.doc")) (locate-data-file "enriched.doc")]) - "-----" - ("Lookup in Info" - ["Key Binding..." Info-goto-emacs-key-command-node] - ["Command..." Info-goto-emacs-command-node] - ["Function..." Info-elisp-ref] - ["Topic..." Info-query]) - ("Manuals" - ["Info" info] - ["Unix Manual..." manual-entry]) - ("Commands & Keys" - ["Mode" describe-mode] - ["Apropos..." hyper-apropos] - ["Apropos Docs..." apropos-documentation] - "-----" - ["Key..." describe-key] - ["Bindings" describe-bindings] - ["Mouse Bindings" describe-pointer] - ["Recent Keys" view-lossage] - "-----" - ["Function..." describe-function] - ["Variable..." describe-variable] - ["Locate Command..." where-is]) - "-----" - ["Recent Messages" view-lossage] - ("Misc" - ["No Warranty" describe-no-warranty] - ["XEmacs License" describe-copying] - ["The Latest Version" describe-distribution]) - ["Send Bug Report..." report-emacs-bug + ["%_No Warranty" describe-no-warranty] + ["XEmacs %_License" describe-copying] + ["Find %_Packages" finder-by-keyword] + ["View %_Splash Screen" xemacs-splash-buffer] + ["%_Unix Manual..." manual-entry]) + ["Send %_Bug Report..." report-emacs-bug :active (fboundp 'report-emacs-bug)])))) (defun maybe-add-init-button () "Don't call this. Adds `Load .emacs' button to menubar when starting up with -q." - ;; by Stig@hackvan.com - (cond - (load-user-init-file-p nil) - ((file-exists-p (expand-file-name ".emacs" "~")) - (add-menu-button nil - ["Load .emacs" - (progn (delete-menu-item '("Load .emacs")) - (load-user-init-file)) - ] - "Help")) - (t nil))) + (when (and (not load-user-init-file-p) + (file-exists-p (expand-file-name ".emacs" "~"))) + (add-menu-button + nil + ["%_Load .emacs" + (progn + (mapc #'(lambda (buf) + (with-current-buffer buf + (delete-menu-item '("Load .emacs")))) + (buffer-list)) + (load-user-init-file)) + ] + "Help"))) (add-hook 'before-init-hook 'maybe-add-init-button) @@ -1011,38 +1484,41 @@ ;;; The Bookmarks menu (defun bookmark-menu-filter (&rest ignore) + (declare (special bookmark-alist)) (let ((definedp (and (boundp 'bookmark-alist) bookmark-alist t))) `(,(if definedp - '("Jump to Bookmark" + '("%_Jump to Bookmark" :filter (lambda (&rest junk) - (mapcar #'(lambda (bmk) - `[,bmk (bookmark-jump ',bmk)]) - (bookmark-all-names)))) - ["Jump to Bookmark" nil nil]) - ["Set bookmark" bookmark-set + (submenu-generate-accelerator-spec + (mapcar #'(lambda (bmk) + `[,bmk (bookmark-jump ',bmk)]) + (bookmark-all-names))))) + ["%_Jump to Bookmark" nil nil]) + ["Set %_Bookmark" bookmark-set :active (fboundp 'bookmark-set)] "---" - ["Insert contents" bookmark-menu-insert + ["Insert %_Contents" bookmark-menu-insert :active (fboundp 'bookmark-menu-insert)] - ["Insert location" bookmark-menu-locate + ["Insert L%_ocation" bookmark-menu-locate :active (fboundp 'bookmark-menu-locate)] "---" - ["Rename bookmark" bookmark-menu-rename + ["%_Rename Bookmark" bookmark-menu-rename :active (fboundp 'bookmark-menu-rename)] ,(if definedp - '("Delete Bookmark" + '("%_Delete Bookmark" :filter (lambda (&rest junk) - (mapcar #'(lambda (bmk) - `[,bmk (bookmark-delete ',bmk)]) - (bookmark-all-names)))) - ["Delete Bookmark" nil nil]) - ["Edit Bookmark List" bookmark-bmenu-list ,definedp] + (submenu-generate-accelerator-spec + (mapcar #'(lambda (bmk) + `[,bmk (bookmark-delete ',bmk)]) + (bookmark-all-names))))) + ["%_Delete Bookmark" nil nil]) + ["%_Edit Bookmark List" bookmark-bmenu-list ,definedp] "---" - ["Save bookmarks" bookmark-save ,definedp] - ["Save bookmarks as..." bookmark-write ,definedp] - ["Load a bookmark file" bookmark-load + ["%_Save Bookmarks" bookmark-save ,definedp] + ["Save Bookmarks %_As..." bookmark-write ,definedp] + ["%_Load a Bookmark File" bookmark-load :active (fboundp 'bookmark-load)]))) ;;; The Buffers menu @@ -1051,6 +1527,8 @@ "Customization of `Buffers' menu." :group 'menu) +(defvar buffers-menu-omit-chars-list '(?b ?p ?l ?d)) + (defcustom buffers-menu-max-size 25 "*Maximum number of entries which may appear on the \"Buffers\" menu. If this is 10, then only the ten most-recently-selected buffers will be @@ -1096,11 +1574,22 @@ :group 'buffers-menu) (defcustom buffers-menu-format-buffer-line-function 'format-buffers-menu-line - "*The function to call to return a string to represent a buffer in the -buffers menu. The function is passed a buffer and should return a string. -The default value `format-buffers-menu-line' just returns the name of -the buffer. Also check out `slow-format-buffers-menu-line' which -returns a whole bunch of info about a buffer." + "*The function to call to return a string to represent a buffer in +the buffers menu. The function is passed a buffer and a number +(starting with 1) indicating which buffer line in the menu is being +processed and should return a string containing an accelerator +spec. (Check out `menu-item-generate-accelerator-spec' as a convenient +way of generating the accelerator specs.) The default value +`format-buffers-menu-line' just returns the name of the buffer and +uses the number as the accelerator. Also check out +`slow-format-buffers-menu-line' which returns a whole bunch of info +about a buffer. + +Note: Gross Compatibility Hack: Older versions of this function prototype +only expected one argument, not two. We deal gracefully with such +functions by simply calling them with one argument and leaving out the +line number. However, this may go away at any time, so make sure to +update all of your functions of this type." :type 'function :group 'buffers-menu) @@ -1131,11 +1620,6 @@ function) :group 'buffers-menu) -(defun buffers-menu-omit-invisible-buffers (buf) - "For use as a value of `buffers-menu-omit-function'. -Omits normally invisible buffers (those whose name begins with a space)." - (not (null (string-match "\\` " (buffer-name buf))))) - (defun sort-buffers-menu-alphabetically (buf1 buf2) "For use as a value of `buffers-menu-sort-function'. Sorts the buffers in alphabetical order by name, but puts buffers beginning @@ -1178,21 +1662,25 @@ (string-lessp nam1 nam2))))) ;; this version is too slow on some machines. -(defun slow-format-buffers-menu-line (buffer) +;; (vintage 1990, that is) +(defun slow-format-buffers-menu-line (buffer n) "For use as a value of `buffers-menu-format-buffer-line-function'. This returns a string containing a bunch of info about the buffer." - (format "%s%s %-19s %6s %-15s %s" - (if (buffer-modified-p buffer) "*" " ") - (if (symbol-value-in-buffer 'buffer-read-only buffer) "%" " ") - (buffer-name buffer) - (buffer-size buffer) - (symbol-value-in-buffer 'mode-name buffer) - (or (buffer-file-name buffer) ""))) + (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list) + (format "%s%s %-19s %6s %-15s %s" + (if (buffer-modified-p buffer) "*" " ") + (if (symbol-value-in-buffer 'buffer-read-only buffer) + "%" " ") + (buffer-name buffer) + (buffer-size buffer) + (symbol-value-in-buffer 'mode-name buffer) + (or (buffer-file-name buffer) "")))) -(defun format-buffers-menu-line (buffer) +(defun format-buffers-menu-line (buffer n) "For use as a value of `buffers-menu-format-buffer-line-function'. This just returns the buffer's name." - (buffer-name buffer)) + (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list) + (buffer-name buffer))) (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2) "For use as a value of `buffers-menu-grouping-function'. @@ -1221,36 +1709,41 @@ (buffer-name (current-buffer))))))) (defsubst build-buffers-menu-internal (buffers) - (let (name line) + (let (name line (n 0)) (mapcar #'(lambda (buffer) (if (eq buffer t) "---" - (setq line (funcall buffers-menu-format-buffer-line-function - buffer)) + (setq n (1+ n)) + (setq line + ; #### a truly Kyle-friendly hack. + (let ((fn buffers-menu-format-buffer-line-function)) + (if (= (function-max-args fn) 1) + (funcall fn buffer) + (funcall fn buffer n)))) (if complex-buffers-menu-p (delq nil (list line - (vector "Switch to Buffer" + (vector "S%_witch to Buffer" (list buffers-menu-switch-to-buffer-function (setq name (buffer-name buffer))) t) (if (eq buffers-menu-switch-to-buffer-function 'switch-to-buffer) - (vector "Switch to Buffer, Other Frame" + (vector "Switch to Buffer, Other %_Frame" (list 'switch-to-buffer-other-frame (setq name (buffer-name buffer))) t) nil) (if (and (buffer-modified-p buffer) (buffer-file-name buffer)) - (vector "Save Buffer" + (vector "%_Save Buffer" (list 'buffer-menu-save-buffer name) t) - ["Save Buffer" nil nil] + ["%_Save Buffer" nil nil] ) - (vector "Save As..." + (vector "Save %_As..." (list 'buffer-menu-write-file name) t) - (vector "Delete Buffer" (list 'kill-buffer name) + (vector "%_Delete Buffer" (list 'kill-buffer name) t))) ;; #### We don't want buffer names to be translated, ;; #### so we put the buffer name in the suffix. @@ -1323,10 +1816,14 @@ (defun language-environment-menu-filter (menu) "This is the menu filter for the \"Language Environment\" submenu." - (mapcar (lambda (env-sym) - `[ ,(capitalize (symbol-name env-sym)) - (set-language-environment ',env-sym)]) - language-environment-list)) + (declare (special language-environment-list)) + (let ((n 0)) + (mapcar (lambda (env-sym) + (setq n (1+ n)) + `[ ,(concat (menu-item-generate-accelerator-spec n) + (capitalize (symbol-name env-sym))) + (set-language-environment ',env-sym)]) + language-environment-list))) ;;; The Options menu @@ -1360,24 +1857,38 @@ ;;; The Help menu -(if (featurep 'mule) - (defun tutorials-menu-filter (menu-items) - ;; If there's a tutorial for the current language environment, make it - ;; appear first as the default one. Otherwise, use the english one. - (let* ((menu menu-items) - (item (pop menu-items))) - (aset - item 3 - (concat "(" - (if (assoc - 'tutorial - (assoc current-language-environment language-info-alist)) - current-language-environment - "English") - ")")) - menu))) +(defun tutorials-menu-filter (menu-items) + (declare (special language-info-alist + current-language-environment + tutorial-supported-languages)) + (append + (if (featurep 'mule) + (if (assq 'tutorial + (assoc current-language-environment language-info-alist)) + `([,(concat "%_Default (" current-language-environment ")") + help-with-tutorial])) + '(["%_English" help-with-tutorial])) + (submenu-generate-accelerator-spec + (if (featurep 'mule) + ;; Mule tutorials. + (mapcan #'(lambda (lang) + (let ((tut (assq 'tutorial lang))) + (and tut + (not (string= (car lang) "ASCII")) + ;; skip current language, since we already + ;; included it first + (not (string= (car lang) + current-language-environment)) + `([,(car lang) + (help-with-tutorial nil ,(cdr tut))])))) + language-info-alist) + ;; Non mule tutorials. + (mapcar #'(lambda (lang) + `[,(car lang) + (help-with-tutorial ,(format "TUTORIAL.%s" + (cadr lang)))]) + tutorial-supported-languages))))) - (set-menubar default-menubar) @@ -1385,154 +1896,32 @@ (defconst default-popup-menu '("XEmacs Commands" - ["Undo" advertised-undo + ["%_Undo" advertised-undo :active (and (not (eq buffer-undo-list t)) (or buffer-undo-list pending-undo-list)) :suffix (if (or (eq last-command 'undo) (eq last-command 'advertised-undo)) "More" "")] - ["Cut" kill-primary-selection + ["Cu%_t" kill-primary-selection :active (selection-owner-p)] - ["Copy" copy-primary-selection + ["%_Copy" copy-primary-selection :active (selection-owner-p)] - ["Paste" yank-clipboard-selection + ["%_Paste" yank-clipboard-selection :active (selection-exists-p 'CLIPBOARD)] - ["Clear" delete-primary-selection + ["%_Delete" delete-primary-selection :active (selection-owner-p)] "-----" - ["Select Block" mark-paragraph] - ["Split Window" split-window-vertically] - ["Unsplit Window" delete-other-windows] + ["Select %_Block" mark-paragraph] + ["Sp%_lit Window" split-window-vertically] + ["U%_nsplit Window" delete-other-windows] )) -(defvar global-popup-menu nil - "The global popup menu. This is present in all modes. -See the function `popup-menu' for a description of menu syntax.") - -(defvar mode-popup-menu nil - "The mode-specific popup menu. Automatically buffer local. -This is appended to the default items in `global-popup-menu'. -See the function `popup-menu' for a description of menu syntax.") -(make-variable-buffer-local 'mode-popup-menu) - ;; In an effort to avoid massive menu clutter, this mostly worthless menu is ;; superseded by any local popup menu... (setq-default mode-popup-menu default-popup-menu) -(defvar activate-popup-menu-hook nil - "Function or functions run before a mode-specific popup menu is made visible. -These functions are called with no arguments, and should interrogate and -modify the value of `global-popup-menu' or `mode-popup-menu' as desired. -Note: this hook is only run if you use `popup-mode-menu' for activating the -global and mode-specific commands; if you have your own binding for button3, -this hook won't be run.") - -(defun popup-mode-menu () - "Pop up a menu of global and mode-specific commands. -The menu is computed by combining `global-popup-menu' and `mode-popup-menu'." - (interactive "@_") - (run-hooks 'activate-popup-menu-hook) - (popup-menu - (cond ((and global-popup-menu mode-popup-menu) - ;; Merge global-popup-menu and mode-popup-menu - (check-menu-syntax mode-popup-menu) - (let* ((title (car mode-popup-menu)) - (items (cdr mode-popup-menu)) - mode-filters) - ;; Strip keywords from local menu for attaching them at the top - (while (and items - (keywordp (car items))) - ;; Push both keyword and its argument. - (push (pop items) mode-filters) - (push (pop items) mode-filters)) - (setq mode-filters (nreverse mode-filters)) - ;; If mode-filters contains a keyword already present in - ;; `global-popup-menu', you will probably lose. - (append (list (car global-popup-menu)) - mode-filters - (cdr global-popup-menu) - '("---" "---") - (if popup-menu-titles (list title)) - (if popup-menu-titles '("---" "---")) - items))) - (t - (or mode-popup-menu - global-popup-menu - (error "No menu defined in this buffer")))))) - -(defun popup-buffer-menu (event) - "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked." - (interactive "e") - (let ((window (and (event-over-text-area-p event) (event-window event))) - (bmenu nil)) - (or window - (error "Pointer must be in a normal window")) - (select-window window) - (if current-menubar - (setq bmenu (assoc "Buffers" current-menubar))) - (if (null bmenu) - (setq bmenu (assoc "Buffers" default-menubar))) - (if (null bmenu) - (error "Can't find the Buffers menu")) - (popup-menu bmenu))) - -(defun popup-menubar-menu (event) - "Pop up a copy of menu that also appears in the menubar" - ;; by Stig@hackvan.com - (interactive "e") - (let ((window (and (event-over-text-area-p event) (event-window event))) - popup-menubar) - (or window - (error "Pointer must be in a normal window")) - (select-window window) - (and current-menubar (run-hooks 'activate-menubar-hook)) - ;; ##### Instead of having to copy this just to safely get rid of - ;; any nil what we should really do is fix up the internal menubar - ;; code to just ignore nil if generating a popup menu - (setq popup-menubar (delete nil (copy-sequence (or current-menubar - default-menubar)))) - (popup-menu (cons "Menubar Menu" popup-menubar)) - )) - -(global-set-key 'button3 'popup-mode-menu) -;; shift button3 and shift button2 are reserved for Hyperbole -(global-set-key '(meta control button3) 'popup-buffer-menu) -;; The following command is way too dangerous with Custom. -;; (global-set-key '(meta shift button3) 'popup-menubar-menu) - -;; Here's a test of the cool new menu features (from Stig). - -;;(setq mode-popup-menu -;; '("Test Popup Menu" -;; :filter cdr -;; ["this item won't appear because of the menu filter" ding t] -;; "--:singleLine" -;; "singleLine" -;; "--:doubleLine" -;; "doubleLine" -;; "--:singleDashedLine" -;; "singleDashedLine" -;; "--:doubleDashedLine" -;; "doubleDashedLine" -;; "--:noLine" -;; "noLine" -;; "--:shadowEtchedIn" -;; "shadowEtchedIn" -;; "--:shadowEtchedOut" -;; "shadowEtchedOut" -;; "--:shadowDoubleEtchedIn" -;; "shadowDoubleEtchedIn" -;; "--:shadowDoubleEtchedOut" -;; "shadowDoubleEtchedOut" -;; "--:shadowEtchedInDash" -;; "shadowEtchedInDash" -;; "--:shadowEtchedOutDash" -;; "shadowEtchedOutDash" -;; "--:shadowDoubleEtchedInDash" -;; "shadowDoubleEtchedInDash" -;; "--:shadowDoubleEtchedOutDash" -;; "shadowDoubleEtchedOutDash" -;; )) + +;; misc (defun xemacs-splash-buffer () "Redisplay XEmacs splash screen in a buffer." diff -r 72a7cfa4a488 -r abe6d1db359e lisp/menubar.el --- a/lisp/menubar.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/menubar.el Mon Aug 13 11:35:02 2007 +0200 @@ -30,7 +30,7 @@ ;; This file is dumped with XEmacs (when menubar support is compiled in). -;; Some stuff in FSF menu-bar.el is in x-menubar.el +;; Some stuff in FSF menu-bar.el is in menubar-items.el ;;; Code: @@ -128,19 +128,6 @@ menuitem))) (setq plistp (or (>= L 5) (and (> L 2) (keywordp (aref menuitem 2))))) - (or (stringp (aref menuitem 0)) - (signal 'error - (list - "first element of a button must be a string (the label)" - menuitem))) - (or plistp - (< L 4) - (null (aref menuitem 3)) - (stringp (aref menuitem 3)) - (signal 'error - (list - "fourth element of a button must be a string (the label suffix)" - menuitem))) (if plistp (let ((i 2) selp @@ -474,6 +461,199 @@ (enable-menu-item-1 path t nil)) + +;;;;;;; popup menus + +(defvar global-popup-menu nil + "The global popup menu. This is present in all modes. +See the function `popup-menu' for a description of menu syntax.") + +(defvar mode-popup-menu nil + "The mode-specific popup menu. Automatically buffer local. +This is appended to the default items in `global-popup-menu'. +See the function `popup-menu' for a description of menu syntax.") +(make-variable-buffer-local 'mode-popup-menu) + +(defvar activate-popup-menu-hook nil + "Function or functions run before a mode-specific popup menu is made visible. +These functions are called with no arguments, and should interrogate and +modify the value of `global-popup-menu' or `mode-popup-menu' as desired. +Note: this hook is only run if you use `popup-mode-menu' for activating the +global and mode-specific commands; if you have your own binding for button3, +this hook won't be run.") + +(defvar last-popup-menu-event nil + "The mouse event that invoked the last popup menu. +NOTE: This is EXPERIMENTAL and may change at any time.") + +(defun popup-mode-menu (&optional event) + "Pop up a menu of global and mode-specific commands. +The menu is computed by combining `global-popup-menu' and `mode-popup-menu' +with any items derived from the `context-menu' property of the extent where the +button was clicked." + (interactive "_e") + (setq last-popup-menu-event + (or (and event (button-event-p event) event) + (let* ((mouse-pos (mouse-position)) + (win (car mouse-pos)) + (x (cadr mouse-pos)) + (y (cddr mouse-pos)) + (edges (window-pixel-edges win)) + (winx (first edges)) + (winy (second edges)) + (x (+ x winx)) + (y (+ y winy))) + (make-event 'button-press + `(button 3 x ,x y ,y channel ,(window-frame win) + timestamp ,(current-event-timestamp + (cdfw-console win))))))) + (run-hooks 'activate-popup-menu-hook) + (let* ((context-window (and event (event-window event))) + (context-point (and event (event-point event))) + (context-extents (and context-window + context-point + (extents-at context-point + (window-buffer context-window) + 'context-menu))) + (context-menu-items + (apply 'append (mapcar #'(lambda (extent) + (extent-property extent 'context-menu)) + context-extents)))) + (popup-menu + (cond ((and global-popup-menu mode-popup-menu) + ;; Merge global-popup-menu and mode-popup-menu + (check-menu-syntax mode-popup-menu) + (let* ((title (car mode-popup-menu)) + (items (cdr mode-popup-menu)) + mode-filters) + ;; Strip keywords from local menu for attaching them at the top + (while (and items + (keywordp (car items))) + ;; Push both keyword and its argument. + (push (pop items) mode-filters) + (push (pop items) mode-filters)) + (setq mode-filters (nreverse mode-filters)) + ;; If mode-filters contains a keyword already present in + ;; `global-popup-menu', you will probably lose. + (append (list (car global-popup-menu)) + mode-filters + (cdr global-popup-menu) + '("---" "---") + (if popup-menu-titles (list title)) + (if popup-menu-titles '("---" "---")) + items + context-menu-items))) + (t + (append + (or mode-popup-menu + global-popup-menu + (error "No menu defined in this buffer")) + context-menu-items)))) + + (while (popup-up-p) + (dispatch-event (next-event))) + + )) + +(defun popup-buffer-menu (event) + "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked." + (interactive "e") + (let ((window (and (event-over-text-area-p event) (event-window event))) + (bmenu nil)) + (or window + (error "Pointer must be in a normal window")) + (select-window window) + (if current-menubar + (setq bmenu (assoc "%_Buffers" current-menubar))) + (if (null bmenu) + (setq bmenu (assoc "%_Buffers" default-menubar))) + (if (null bmenu) + (error "Can't find the Buffers menu")) + (popup-menu bmenu))) + +(defun popup-menubar-menu (event) + "Pop up a copy of menu that also appears in the menubar." + (interactive "e") + (let ((window (and (event-over-text-area-p event) (event-window event))) + popup-menubar) + (or window + (error "Pointer must be in a normal window")) + (select-window window) + (and current-menubar (run-hooks 'activate-menubar-hook)) + ;; #### Instead of having to copy this just to safely get rid of + ;; any nil what we should really do is fix up the internal menubar + ;; code to just ignore nil if generating a popup menu + (setq popup-menubar (delete nil (copy-sequence (or current-menubar + default-menubar)))) + (popup-menu (cons "%_Menubar Menu" popup-menubar)) + )) + +(defun menu-call-at-event (form &optional event default-behavior-fallback) + "Call FORM while temporarily setting point to the position in EVENT. +NOTE: This is EXPERIMENTAL and may change at any time. + +FORM is called the way forms in menu specs are: i.e. if a symbol, it's called +with `call-interactively', otherwise with `eval'. EVENT defaults to +`last-popup-menu-event', making this function especially useful in popup +menus. The buffer and point are set temporarily within a `save-excursion'. +If EVENT is not a mouse event, or was not over a buffer, nothing +happens unless DEFAULT-BEHAVIOR-FALLBACK is non-nil, in which case the +FORM is called normally." + (or event (setq event last-popup-menu-event)) + (let ((buf (event-buffer event)) + (p (event-closest-point event))) + (cond ((and buf p (> p 0)) + (save-excursion + (set-buffer buf) + (goto-char p) + (if (symbolp form) + (call-interactively form) + (eval form)))) + (default-behavior-fallback + (if (symbolp form) + (call-interactively form) + (eval form)))))) + +(global-set-key 'button3 'popup-mode-menu) +;; shift button3 and shift button2 are reserved for Hyperbole +(global-set-key '(meta control button3) 'popup-buffer-menu) +;; The following command is way too dangerous with Custom. +;; (global-set-key '(meta shift button3) 'popup-menubar-menu) + +;; Here's a test of the cool new menu features (from Stig). + +;;(setq mode-popup-menu +;; '("Test Popup Menu" +;; :filter cdr +;; ["this item won't appear because of the menu filter" ding t] +;; "--:singleLine" +;; "singleLine" +;; "--:doubleLine" +;; "doubleLine" +;; "--:singleDashedLine" +;; "singleDashedLine" +;; "--:doubleDashedLine" +;; "doubleDashedLine" +;; "--:noLine" +;; "noLine" +;; "--:shadowEtchedIn" +;; "shadowEtchedIn" +;; "--:shadowEtchedOut" +;; "shadowEtchedOut" +;; "--:shadowDoubleEtchedIn" +;; "shadowDoubleEtchedIn" +;; "--:shadowDoubleEtchedOut" +;; "shadowDoubleEtchedOut" +;; "--:shadowEtchedInDash" +;; "shadowEtchedInDash" +;; "--:shadowEtchedOutDash" +;; "shadowEtchedOutDash" +;; "--:shadowDoubleEtchedInDash" +;; "shadowDoubleEtchedInDash" +;; "--:shadowDoubleEtchedOutDash" +;; "shadowDoubleEtchedOutDash" +;; )) + (defun get-popup-menu-response (menu-desc &optional event) "Pop up the given menu and wait for a response. This blocks until the response is received, and returns the misc-user diff -r 72a7cfa4a488 -r abe6d1db359e lisp/minibuf.el --- a/lisp/minibuf.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/minibuf.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,8 +1,8 @@ ;;; minibuf.el --- Minibuffer functions for XEmacs ;; Copyright (C) 1992, 1993, 1994, 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995 Tinker Systems -;; Copyright (C) 1995, 1996 Ben Wing +;; Copyright (C) 1995 Tinker Systems. +;; Copyright (C) 1995, 1996, 2000 Ben Wing. ;; Author: Richard Mlynarik ;; Created: 2-Oct-92 @@ -52,7 +52,7 @@ (defcustom minibuffer-history-uniquify t "*Non-nil means when adding an item to a minibuffer history, remove -previous occurances of the same item from the history list first, +previous occurrences of the same item from the history list first, rather than just consing the new element onto the front of the list." :type 'boolean :group 'minibuffer) @@ -111,8 +111,12 @@ ;(defvar minibuffer-setup-hook nil ; "Normal hook run just after entry to minibuffer.") +;; see comment at list-mode-hook. +(put 'minibuffer-setup-hook 'permanent-local t) + (defvar minibuffer-exit-hook nil "Normal hook run just after exit from minibuffer.") +(put 'minibuffer-exit-hook 'permanent-local t) (defvar minibuffer-help-form nil "Value that `help-form' takes on inside the minibuffer.") @@ -608,7 +612,7 @@ ;; Used by minibuffer-do-completion -(defvar last-exact-completion) +(defvar last-exact-completion nil) (defun temp-minibuffer-message (m) (let ((savemax (point-max))) @@ -1325,6 +1329,15 @@ current-minibuffer-point (point))) (let ((narg (- minibuffer-history-position n)) (minimum (if minibuffer-default -1 0))) + ;; a weird special case here; when in repeat-complex-command, we're + ;; trying to edit the top command, and minibuffer-history-position + ;; points to 1, the next-to-top command. in this case, the top + ;; command in the history is suppressed in favor of the one being + ;; edited, and there is no more command below it, except maybe the + ;; default. + (if (and (zerop narg) (eq minibuffer-history-position + initial-minibuffer-history-position)) + (setq minimum (1+ minimum))) (cond ((< narg minimum) (error (if minibuffer-default "No following item in %s" @@ -1338,7 +1351,7 @@ (progn (insert current-minibuffer-contents) (goto-char current-minibuffer-point)) - (let ((elt (if (>= narg 0) + (let ((elt (if (> narg 0) (nth (1- minibuffer-history-position) (symbol-value minibuffer-history-variable)) minibuffer-default))) @@ -1446,7 +1459,10 @@ Prompts with PROMPT. By default, return DEFAULT-VALUE. A user variable is one whose documentation starts with a `*' character." (intern (completing-read prompt obarray 'user-variable-p t nil - 'variable-history default-value))) + 'variable-history + (if (symbolp default-value) + (symbol-name default-value) + default-value)))) (defun read-buffer (prompt &optional default require-match) "Read the name of a buffer and return as a string. @@ -1537,6 +1553,24 @@ (setq n (1+ n)))) new))) + +;; Wrapper for `directory-files' for use in generating completion lists. +;; Generates output in the same format as `file-name-all-completions'. +;; +;; The EFS replacement for `directory-files' doesn't support the FILES-ONLY +;; option, so it has to be faked. The listing cache will hopefully +;; improve the performance of this operation. +(defun minibuf-directory-files (dir &optional match-regexp files-only) + (let ((want-file (or (eq files-only nil) (eq files-only t))) + (want-dirs (or (eq files-only nil) (not (eq files-only t))))) + (delete nil + (mapcar (function (lambda (f) + (if (file-directory-p (expand-file-name f dir)) + (and want-dirs (file-name-as-directory f)) + (and want-file f)))) + (delete "." (directory-files dir nil match-regexp)))))) + + (defun read-file-name-2 (history prompt dir default must-match initial-contents completer) @@ -1625,7 +1659,7 @@ (reset-buffer completion-buf) (let ((standard-output completion-buf)) (display-completion-list - (delete "." (directory-files full nil nil nil (if dir-p 'directory))) + (minibuf-directory-files full nil (if dir-p 'directory)) :user-data dir-p :reference-buffer minibuf :activate-callback 'read-file-name-activate-callback) @@ -1635,33 +1669,47 @@ must-match initial-contents completer) (if (should-use-dialog-box-p) - ;; this calls read-file-name-2 - (mouse-read-file-name-1 history prompt dir default must-match - initial-contents completer) - (let ((rfhookfun - (lambda () - ;; #### SCREAM! Create a `file-system-ignore-case' - ;; function, so this kind of stuff is generalized! - (and (eq system-type 'windows-nt) - (set (make-local-variable 'completion-ignore-case) t)) - (set - (make-local-variable - 'completion-display-completion-list-function) - #'(lambda (completions) - (display-completion-list - completions - :user-data (not (eq completer 'read-file-name-internal)) - :activate-callback - 'read-file-name-activate-callback))) - ;; kludge! - (remove-hook 'minibuffer-setup-hook rfhookfun) - ))) - (unwind-protect - (progn - (add-hook 'minibuffer-setup-hook rfhookfun) - (read-file-name-2 history prompt dir default must-match - initial-contents completer)) - (remove-hook 'minibuffer-setup-hook rfhookfun))))) + (condition-case nil + (let ((file + (apply #'make-dialog-box + 'file `(:title ,(capitalize-string-as-title + ;; Kludge: Delete ": " off the end. + (replace-in-string prompt ": $" "")) + ,@(and dir (list :initial-directory + dir)) + :file-must-exist ,must-match + ,@(and initial-contents + (list :initial-filename + initial-contents)))))) + ;; hack -- until we implement reading a directory properly, + ;; allow a file as indicating the directory it's in + (if (and (eq completer 'read-directory-name-internal) + (not (file-directory-p file))) + (file-name-directory file) + file)) + (unimplemented + ;; this calls read-file-name-2 + (mouse-read-file-name-1 history prompt dir default must-match + initial-contents completer) + )) + (add-one-shot-hook + 'minibuffer-setup-hook + (lambda () + ;; #### SCREAM! Create a `file-system-ignore-case' + ;; function, so this kind of stuff is generalized! + (and (eq system-type 'windows-nt) + (set (make-local-variable 'completion-ignore-case) t)) + (set + (make-local-variable + 'completion-display-completion-list-function) + #'(lambda (completions) + (display-completion-list + completions + :user-data (not (eq completer 'read-file-name-internal)) + :activate-callback + 'read-file-name-activate-callback))))) + (read-file-name-2 history prompt dir default must-match + initial-contents completer))) (defun read-file-name (prompt &optional dir default must-match initial-contents @@ -1824,7 +1872,9 @@ ((eq action 't) ;; all completions (mapcar #'un-substitute-in-file-name - (file-name-all-completions name dir))) + (if (string= name "") + (delete "./" (file-name-all-completions "" dir)) + (file-name-all-completions name dir)))) (t;; nil ;; complete (let* ((d (or dir default-directory)) @@ -1853,17 +1903,13 @@ #'(lambda (action orig string specdir dir name) (let* ((dirs #'(lambda (fn) (let ((l (if (equal name "") - (directory-files + (minibuf-directory-files dir - nil "" - nil 'directories) - (directory-files + (minibuf-directory-files dir - nil (concat "\\`" (regexp-quote name)) - nil 'directories)))) (mapcar fn ;; Wretched unix @@ -1925,40 +1971,59 @@ result) (t file)))) +(defun mouse-rfn-setup-vars (prompt) + ;; a specifier would be nice. + (set (make-local-variable 'frame-title-format) + (capitalize-string-as-title + ;; Kludge: Delete ": " off the end. + (replace-in-string prompt ": $" ""))) + ;; ensure that killing the frame works right, + ;; instead of leaving us in the minibuffer. + (add-local-hook 'delete-frame-hook + #'(lambda (frame) + (abort-recursive-edit)))) + (defun mouse-file-display-completion-list (window dir minibuf user-data) (let ((standard-output (window-buffer window))) (condition-case nil (display-completion-list - (directory-files dir nil nil nil t) - :window-width (* 2 (window-width window)) + (minibuf-directory-files dir nil t) + :window-width (window-width window) + :window-height (window-text-area-height window) + :completion-string "" :activate-callback 'mouse-read-file-name-activate-callback :user-data user-data :reference-buffer minibuf :help-string "") - (t nil)))) + (t nil)) + )) (defun mouse-directory-display-completion-list (window dir minibuf user-data) (let ((standard-output (window-buffer window))) (condition-case nil (display-completion-list - (delete "." (directory-files dir nil nil nil 1)) + (minibuf-directory-files dir nil 1) :window-width (window-width window) + :window-height (window-text-area-height window) + :completion-string "" :activate-callback 'mouse-read-file-name-activate-callback :user-data user-data :reference-buffer minibuf :help-string "") - (t nil)))) + (t nil)) + )) (defun mouse-read-file-name-activate-callback (event extent user-data) (let* ((file (extent-string extent)) (minibuf (symbol-value-in-buffer 'completion-reference-buffer (extent-object extent))) - (in-dir (buffer-substring nil nil minibuf)) + (ministring (buffer-substring nil nil minibuf)) + (in-dir (file-name-directory ministring)) (full (expand-file-name file in-dir)) (filebuf (nth 0 user-data)) - (dirbuff (nth 1 user-data)) + (dirbuf (nth 1 user-data)) (filewin (nth 2 user-data)) (dirwin (nth 3 user-data))) (if (file-regular-p full) @@ -1967,29 +2032,34 @@ (insert-string (file-name-as-directory (abbreviate-file-name full t)) minibuf) (reset-buffer filebuf) - (if (not dirbuff) + (if (not dirbuf) (mouse-directory-display-completion-list filewin full minibuf user-data) (mouse-file-display-completion-list filewin full minibuf user-data) - (reset-buffer dirbuff) + (reset-buffer dirbuf) (mouse-directory-display-completion-list dirwin full minibuf user-data))))) -;; this is rather cheesified but gets the job done. +;; our cheesy but god-awful time consuming file dialog box implementation. +;; this will be replaced with use of the native file dialog box (when +;; available). (defun mouse-read-file-name-1 (history prompt dir default - must-match initial-contents - completer) + must-match initial-contents + completer) + ;; file-p is t if we're reading files, nil if directories. (let* ((file-p (eq 'read-file-name-internal completer)) (filebuf (get-buffer-create "*Completions*")) - (dirbuff (and file-p (generate-new-buffer " *mouse-read-file*"))) - (butbuff (generate-new-buffer " *mouse-read-file*")) + (dirbuf (and file-p (generate-new-buffer " *mouse-read-file*"))) + (butbuf (generate-new-buffer " *mouse-read-file*")) (frame (make-dialog-frame)) filewin dirwin user-data) (unwind-protect (progn (reset-buffer filebuf) - (select-frame frame) + + ;; set up the frame. + (focus-frame frame) (let ((window-min-height 1)) ;; #### should be 2 not 3, but that causes ;; "window too small to split" errors for some @@ -2002,16 +2072,80 @@ (setq filewin (frame-rightmost-window frame) dirwin (frame-leftmost-window frame)) (set-window-buffer filewin filebuf) - (set-window-buffer dirwin dirbuff)) + (set-window-buffer dirwin dirbuf)) (setq filewin (frame-highest-window frame)) (set-window-buffer filewin filebuf)) - (setq user-data (list filebuf dirbuff filewin dirwin)) - (set-window-buffer (frame-lowest-window frame) butbuff) - (set-buffer butbuff) + (setq user-data (list filebuf dirbuf filewin dirwin)) + (set-window-buffer (frame-lowest-window frame) butbuf) + + ;; set up completion buffers. + (let ((rfcshookfun + ;; kludge! + ;; #### I really need to flesh out the object + ;; hierarchy better to avoid these kludges. + ;; (?? I wrote this comment above some time ago, + ;; and I don't understand what I'm referring to + ;; any more. --ben + (lambda () + (mouse-rfn-setup-vars prompt) + (when (featurep 'scrollbar) + (set-specifier scrollbar-width 0 (current-buffer))) + (setq truncate-lines t)))) + + (set-buffer filebuf) + (add-local-hook 'completion-setup-hook rfcshookfun) + (when file-p + (set-buffer dirbuf) + (add-local-hook 'completion-setup-hook rfcshookfun))) + + ;; set up minibuffer. + (add-one-shot-hook + 'minibuffer-setup-hook + (lambda () + (if (not file-p) + (mouse-directory-display-completion-list + filewin dir (current-buffer) user-data) + (mouse-file-display-completion-list + filewin dir (current-buffer) user-data) + (mouse-directory-display-completion-list + dirwin dir (current-buffer) user-data)) + (set + (make-local-variable + 'completion-display-completion-list-function) + (lambda (completions) + (display-completion-list + completions + :help-string "" + :window-width (window-width filewin) + :window-height (window-text-area-height filewin) + :completion-string "" + :activate-callback + 'mouse-read-file-name-activate-callback + :user-data user-data))) + (mouse-rfn-setup-vars prompt) + (save-selected-window + ;; kludge to ensure the frame title is correct. + ;; the minibuffer leaves the frame title the way + ;; it was before (i.e. of the selected window before + ;; the dialog box was opened), so to get it correct + ;; we have to be tricky. + (select-window filewin) + (redisplay-frame nil t) + ;; #### another kludge. sometimes the focus ends up + ;; back in the main window, not the dialog box. it + ;; occurs randomly and it's not possible to reliably + ;; reproduce. We try to fix it by draining non-user + ;; events and then setting the focus back on the frame. + (sit-for 0 t) + (focus-frame frame)))) + + ;; set up button buffer. + (set-buffer butbuf) + (mouse-rfn-setup-vars prompt) (when dir (setq default-directory dir)) (when (featurep 'scrollbar) - (set-specifier scrollbar-width 0 butbuff)) + (set-specifier scrollbar-width 0 butbuf)) (insert " ") (insert-gui-button (make-gui-button "OK" (lambda (foo) @@ -2020,51 +2154,20 @@ (insert-gui-button (make-gui-button "Cancel" (lambda (foo) (abort-recursive-edit)))) - (let ((rfhookfun - (lambda () - (if (not file-p) - (mouse-directory-display-completion-list - filewin dir (current-buffer) user-data) - (mouse-file-display-completion-list filewin dir - (current-buffer) - user-data) - (mouse-directory-display-completion-list dirwin dir - (current-buffer) - user-data)) - (set - (make-local-variable - 'completion-display-completion-list-function) - #'(lambda (completions) - (display-completion-list - completions - :help-string "" - :activate-callback - 'mouse-read-file-name-activate-callback - :user-data user-data))) - ;; kludge! - (remove-hook 'minibuffer-setup-hook rfhookfun) - )) - (rfcshookfun - ;; kludge! - ;; #### I really need to flesh out the object - ;; hierarchy better to avoid these kludges. - (lambda () - (save-excursion - (set-buffer standard-output) - (setq truncate-lines t))))) - (unwind-protect - (progn - (add-hook 'minibuffer-setup-hook rfhookfun) - (add-hook 'completion-setup-hook rfcshookfun) - (read-file-name-2 history prompt dir default - must-match initial-contents - completer)) - (remove-hook 'minibuffer-setup-hook rfhookfun) - (remove-hook 'completion-setup-hook rfcshookfun)))) + + ;; now start reading filename. + (read-file-name-2 history prompt dir default + must-match initial-contents + completer)) + + ;; always clean up. + ;; get rid of our hook that calls abort-recursive-edit -- not a good + ;; idea here. + (kill-local-variable 'delete-frame-hook) (delete-frame frame) (kill-buffer filebuf) - (kill-buffer butbuff) - (and dirbuff (kill-buffer dirbuff))))) + (kill-buffer butbuf) + (and dirbuf (kill-buffer dirbuf))))) (defun read-face (prompt &optional must-match) "Read the name of a face from the minibuffer and return it as a symbol." diff -r 72a7cfa4a488 -r abe6d1db359e lisp/modeline.el --- a/lisp/modeline.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/modeline.el Mon Aug 13 11:35:02 2007 +0200 @@ -39,6 +39,23 @@ "Modeline customizations." :group 'environment) +(defcustom modeline-3d-p ;; added for the options menu + (let ((thickness + (specifier-instance modeline-shadow-thickness))) + (and (integerp thickness) + (> thickness 0))) + "Whether the default toolbar is globally visible. This option can be +customized through the options menu." + :group 'display + :type 'boolean + :set #'(lambda (var val) + (if val + (set-specifier modeline-shadow-thickness 2) + (set-specifier modeline-shadow-thickness 0)) + (redraw-modeline t) + (setq modeline-3d-p val)) + ) + (defcustom drag-divider-event-lag 150 "*The pause (in msecs) between divider drag events before redisplaying. If this value is too small, dragging will be choppy because redisplay cannot @@ -79,7 +96,23 @@ (set-glyph-image modeline-pointer-glyph "fleur" 'global 'x)) (t (set-glyph-image modeline-pointer-glyph "sb_v_double_arrow" - 'global 'x))))) + 'global 'x)))) + (when (featurep 'mswindows) + (cond ((eq val t) + (set-glyph-image modeline-pointer-glyph + [mswindows-resource :resource-type cursor + :resource-id "SizeAll"] + 'global 'mswindows)) + ((eq val 'scrollbar) + (set-glyph-image modeline-pointer-glyph + [mswindows-resource :resource-type cursor + :resource-id "Normal"] + 'global 'mswindows)) + (t + (set-glyph-image modeline-pointer-glyph + [mswindows-resource :resource-type cursor + :resource-id "SizeNS"] + 'global 'mswindows))))) :group 'modeline) (defun mouse-drag-modeline (event) @@ -559,8 +592,13 @@ ; this used to be "XEmacs:" (cons modeline-buffer-id-right-extent (purecopy " %17b"))) "Modeline control for identifying the buffer being displayed. -Its default value is \"XEmacs: %17b\" (NOT!). Major modes that edit things -other than ordinary files may change this (e.g. Info, Dired,...)") +Its default value is + + (list (cons modeline-buffer-id-left-extent (purecopy \"XEmacs%N:\")) + (cons modeline-buffer-id-right-extent (purecopy \" %17b\"))) + +Major modes that edit things other than ordinary files may change this +(e.g. Info, Dired,...).") (make-variable-buffer-local 'modeline-buffer-identification) ;; These are for the sake of minor mode menu. #### All of this is diff -r 72a7cfa4a488 -r abe6d1db359e lisp/mouse.el --- a/lisp/mouse.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/mouse.el Mon Aug 13 11:35:02 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1988, 1992-4, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems -;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 1995, 1996, 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: mouse, dumped @@ -30,6 +30,15 @@ ;; This file is dumped with XEmacs (when window system support is compiled in). +;;; Authorship: + +;; Probably originally derived from FSF 19 pre-release. +;; much hacked upon by Jamie Zawinski and crew, pre-1994. +;; (only mouse-motion stuff currently remains from that era) +;; all mouse-track stuff completely rewritten by Ben Wing, 1995-1996. +;; mouse-eval-sexp and *-inside-extent-p from Stig, 1995. +;; vertical divider code c. 1998 from ?. + ;;; Code: (provide 'mouse) @@ -39,16 +48,7 @@ (global-set-key '(control button1) 'mouse-track-insert) (global-set-key '(control shift button1) 'mouse-track-delete-and-insert) (global-set-key '(meta button1) 'mouse-track-do-rectangle) - -;; drops are now handled in dragdrop.el (ograf@fga.de) - -;; enable drag regions (ograf@fga.de) -;; if button2 is dragged from within a region, this becomes a drop -;; -;; this must be changed to the new api -(if (featurep '(or offix cde mswindows)) - (global-set-key 'button2 'mouse-drag-or-yank) - (global-set-key 'button2 'mouse-yank)) +(global-set-key 'button2 'mouse-track) (defgroup mouse nil "Window system-independent mouse support." @@ -185,7 +185,6 @@ (defun click-inside-extent-p (click extent) "Return non-nil if the button event is within the primary selection-extent. Return nil otherwise." - ;; stig@hackvan.com (let ((ewin (event-window click)) (epnt (event-point click))) (and ewin @@ -206,7 +205,6 @@ "Return t if point is within the bounds of the primary selection extent. Return t is point is at the end position of the extent. Return nil otherwise." - ;; stig@hackvan.com (and extent (eq (current-buffer) (extent-object extent)) @@ -214,35 +212,27 @@ (>= (extent-end-position extent) (point)))) (defun point-inside-selection-p () - ;; by Stig@hackvan.com (or (point-inside-extent-p primary-selection-extent) (point-inside-extent-p zmacs-region-extent))) -(defun mouse-drag-or-yank (event) - "Either drag or paste the current selection. -If the variable `mouse-yank-at-point' is non-nil, -move the cursor to the location of the click before pasting. -This functions has to be improved. Currently it is just a (working) test." - ;; by Oliver Graf - (interactive "e") - (if (click-inside-extent-p event zmacs-region-extent) - ;; okay, this is a drag - (cond ((featurep 'offix) - (offix-start-drag-region - event - (extent-start-position zmacs-region-extent) - (extent-end-position zmacs-region-extent))) - ((featurep 'cde) - ;; should also work with CDE - (cde-start-drag-region event - (extent-start-position zmacs-region-extent) - (extent-end-position zmacs-region-extent))) - (t (error "No offix or CDE support compiled in"))) - ;; no drag, call region-funct - (and (not mouse-yank-at-point) - (mouse-set-point event)) - (funcall mouse-yank-function)) - ) +(defun mouse-begin-drag-n-drop (event) + "Begin a drag-n-drop operation. +EVENT should be the button event that initiated the drag. +Returns whether a drag was begun." + ;; #### barely implemented. + (when (click-inside-selection-p event) + (cond ((featurep 'offix) + (offix-start-drag-region + event + (extent-start-position zmacs-region-extent) + (extent-end-position zmacs-region-extent)) + t) + ((featurep 'cde) + ;; should also work with CDE + (cde-start-drag-region event + (extent-start-position zmacs-region-extent) + (extent-end-position zmacs-region-extent)) + t)))) (defun mouse-eval-sexp (click force-window) "Evaluate the sexp under the mouse. Usually, this is the last sexp before @@ -257,7 +247,6 @@ you can use `mouse-eval-sexp' to interactively test code that acts upon a buffer...something you cannot do with the standard `eval-last-sexp' function. It's also fantastic for debugging regular expressions." - ;; by Stig@hackvan.com (interactive "e\nP") (let (exp val result-str) (setq exp (save-window-excursion @@ -503,6 +492,36 @@ :type '(choice integer (const :tag "Disabled" nil)) :group 'mouse) +(defcustom mouse-track-activate-strokes '(button1-double-click button2-click) + "List of mouse strokes that can cause \"activation\" of the text extent +under the mouse. The exact meaning of \"activation\" is dependent on the +text clicked on and the mode of the buffer, but typically entails actions +such as following a hyperlink or selecting an entry in a completion buffer. + +Possible list entries are + +button1-click +button1-double-click +button1-triple-click +button1-down +button2-click +button2-double-click +button2-triple-click +button2-down + +As a general rule, you should not use the \"-down\" values, because this +makes it impossible to have other simultaneous actions, such as selection." + :type '(set + button1-click + button1-double-click + button1-triple-click + button1-down + button2-click + button2-double-click + button2-triple-click + button2-down) + :group 'mouse) + (defvar mouse-track-x-threshold '(face-width 'default) "Minimum number of pixels in the X direction for a drag to be initiated. If the mouse is moved more than either the X or Y threshold while the @@ -539,6 +558,15 @@ 'mouse-track-scroll-undefined (copy-event event))))) +(defun mouse-track-do-activate (event) + "Execute the activate function under EVENT, if any. +Return true if the function was activated." + (let ((ex (extent-at-event event 'activate-function))) + (when ex + (funcall (extent-property ex 'activate-function) + event ex) + t))) + (defun mouse-track-run-hook (hook event &rest args) ;; ugh, can't use run-hook-with-args-until-success because we have ;; to get the value using symbol-value-in-buffer. Doing a @@ -585,9 +613,9 @@ ) (defun mouse-track (event) - "Make a selection with the mouse. This should be bound to a mouse button. -The behavior of XEmacs during mouse selection is customizable using various -hooks and variables: see `mouse-track-click-hook', `mouse-track-drag-hook', + "Generalized mouse-button handler. This should be bound to a mouse button. +The behavior of this function is customizable using various hooks and +variables: see `mouse-track-click-hook', `mouse-track-drag-hook', `mouse-track-drag-up-hook', `mouse-track-down-hook', `mouse-track-up-hook', `mouse-track-cleanup-hook', `mouse-track-multi-click-time', `mouse-track-scroll-delay', `mouse-track-x-threshold', and @@ -1110,9 +1138,26 @@ (disown-selection))))) (setq default-mouse-track-down-event nil)))) +;; return t if the button or motion event involved the specified button. +(defun default-mouse-track-event-is-with-button (event n) + (cond ((button-event-p event) + (= n (event-button event))) + ((motion-event-p event) + (memq (cdr + (assq n '((1 . button1) (2 . button2) (3 . button3) + (4 . button4) (5 . button5)))) + (event-modifiers event))))) + (defun default-mouse-track-down-hook (event click-count) - (setq default-mouse-track-down-event (copy-event event)) - nil) + (cond ((default-mouse-track-event-is-with-button event 1) + (if (and (memq 'button1-down mouse-track-activate-strokes) + (mouse-track-do-activate event)) + t + (setq default-mouse-track-down-event (copy-event event)) + nil)) + ((default-mouse-track-event-is-with-button event 2) + (and (memq 'button2-down mouse-track-activate-strokes) + (mouse-track-do-activate event))))) (defun default-mouse-track-cleanup-extents-hook () (remove-hook 'pre-command-hook 'default-mouse-track-cleanup-extents-hook) @@ -1133,7 +1178,8 @@ (if (consp extent) ; rectangle-p (mapcar func extent) (if extent - (funcall func extent)))))) + (funcall func extent))))) + t) (defun default-mouse-track-cleanup-extent () (let ((dead-func @@ -1153,13 +1199,16 @@ (setq default-mouse-track-extent nil))))) (defun default-mouse-track-drag-hook (event click-count was-timeout) - (default-mouse-track-deal-with-down-event click-count) - (default-mouse-track-set-point event default-mouse-track-window) - (default-mouse-track-cleanup-extent) - (default-mouse-track-next-move default-mouse-track-min-anchor - default-mouse-track-max-anchor - default-mouse-track-extent) - t) + (cond ((default-mouse-track-event-is-with-button event 1) + (default-mouse-track-deal-with-down-event click-count) + (default-mouse-track-set-point event default-mouse-track-window) + (default-mouse-track-cleanup-extent) + (default-mouse-track-next-move default-mouse-track-min-anchor + default-mouse-track-max-anchor + default-mouse-track-extent) + t) + ((default-mouse-track-event-is-with-button event 2) + (mouse-begin-drag-n-drop event)))) (defun default-mouse-track-return-dragged-selection (event) (default-mouse-track-cleanup-extent) @@ -1210,15 +1259,45 @@ result)) (defun default-mouse-track-drag-up-hook (event click-count) - (let ((result (default-mouse-track-return-dragged-selection event))) - (if result - (default-mouse-track-maybe-own-selection result 'PRIMARY))) - t) + (when (default-mouse-track-event-is-with-button event 1) + (let ((result (default-mouse-track-return-dragged-selection event))) + (if result + (default-mouse-track-maybe-own-selection result 'PRIMARY))) + t)) (defun default-mouse-track-click-hook (event click-count) - (default-mouse-track-drag-hook event click-count nil) - (default-mouse-track-drag-up-hook event click-count) - t) + (cond ((default-mouse-track-event-is-with-button event 1) + (if (and + (or (and (= click-count 1) + (memq 'button1-click + mouse-track-activate-strokes)) + (and (= click-count 2) + (memq 'button1-double-click + mouse-track-activate-strokes)) + (and (= click-count 3) + (memq 'button1-triple-click + mouse-track-activate-strokes))) + (mouse-track-do-activate event)) + t + (default-mouse-track-drag-hook event click-count nil) + (default-mouse-track-drag-up-hook event click-count) + t)) + ((default-mouse-track-event-is-with-button event 2) + (if (and + (or (and (= click-count 1) + (memq 'button2-click + mouse-track-activate-strokes)) + (and (= click-count 2) + (memq 'button2-double-click + mouse-track-activate-strokes)) + (and (= click-count 3) + (memq 'button2-triple-click + mouse-track-activate-strokes))) + (mouse-track-do-activate event)) + t + (mouse-yank event) + t)))) + (add-hook 'mouse-track-down-hook 'default-mouse-track-down-hook) (add-hook 'mouse-track-drag-hook 'default-mouse-track-drag-hook) @@ -1471,7 +1550,7 @@ ;; (defun drag-window-divider (event) "Handle resizing windows by dragging window dividers. -This is an intenal function, normally bound to button1 event in +This is an internal function, normally bound to button1 event in window-divider-map. You would not call it, but you may bind it to other mouse buttons." (interactive "e") diff -r 72a7cfa4a488 -r abe6d1db359e lisp/movemail.el --- a/lisp/movemail.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/movemail.el Mon Aug 13 11:35:02 2007 +0200 @@ -41,7 +41,7 @@ (if stuff (intern stuff) configure-mail-lock-method)) - "mail spool locking method used by thios instance of XEmacs. + "mail spool locking method used by this instance of XEmacs. This must be one of the symbols in MAIL-LOCK-METHODS.") (defun move-mail-spool (from to &optional buffer pop-password) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/msw-faces.el --- a/lisp/msw-faces.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/msw-faces.el Mon Aug 13 11:35:02 2007 +0200 @@ -29,12 +29,23 @@ ;; This file does the magic to parse mswindows font names, and make sure that ;; the default and modeline attributes of new frames are specified enough. -;;; Force creation of the default face font so that if it fails we get an -;;; error now instead of a crash at frame creation. (defun mswindows-init-device-faces (device) - (unless (face-font-instance 'default device) - (error "Can't find a suitable default font"))) - + (let ((color-default (device-system-metric device 'color-default)) + (color-3d-face (device-system-metric device 'color-3d-face))) + ; Force creation of the default face font so that if it fails we get + ; an error now instead of a crash at frame creation. + (unless (face-font-instance 'default device) + (error "Can't find a suitable default font")) + + (if (car color-default) + (set-face-foreground 'default (car color-default)) device) + (if (cdr color-default) + (set-face-background 'default (cdr color-default)) device) + (if (car color-3d-face) + (set-face-foreground 'gui-element (car color-3d-face)) device) + (if (cdr color-3d-face) + (set-face-background 'gui-element (cdr color-3d-face)) device) + (set-face-font 'gui-element "MS Sans Serif:Regular:8" device))) (defun mswindows-init-frame-faces (frame) ) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/msw-glyphs.el --- a/lisp/msw-glyphs.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/msw-glyphs.el Mon Aug 13 11:35:02 2007 +0200 @@ -30,11 +30,24 @@ ;; Initialization code for MS Windows glyphs. ;; This file is dumped with XEmacs (when MS Windows support is -;; compiled in). +;; compiled in). Make sure this is the first of msw-*.el files +;; dumped. ;;; Code: +(defun msgdi-device-p (&optional device) + "Return non-nil if DEVICE is a GDI device, that is 'mswindows or 'msprinter. +MS GDI devices are mutuially WYSIWIG-compatible, so that many common glyph, +color and font properties apply to them equally. + +This function is also a predicate for 'msgdi device tag, matching this +device class." + (memq (device-type device) '(mswindows msprinter))) + (progn + + (define-specifier-tag 'msgdi (function msgdi-device-p)) + (set-console-type-image-conversion-list 'mswindows `(("\\.bmp\\'" [bmp :file nil] 2) @@ -59,11 +72,14 @@ ;; strings are not allowed so they will be ignored. ("" [nothing]))) + (set-console-type-image-conversion-list + 'msprinter (console-type-image-conversion-list 'mswindows)) + (set-face-font 'border-glyph "WingDings:Regular:11::Symbol" - 'global 'mswindows) - (set-glyph-image continuation-glyph "\xC3" 'global 'mswindows) - (set-glyph-image truncation-glyph "\xF0" 'global 'mswindows) - (set-glyph-image hscroll-glyph "\xEF" 'global 'mswindows) + 'global 'msgdi) + (set-glyph-image continuation-glyph "\xC3" 'global 'msgdi) + (set-glyph-image truncation-glyph "\xF0" 'global 'msgdi) + (set-glyph-image hscroll-glyph "\xEF" 'global 'msgdi) (set-glyph-image octal-escape-glyph "\\") (set-glyph-image control-arrow-glyph "^") @@ -78,11 +94,11 @@ (if emacs-beta-version "xemacs-beta.xpm" "xemacs.xpm")) - 'global 'mswindows)) + 'global 'msgdi)) (t (set-glyph-image xemacs-logo "XEmacs " - 'global 'mswindows))) + 'global 'msgdi))) ) ;;; msw-glyphs.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/msw-init.el --- a/lisp/msw-init.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/msw-init.el Mon Aug 13 11:35:02 2007 +0200 @@ -47,6 +47,7 @@ (if (featurep 'infodock) (require 'id-x-toolbar) (init-x-toolbar))) + (if (featurep 'gutter) (init-gutter)) (add-hook 'zmacs-deactivate-region-hook (lambda () (if (console-on-window-system-p) @@ -61,13 +62,15 @@ (activate-region-as-selection)))) ;; Old-style mswindows bindings. The new-style mswindows bindings ;; (namely Ctrl-X, Ctrl-C and Ctrl-V) are already spoken for by XEmacs. - (define-key global-map '(shift delete) 'kill-primary-selection) - (define-key global-map '(control delete) 'delete-primary-selection) - (define-key global-map '(shift insert) 'yank-clipboard-selection) - (define-key global-map '(control insert) 'copy-primary-selection) + (global-set-key '(shift delete) 'kill-primary-selection) + (global-set-key '(control delete) 'delete-primary-selection) + (global-set-key '(shift insert) 'yank-clipboard-selection) + (global-set-key '(control insert) 'copy-primary-selection) + + (global-set-key '(meta f4) 'save-buffers-kill-emacs) ;; Random stuff - (define-key global-map 'menu 'popup-mode-menu) + (global-set-key 'menu 'popup-mode-menu) (setq mswindows-post-win-initted t))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/msw-select.el --- a/lisp/msw-select.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/msw-select.el Mon Aug 13 11:35:02 2007 +0200 @@ -38,7 +38,7 @@ (interactive "*") (setq last-command nil) (setq this-command 'yank) ; so that yank-pop works. - (let ((clip (mswindows-get-clipboard)) (s (mark-marker)) (e (point-marker))) + (let ((clip (get-clipboard)) (s (mark-marker)) (e (point-marker))) (or clip (error "there is no text on the clipboard")) (if s (if mouse-track-rectangle-p diff -r 72a7cfa4a488 -r abe6d1db359e lisp/mule/auto-autoloads.el --- a/lisp/mule/auto-autoloads.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/mule/auto-autoloads.el Mon Aug 13 11:35:02 2007 +0200 @@ -4,7 +4,7 @@ ;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program declare-ccl-program ccl-dump ccl-compile ccl-program-p) "mule-ccl" "mule/mule-ccl.el") (autoload 'ccl-program-p "mule-ccl" "\ -T if OBJECT is a valid CCL compiled code." nil nil) +Return t if OBJECT is a valid CCL compiled code." nil nil) (autoload 'ccl-compile "mule-ccl" "\ Return a compiled code of CCL-PROGRAM as a vector of integer." nil nil) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/mule/mule-category.el --- a/lisp/mule/mule-category.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/mule/mule-category.el Mon Aug 13 11:35:02 2007 +0200 @@ -35,7 +35,7 @@ ;;; Code: -(defvar defined-category-hashtable (make-hashtable 50)) +(defvar defined-category-hashtable (make-hash-table :size 50)) (defun define-category (designator doc-string) "Make a new category whose designator is DESIGNATOR. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/mule/mule-ccl.el --- a/lisp/mule/mule-ccl.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/mule/mule-ccl.el Mon Aug 13 11:35:02 2007 +0200 @@ -952,10 +952,7 @@ ;; (setq args (cdr args))))) -;;; CCL dump staffs - -;; To avoid byte-compiler warning. -(defvar ccl-code) +;;; CCL dump stuff ;;;###autoload (defun ccl-dump (ccl-code) @@ -983,6 +980,7 @@ ;; Return a CCL code in `ccl-code' at `ccl-current-ic'. (defun ccl-get-next-code () + (declare (special ccl-code)) (prog1 (aref ccl-code ccl-current-ic) (setq ccl-current-ic (1+ ccl-current-ic)))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/mule/mule-charset.el --- a/lisp/mule/mule-charset.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/mule/mule-charset.el Mon Aug 13 11:35:02 2007 +0200 @@ -249,4 +249,13 @@ (defalias 'charset-plist 'object-plist) (defalias 'set-charset-plist 'setplist) +;; Setup auto-fill-chars for charsets that should invoke auto-filling. +;; SPACE and NEWLIE are already set. +(let ((l '(katakana-jisx0201 + japanese-jisx0208 japanese-jisx0212 + chinese-gb2312 chinese-big5-1 chinese-big5-2))) + (while l + (put-char-table (car l) t auto-fill-chars) + (setq l (cdr l)))) + ;;; mule-charset.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/mule/mule-cmds.el --- a/lisp/mule/mule-cmds.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/mule/mule-cmds.el Mon Aug 13 11:35:02 2007 +0200 @@ -47,11 +47,9 @@ (define-key mule-keymap "r" 'toggle-display-direction) ; XEmacs (define-key mule-keymap "l" 'set-language-environment) -(define-key help-map "\C-L" 'describe-language-support) (define-key help-map "L" 'describe-language-environment) (define-key help-map "\C-\\" 'describe-input-method) (define-key help-map "I" 'describe-input-method) -(define-key help-map "C" 'describe-coding-system) (define-key help-map "h" 'view-hello-file) ;; Menu for XEmacs were moved to menubar-items.el. @@ -99,7 +97,7 @@ (let ((base (coding-system-base coding-system))) (if (not eol-type) base - (if (= eol-type orig-eol-type) + (if (eq eol-type orig-eol-type) coding-system (setq orig-eol-type (coding-system-eol-type base)) (if (null orig-eol-type) @@ -164,9 +162,9 @@ ;; that they could reset the terminal coding system. ;; (unless (and (eq window-system 'pc) coding-system) ;; (setq default-terminal-coding-system coding-system)) - (setq terminal-coding-system coding-system) + (set-terminal-coding-system coding-system) ;;(setq default-keyboard-coding-system coding-system) - (setq keyboard-coding-system coding-system) + (set-keyboard-coding-system coding-system) ;;(setq default-process-coding-system (cons coding-system coding-system)) ;; Refer to coding-system-for-read and coding-system-for-write ;; so that C-x RET c works. @@ -613,7 +611,8 @@ (eval-after-load "menubar-items.elc" `(add-menu-button - '("Mule" "Describe Language Support") + '("%_Edit" "%_Multilingual (\"Mule\")" + "%_Describe Language Support") (vector ,lang-env '(describe-language-environment ,lang-env) t)))) @@ -624,11 +623,12 @@ (eval-after-load "menubar-items.elc" `(add-menu-button - '("Mule" "Set Language Environment") + '("%_Edit" "%_Multilingual (\"Mule\")" + "%_Set Language Environment") (vector ,lang-env '(set-language-environment ,lang-env) t)))) - + (while alist (set-language-info lang-env (car (car alist)) (cdr (car alist))) (setq alist (cdr alist))))) @@ -996,7 +996,7 @@ But, if this flag is non-nil, it displays them in echo area instead.") (defvar input-method-exit-on-invalid-key nil - "This flag controls the behaviour of an input method on invalid key input. + "This flag controls the behavior of an input method on invalid key input. Usually, when a user types a key which doesn't start any character handled by the input method, the key is handled by turning off the input method temporarily. After that key, the input method is re-enabled. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/mule/mule-coding.el --- a/lisp/mule/mule-coding.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/mule/mule-coding.el Mon Aug 13 11:35:02 2007 +0200 @@ -185,4 +185,6 @@ (set-coding-category-system 'iso-lock-shift 'iso-2022-lock) (set-coding-category-system 'no-conversion 'no-conversion) +(setq-default buffer-file-coding-system 'iso-2022-8) + ;;; mule-coding.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/mule/mule-x-init.el --- a/lisp/mule/mule-x-init.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/mule/mule-x-init.el Mon Aug 13 11:35:02 2007 +0200 @@ -40,16 +40,16 @@ occupy exactly twice the screen space of ASCII (`halfwidth') characters. On many systems, e.g. Sun CDE systems, this can only be achieved by using a national variant roman font to display ASCII." - (let ((charset-font-width - (lambda (charset) - (font-instance-width - (face-font-instance 'default (selected-device) charset)))) + (let* ((charset-font-width + (lambda (charset) + (font-instance-width + (face-font-instance 'default (selected-device) charset)))) - (twice-as-wide - (lambda (cs1 cs2) - (let ((width1 (funcall charset-font-width cs1)) - (width2 (funcall charset-font-width cs2))) - (and width1 width2 (eq (+ width1 width1) width2)))))) + (twice-as-wide + (lambda (cs1 cs2) + (let ((width1 (funcall charset-font-width cs1)) + (width2 (funcall charset-font-width cs2))) + (and width1 width2 (eq (+ width1 width1) width2)))))) (when (eq 'x (device-type)) (condition-case nil diff -r 72a7cfa4a488 -r abe6d1db359e lisp/multicast.el --- a/lisp/multicast.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/multicast.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,25 +1,25 @@ ;;; multicast.el --- lisp frontend for multicast connections in XEmacs -;; Copyright (C) 1997-1998 Didier Verna. +;; Copyright (C) 1997-2000 Didier Verna. -;; Author: Didier Verna -;; Maintainer: Didier Verna -;; Created: Thu Dec 4 16:37:39 1997 +;; Author: Didier Verna +;; Maintainer: Didier Verna +;; Created: Thu Dec 4 16:37:39 1997 ;; Last Revision: Mon Jan 19 19:10:50 1998 ;; Current Version: 0.4 ;; Keywords: dumped comm processes -;; This file is part of XEmacs. +;; 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 of the License, or -;; (at your option) any later version. +;; (at your option) any later version. ;; XEmacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. +;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software @@ -60,7 +60,7 @@ ttl is the time-to-live (15 for site, 63 for region and 127 for world). WARNING: it is *strongly* recommended to avoid using groups beginning with - 224 or 239. Such groups are considered 'admin' groups, and may + 224 or 239. Such groups are considered 'admin' groups, and may behave in a surprising way ..." (let (dest port ttl) ;; We check only the general form of the multicast address. @@ -77,5 +77,5 @@ (error "invalid ttl specification.")) (open-multicast-group-internal name buffer dest port ttl) )) - + ;;; multicast.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/objects.el --- a/lisp/objects.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/objects.el Mon Aug 13 11:35:02 2007 +0200 @@ -46,7 +46,19 @@ SPEC-LIST can be a list of specifications (each of which is a cons of a locale and a list of instantiators), a single instantiator, or a list of instantiators. See `make-specifier' for more information about -specifiers." +specifiers. + +Valid instantiators for font specifiers are: + +-- a string naming a font (e.g. under X this might be + \"-*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-*\" for a 14-point + upright medium-weight Courier font) +-- a font instance (use that instance directly if the device matches, + or use the string that generated it) +-- a vector of no elements (only on TTY's; this means to set no font + at all, thus using the \"natural\" font of the terminal's text) +-- a vector of one element (a face to inherit from) +" (make-specifier-and-init 'font spec-list)) (defun font-name (font &optional domain charset) @@ -127,7 +139,21 @@ SPEC-LIST can be a list of specifications (each of which is a cons of a locale and a list of instantiators), a single instantiator, or a list of instantiators. See `make-specifier' for a detailed description of -how specifiers work." +how specifiers work. + +Valid instantiators for color specifiers are: + +-- a string naming a color (e.g. under X this might be \"lightseagreen2\" + or \"#F534B2\") +-- a color instance (use that instance directly if the device matches, + or use the string that generated it) +-- a vector of no elements (only on TTY's; this means to set no color + at all, thus using the \"natural\" color of the terminal's text) +-- a vector of one or two elements: a face to inherit from, and + optionally a symbol naming which property of that face to inherit, + either `foreground' or `background' (if omitted, defaults to the same + property that this color specifier is used for; if this specifier is + not part of a face, the instantiator would not be valid)." (make-specifier-and-init 'color spec-list)) (defun color-name (color &optional domain) @@ -146,4 +172,24 @@ to the result. See `make-specifier' for more information about specifiers." (ws-object-property-1 'color-instance-rgb-components color domain)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; face-boolean specifiers + +(defun make-face-boolean-specifier (spec-list) + "Return a new `face-boolean' specifier object with the given spec list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for a detailed description of +how specifiers work. + +Valid instantiators for face-boolean specifiers are + +-- t or nil +-- a vector of two or three elements: a face to inherit from, + optionally a symbol naming the property of that face to inherit from + (if omitted, defaults to the same property that this face-boolean + specifier is used for; if this specifier is not part of a face, + the instantiator would not be valid), and optionally a value which, + if non-nil, means to invert the sense of the inherited property." + (make-specifier-and-init 'color spec-list)) + ;;; objects.el ends here. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/obsolete.el --- a/lisp/obsolete.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/obsolete.el Mon Aug 13 11:35:02 2007 +0200 @@ -219,8 +219,8 @@ (defun add-menu (menu-path menu-name menu-items &optional before) "See the function `add-submenu'." - (or menu-name (error (gettext "must specify a menu name"))) - (or menu-items (error (gettext "must specify some menu items"))) + (or menu-name (error "must specify a menu name")) + (or menu-items (error "must specify some menu items")) (add-submenu menu-path (cons menu-name menu-items) before)) ;; Can't make this obsolete. easymenu depends on it. (make-compatible 'add-menu 'add-submenu) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/package-admin.el --- a/lisp/package-admin.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/package-admin.el Mon Aug 13 11:35:02 2007 +0200 @@ -441,7 +441,8 @@ ;; Delete empty directories. (if dirs (let ( (orig-default-directory default-directory) - directory files file ) + ;; directory files file + ) ;; Make sure we preserve the existing `default-directory'. ;; JV, why does this change the default directory? Does it indeed? (unwind-protect diff -r 72a7cfa4a488 -r abe6d1db359e lisp/package-get.el --- a/lisp/package-get.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/package-get.el Mon Aug 13 11:35:02 2007 +0200 @@ -68,7 +68,7 @@ ;; vm - a mail reader ;; [] Always install ;; [] Needs updating -;; [] Required by other [packages] +;; [] Required by other [packages] ;; ;; Where `[]' indicates a toggle box ;; @@ -79,7 +79,7 @@ ;; - "Required by other" means some other packages are going to force ;; this to be installed. Clicking on [packages] gives a list ;; of packages that require this. -;; +;; ;; The `package-get-base' should be installed in a file in ;; `data-directory'. The `package-get-here' should be installed in ;; site-lisp. Both are then read at run time. @@ -113,7 +113,7 @@ :prefix "package-get" :group 'package-tools) -;;;###autoload +;;;###autoload (defvar package-get-base nil "List of packages that are installed at this site. For each element in the alist, car is the package name and the cdr is @@ -239,7 +239,7 @@ This variable is used to initialize `package-get-remote', the variable actually used to specify package download sites." :tag "Package download sites" - :type '(repeat (list hostname directory)) + :type '(repeat (list (string :tag "Name") host-name directory)) :group 'package-get) (defcustom package-get-remove-copy t @@ -288,7 +288,8 @@ `(if (member (quote ,(cdr site)) package-get-remote) (setq package-get-remote - (delete (quote ,(cdr site)) package-get-remote)) + (delete (quote ,(cdr site)) + package-get-remote)) (package-ui-add-site (quote ,(cdr site)))) :style 'toggle :selected `(member (quote ,(cdr site)) @@ -372,8 +373,9 @@ (unless (and location (file-writable-p location)) (setq location package-get-user-index-filename)) (when (y-or-n-p (concat "Update package index in " location "? ")) - (write-file location)))))) - + (let ((coding-system-for-write 'binary)) + (write-file location))))))) + ;;;###autoload (defun package-get-update-base (&optional db-file force-current) @@ -398,7 +400,7 @@ (save-excursion (set-buffer buf) (erase-buffer buf) - (insert-file-contents-internal db-file) + (insert-file-contents-literally db-file) (package-get-update-base-from-buffer buf) (if (file-remote-p db-file) (package-get-maybe-save-index db-file))) @@ -515,19 +517,18 @@ a symbol instead of a string if PACKAGE-SYMBOL is non-nil. The return value is suitable for direct passing to `interactive'." (package-get-require-base t) - (let ( (table (mapcar '(lambda (item) - (let ( (name (symbol-name (car item))) ) - (cons name name) - )) - package-get-base)) - package package-symbol default-version version) + (let ((table (mapcar #'(lambda (item) + (let ((name (symbol-name (car item)))) + (cons name name))) + package-get-base)) + package package-symbol default-version version) (save-window-excursion (setq package (completing-read "Package: " table nil t)) (setq package-symbol (intern package)) (if get-version (progn - (setq default-version - (package-get-info-prop + (setq default-version + (package-get-info-prop (package-get-info-version (package-get-info-find-package package-get-base package-symbol) nil) @@ -542,8 +543,7 @@ ) (if package-symbol (list package-symbol) - (list package))) - ))) + (list package)))))) ;;;###autoload (defun package-get-delete-package (package &optional pkg-topdir) @@ -639,7 +639,6 @@ (mapcar #'(lambda (reqd) (let* ((reqd-package (package-get-package-provider reqd)) - (reqd-version (cadr reqd-package)) (reqd-name (car reqd-package))) (if (null reqd-name) (error "Unable to find a provider for %s" reqd)) @@ -706,7 +705,7 @@ INSTALL-DIR, if non-nil, specifies the package directory where fetched packages should be installed. -The value of `package-get-base' is used to determine what files should +The value of `package-get-base' is used to determine what files should be retrieved. The value of `package-get-remote' is used to determine where a package should be retrieved from. The sites are tried in order so one is better off listing easily reached sites first. @@ -814,7 +813,7 @@ current-dir-entry current-filename)) ;; Get it (setq full-package-filename dest-filename) - (message "Retrieving package `%s' ..." + (message "Retrieving package `%s' ..." current-filename) (sit-for 0) (copy-file (package-get-remote-filename current-dir-entry @@ -845,9 +844,7 @@ ;; Doing it with XEmacs removes the need for an external md5 program (message "Validating checksum for `%s'..." package) (sit-for 0) (with-temp-buffer - ;; What ever happened to i-f-c-literally - (let (file-name-handler-alist) - (insert-file-contents-internal full-package-filename)) + (insert-file-contents-literally full-package-filename) (if (not (string= (md5 (current-buffer)) (package-get-info-prop this-package 'md5sum))) @@ -900,7 +897,7 @@ To access fields returned from this, use `package-get-info-version' to return information about particular a -version. Use `package-get-info-find-prop' to find particular property +version. Use `package-get-info-find-prop' to find particular property from a version returned by `package-get-info-version'." (interactive "xPackage list: \nsPackage Name: ") (if which @@ -912,7 +909,7 @@ (defun package-get-info-version (package version) "In PACKAGE, return the plist associated with a particular VERSION of the package. PACKAGE is typically as returned by - `package-get-info-find-package'. If VERSION is nil, then return the + `package-get-info-find-package'. If VERSION is nil, then return the first (aka most recent) version. Use `package-get-info-find-prop' to retrieve a particular property from the value returned by this." (interactive (package-get-interactive-package-query t t)) @@ -989,7 +986,7 @@ (defun package-get-installedp (package version) "Determine if PACKAGE with VERSION has already been installed. -I'm not sure if I want to do this by searching directories or checking +I'm not sure if I want to do this by searching directories or checking some built in variables. For now, use packages-package-list." ;; Use packages-package-list which contains name and version (equal (plist-get @@ -1001,7 +998,7 @@ (defun package-get-package-provider (sym &optional force-current) "Search for a package that provides SYM and return the name and version. Searches in `package-get-base' for SYM. If SYM is a - consp, then it must match a corresponding (provide (SYM VERSION)) from + consp, then it must match a corresponding (provide (SYM VERSION)) from the package. If FORCE-CURRENT is non-nil make sure the database is up to date. This might @@ -1054,10 +1051,10 @@ (defun package-get-ever-installed-p (pkg &optional notused) (string-match "-package$" (symbol-name pkg)) - (custom-initialize-set - pkg - (if (package-get-info-find-package - packages-package-list + (custom-initialize-set + pkg + (if (package-get-info-find-package + packages-package-list (intern (substring (symbol-name pkg) 0 (match-beginning 0)))) t))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/package-info.el --- a/lisp/package-info.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/package-info.el Mon Aug 13 11:35:02 2007 +0200 @@ -48,12 +48,11 @@ ; (setq result (md5 (current-buffer)))) ; result)) +;;; APA: Stolen from package-get in package-get.el (defun pi-md5sum (file) (with-temp-buffer - (call-process "md5sum" file t) - (goto-char (point-min)) - (looking-at "[a-z0-9]+") - (buffer-substring (match-beginning 0) (match-end 0)))) + (insert-file-contents-literally file) + (md5 (current-buffer)))) (defun pi-update-key (key value) (save-excursion diff -r 72a7cfa4a488 -r abe6d1db359e lisp/package-ui.el --- a/lisp/package-ui.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/package-ui.el Mon Aug 13 11:35:02 2007 +0200 @@ -31,7 +31,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defgroup pui nil - "Conventient interface to the package system." + "Convenient interface to the package system." :group 'package-tools :tag "Package User interface" :prefix "pui-") @@ -140,12 +140,12 @@ (defun pui-directory-exists (dir) "Check to see if DIR exists in `package-get-remote'." (let (found) - (mapcar '(lambda (item) - (if (and (null (car item)) - (string-equal (file-name-as-directory (car (cdr item))) - (file-name-as-directory dir))) - (setq found t)) - ) package-get-remote) + (mapcar #'(lambda (item) + (if (and (null (car item)) + (string-equal (file-name-as-directory (car (cdr item))) + (file-name-as-directory dir))) + (setq found t))) + package-get-remote) found )) @@ -309,7 +309,7 @@ (delete pkg-sym pui-deleted-packages)) (setq pui-deleted-packages (cons pkg-sym pui-deleted-packages)) - (setq pui-seleted-packages + (setq pui-selected-packages (delete pkg-sym pui-selected-packages))) (pui-update-package-display extent pkg-sym) )) @@ -358,11 +358,8 @@ (save-window-excursion (with-output-to-temp-buffer tmpbuf (display-completion-list (sort - (mapcar '(lambda (pkg) - (symbol-name pkg) - ) - pui-deleted-packages) - 'string<) + (mapcar #'symbol-name pui-deleted-packages) + #'string<) :activate-callback nil :help-string "Packages selected for removal:\n" :completion-string t @@ -389,16 +386,12 @@ ;; errors occur, which would normally be caused by display-buffer). (save-window-excursion (with-output-to-temp-buffer tmpbuf - (display-completion-list (sort - (mapcar '(lambda (pkg) - (symbol-name pkg) - ) - pui-selected-packages) - 'string<) - :activate-callback nil - :help-string "Packages selected for installation:\n" - :completion-string t - )) + (display-completion-list + (sort (mapcar #'symbol-name pui-selected-packages) #'string<) + :activate-callback nil + :help-string "Packages selected for installation:\n" + :completion-string t + )) (setq tmpbuf (get-buffer-create tmpbuf)) (display-buffer tmpbuf) (setq do-install (y-or-n-p "Install these packages? ")) @@ -528,17 +521,6 @@ (error "No package under cursor!"))) ))) -;;; "Why is there no standard function to do this?" -(defun pui-popup-context-sensitive (event) - (interactive "e") - (save-excursion - (set-buffer (event-buffer event)) - (goto-char (event-point event)) - (popup-menu pui-menu event) - ;; I agree with dired.el - this is seriously bogus. - (while (popup-menu-up-p) - (dispatch-event (next-event))))) - (defvar pui-menu '("Packages" ["Toggle install " pui-toggle-package-key :active (pui-current-package) :suffix (format "`%s'" (or (pui-current-package) "..."))] @@ -554,6 +536,16 @@ ["Help" pui-help t] ["Quit" pui-quit t])) +;;; "Why is there no standard function to do this?" +(defun pui-popup-context-sensitive (event) + (interactive "e") + (save-excursion + (set-buffer (event-buffer event)) + (goto-char (event-point event)) + (popup-menu pui-menu event) + ;; I agree with dired.el - this is seriously bogus. + (while (popup-up-p) + (dispatch-event (next-event))))) (defun list-packages-mode () "Symbols in the leftmost column: @@ -618,67 +610,66 @@ ")) (insert sep-string) (setq start (point)) - (mapcar '(lambda (pkg) - (let (pkg-sym info version desc - b e extent current-vers disp) - (setq pkg-sym (car pkg) - info (package-get-info-version (cdr pkg) nil)) - (setq version (package-get-info-prop info 'version) - desc (package-get-info-prop info 'description)) + (mapcar + #'(lambda (pkg) + (let (pkg-sym info version desc + b e extent current-vers disp) + (setq pkg-sym (car pkg) + info (package-get-info-version (cdr pkg) nil)) + (setq version (package-get-info-prop info 'version) + desc (package-get-info-prop info 'description)) - (setq disp (pui-package-symbol-char pkg-sym - version)) - (setq b (point)) - (if pui-list-verbose - (progn - (setq current-vers (package-get-key pkg-sym :version)) - (cond - ( (not current-vers) - (setq current-vers "-----") ) - ( (stringp current-vers) - (setq current-vers - (format "%.2f" - (string-to-number current-vers))) ) - ( (numberp current-vers) - (setq current-vers (format "%.2f" current-vers)) ) - ) - (insert - (format "%s %-15s %-5.2f %-5s %s\n" - (car disp) pkg-sym - (if (stringp version) - (string-to-number version) - version) - current-vers desc)) -;; (insert -;; (format "\t\t %-12s %s\n" -;; (package-get-info-prop info 'author-version) -;; (package-get-info-prop info 'date) -;; )) - ) - (insert (format "%s %-15s %-5s %s\n" - (car disp) - pkg-sym version desc))) - (save-excursion - (setq e (progn - (forward-line -1) - (end-of-line) - (point))) - ) - (setq extent (make-extent b e)) - (if (car (cdr disp)) - (set-extent-face extent (get-face (car (cdr disp)))) - (set-extent-face extent (get-face 'default))) - (set-extent-property extent 'highlight t) - (set-extent-property extent 'pui t) - (set-extent-property extent 'pui-package pkg-sym) - (set-extent-property extent 'pui-info info) - (set-extent-property extent 'help-echo 'pui-help-echo) - (set-extent-property extent 'keymap pui-package-keymap) - )) (sort (copy-sequence package-get-base) - '(lambda (a b) - (string< (symbol-name (car a)) - (symbol-name (car b))) - ))) + (setq disp (pui-package-symbol-char pkg-sym + version)) + (setq b (point)) + (if pui-list-verbose + (progn + (setq current-vers (package-get-key pkg-sym :version)) + (cond + ( (not current-vers) + (setq current-vers "-----") ) + ( (stringp current-vers) + (setq current-vers + (format "%.2f" + (string-to-number current-vers))) ) + ( (numberp current-vers) + (setq current-vers (format "%.2f" current-vers)) ) + ) + (insert + (format "%s %-15s %-5.2f %-5s %s\n" + (car disp) pkg-sym + (if (stringp version) + (string-to-number version) + version) + current-vers desc)) + ;; (insert + ;; (format "\t\t %-12s %s\n" + ;; (package-get-info-prop info 'author-version) + ;; (package-get-info-prop info 'date))) + ) + (insert (format "%s %-15s %-5s %s\n" + (car disp) + pkg-sym version desc))) + (save-excursion + (setq e (progn + (forward-line -1) + (end-of-line) + (point)))) + (setq extent (make-extent b e)) + (if (car (cdr disp)) + (set-extent-face extent (get-face (car (cdr disp)))) + (set-extent-face extent (get-face 'default))) + (set-extent-property extent 'highlight t) + (set-extent-property extent 'pui t) + (set-extent-property extent 'pui-package pkg-sym) + (set-extent-property extent 'pui-info info) + (set-extent-property extent 'help-echo 'pui-help-echo) + (set-extent-property extent 'keymap pui-package-keymap) + )) + (sort (copy-sequence package-get-base) + #'(lambda (a b) + (string< (symbol-name (car a)) + (symbol-name (car b)))))) (insert sep-string) (insert (documentation 'list-packages-mode)) (set-buffer-modified-p nil) @@ -693,7 +684,7 @@ (add-submenu '() pui-menu) (setq mode-popup-menu pui-menu)) (clear-message) -; (message (substitute-command-keys "Press `\\[pui-help]' for help.")) + ;; (message (substitute-command-keys "Press `\\[pui-help]' for help.")) )) ;;;###autoload diff -r 72a7cfa4a488 -r abe6d1db359e lisp/packages.el --- a/lisp/packages.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/packages.el Mon Aug 13 11:35:02 2007 +0200 @@ -38,8 +38,8 @@ ;; (this goes for any package loaded before `subr.el'.) ;; ;; - not to use macros, because they are not yet available (and this -;; file must be loadable uncompiled.) This rules out CL-style -;; macros like `when', for instance. +;; file must be loadable uncompiled.) Built in macros, such as +;; `when' and `unless' are fine, of course. ;; ;; - not to use `defcustom'. If you must add user-customizable ;; variables here, use `defvar', and add the variable to @@ -350,7 +350,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))) + (site-directory (paths-find-site-directory roots base nil nil t))) (paths-uniq-append (and version-directory (list version-directory)) (and site-directory (list site-directory))))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/paths.el --- a/lisp/paths.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/paths.el Mon Aug 13 11:35:02 2007 +0200 @@ -85,16 +85,6 @@ ;Go to a local news spool if its value is nil, in which case `gnus-nntp-server' ;should be set to `(system-name)'.") -(defvar gnus-local-domain nil - "*Your domain name without a host name: for example, \"ai.mit.edu\". -The DOMAINNAME environment variable is used instead if defined. -If the function `system-name' returns a fully qualified domain name, -there is no need to set this variable.") - -(defvar gnus-local-organization nil - "*The name of your organization, as a string. -The `ORGANIZATION' environment variable is used instead if defined.") - (defvar mh-progs nil "Directory containing MH commands.") @@ -104,10 +94,6 @@ (defvar rmail-file-name (purecopy "~/RMAIL") "Name of user's primary mail file.") -(defvar gnus-startup-file (purecopy "~/.newsrc") - "The file listing groups to which user is subscribed. -Will use `gnus-startup-file'-SERVER instead if exists.") - (defconst rmail-spool-directory nil "Name of directory used by system mailer for delivering new mail. Its name should end with a slash.") diff -r 72a7cfa4a488 -r abe6d1db359e lisp/printer.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/printer.el Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,211 @@ +;;; printer.el --- support for hard-copy printing in XEmacs + +;; Copyright (C) 2000 Ben Wing. +;; Copyright (C) 2000 Kirill Katsnelson. + +;; Maintainer: XEmacs Development Team +;; Keywords: printer, printing, internal, dumped + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. + +;;; Synched up with: Not in FSF. + +;;; Authorship: + +;; Created 2000 by Ben Wing, to provide the high-level interface onto the +;; print support implemented by Kirill Katsnelson. + +;;; Commentary: + +;; This file is dumped with XEmacs. + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; generic printing code ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; #### should be named print-buffer, but that's currently in +;; lpr-buffer with some horrible definition: print-buffer == "print with +;; headings", lpr-buffer == "print without headings", and the headings are +;; generated by calling the external program "pr"! This is major stone-age +;; here! +;; +;; I propose junking that package entirely and creating a unified, +;; modern API here that will work well with modern GUI's on top of it, +;; and with various different actual implementations (e.g. lpr or the +;; pretty-print package on Unix, built-in msprinter support on +;; Windows), where the workings of a particular implementation is +;; hidden from the user and there is a consistent set of options to +;; control how to print, which works across all implementations. +;; +;; The code here is just a start and needs a huge amount of work. Probably +;; the interfaces below will change and the functions renamed. + +(defgroup printing nil + "Generic printing support." + :group 'wp) + +(defcustom printer-name nil + "*Name of printer to print to. +If nil, use default. +Under Windows, use `mswindows-printer-list' to get names of installed +printers." + :type 'string + :group 'printing) + +(defcustom printer-page-header '(date buffer-name) +"*Controls printed page header. + +#### not yet implemented. + +This can be: +- nil. Header is not printed. +- An fbound symbol or lambda expression. The function is called with + one parameter, a print-context object, every time the headers need + to be set up. It can use the function `print-context-property' to + query the properties of this object. The return value is treated as + if it was literally specified: i.e. it will be reprocessed. +- A list of up to three elements, for left, center and right portions + of the header. Each of these can be + - nil, not to print the portion + - A string, which will be printed literally. + - A predefined symbol, on of the following: + short-file-name File name only, no path + long-file-name File name with its path + buffer-name Buffer name + date Date current when printing started + time Time current when printing started + page Current printout page number, 1-based + user-id User logon id + user-name User full name + - A cons of an extent and any of the items given here. The item will + be displayed using the extent's face, begin-glyph and end-glyph + properties. + - A list, each element of which is any of the items given here. + Each element of the list is rendered in sequence. For example, + '(\"Page \" page) is rendered as \"Page 5\" on the fifth page. + - An fbound symbol or lambda expression, called with one parameter, + a print-context object, as above. The return value is treated as + if it was literally specified: i.e. it will be reprocessed." + :type 'sexp + :group 'printing) + +(defcustom printer-page-footer '(nil page) +"*Controls printed page footer. + +#### not yet implemented. + +Format is the same as `printer-page-header'." + :type 'sexp + :group 'printing) + +(defun print-context-property (print-context prop) + "Return property PROP of PRINT-CONTEXT. + +Valid properties are + +print-buffer Buffer being printed. +print-window Window on printer device containing print buffer. +print-frame Frame on printer device corresponding to current page. +print-device Device referring to printer. +printer-name Name of printer being printed to. +short-file-name File name only, no path +long-file-name File name with its path +buffer-name Buffer name +date Date current when printing started +time Time current when printing started +page Current printout page number, 1-based +user-id User logon id +user-name User full name" + (error "not yet implemented")) + +(defun generic-print-buffer (&optional buf) + "Print buffer BUF using a printing method appropriate to the O.S. being run. +Under Unix, `lpr' is normally used to spool out a no-frills version of the +buffer, or the `ps-print' package is used to pretty-print the buffer to a +PostScript printer. Under MS Windows, the built-in printing support is used. + +If BUF is nil or omitted, the current buffer is used." + (interactive) + (generic-print-region (point-min buf) (point-max buf) buf)) + +(defun generic-print-region (b e &optional buf) + "Print region using a printing method appropriate to the O.S. being run. +The region between B and E of BUF (defaults to the current buffer) is printed. + +Under Unix, `lpr' is normally used to spool out a no-frills version of the +buffer, or the `ps-print' package is used to pretty-print the buffer to a +PostScript printer. Under MS Windows, the built-in printing support is used." + (cond ((valid-specifier-tag-p 'msprinter) + (let (d f) + (setq buf (decode-buffer buf)) + (unwind-protect + (progn + (setq d (make-device 'msprinter printer-name)) + (setq f (make-frame + (list* 'name (concat (substitute ?_ ?. + (buffer-name buf)) + " - XEmacs") + '(menubar-visible-p nil + has-modeline-p nil + default-toolbar-visible-p nil + default-gutter-visible-p nil + minibuffer none + modeline-shadow-thickness 0 + vertical-scrollbar-visible-p nil + horizontal-scrollbar-visible-p nil)) + d)) + (let* ((w (frame-root-window f)) + (vertdpi (cdr (device-system-metric d 'device-dpi))) + (pixel-vertical-clip-threshold (/ vertdpi 2)) + (last-end 0) + done) + (set-window-buffer w (or buf (current-buffer))) + (set-window-start w b) + (while (not done) + (redisplay-frame f) + (print-job-eject-page f) + (let ((end (window-end w)) + (pixvis (window-last-line-visible-height w))) + ;; in case we get stuck somewhere, bow out + ;; rather than printing an infinite number of + ;; pages. #### this will fail with an image + ;; bigger than an entire page. but we really + ;; need this check here. we should be more + ;; clever in our check, to deal with this case. + (if (or (= end last-end) + ;; #### fuckme! window-end returns a value + ;; outside of the valid range of buffer + ;; positions!!! + (>= end e)) + (setq done t) + (setq last-end end) + (set-window-start w end) + (if pixvis + (save-selected-window + (select-window w) + ;; #### scroll-down should take a window arg. + (let ((window-pixel-scroll-increment pixvis)) + (scroll-down 1))))))))) + (and f (delete-frame f)) + (and d (delete-device d)) + ))) + ((and (not (eq system-type 'windows-nt)) + (fboundp 'lpr-buffer)) + (lpr-region buf)) + (t (error "No print support available")))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/process.el --- a/lisp/process.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/process.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,7 +1,7 @@ ;;; process.el --- commands for subprocesses; split out of simple.el ;; Copyright (C) 1985-7, 1993,4, 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995 Ben Wing. +;; Copyright (C) 1995, 2000 Ben Wing. ;; Author: Ben Wing ;; Maintainer: XEmacs Development Team @@ -26,6 +26,13 @@ ;;; Synched up with: FSF 19.30. +;;; Authorship: + +;; Created 1995 by Ben Wing during Mule work -- some commands split out +;; of simple.el and wrappers of *-internal functions created so they could +;; be redefined in a Mule world. +;; Lisp definition of call-process-internal added Mar. 2000 by Ben Wing. + ;;; Commentary: ;; This file is dumped with XEmacs. @@ -67,6 +74,110 @@ (start-process name buffer shell-file-name shell-command-switch (mapconcat #'identity args " "))) +(defun call-process-internal (program &optional infile buffer display &rest args) + "Call PROGRAM synchronously in separate process, with coding-system specified. +Arguments are + (PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS). +The program's input comes from file INFILE (nil means `/dev/null'). +Insert output in BUFFER before point; t means current buffer; + nil for BUFFER means discard it; 0 means discard and don't wait. +BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case, +REAL-BUFFER says what to do with standard output, as above, +while STDERR-FILE says what to do with standard error in the child. +STDERR-FILE may be nil (discard standard error output), +t (mix it with ordinary output), or a file name string. + +Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted. +Remaining arguments are strings passed as command arguments to PROGRAM. + +If BUFFER is 0, `call-process' returns immediately with value nil. +Otherwise it waits for PROGRAM to terminate and returns a numeric exit status + or a signal description string. +If you quit, the process is killed with SIGINT, or SIGKILL if you + quit again." + ;; #### remove windows-nt check when this is ready for prime time. + (if (or (noninteractive) (not (eq 'windows-nt system-type))) + (apply 'old-call-process-internal program infile buffer display args) + (let (proc inbuf errbuf discard) + (unwind-protect + (progn + (when infile + (setq infile (expand-file-name infile)) + (setq inbuf (generate-new-buffer "*call-process*")) + (with-current-buffer inbuf + ;; Make sure this works with jka-compr + (let ((file-name-handler-alist nil)) + (insert-file-contents-internal infile nil nil nil nil + 'binary)))) + (let ((stderr (if (consp buffer) (second buffer) t))) + (if (consp buffer) (setq buffer (car buffer))) + (setq buffer + (cond ((null buffer) nil) + ((eq buffer t) (current-buffer)) + ;; use integerp for compatibility with existing + ;; call-process rmsism. + ((integerp buffer) (setq discard t) nil) + (t (get-buffer-create buffer)))) + (when (and stderr (not (eq t stderr))) + (setq stderr (expand-file-name stderr)) + (setq errbuf (generate-new-buffer "*call-process*"))) + (setq proc + (apply 'start-process-internal "*call-process*" + buffer + ;#### not implemented until my new process + ;changes go in. + ;(if (eq t stderr) buffer (list buffer errbuf)) + program args)) + (if buffer + (set-marker (process-mark proc) (point buffer) buffer)) + (unwind-protect + (prog1 + (catch 'call-process-done + (when (not discard) + (set-process-sentinel + proc + #'(lambda (proc status) + (cond ((eq 'exit (process-status proc)) + (set-process-sentinel proc nil) + (throw 'call-process-done + (process-exit-status proc))) + ((eq 'signal (process-status proc)) + (set-process-sentinel proc nil) + (throw 'call-process-done status)))))) + (when inbuf + (process-send-region proc 1 + (1+ (buffer-size inbuf)) inbuf)) + (process-send-eof proc) + (when discard + ;; we're trying really really hard to emulate + ;; the old call-process. + (if errbuf + (set-process-sentinel + proc + `(lambda (proc status) + (write-region-internal + 1 (1+ (buffer-size)) + ,stderr + nil 'major-rms-kludge-city nil + coding-system-for-write)))) + (setq errbuf nil) + (setq proc nil) + (throw 'call-process-done nil)) + (while t + (accept-process-output proc) + (if display (sit-for 0)))) + (when errbuf + (with-current-buffer errbuf + (write-region-internal 1 (1+ (buffer-size)) stderr + nil 'major-rms-kludge-city nil + coding-system-for-write)))) + (if proc (set-process-sentinel proc nil))))) + (if inbuf (kill-buffer inbuf)) + (if errbuf (kill-buffer errbuf)) + (condition-case nil + (if (and proc (process-live-p proc)) (kill-process proc)) + (error nil)))))) + (defun call-process (program &optional infile buffer displayp &rest args) "Call PROGRAM synchronously in separate process. The program's input comes from file INFILE (nil means `/dev/null'). @@ -310,7 +421,7 @@ (Transmission Control Protocol) and 'udp (User Datagram Protocol) are supported. When omitted, 'tcp is assumed. -Ouput via `process-send-string' and input via buffer or filter (see +Output via `process-send-string' and input via buffer or filter (see `set-process-filter') are stream-oriented. That means UDP datagrams are not guaranteed to be sent and received in discrete packets. (But small datagrams around 500 bytes that are not truncated by `process-send-string' @@ -320,8 +431,21 @@ (defun shell-quote-argument (argument) "Quote an argument for passing as argument to an inferior shell." - (if (eq system-type 'windows-nt) - (nt-quote-process-args (list shell-file-name argument)) + (if (and (eq system-type 'windows-nt) + (let ((progname (downcase (file-name-nondirectory + shell-file-name)))) + (or (equal progname "command.com") + (equal progname "cmd.exe")))) + ;; the expectation is that you can take the result of + ;; shell-quote-argument and pass it to as an arg to + ;; (start-process shell-quote-argument ...) and have it end + ;; up as-is in the program's argv[] array. to do this, we + ;; need to protect against both the shell's and the program's + ;; quoting conventions (and our own conventions in + ;; mswindows-construct-process-command-line!). Putting quotes + ;; around shell metachars gets through the last two, and applying + ;; the normal VC runtime quoting works with practically all apps. + (mswindows-quote-one-vc-runtime-arg argument t) ;; Quote everything except POSIX filename characters. ;; This should be safe enough even for really weird shells. (let ((result "") (start 0) end) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/rect.el --- a/lisp/rect.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/rect.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,8 +1,8 @@ ;;; rect.el --- rectangle functions for XEmacs. -;; Copyright (C) 1985, 1993, 1994, 1999 Free Software Foundation, Inc. +;; Copyright (C) 1985-2000 Free Software Foundation, Inc. -;; Maintainer: Didier Verna +;; Maintainer: Didier Verna ;; Keywords: internal ;; This file is part of XEmacs. @@ -30,7 +30,7 @@ ;; in the XEmacs Reference Manual. ;; #### NOTE: this file has been almost completely rewritten by Didier Verna -;; , Jul 99. The purpose of this rewrite is to be less +;; , Jul 99. The purpose of this rewrite is to be less ;; intrusive and fill lines with whitespaces only when needed. A few functions ;; are untouched though, as noted above their definition. @@ -111,44 +111,17 @@ (forward-line 1))) )) -;; I love ascii art ;-) -(defconst spaces-strings '["" - " " - " " - " " - " " - " " - " " - " " - " "]) - -;; This function is untouched --dv -(defun spaces-string (n) - (if (<= n 8) (aref spaces-strings n) - (let ((val "")) - (while (> n 8) - (setq val (concat " " val) - n (- n 8))) - (concat val (aref spaces-strings n))))) - -;;;###autoload -(defvar killed-rectangle nil - "Rectangle for `yank-rectangle' to insert.") - -;;;###autoload -(defun kill-rectangle (start end &optional fill) - "Delete the region-rectangle and save it as the last killed one. -You might prefer to use `delete-extract-rectangle' from a program. - -When called from a program, the rectangle's corners are START and END. -With a prefix (or FILL) argument, also fill lines where nothing has to be -deleted." - (interactive "*r\nP") - (when buffer-read-only - (setq killed-rectangle (extract-rectangle start end)) - (barf-if-buffer-read-only)) - (setq killed-rectangle (delete-extract-rectangle start end fill))) +(defun delete-rectangle-line (startcol endcol fill) + (let ((pt (point-at-eol))) + (when (= (move-to-column startcol (or fill 'coerce)) startcol) + (if (and (not fill) (<= pt endcol)) + (delete-region (point) pt) + ;; else + (setq pt (point)) + (move-to-column endcol t) + (delete-region pt (point)))) + )) ;;;###autoload (defun delete-rectangle (start end &optional fill) @@ -162,27 +135,27 @@ (interactive "*r\nP") (apply-on-rectangle 'delete-rectangle-line start end fill)) -(defun delete-rectangle-line (startcol endcol fill) - (let ((pt (point-at-eol))) - (when (= (move-to-column startcol (or fill 'coerce)) startcol) - (if (and (not fill) (<= pt endcol)) - (delete-region (point) pt) - ;; else - (setq pt (point)) - (move-to-column endcol t) - (delete-region pt (point)))) - )) -;;;###autoload -(defun delete-extract-rectangle (start end &optional fill) - "Delete the contents of the rectangle with corners at START and END, and -return it as a list of strings, one for each line of the rectangle. +;; I love ascii art ;-) +(defconst spaces-strings '["" + " " + " " + " " + " " + " " + " " + " " + " "]) -With an optional FILL argument, also fill lines where nothing has to be -deleted." - (let ((lines (list nil))) - (apply-on-rectangle 'delete-extract-rectangle-line start end lines fill) - (nreverse (cdr lines)))) +;; This function is untouched --dv +(defun spaces-string (n) + (if (<= n 8) (aref spaces-strings n) + (let ((val "")) + (while (> n 8) + (setq val (concat " " val) + n (- n 8))) + (concat val (aref spaces-strings n))))) + (defun delete-extract-rectangle-line (startcol endcol lines fill) (let ((pt (point-at-eol))) @@ -197,13 +170,17 @@ )) ;;;###autoload -(defun extract-rectangle (start end) - "Return the contents of the rectangle with corners at START and END, -as a list of strings, one for each line of the rectangle." +(defun delete-extract-rectangle (start end &optional fill) + "Delete the contents of the rectangle with corners at START and END, and +return it as a list of strings, one for each line of the rectangle. + +With an optional FILL argument, also fill lines where nothing has to be +deleted." (let ((lines (list nil))) - (apply-on-rectangle 'extract-rectangle-line start end lines) + (apply-on-rectangle 'delete-extract-rectangle-line start end lines fill) (nreverse (cdr lines)))) + ;; #### NOTE: this is actually the only function that needs to do complicated ;; stuff like what's happening in `operate-on-rectangle', because the buffer ;; might be read-only. --dv @@ -236,6 +213,33 @@ (spaces-string endextra)))) (setcdr lines (cons line (cdr lines))))) +;;;###autoload +(defun extract-rectangle (start end) + "Return the contents of the rectangle with corners at START and END, +as a list of strings, one for each line of the rectangle." + (let ((lines (list nil))) + (apply-on-rectangle 'extract-rectangle-line start end lines) + (nreverse (cdr lines)))) + + +;;;###autoload +(defvar killed-rectangle nil + "Rectangle for `yank-rectangle' to insert.") + +;;;###autoload +(defun kill-rectangle (start end &optional fill) + "Delete the region-rectangle and save it as the last killed one. +You might prefer to use `delete-extract-rectangle' from a program. + +When called from a program, the rectangle's corners are START and END. +With a prefix (or FILL) argument, also fill lines where nothing has to be +deleted." + (interactive "*r\nP") + (when buffer-read-only + (setq killed-rectangle (extract-rectangle start end)) + (barf-if-buffer-read-only)) + (setq killed-rectangle (delete-extract-rectangle start end fill))) + ;; This function is untouched --dv ;;;###autoload (defun yank-rectangle () @@ -243,6 +247,7 @@ (interactive "*") (insert-rectangle killed-rectangle)) + ;; This function is untouched --dv ;;;###autoload (defun insert-rectangle (rectangle) @@ -266,6 +271,13 @@ (insert (car lines)) (setq lines (cdr lines))))) + +(defun open-rectangle-line (startcol endcol fill) + (when (= (move-to-column startcol (or fill 'coerce)) startcol) + (unless (and (not fill) + (= (point) (point-at-eol))) + (indent-to endcol)))) + ;;;###autoload (defun open-rectangle (start end &optional fill) "Blank out the region-rectangle, shifting text right. @@ -277,38 +289,33 @@ (apply-on-rectangle 'open-rectangle-line start end fill) (goto-char start)) -(defun open-rectangle-line (startcol endcol fill) - (let (spaces) - (when (= (move-to-column startcol (or fill 'coerce)) startcol) - (unless (and (not fill) - (= (point) (point-at-eol))) - (indent-to endcol))) - )) + +(defun string-rectangle-line (startcol endcol string delete) + (move-to-column startcol t) + (if delete + (delete-rectangle-line startcol endcol nil)) + (insert string)) ;;;###autoload (defun string-rectangle (start end string) "Insert STRING on each line of the region-rectangle, shifting text right. -The left edge of the rectangle specifies the column for insertion. This -command does not delete or overwrite any existing text. +The left edge of the rectangle specifies the column for insertion. + +If `pending-delete-mode' is active the string replace the region. +Otherwise this command does not delete or overwrite any existing text. When called from a program, the rectangle's corners are START and END." (interactive "*r\nsString rectangle: ") - (apply-on-rectangle 'string-rectangle-line start end string)) - -(defun string-rectangle-line (startcol endcol string) - (move-to-column startcol t) - (insert string)) + (defvar pending-delete-mode) + (apply-on-rectangle 'string-rectangle-line start end string + (and (boundp 'pending-delete-mode) pending-delete-mode))) -;;;###autoload -(defun clear-rectangle (start end &optional fill) - "Blank out the region-rectangle. -The text previously in the region is overwritten with blanks. +(defun replace-rectangle (start end string) + "Like `string-rectangle', but unconditionally replace the original region, +as if `pending-delete-mode' were active." + (interactive "*r\nsString rectangle: ") + (apply-on-rectangle 'string-rectangle-line start end string t)) -When called from a program, the rectangle's corners are START and END. -With a prefix (or FILL) argument, also fill with blanks the parts of the -rectangle which were empty." - (interactive "*r\nP") - (apply-on-rectangle 'clear-rectangle-line start end fill)) (defun clear-rectangle-line (startcol endcol fill) (let ((pt (point-at-eol)) @@ -325,6 +332,18 @@ (indent-to (+ (current-column) spaces)))) )) +;;;###autoload +(defun clear-rectangle (start end &optional fill) + "Blank out the region-rectangle. +The text previously in the region is overwritten with blanks. + +When called from a program, the rectangle's corners are START and END. +With a prefix (or FILL) argument, also fill with blanks the parts of the +rectangle which were empty." + (interactive "*r\nP") + (apply-on-rectangle 'clear-rectangle-line start end fill)) + + (provide 'rect) ;;; rect.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/replace.el --- a/lisp/replace.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/replace.el Mon Aug 13 11:35:02 2007 +0200 @@ -604,7 +604,7 @@ ;; XEmacs (defun perform-replace-next-event (event) - (if isearch-highlight + (if search-highlight (let ((aborted t)) (unwind-protect (progn diff -r 72a7cfa4a488 -r abe6d1db359e lisp/select.el --- a/lisp/select.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/select.el Mon Aug 13 11:35:02 2007 +0200 @@ -83,14 +83,14 @@ This will do nothing under anything other than X.") (defun get-selection-no-error (&optional type data-type) - "Return the value of a Windows selection. + "Return the value of a window-system selection. The argument TYPE (default `PRIMARY') says which selection, and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule) says how to convert the data. Returns NIL if there is no selection" - (condition-case err (get-selection type data-type) (t nil))) + (condition-case nil (get-selection type data-type) (t nil))) (defun get-selection (&optional type data-type) - "Return the value of a Windows selection. + "Return the value of a window-system selection. The argument TYPE (default `PRIMARY') says which selection, and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule) says how to convert the data. If there is no selection an error is signalled." @@ -105,23 +105,33 @@ (get-selection type (cdr data-type)) (signal (car err) (cdr err))))) (get-selection-internal type data-type)))) - (when (and (consp text) (symbolp (car text))) - (setq text (cdr text))) - (when (not (stringp text)) - (error "Selection is not a string: %S" text)) text)) ;; FSFmacs calls this `x-set-selection', and reverses the -;; arguments (duh ...). This order is more logical. -(defun own-selection (data &optional type) - "Make an Windows selection of type TYPE and value DATA. +;; first two arguments (duh ...). This order is more logical. +(defun own-selection (data &optional type how-to-add data-type) + "Make a window-system selection of type TYPE and value DATA. The argument TYPE (default `PRIMARY') says which selection, -and DATA specifies the contents. DATA may be a string, -a symbol, an integer (or a cons of two integers or list of two integers). +and DATA specifies the contents. DATA may be any lisp data type +that can be converted using the function corresponding to DATA-TYPE +in `select-converter-alist'---strings are the usual choice, but +other types may be permissible depending on the DATA-TYPE parameter +(if DATA-TYPE is not supplied, the default behavior is window +system specific, but strings are always accepted). +HOW-TO-ADD may be any of the following: + + 'replace-all or nil -- replace all data in the selection. + 'replace-existing -- replace data for specified DATA-TYPE only. + 'append or t -- append data to existing DATA-TYPE data. + +DATA-TYPE is the window-system specific data type identifier +(see `register-selection-data-type' for more information). The selection may also be a cons of two markers pointing to the same buffer, or an overlay. In these cases, the selection is considered to be the text -between the markers *at whatever time the selection is examined*. +between the markers *at whatever time the selection is examined* (note +that the window system clipboard does not necessarily duplicate this +behavior - it doesn't on mswindows for example). Thus, editing done in the buffer after you specify the selection can alter the effective value of the selection. @@ -131,36 +141,32 @@ (interactive (if (not current-prefix-arg) (list (read-string "Store text for pasting: ")) (list (substring (region-beginning) (region-end))))) - ;FSFmacs huh?? It says: - ;; "This is for temporary compatibility with pre-release Emacs 19." - ;(if (stringp type) - ; (setq type (intern type))) - (or (valid-simple-selection-p data) - (and (vectorp data) - (let ((valid t) - (i (1- (length data)))) - (while (>= i 0) - (or (valid-simple-selection-p (aref data i)) - (setq valid nil)) - (setq i (1- i))) - valid)) - (signal 'error (list "invalid selection" data))) - (or type (setq type 'PRIMARY)) - (if (null data) - (disown-selection-internal type) - (own-selection-internal type data) - (when (and (eq type 'PRIMARY) - selection-sets-clipboard) - (own-selection-internal 'CLIPBOARD data))) - (cond ((eq type 'PRIMARY) - (setq primary-selection-extent - (select-make-extent-for-selection - data primary-selection-extent))) - ((eq type 'SECONDARY) - (setq secondary-selection-extent - (select-make-extent-for-selection - data secondary-selection-extent)))) - (setq zmacs-region-stays t) + ;; calling own-selection-internal will mess this up, so preserve it. + (let ((zmacs-region-stays zmacs-region-stays)) + ;FSFmacs huh?? It says: + ;; "This is for temporary compatibility with pre-release Emacs 19." + ;(if (stringp type) + ; (setq type (intern type))) + (or type (setq type 'PRIMARY)) + (if (null data) + (disown-selection-internal type) + (own-selection-internal type data how-to-add data-type) + (when (and (eq type 'PRIMARY) + selection-sets-clipboard) + (own-selection-internal 'CLIPBOARD data how-to-add data-type))) + (cond ((eq type 'PRIMARY) + (setq primary-selection-extent + (select-make-extent-for-selection + data primary-selection-extent))) + ((eq type 'SECONDARY) + (setq secondary-selection-extent + (select-make-extent-for-selection + data secondary-selection-extent))))) + ;; zmacs-region-stays is for commands, not low-level functions. + ;; when behaving as the latter, we better not set it, or we will + ;; cause unwanted sticky-region behavior in kill-region and friends. + (if (interactive-p) + (setq zmacs-region-stays t)) data) (defun dehilight-selection (selection) @@ -184,8 +190,9 @@ (setq lost-selection-hooks 'dehilight-selection) -(defun own-clipboard (string) - "Paste the given string to the window system Clipboard." +(defun own-clipboard (string &optional push) + "Paste the given string to the window system Clipboard. +See `interprogram-cut-function' for more information." (own-selection string 'CLIPBOARD)) (defun disown-selection (&optional secondary-p) @@ -289,6 +296,9 @@ ;; moved from x-select.el (defun valid-simple-selection-p (data) + "An obsolete function that tests whether something was a valid simple +selection using the old XEmacs selection support. You shouldn't use this +any more, because just about anything could be a valid selection now." (or (stringp data) ;FSFmacs huh?? (symbolp data) (integerp data) @@ -350,11 +360,40 @@ (disown-selection nil) ))) + ;;; Functions to convert the selection into various other selection -;;; types. Every selection type that emacs handles is implemented -;;; this way, except for TIMESTAMP, which is a special case. These are -;;; all moved from x-select.el +;;; types. + +;; These next three functions get called by C code... +(defun select-convert-in (selection type value) + "Attempt to convert the specified external VALUE to the specified DATA-TYPE, +for the specified SELECTION. Return nil if this is impossible, or a +suitable internal representation otherwise." + (when value + (let ((handler-fn (cdr (assq type selection-converter-in-alist)))) + (when handler-fn + (apply handler-fn (list selection type value)))))) +(defun select-convert-out (selection type value) + "Attempt to convert the specified internal VALUE for the specified DATA-TYPE +and SELECTION. Return nil if this is impossible, or a suitable external +representation otherwise." + (when value + (let ((handler-fn (cdr (assq type selection-converter-out-alist)))) + (when handler-fn + (apply handler-fn (list selection type value)))))) + +(defun select-coerce (selection type value) + "Attempt to convert the specified internal VALUE to a representation +suitable for return from `get-selection' in the specified DATA-TYPE. Return +nil if this is impossible, or a suitable representation otherwise." + (when value + (let ((handler-fn (cdr (assq type selection-coercion-alist)))) + (when handler-fn + (apply handler-fn (list selection type value)))))) + +;; The rest of the functions on this "page" are conversion handlers, +;; append handlers and buffer-kill handlers. (defun select-convert-to-text (selection type value) (cond ((stringp value) value) @@ -380,9 +419,17 @@ (buffer-substring (car value) (cdr value))))) (t nil))) +(defun select-coerce-to-text (selection type value) + (select-convert-to-text selection type value)) + +(defun select-convert-from-text (selection type value) + (when (stringp value) + value)) + (defun select-convert-to-string (selection type value) (let ((outval (select-convert-to-text selection type value))) - ;; force the string to be not in Compound Text format. + ;; force the string to be not in Compound Text format. This grubby + ;; hack will go soon, to be replaced by a more general mechanism. (if (stringp outval) (cons 'STRING outval) outval))) @@ -410,6 +457,9 @@ (cons (ash value -16) (logand value 65535)) nil))) +(defun select-convert-from-length (selection type value) + (select-convert-to-length selection type value)) + (defun select-convert-to-targets (selection type value) ;; return a vector of atoms, but remove duplicates first. (let* ((all (cons 'TIMESTAMP (mapcar 'car selection-converter-alist))) @@ -417,8 +467,6 @@ (while rest (cond ((memq (car rest) (cdr rest)) (setcdr rest (delq (car rest) (cdr rest)))) - ((eq (car (cdr rest)) '_EMACS_INTERNAL) ; shh, it's a secret - (setcdr rest (cdr (cdr rest)))) (t (setq rest (cdr rest))))) (apply 'vector all))) @@ -441,6 +489,10 @@ (error "selection is in a killed buffer")))) (t nil))) +(defun select-convert-from-filename (selection type value) + (when (stringp value) + value)) + (defun select-convert-to-charpos (selection type value) (let (a b tmp) (cond ((cond ((extentp value) @@ -546,7 +598,7 @@ (user-full-name)) (defun select-convert-to-class (selection type size) - x-emacs-application-class) + (symbol-value 'x-emacs-application-class)) ;; We do not try to determine the name Emacs was invoked with, ;; because it is not clean for a program's behavior to depend on that. @@ -558,13 +610,139 @@ (and (integerp value) (cons (ash value -16) (logand value 65535)))) +;; Can convert from the following integer representations +;; +;; integer +;; (integer . integer) +;; (integer integer) +;; (list [integer|(integer . integer)]*) +;; (vector [integer|(integer . integer)]*) +;; +;; Cons'd integers get cleaned up a little. + +(defun select-convert-from-integer (selection type value) + (cond ((integerp value) ; Integer + value) + + ((and (consp value) ; (integer . integer) + (integerp (car value)) + (integerp (cdr value))) + (if (eq (car value) 0) + (cdr value) + (if (and (eq (car value) -1) + (< (cdr value) 0)) + (cdr value) + value))) + + ((and (listp value) ; (integer integer) + (eq (length value) 2) + (integerp (car value)) + (integerp (cadr value))) + (if (eq (car value) 0) + (cadr value) + (if (and (eq (car value) -1) + (< (cdr value) 0)) + (- (cadr value)) + (cons (car value) (cadr value))))) + + ((listp value) ; list + (if (cdr value) + (mapcar '(lambda (x) + (select-convert-from-integer selection type x)) + value) + (select-convert-from-integer selection type (car value)))) + + ((vectorp value) ; vector + (if (eq (length value) 1) + (select-convert-from-integer selection type (aref value 0)) + (mapvector '(lambda (x) + (select-convert-from-integer selection type x)) + value))) + + (t nil) + )) + (defun select-convert-to-atom (selection type value) (and (symbolp value) value)) -(defun select-convert-to-identity (selection type value) ; used internally - (vector value)) +;;; CF_xxx conversions +(defun select-convert-from-cf-text (selection type value) + (replace-in-string (if (string-match "\0" value) + (substring value 0 (match-beginning 0)) + value) + "\\(\r\n\\|\n\r\\)" "\n" t)) + +(defun select-convert-to-cf-text (selection type value) + (let ((text (select-convert-to-text selection type value))) + (concat (replace-in-string text "\n" "\r\n" t) "\0"))) + +;;; Appenders +(defun select-append-to-text (selection type value1 value2) + (let ((text1 (select-convert-to-text selection 'STRING value1)) + (text2 (select-convert-to-text selection 'STRING value2))) + (if (and text1 text2) + (concat text1 text2) + nil))) + +(defun select-append-to-string (selection type value1 value2) + (select-append-to-text selection type value1 value2)) + +(defun select-append-to-compound-text (selection type value1 value2) + (select-append-to-text selection type value1 value2)) + +(defun select-append-to-cf-text (selection type value1 value2) + (let ((text1 (select-convert-from-cf-text selection 'CF_TEXT value1)) + (text2 (select-convert-from-cf-text selection 'CF_TEXT value2))) + (if (and text1 text2) + (select-convert-to-cf-text selection type (concat text1 text2)) + nil))) -(setq selection-converter-alist +(defun select-append-default (selection type value1 value2) +;; This appender gets used if the type is "nil" - i.e. default. +;; It should probably have more cases implemented than it does - e.g. +;; appending numbers to strings, etc... + (cond ((and (stringp value1) (stringp value2)) + (select-append-to-string selection 'STRING value1 value2)) + (t nil))) + +;;; Buffer kill handlers + +(defun select-buffer-killed-default (selection type value buffer) +;; This handler gets used if the type is "nil". + (cond ((extentp value) + (if (eq (extent-object value) buffer) + ; If this selection is on the clipboard, grab it quick + (when (eq selection 'CLIPBOARD) + (save-excursion + (set-buffer (extent-object value)) + (save-restriction + (widen) + (buffer-substring (extent-start-position value) + (extent-end-position value))))) + value)) + ((markerp value) + (unless (eq (marker-buffer value) buffer) + value)) + ((and (consp value) + (markerp (car value)) + (markerp (cdr value))) + (if (or (eq (marker-buffer (car value)) buffer) + (eq (marker-buffer (cdr value)) buffer)) + ; If this selection is on the clipboard, grab it quick + (when (eq selection 'CLIPBOARD) + (save-excursion + (set-buffer (marker-buffer (car value))) + (save-restriction + (widen) + (buffer-substring (car value) (cdr value))))) + value)) + (t value))) + +(defun select-buffer-killed-text (selection type value buffer) + (select-buffer-killed-default selection type value buffer)) + +;; Types listed in here can be selections of XEmacs +(setq selection-converter-out-alist '((TEXT . select-convert-to-text) (STRING . select-convert-to-string) (COMPOUND_TEXT . select-convert-to-compound-text) @@ -583,7 +761,62 @@ (NAME . select-convert-to-name) (ATOM . select-convert-to-atom) (INTEGER . select-convert-to-integer) - (_EMACS_INTERNAL . select-convert-to-identity) + (CF_TEXT . select-convert-to-cf-text) + )) + +;; Types listed here can be selections foreign to XEmacs +(setq selection-converter-in-alist + '(; Specific types that get handled by generic converters + (COMPOUND_TEXT . select-convert-from-text) + (SOURCE_LOC . select-convert-from-text) + (OWNER_OS . select-convert-from-text) + (HOST_NAME . select-convert-from-text) + (USER . select-convert-from-text) + (CLASS . select-convert-from-text) + (NAME . select-convert-from-text) + ; Generic types + (INTEGER . select-convert-from-integer) + (TEXT . select-convert-from-text) + (STRING . select-convert-from-text) + (LENGTH . select-convert-from-length) + (FILE_NAME . select-convert-from-filename) + (CF_TEXT . select-convert-from-cf-text) )) +;; Types listed here have special coercion functions that can munge +;; other types. This can also be used to add special features - e.g. +;; being able to pass a region or a cons of markers to own-selection, +;; but getting the *current* text in the region back when calling +;; get-selection. +;; +;; Any function listed in here *will be called* whenever a value of +;; its type is retrieved from the internal selection cache, or when +;; no suitable values could be found in which case XEmacs looks for +;; values with types listed in selection-coercible-types. +(setq selection-coercion-alist + '((TEXT . select-coerce-to-text) + (STRING . select-coerce-to-text) + (COMPOUND_TEXT . select-coerce-to-text) + (CF_TEXT . select-coerce-to-text))) + +;; Types listed here can be appended by own-selection +(setq selection-appender-alist + '((nil . select-append-default) + (TEXT . select-append-to-text) + (STRING . select-append-to-string) + (COMPOUND_TEXT . select-append-to-compound-text) + (CF_TEXT . select-append-to-cf-text) + )) + +;; Types listed here have buffer-kill handlers +(setq selection-buffer-killed-alist + '((nil . select-buffer-killed-default) + (TEXT . select-buffer-killed-text) + (STRING . select-buffer-killed-text) + (COMPOUND_TEXT . select-buffer-killed-text) + (CF_TEXT . select-buffer-killed-text))) + +;; Lists of types that are coercible (can be converted to other types) +(setq selection-coercible-types '(TEXT STRING COMPOUND_TEXT)) + ;;; select.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/setup-paths.el --- a/lisp/setup-paths.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/setup-paths.el Mon Aug 13 11:35:02 2007 +0200 @@ -143,23 +143,6 @@ "Find the documentation directory." (paths-find-architecture-directory roots "lib-src" nil configure-doc-directory)) -(defun paths-find-lock-directory (roots) - "Find the lock directory." - (defvar configure-lock-directory) - (paths-find-site-directory roots "lock" "EMACSLOCKDIR" configure-lock-directory)) - -(defun paths-find-superlock-file (lock-directory) - "Find the superlock file." - ;; #### There is no such variable configure-superlock-file! - (cond - ((null lock-directory) - nil) - ((and configure-superlock-file - (file-directory-p (file-name-directory configure-superlock-file))) - configure-superlock-file) - (t - (expand-file-name "!!!SuperLock!!!" lock-directory)))) - (defun paths-find-exec-directory (roots) "Find the binary directory." (paths-find-architecture-directory roots "lib-src" diff -r 72a7cfa4a488 -r abe6d1db359e lisp/simple.el --- a/lisp/simple.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/simple.el Mon Aug 13 11:35:02 2007 +0200 @@ -2,6 +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 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: lisp, extensions, internal, dumped @@ -718,9 +719,18 @@ (message "Line %d" buffer-line))))))) (setq zmacs-region-stays t)) -;;; Bob Weiner, Altrasoft, 02/12/1998 -;;; Added the 3rd arg in `count-lines' to conditionalize the counting of -;;; collapsed lines. +;; new in XEmacs 21.2 (not in FSF). +(defun line-number (&optional pos respect-narrowing) + "Return the line number of POS (defaults to point). +If RESPECT-NARROWING is non-nil, then the narrowed line number is returned; +otherwise, the absolute line number is returned. The returned line can always +be given to `goto-line' to get back to the current line." + (if (and pos (/= pos (point))) + (save-excursion + (goto-char pos) + (line-number nil respect-narrowing)) + (1+ (count-lines (if respect-narrowing (point-min) 1) (point-at-bol))))) + (defun count-lines (start end &optional ignore-invisible-lines-flag) "Return number of lines between START and END. This is usually the number of newlines between them, @@ -728,7 +738,13 @@ and the greater of them is not at the start of a line. With optional IGNORE-INVISIBLE-LINES-FLAG non-nil, lines collapsed with -selective-display are excluded from the line count." +selective-display are excluded from the line count. + +NOTE: The expression to return the current line number is not obvious: + +(1+ (count-lines 1 (point-at-bol))) + +See also `line-number'." (save-excursion (save-restriction (narrow-to-region start end) @@ -1087,22 +1103,50 @@ (skip-chars-forward " \t")) (defcustom kill-whole-line nil - "*If non-nil, `kill-line' with no arg at beg of line kills the whole line." - :type 'boolean + "*Control when and whether `kill-line' removes entire lines. +Note: This only applies when `kill-line' is called interactively; +otherwise, it behaves \"historically\". + +If `always', `kill-line' with no arg always kills the whole line, +wherever point is in the line. (If you want to just kill to the end +of the line, use \\[historical-kill-line].) + +If not `always' but non-nil, `kill-line' with no arg kills the whole +line if point is at the beginning, and otherwise behaves historically. + +If nil, `kill-line' behaves historically." + :type '(radio (const :tag "Kill to end of line" nil) + (const :tag "Kill whole line" always) + (const + :tag "Kill whole line at beginning, otherwise end of line" t)) :group 'killing) +(defun historical-kill-line (&optional arg) + "Same as `kill-line' but ignores value of `kill-whole-line'." + (interactive "*P") + (let ((kill-whole-line nil)) + (if (interactive-p) + (call-interactively 'kill-line) + (kill-line arg)))) + (defun kill-line (&optional arg) - "Kill the rest of the current line; if no nonblanks there, kill thru newline. + "Kill the rest of the current line, or the entire line. +If no nonblanks there, kill thru newline. +If called interactively, may kill the entire line; see `kill-whole-line'. +when given no argument at the beginning of a line. With prefix argument, kill that many lines from point. Negative arguments kill lines backward. When calling from a program, nil means \"no arg\", -a number counts as a prefix arg. - -If `kill-whole-line' is non-nil, then kill the whole line -when given no argument at the beginning of a line." +a number counts as a prefix arg." (interactive "*P") - (kill-region (point) + (kill-region (if (and (interactive-p) + (not arg) + (eq kill-whole-line 'always)) + (save-excursion + (beginning-of-line) + (point)) + (point)) ;; Don't shift point before doing the delete; that way, ;; undo will record the right position of point. ;; FSF @@ -1117,7 +1161,10 @@ (forward-line (prefix-numeric-value arg)) (if (eobp) (signal 'end-of-buffer nil)) - (if (or (looking-at "[ \t]*$") (and kill-whole-line (bolp))) + (if (or (looking-at "[ \t]*$") + (and (interactive-p) + (or (eq kill-whole-line 'always) + (and kill-whole-line (bolp))))) (forward-line 1) (end-of-line))) (point)))) @@ -1154,7 +1201,7 @@ ;;; the cut buffers. I'm afraid to change interface of `kill-hooks', ;;; so I add it. (1997-11-03 by MORIOKA Tomohiko) -(defvar interprogram-cut-function nil +(defcustom interprogram-cut-function 'own-clipboard "Function to call to make a killed region available to other programs. Most window systems provide some sort of facility for cutting and @@ -1167,9 +1214,15 @@ The first argument, TEXT, is a string containing the text which should be made available. The second, PUSH, if non-nil means this is a \"new\" kill; -nil means appending to an \"old\" kill.") - -(defvar interprogram-paste-function nil +nil means appending to an \"old\" kill." + :type '(radio (function-item :tag "Send to Clipboard" + :format "%t\n" + own-clipboard) + (const :tag "None" nil) + (function :tag "Other")) + :group 'killing) + +(defcustom interprogram-paste-function 'get-clipboard "Function to call to get text cut from other programs. Most window systems provide some sort of facility for cutting and @@ -1187,7 +1240,13 @@ most recent string, the function should return nil. If it is difficult to tell whether Emacs or some other program provided the current string, it is probably good enough to return nil if the string -is equal (according to `string=') to the last text Emacs provided.") +is equal (according to `string=') to the last text Emacs provided." + :type '(radio (function-item :tag "Get from Clipboard" + :format "%t\n" + get-clipboard) + (const :tag "None" nil) + (function :tag "Other")) + :group 'killing) ;;;; The kill ring data structure. @@ -1623,10 +1682,71 @@ ; (set-marker (mark-marker) nil))) (defvar mark-ring nil - "The list of former marks of the current buffer, most recent first.") + "The list of former marks of the current buffer, most recent first. +This variable is automatically buffer-local.") (make-variable-buffer-local 'mark-ring) (put 'mark-ring 'permanent-local t) +(defvar dont-record-current-mark nil + "If set to t, the current mark value should not be recorded on the mark ring. +This is set by commands that manipulate the mark incidentally, to avoid +cluttering the mark ring unnecessarily. Under most circumstances, you do +not need to set this directly; it is automatically reset each time +`push-mark' is called, according to `mark-ring-unrecorded-commands'. This +variable is automatically buffer-local.") +(make-variable-buffer-local 'dont-record-current-mark) +(put 'dont-record-current-mark 'permanent-local t) + +;; a conspiracy between push-mark and handle-pre-motion-command +(defvar in-shifted-motion-command nil) + +(defcustom mark-ring-unrecorded-commands '(shifted-motion-commands + yank + mark-beginning-of-buffer + mark-bob + mark-defun + mark-end-of-buffer + mark-end-of-line + mark-end-of-sentence + mark-eob + mark-marker + mark-page + mark-paragraph + mark-sexp + mark-whole-buffer + mark-word) + "*List of commands whose marks should not be recorded on the mark stack. +Many commands set the mark as part of their action. Normally, all such +marks get recorded onto the mark stack. However, this tends to clutter up +the mark stack unnecessarily. You can control this by putting a command +onto this list. Then, any marks set by the function will not be recorded. + +The special value `shifted-motion-commands' causes marks set as a result +of selection using any shifted motion commands to not be recorded. + +The value `yank' affects all yank-like commands, as well as just `yank'." + :type '(repeat (choice (const :tag "shifted motion commands" + 'shifted-motion-commands) + (const :tag "functions that select text" + :inline t + '(mark-beginning-of-buffer + mark-bob + mark-defun + mark-end-of-buffer + mark-end-of-line + mark-end-of-sentence + mark-eob + mark-marker + mark-page + mark-paragraph + mark-sexp + mark-whole-buffer + mark-word)) + (const :tag "functions that paste text" + 'yank) + function)) + :group 'killing) + (defcustom mark-ring-max 16 "*Maximum size of mark ring. Start discarding off end if gets this big." :type 'integer @@ -1648,6 +1768,14 @@ With argument, jump to mark, and pop a new position for mark off the ring \(does not affect global mark ring\). +The mark ring is a per-buffer stack of marks, most recent first. Its +maximum length is controlled by `mark-ring-max'. Generally, when new +marks are set, the current mark is pushed onto the stack. You can pop +marks off the stack using \\[universal-argument] \\[set-mark-command]. The term \"ring\" is used because when +you pop a mark off the stack, the current mark value is pushed onto the +far end of the stack. If this is confusing, just think of the mark ring +as a stack. + Novice Emacs Lisp programmers often try to use the mark for the wrong purposes. See the documentation of `set-mark' for more information." (interactive "P") @@ -1655,6 +1783,7 @@ (push-mark nil nil t) (if (null (mark t)) (error "No mark set in this buffer") + (if dont-record-current-mark (pop-mark)) (goto-char (mark t)) (pop-mark)))) @@ -1669,7 +1798,7 @@ Novice Emacs Lisp programmers often try to use the mark for the wrong purposes. See the documentation of `set-mark' for more information." (setq buffer (decode-buffer buffer)) ; XEmacs - (if (null (mark t buffer)) ; XEmacs + (if (or dont-record-current-mark (null (mark t buffer))) ; XEmacs nil ;; The save-excursion / set-buffer is necessary because mark-ring ;; is a buffer local variable @@ -1683,8 +1812,9 @@ (set-mark (or location (point buffer)) buffer) ; (set-marker (mark-marker) (or location (point)) (current-buffer)) ; FSF ;; Now push the mark on the global mark ring. - (if (or (null global-mark-ring) - (not (eq (marker-buffer (car global-mark-ring)) buffer))) + (if (and (not dont-record-current-mark) + (or (null global-mark-ring) + (not (eq (marker-buffer (car global-mark-ring)) buffer)))) ;; The last global mark pushed wasn't in this same buffer. (progn (setq global-mark-ring (cons (copy-marker (mark-marker t buffer)) @@ -1694,7 +1824,13 @@ (move-marker (car (nthcdr global-mark-ring-max global-mark-ring)) nil buffer) (setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil))))) - (or nomsg executing-kbd-macro (> (minibuffer-depth) 0) + (setq dont-record-current-mark + (not (not (or (and in-shifted-motion-command + (memq 'shifted-motion-commands + mark-ring-unrecorded-commands)) + (memq this-command mark-ring-unrecorded-commands))))) + (or dont-record-current-mark nomsg executing-kbd-macro + (> (minibuffer-depth) 0) (display-message 'command "Mark set")) (if activate-region (progn @@ -1804,6 +1940,54 @@ :type 'boolean :group 'editing-basics) +(defcustom shifted-motion-keys-select-region t + "*If non-nil, shifted motion keys select text, like in MS Windows. +See also `unshifted-motion-keys-deselect-region'." + :type 'boolean + :group 'editing-basics) + +(defcustom unshifted-motion-keys-deselect-region t + "*If non-nil, unshifted motion keys deselect a shifted-motion region. +This only occurs after a region has been selected using shifted motion keys +(not when using the traditional set-mark-then-move method), and has no effect +if `shifted-motion-keys-select-region' is nil." + :type 'boolean + :group 'editing-basics) + +(defun handle-pre-motion-command-current-command-is-motion () + (and (key-press-event-p last-input-event) + (memq (event-key last-input-event) + '(left right up down home end prior next + kp-left kp-right kp-up kp-down + kp-home kp-end kp-prior kp-next)))) + +(defun handle-pre-motion-command () + (if + (and + (handle-pre-motion-command-current-command-is-motion) + zmacs-regions + shifted-motion-keys-select-region + (not (region-active-p)) + (memq 'shift (event-modifiers last-input-event))) + (let ((in-shifted-motion-command t)) + (push-mark nil nil t)))) + +(defun handle-post-motion-command () + (if + (and + (handle-pre-motion-command-current-command-is-motion) + zmacs-regions + (region-active-p)) + (cond ((memq 'shift (event-modifiers last-input-event)) + (if shifted-motion-keys-select-region + (putf this-command-properties 'shifted-motion-command t)) + (setq zmacs-region-stays t)) + ((and (getf last-command-properties 'shifted-motion-command) + unshifted-motion-keys-deselect-region) + (setq zmacs-region-stays nil)) + (t + (setq zmacs-region-stays t))))) + (defun forward-char-command (&optional arg buffer) "Move point right ARG characters (left if ARG negative) in BUFFER. On attempt to pass end of buffer, stop and signal `end-of-buffer'. @@ -1832,6 +2016,17 @@ (beginning-of-buffer nil) (end-of-buffer nil)))) +(defun scroll-up-one () + "Scroll text of current window upward one line. +On attempt to scroll past end of buffer, `end-of-buffer' is signaled. +On attempt to scroll past beginning of buffer, `beginning-of-buffer' is +signaled. + +If `signal-error-on-buffer-boundary' is nil, attempts to scroll past buffer +boundaries do not cause an error to be signaled." + (interactive "_") + (scroll-up-command 1)) + (defun scroll-up-command (&optional n) "Scroll text of current window upward ARG lines; or near full screen if no ARG. A near full screen is `next-screen-context-lines' less than a full screen. @@ -1851,6 +2046,17 @@ (beginning-of-buffer nil) (end-of-buffer nil)))) +(defun scroll-down-one () + "Scroll text of current window downward one line. +On attempt to scroll past end of buffer, `end-of-buffer' is signaled. +On attempt to scroll past beginning of buffer, `beginning-of-buffer' is +signaled. + +If `signal-error-on-buffer-boundary' is nil, attempts to scroll past buffer +boundaries do not cause an error to be signaled." + (interactive "_") + (scroll-down-command 1)) + (defun scroll-down-command (&optional n) "Scroll text of current window downward ARG lines; or near full screen if no ARG. A near full screen is `next-screen-context-lines' less than a full screen. @@ -1889,7 +2095,7 @@ If you are thinking of using this in a Lisp program, consider using `forward-line' instead. It is usually easier to use and more reliable (no dependence on goal column, etc.)." - (interactive "_p") ; XEmacs + (interactive "_p") (if (and next-line-add-newlines (= arg 1)) (let ((opoint (point))) (end-of-line) @@ -1920,7 +2126,7 @@ If you are thinking of using this in a Lisp program, consider using `forward-line' with a negative argument instead. It is usually easier to use and more reliable (no dependence on goal column, etc.)." - (interactive "_p") ; XEmacs + (interactive "_p") (if (interactive-p) (condition-case nil (line-move (- arg)) @@ -1930,6 +2136,25 @@ (line-move (- arg))) nil) +(defcustom block-movement-size 6 + "*Number of lines that \"block movement\" commands (\\[forward-block-of-lines], \\[backward-block-of-lines]) move by." + :type 'integer + :group 'editing-basics) + +(defun backward-block-of-lines () + "Move backward by one \"block\" of lines. +The number of lines that make up a block is controlled by +`block-movement-size', which defaults to 6." + (interactive "_") + (forward-line (- block-movement-size))) + +(defun forward-block-of-lines () + "Move forward by one \"block\" of lines. +The number of lines that make up a block is controlled by +`block-movement-size', which defaults to 6." + (interactive "_") + (forward-line block-movement-size)) + (defcustom track-eol nil "*Non-nil means vertical motion starting at end of line keeps to ends of lines. This means moving to the end of each line moved onto. @@ -2168,67 +2393,86 @@ (forward-line arg))) arg)) -(eval-when-compile - ;; avoid byte-compiler warnings... - (defvar start1) - (defvar start2) - (defvar end1) - (defvar end2)) - -; start[12] and end[12] used in transpose-subr-1 below +(defun transpose-line-up (arg) + "Move current line one line up, leaving point at beginning of that line. +This can be run repeatedly to move to current line up a number of lines." + (interactive "*p") + ;; Move forward over a line, + ;; but create a newline if none exists yet. + (end-of-line) + (if (eobp) + (newline) + (forward-char 1)) + (transpose-lines (- arg)) + (forward-line -1)) + +(defun transpose-line-down (arg) + "Move current line one line down, leaving point at beginning of that line. +This can be run repeatedly to move to current line down a number of lines." + (interactive "*p") + ;; Move forward over a line, + ;; but create a newline if none exists yet. + (end-of-line) + (if (eobp) + (newline) + (forward-char 1)) + (transpose-lines arg) + (forward-line -1)) + (defun transpose-subr (mover arg) (let (start1 end1 start2 end2) - (if (= arg 0) - (progn - (save-excursion - (funcall mover 1) - (setq end2 (point)) - (funcall mover -1) - (setq start2 (point)) - (goto-char (mark t)) ; XEmacs - (funcall mover 1) - (setq end1 (point)) - (funcall mover -1) - (setq start1 (point)) - (transpose-subr-1)) - (exchange-point-and-mark t))) ; XEmacs - (while (> arg 0) - (funcall mover -1) - (setq start1 (point)) - (funcall mover 1) - (setq end1 (point)) - (funcall mover 1) - (setq end2 (point)) - (funcall mover -1) - (setq start2 (point)) - (transpose-subr-1) - (goto-char end2) - (setq arg (1- arg))) - (while (< arg 0) - (funcall mover -1) - (setq start2 (point)) - (funcall mover -1) - (setq start1 (point)) - (funcall mover 1) - (setq end1 (point)) - (funcall mover 1) - (setq end2 (point)) - (transpose-subr-1) - (setq arg (1+ arg))))) - -; start[12] and end[12] used free -(defun transpose-subr-1 () - (if (> (min end1 end2) (max start1 start2)) - (error "Don't have two things to transpose")) - (let ((word1 (buffer-substring start1 end1)) - (word2 (buffer-substring start2 end2))) - (delete-region start2 end2) - (goto-char start2) - (insert word1) - (goto-char (if (< start1 start2) start1 - (+ start1 (- (length word1) (length word2))))) - (delete-char (length word1)) - (insert word2))) + ;; XEmacs -- use flet instead of defining a separate function and + ;; relying on dynamic scope!!! + (flet ((transpose-subr-1 () + (if (> (min end1 end2) (max start1 start2)) + (error "Don't have two things to transpose")) + (let ((word1 (buffer-substring start1 end1)) + (word2 (buffer-substring start2 end2))) + (delete-region start2 end2) + (goto-char start2) + (insert word1) + (goto-char (if (< start1 start2) start1 + (+ start1 (- (length word1) (length word2))))) + (delete-char (length word1)) + (insert word2)))) + (if (= arg 0) + (progn + (save-excursion + (funcall mover 1) + (setq end2 (point)) + (funcall mover -1) + (setq start2 (point)) + (goto-char (mark t)) ; XEmacs + (funcall mover 1) + (setq end1 (point)) + (funcall mover -1) + (setq start1 (point)) + (transpose-subr-1)) + (exchange-point-and-mark t))) ; XEmacs + (while (> arg 0) + (funcall mover -1) + (setq start1 (point)) + (funcall mover 1) + (setq end1 (point)) + (funcall mover 1) + (setq end2 (point)) + (funcall mover -1) + (setq start2 (point)) + (transpose-subr-1) + (goto-char end2) + (setq arg (1- arg))) + (while (< arg 0) + (funcall mover -1) + (setq start2 (point)) + (funcall mover -1) + (setq start1 (point)) + (funcall mover 1) + (setq end1 (point)) + (funcall mover 1) + (setq end2 (point)) + (transpose-subr-1) + (setq arg (1+ arg)))))) + (defcustom comment-column 32 "*Column to indent right-margin comments to. @@ -3148,7 +3392,6 @@ ;Turned off because it makes dbx bomb out. (setq blink-paren-function 'blink-matching-open) -(eval-when-compile (defvar myhelp)) ; suppress compiler warning ;; XEmacs: Some functions moved to cmdloop.el: ;; keyboard-quit @@ -3166,6 +3409,10 @@ element)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; mail composition code ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defcustom mail-user-agent 'sendmail-user-agent "*Your preference for a mail composition package. Various Emacs Lisp packages (e.g. reporter) require you to compose an @@ -3311,6 +3558,10 @@ 'switch-to-buffer-other-frame yank-action send-actions)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; set variable ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defun set-variable (var val) "Set VARIABLE to VALUE. VALUE is a Lisp object. When using this interactively, supply a Lisp expression for VALUE. @@ -3324,8 +3575,6 @@ (let* ((var (read-variable "Set variable: ")) ;; #### - yucky code replication here. This should use something ;; from help.el or hyper-apropos.el - (minibuffer-help-form - '(funcall myhelp)) (myhelp #'(lambda () (with-output-to-temp-buffer "*Help*" @@ -3340,7 +3589,9 @@ (save-excursion (set-buffer standard-output) (help-mode)) - nil)))) + nil))) + (minibuffer-help-form + '(funcall myhelp))) (list var (let ((prop (get var 'variable-interactive))) (if prop @@ -3353,31 +3604,11 @@ (if (and (boundp var) (specifierp (symbol-value var))) (set-specifier (symbol-value var) val) (set var val))) + -;; XEmacs -(defun activate-region () - "Activate the region, if `zmacs-regions' is true. -Setting `zmacs-regions' to true causes LISPM-style active regions to be used. -This function has no effect if `zmacs-regions' is false." - (interactive) - (and zmacs-regions (zmacs-activate-region))) - -;; XEmacs -(defsubst region-exists-p () - "Return t if the region exists. -If active regions are in use (i.e. `zmacs-regions' is true), this means that - the region is active. Otherwise, this means that the user has pushed - a mark in this buffer at some point in the past. -The functions `region-beginning' and `region-end' can be used to find the - limits of the region." - (not (null (mark)))) - -;; XEmacs -(defun region-active-p () - "Return non-nil if the region is active. -If `zmacs-regions' is true, this is equivalent to `region-exists-p'. -Otherwise, this function always returns false." - (and zmacs-regions zmacs-region-extent)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; case changing code ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; A bunch of stuff was moved elsewhere: ;; completion-list-mode-map @@ -3418,12 +3649,79 @@ (downcase-region (region-beginning) (region-end)) (downcase-word arg))) +;; #### not localized +(defvar uncapitalized-title-words + '("the" "a" "an" "in" "of" "for" "to" "and" "but" "at" "on" "as" "by")) + +(defvar uncapitalized-title-word-regexp + (concat "[ \t]*\\(" (mapconcat #'identity uncapitalized-title-words "\\|") + "\\)\\>")) + +(defun capitalize-string-as-title (string) + "Capitalize the words in the string, except for small words (as in titles). +The words not capitalized are specified in `uncapitalized-title-words'." + (let ((buffer (get-buffer-create " *capitalize-string-as-title*"))) + (unwind-protect + (progn + (insert-string string buffer) + (capitalize-region-as-title 1 (point-max buffer) buffer) + (buffer-string buffer)) + (kill-buffer buffer)))) + +(defun capitalize-region-as-title (b e &optional buffer) + "Capitalize the words in the region, except for small words (as in titles). +The words not capitalized are specified in `uncapitalized-title-words'." + (interactive "r") + (save-excursion + (and buffer + (set-buffer buffer)) + (save-restriction + (narrow-to-region b e) + (goto-char (point-min)) + (let ((first t)) + (while (< (point) (point-max)) + (if (or first + (not (looking-at uncapitalized-title-word-regexp))) + (capitalize-word 1) + (forward-word 1)) + (setq first nil)))))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; zmacs active region code ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Most of the zmacs code is now in elisp. The only thing left in C ;; are the variables zmacs-regions, zmacs-region-active-p and ;; zmacs-region-stays plus the function zmacs_update_region which ;; simply calls the lisp level zmacs-update-region. It must remain ;; for convenience, since it is called by core C code. +;; XEmacs +(defun activate-region () + "Activate the region, if `zmacs-regions' is true. +Setting `zmacs-regions' to true causes LISPM-style active regions to be used. +This function has no effect if `zmacs-regions' is false." + (interactive) + (and zmacs-regions (zmacs-activate-region))) + +;; XEmacs +(defsubst region-exists-p () + "Return t if the region exists. +If active regions are in use (i.e. `zmacs-regions' is true), this means that + the region is active. Otherwise, this means that the user has pushed + a mark in this buffer at some point in the past. +The functions `region-beginning' and `region-end' can be used to find the + limits of the region." + (not (null (mark)))) + +;; XEmacs +(defun region-active-p () + "Return non-nil if the region is active. +If `zmacs-regions' is true, this is equivalent to `region-exists-p'. +Otherwise, this function always returns false." + (and zmacs-regions zmacs-region-extent)) + (defvar zmacs-activate-region-hook nil "Function or functions called when the region becomes active; see the variable `zmacs-regions'.") @@ -3564,9 +3862,10 @@ (mark-marker t)))) (run-hooks 'zmacs-update-region-hook))) -;;;;;; -;;;;;; echo area stuff -;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; message logging code ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; #### Should this be moved to a separate file, for clarity? ;;; -hniksic @@ -3887,10 +4186,10 @@ (display-message label str) str))) - -;;;;;; -;;;;;; warning stuff -;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; warning code ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defcustom log-warning-minimum-level 'info "Minimum level of warnings that should be logged. @@ -4078,24 +4377,27 @@ (setq warning-marker (make-marker)) (set-marker warning-marker 1 buffer)) (if temp-buffer-show-function - (let ((show-buffer (get-buffer-create "*Warnings-Show*"))) - (save-excursion - (set-buffer show-buffer) - (setq buffer-read-only nil) - (erase-buffer)) - (save-excursion - (set-buffer buffer) - (copy-to-buffer show-buffer - (marker-position warning-marker) - (point-max))) - (funcall temp-buffer-show-function show-buffer)) + (progn + (funcall temp-buffer-show-function buffer) + (mapc #'(lambda (win) (set-window-start win warning-marker)) + (windows-of-buffer buffer nil t))) (set-window-start (display-buffer buffer) warning-marker)) (set-marker warning-marker (point-max buffer) buffer))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; misc junk ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defun emacs-name () "Return the printable name of this instance of Emacs." (cond ((featurep 'infodock) "InfoDock") ((featurep 'xemacs) "XEmacs") (t "Emacs"))) +(defun debug-print (format &rest args) + "Send a string to the debugging output. +The string is formatted using (apply #'format FORMAT ARGS)." + (princ (apply #'format format args) 'external-debugging-output)) + ;;; simple.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/specifier.el --- a/lisp/specifier.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/specifier.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,7 +1,7 @@ ;;; specifier.el --- Lisp interface to specifiers ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 1995, 1996, 2000 Ben Wing. ;; Author: Ben Wing ;; Keywords: internal, dumped @@ -275,18 +275,20 @@ VALUE is usually what is called an \"instantiator\" (which, roughly speaking, corresponds to the \"value\" of the property governed by -SPECIFIER). The valid instantiators for SPECIFIER depend on the -type of SPECIFIER (which you can determine using `specifier-type'). -The specifier `scrollbar-width', for example, is of type `integer', -meaning its valid instantiators are integers. The specifier -governing the background color of the `default' face (you can -retrieve this specifier using `(face-background 'default)') is -of type `color', meaning its valid instantiators are strings naming -colors and color-instance objects. For some types of specifiers, -such as `image' and `toolbar', the instantiators can be very -complex. Generally this is documented in the appropriate predicate -function -- `color-specifier-p', `image-specifier-p', -`toolbar-specifier-p', etc. +SPECIFIER). The valid instantiators for SPECIFIER depend on the type +of SPECIFIER (which you can determine using `specifier-type'). The +specifier `scrollbar-width', for example, is of type `integer', +meaning its valid instantiators are integers. The specifier governing +the background color of the `default' face (you can retrieve this +specifier using `(face-background 'default)') is of type `color', +meaning its valid instantiators are strings naming colors and +color-instance objects. For some types of specifiers, such as `image' +and `toolbar', the instantiators can be very complex. Generally this +is documented in the appropriate creation function -- +e.g. `make-color-specifier', `make-font-specifier', +`make-image-specifier' -- or in the global variable holding the most +common specifier for that type (`default-toolbar', `default-gutter', +`current-display-table'). NOTE: It does *not* work to give a VALUE of nil as a way of removing the specifications for a locale. Use `remove-specifier' @@ -403,6 +405,40 @@ how-to-add)))) value) +(defun modify-specifier-instances (specifier func &optional args force default + locale tag-set) + "Modify all specifications that match LOCALE and TAG-SET by FUNC. + +For each specification that exists for SPECIFIER, in locale LOCALE +that matches TAG-SET, call the function FUNC with the instance as its +first argument and with optional arguments ARGS. The result is then +used as the new value of the instantiator. + +If there is no specification in the domain LOCALE matching TAG-SET and +FORCE is non-nil, an explicit one is created from the matching +specifier instance if that exists or DEFAULT otherwise. If LOCALE is +not a domain (i.e. a buffer), DEFAULT is always used. FUNC is then +applied like above and the resulting specification is added." + + (let ((spec-list (specifier-spec-list specifier locale tag-set))) + (cond + (spec-list + ;; Destructively edit the spec-list + (mapc #'(lambda (spec) + (mapc #'(lambda (inst-pair) + (setcdr inst-pair + (apply func (cdr inst-pair) args))) + (cdr spec))) + spec-list) + (add-spec-list-to-specifier specifier spec-list)) + (force + (set-specifier specifier + (apply func + (or (and (valid-specifier-domain-p locale) + (specifier-instance specifier)) + default) args) + locale tag-set))))) + (defmacro let-specifier (specifier-list &rest body) "Add specifier specs, evaluate forms in BODY and restore the specifiers. \(let-specifier SPECIFIER-LIST BODY...) @@ -492,6 +528,58 @@ ,(car oldval)))) oldvallist varlist)))))))) +(defun make-integer-specifier (spec-list) + "Return a new `integer' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for integer specifiers are integers." + (make-specifier-and-init 'integer spec-list)) + +(defun make-boolean-specifier (spec-list) + "Return a new `boolean' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for boolean specifiers are t and nil." + (make-specifier-and-init 'boolean spec-list)) + +(defun make-natnum-specifier (spec-list) + "Return a new `natnum' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for natnum specifiers are non-negative integers." + (make-specifier-and-init 'natnum spec-list)) + +(defun make-generic-specifier (spec-list) + "Return a new `generic' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for generic specifiers are all Lisp values. +They are returned back unchanged when a specifier is instantiated." + (make-specifier-and-init 'generic spec-list)) + +(defun make-display-table-specifier (spec-list) + "Return a new `display-table' specifier object with the given spec list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for display-table specifiers are described in +detail in the doc string for `current-display-table'." + (make-specifier-and-init 'display-table spec-list)) + ;; Evaluate this for testing: ; (cl-prettyexpand '(let-specifier ((modeline-shadow-thickness 0 (selected-window) 'x) (fubar (value) baz)) (sit-for 1))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/startup.el --- a/lisp/startup.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/startup.el Mon Aug 13 11:35:02 2007 +0200 @@ -20,7 +20,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -107,17 +107,30 @@ (defvar user-init-directory-base ".xemacs" "Base of directory where user-installed init files may go.") -(defvar user-init-file-base-list (append - '(".emacs.elc" ".emacs.el" ".emacs") - (and (eq system-type 'windows-nt) - '("_emacs.elc" "_emacs.el" "_emacs"))) - "List of allowed init files. The first one found takes precedence.") - (defvar user-init-directory (file-name-as-directory (paths-construct-path (list "~" user-init-directory-base))) "Directory where user-installed init files may go.") +(defvar user-init-file-base "init.el" + "Default name of the user init file if uncompiled. +This should be used for migration purposes only.") + +(defvar user-init-file-base-list '("init.elc" "init.el") + "List of allowed init files in the user's init directory. +The first one found takes precedence.") + +(defvar user-home-init-file-base-list + (append '(".emacs.elc" ".emacs.el" ".emacs") + (and (eq system-type 'windows-nt) + '("_emacs.elc" "_emacs.el" "_emacs"))) + "List of allowed init files in the user's home directory. +The first one found takes precedence.") + +(defvar load-home-init-file nil + "Non-nil if XEmacs should load the init file from the home directory. +Otherwise, XEmacs will offer migration to the init directory.") + (defvar load-user-init-file-p t "Non-nil if XEmacs should load the user's init file.") @@ -146,13 +159,17 @@ ;;We do that if this regexp matches the locale name ;;specified by the LC_ALL, LC_CTYPE and LANG environment variables.") -(defvar mail-host-address nil - "*Name of this machine, for purposes of naming users.") +(defcustom mail-host-address nil + "*Name of this machine, for purposes of naming users." + :type 'string + :group 'mail) -(defvar user-mail-address nil +(defcustom user-mail-address nil "*Full mailing address of this user. This is initialized based on `mail-host-address', -after your init file is read, in case it sets `mail-host-address'.") +after your init file is read, in case it sets `mail-host-address'." + :type 'string + :group 'mail) (defvar auto-save-list-file-prefix "~/.saves-" "Prefix for generating auto-save-list-file-name. @@ -369,11 +386,10 @@ (princ "\n\n" stream))) (when (not suppress-early-error-handler-backtrace) (backtrace stream t))) + (if (fboundp 'mswindows-message-box) + (mswindows-message-box "Initialization error")) (kill-emacs -1)) -(defvar lock-directory) -(defvar superlock-file) - (defun normal-top-level () (if command-line-processed (message "Back to top level.") @@ -448,6 +464,9 @@ (when window-setup-hook (run-hooks 'window-setup-hook)) (setq window-setup-hook nil)) + + (if load-user-init-file-p + (maybe-migrate-user-init-file)) ;;####FSFmacs junk ;; (or menubar-bindings-done ;; (precompute-menubar-bindings)) @@ -531,10 +550,13 @@ (string= arg "-user")) (let* ((user (pop args)) (home-user (concat "~" user))) - (setq user-init-file (find-user-init-file home-user) - user-init-directory (file-name-as-directory + (setq user-init-directory (file-name-as-directory (paths-construct-path - (list home-user user-init-directory-base)))))) + (list home-user user-init-directory-base)))) + (setq user-init-file + (find-user-init-file user-init-directory home-user)) + (setq custom-file + (make-custom-file-name user-init-file)))) ((string= arg "-debug-init") (setq init-file-debug t)) ((string= arg "-unmapped") @@ -638,20 +660,94 @@ (setq term (substring term 0 hyphend)) (setq term nil)))))) -(defun find-user-init-file (&optional directory) +(defun find-user-init-directory-init-file (&optional init-directory) + "Determine the user's init file if in the init directory." + (let ((init-directory (or init-directory user-init-directory))) + (catch 'found + (dolist (file user-init-file-base-list) + (let ((expanded (expand-file-name file init-directory))) + (when (file-readable-p expanded) + (throw 'found expanded))))))) + +(defun find-user-home-directory-init-file (&optional home-directory) + "Determine the user's init file if in the home directory." + (let ((home-directory (or home-directory "~"))) + (catch 'found + (dolist (file user-home-init-file-base-list) + (let ((expanded (expand-file-name file home-directory))) + (when (file-readable-p expanded) + (throw 'found expanded)))) + nil))) + +(defun find-user-init-file (&optional init-directory home-directory) "Determine the user's init file." - (unless directory - (setq directory "~")) - (dolist (file user-init-file-base-list) - (let ((expanded (paths-construct-path (list directory file)))) - (when (file-exists-p expanded) - (return expanded))))) + (if load-home-init-file + (find-user-home-directory-init-file home-directory) + (or (find-user-init-directory-init-file init-directory) + (find-user-home-directory-init-file home-directory)))) + +(defun maybe-migrate-user-init-file () + "Ask user if she wants to migrate the init file(s) to new location." + (if (and (not load-home-init-file) + (not (find-user-init-directory-init-file user-init-directory)) + (stringp user-init-file) + (file-readable-p user-init-file)) + (if (with-output-to-temp-buffer (help-buffer-name nil) + (progn + (princ "XEmacs recommends that the initialization code in +") + (princ user-init-file) + (princ " +be migrated to the ") + (princ user-init-directory) + (princ " directory. XEmacs can +perform the migration automatically. + +After the migration, init.el/init.elc holds user-written +initialization code. Moreover the customize settings will be in +custom.el. + +If you choose not to do this now, XEmacs will not ask you this +question in the future. However, you can still make XEmacs +perform the migration at any time with M-x migrate-user-init-file.") + (show-temp-buffer-in-current-frame standard-output) + (yes-or-no-p-minibuf (concat "Migrate init file to " + user-init-directory + "? ")))) + (migrate-user-init-file) + (customize-save-variable 'load-home-init-file t)))) + +(defun migrate-user-init-file () + "Migrate the init file from the home directory." + (interactive) + (if (not (file-exists-p user-init-directory)) + (progn + (message "Creating %s directory..." user-init-directory) + (make-directory user-init-directory))) + (message "Migrating custom file...") + (custom-migrate-custom-file (make-custom-file-name user-init-file + 'force-new)) + (message "Moving init file...") + (rename-file user-init-file + (expand-file-name user-init-file-base + user-init-directory)) + (message "Migration done.")) (defun load-user-init-file () - "This function actually reads the init file, .emacs." + "This function actually reads the init file." (if (not user-init-file) - (setq user-init-file (find-user-init-file))) - (load user-init-file t t t) + (setq user-init-file + (find-user-init-file user-init-directory))) + (if (and user-init-file + (file-readable-p user-init-file)) + (load user-init-file t t t)) + (if (not custom-file) + (setq custom-file (make-custom-file-name user-init-file))) + (if (and custom-file + (or (not user-init-file) + (not (string= custom-file user-init-file))) + (file-readable-p custom-file)) + (load custom-file t t t)) (unless inhibit-default-init (let ((inhibit-startup-message nil)) ;; Users are supposed to be told their rights. @@ -679,8 +775,9 @@ (if (eq init-file-debug t) 'startup init-file-debug))) (let ((debug-on-error debug-on-error-initial)) (if (and load-user-init-file-p init-file-debug) - ;; Do this without a condition-case if the user wants to debug. - (load-user-init-file) + (progn + ;; Do this without a condition-case if the user wants to debug. + (load-user-init-file)) (condition-case error (progn (if load-user-init-file-p @@ -777,7 +874,7 @@ (file-count 0) (line nil) (end-of-options nil) - first-file-buffer file-p arg tem) + file-p arg tem) (while command-line-args-left (setq arg (pop command-line-args-left)) (cond @@ -804,8 +901,8 @@ (incf file-count) (setq arg (expand-file-name arg dir)) (cond - ((= file-count 1) (setq first-file-buffer - (progn (find-file arg) (current-buffer)))) + ((= file-count 1) + (find-file arg)) (noninteractive (find-file arg)) (t (find-file-other-window arg))) (when line @@ -1146,18 +1243,6 @@ (princ (format "Info-directory-list:\n%S\n" Info-directory-list) 'external-debugging-output)) - (if (boundp 'lock-directory) - (progn - (setq lock-directory (paths-find-lock-directory roots)) - (setq superlock-file (paths-find-superlock-file lock-directory)) - - (if debug-paths - (progn - (princ (format "lock-directory:\n%S\n" lock-directory) - 'external-debugging-output) - (princ (format "superlock-file:\n%S\n" superlock-file) - 'external-debugging-output))))) - (setq exec-directory (paths-find-exec-directory roots)) (if debug-paths @@ -1205,20 +1290,15 @@ (princ (buffer-string) 'external-debugging-output))) (defun startup-setup-paths-warning () - (let ((lock (if (boundp 'lock-directory) lock-directory 't)) - (warnings '())) - (if (and (stringp lock) (null (file-directory-p lock))) - (setq lock nil)) + (let ((warnings '())) (cond ((null (and lisp-directory exec-directory data-directory doc-directory - load-path - lock)) + load-path)) (save-excursion (set-buffer (get-buffer-create " *warning-tmp*")) (erase-buffer) (buffer-disable-undo (current-buffer)) (if (null lisp-directory) (push "lisp-directory" warnings)) - (if (null lock) (push "lock-directory" warnings)) (if (null exec-directory) (push "exec-directory" warnings)) (if (null data-directory) (push "data-directory" warnings)) (if (null doc-directory) (push "doc-directory" warnings)) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/subr.el --- a/lisp/subr.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/subr.el Mon Aug 13 11:35:02 2007 +0200 @@ -3,6 +3,7 @@ ;; Copyright (C) 1985, 1986, 1992, 1994-5, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. ;; Copyright (C) 1995 Sun Microsystems. +;; Copyright (C) 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, dumped @@ -117,7 +118,9 @@ This function does nothing if HOOK is already local in the current buffer. -Do not use `make-local-variable' to make a hook variable buffer-local." +Do not use `make-local-variable' to make a hook variable buffer-local. + +See also `add-local-hook' and `remove-local-hook'." (if (local-variable-p hook (current-buffer)) ; XEmacs nil (or (boundp hook) (set hook nil)) @@ -139,7 +142,11 @@ HOOK should be a symbol, and FUNCTION may be any valid function. If HOOK is void, it is first set to nil. If HOOK's value is a single -function, it is changed to a list of functions." +function, it is changed to a list of functions. + +You can remove this hook yourself using `remove-hook'. + +See also `add-local-hook' and `add-one-shot-hook'." (or (boundp hook) (set hook nil)) (or (default-boundp hook) (set-default hook nil)) ;; If the hook value is a single function, turn it into a list. @@ -185,25 +192,114 @@ (null (symbol-value hook)) ;value is nil, or (null function)) ;function is nil, then nil ;Do nothing. - (if (or local - ;; Detect the case where make-local-variable was used on a hook - ;; and do what we used to do. - (and (local-variable-p hook (current-buffer)) - (not (memq t (symbol-value hook))))) - (let ((hook-value (symbol-value hook))) - (if (and (consp hook-value) (not (functionp hook-value))) - (if (member function hook-value) - (setq hook-value (delete function (copy-sequence hook-value)))) - (if (equal hook-value function) - (setq hook-value nil))) - (set hook hook-value)) - (let ((hook-value (default-value hook))) - (if (and (consp hook-value) (not (functionp hook-value))) - (if (member function hook-value) - (setq hook-value (delete function (copy-sequence hook-value)))) - (if (equal hook-value function) - (setq hook-value nil))) - (set-default hook hook-value))))) + (flet ((hook-remove + (function hook-value) + (flet ((hook-test + (fn hel) + (or (equal fn hel) + (and (symbolp hel) + (equal fn + (get hel 'one-shot-hook-fun)))))) + (if (and (consp hook-value) + (not (functionp hook-value))) + (if (member* function hook-value :test 'hook-test) + (setq hook-value + (delete* function (copy-sequence hook-value) + :test 'hook-test))) + (if (equal hook-value function) + (setq hook-value nil))) + hook-value))) + (if (or local + ;; Detect the case where make-local-variable was used on a hook + ;; and do what we used to do. + (and (local-variable-p hook (current-buffer)) + (not (memq t (symbol-value hook))))) + (set hook (hook-remove function (symbol-value hook))) + (set-default hook (hook-remove function (default-value hook))))))) + +;; XEmacs addition +;; #### we need a coherent scheme for indicating compatibility info, +;; so that it can be programmatically retrieved. +(defun add-local-hook (hook function &optional append) + "Add to the local value of HOOK the function FUNCTION. +This modifies only the buffer-local value for the hook (which is +automatically make buffer-local, if necessary), not its default value. +FUNCTION is not added if already present. +FUNCTION is added (if necessary) at the beginning of the hook list +unless the optional argument APPEND is non-nil, in which case +FUNCTION is added at the end. + +HOOK should be a symbol, and FUNCTION may be any valid function. If +HOOK is void, it is first set to nil. If HOOK's value is a single +function, it is changed to a list of functions. + +You can remove this hook yourself using `remove-local-hook'. + +See also `add-hook' and `make-local-hook'." + (make-local-hook hook) + (add-hook hook function append t)) + +;; XEmacs addition +(defun remove-local-hook (hook function) + "Remove from the local value of HOOK the function FUNCTION. +This modifies only the buffer-local value for the hook, not its default +value. (Nothing happens if the hook is not buffer-local.) +HOOK should be a symbol, and FUNCTION may be any valid function. If +FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the +list of hooks to run in HOOK, then nothing is done. See `add-hook'. + +See also `add-local-hook' and `make-local-hook'." + (if (local-variable-p hook (current-buffer)) + (remove-hook hook function t))) + +(defun add-one-shot-hook (hook function &optional append local) + "Add to the value of HOOK the one-shot function FUNCTION. +FUNCTION will automatically be removed from the hook the first time +after it runs (whether to completion or to an error). +FUNCTION is not added if already present. +FUNCTION is added (if necessary) at the beginning of the hook list +unless the optional argument APPEND is non-nil, in which case +FUNCTION is added at the end. + +HOOK should be a symbol, and FUNCTION may be any valid function. If +HOOK is void, it is first set to nil. If HOOK's value is a single +function, it is changed to a list of functions. + +You can remove this hook yourself using `remove-hook'. + +See also `add-hook', `add-local-hook', and `add-local-one-shot-hook'." + (let ((sym (gensym))) + (fset sym `(lambda (&rest args) + (unwind-protect + (apply ',function args) + (remove-hook ',hook ',sym ',local)))) + (put sym 'one-shot-hook-fun function) + (add-hook hook sym append local))) + +(defun add-local-one-shot-hook (hook function &optional append) + "Add to the local value of HOOK the one-shot function FUNCTION. +FUNCTION will automatically be removed from the hook the first time +after it runs (whether to completion or to an error). +FUNCTION is not added if already present. +FUNCTION is added (if necessary) at the beginning of the hook list +unless the optional argument APPEND is non-nil, in which case +FUNCTION is added at the end. + +The optional fourth argument, LOCAL, if non-nil, says to modify +the hook's buffer-local value rather than its default value. +This makes no difference if the hook is not buffer-local. +To make a hook variable buffer-local, always use +`make-local-hook', not `make-local-variable'. + +HOOK should be a symbol, and FUNCTION may be any valid function. If +HOOK is void, it is first set to nil. If HOOK's value is a single +function, it is changed to a list of functions. + +You can remove this hook yourself using `remove-local-hook'. + +See also `add-hook', `add-local-hook', and `add-local-one-shot-hook'." + (make-local-hook hook) + (add-one-shot-hook hook function append t)) (defun add-to-list (list-var element) "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet. @@ -223,12 +319,6 @@ The value of this variable may be buffer-local. The buffer about to be killed is current when this hook is run.") -;; called by Frecord_buffer() -(defvar record-buffer-hook nil - "Function or functions to be called when a buffer is recorded. -The value of this variable may be buffer-local. -The buffer being recorded is passed as an argument to the hook.") - ;; in C in FSFmacs (defvar kill-emacs-hook nil "Function or functions to be called when `kill-emacs' is called, @@ -261,6 +351,15 @@ (setplist new (copy-list (symbol-plist symbol)))) new)) +(defun set-symbol-value-in-buffer (sym val buffer) + "Set the value of SYM to VAL in BUFFER. Useful with buffer-local variables. +If SYM has a buffer-local value in BUFFER, or will have one if set, this +function allows you to set the local value. + +NOTE: At some point, this will be moved into C and will be very fast." + (with-current-buffer buffer + (set sym val))) + ;;;; String functions. ;; XEmacs @@ -268,48 +367,31 @@ "Replace all matches in STR for REGEXP with NEWTEXT string, and returns the new string. Optional LITERAL non-nil means do a literal replacement. -Otherwise treat \\ in NEWTEXT string as special: - \\& means substitute original matched text, - \\N means substitute match for \(...\) number N, - \\\\ means insert one \\." +Otherwise treat `\\' in NEWTEXT as special: + `\\&' in NEWTEXT means substitute original matched text. + `\\N' means substitute what matched the Nth `\\(...\\)'. + If Nth parens didn't match, substitute nothing. + `\\\\' means insert one `\\'. + `\\u' means upcase the next character. + `\\l' means downcase the next character. + `\\U' means begin upcasing all following characters. + `\\L' means begin downcasing all following characters. + `\\E' means terminate the effect of any `\\U' or `\\L'." (check-argument-type 'stringp str) (check-argument-type 'stringp newtext) - (let ((rtn-str "") - (start 0) - (special) - match prev-start) - (while (setq match (string-match regexp str start)) - (setq prev-start start - start (match-end 0) - rtn-str - (concat - rtn-str - (substring str prev-start match) - (cond (literal newtext) - (t (mapconcat - (lambda (c) - (if special - (progn - (setq special nil) - (cond ((eq c ?\\) "\\") - ((eq c ?&) - (substring str - (match-beginning 0) - (match-end 0))) - ((and (>= c ?0) (<= c ?9)) - (if (> c (+ ?0 (length - (match-data)))) - ;; Invalid match num - (error "Invalid match num: %c" c) - (setq c (- c ?0)) - (substring str - (match-beginning c) - (match-end c)))) - (t (char-to-string c)))) - (if (eq c ?\\) (progn (setq special t) nil) - (char-to-string c)))) - newtext "")))))) - (concat rtn-str (substring str start)))) + (if (> (length str) 50) + (with-temp-buffer + (insert str) + (goto-char 1) + (while (re-search-forward regexp nil t) + (replace-match newtext t literal)) + (buffer-string)) + (let ((start 0) newstr) + (while (string-match regexp str start) + (setq newstr (replace-match newtext t literal str) + start (+ (match-end 0) (- (length newstr) (length str))) + str newstr)) + str))) (defun split-string (string &optional pattern) "Return a list of substrings of STRING which are separated by PATTERN. @@ -345,7 +427,8 @@ "Collect output to `standard-output' while evaluating FORMS and return it as a string." ;; by "William G. Dubuque" w/ mods from Stig - `(with-current-buffer (get-buffer-create " *string-output*") + `(with-current-buffer (get-buffer-create + (generate-new-buffer-name " *string-output*")) (setq buffer-read-only nil) (buffer-disable-undo (current-buffer)) (erase-buffer) @@ -399,16 +482,10 @@ "With the contents of the current buffer being STR, run BODY. Returns the new contents of the buffer, as modified by BODY. The original current buffer is restored afterwards." - `(let ((tempbuf (get-buffer-create " *string-as-buffer-contents*"))) - (with-current-buffer tempbuf - (unwind-protect - (progn - (buffer-disable-undo (current-buffer)) - (erase-buffer) - (insert ,str) - ,@body - (buffer-string)) - (erase-buffer tempbuf))))) + `(with-temp-buffer + (insert ,str) + ,@body + (buffer-string))) (defun insert-face (string face) "Insert STRING and highlight with FACE. Return the extent created." @@ -511,25 +588,126 @@ ;;; Error functions -(defun error (&rest args) - "Signal an error, making error message by passing all args to `format'. +(defun error (datum &rest args) + "Signal a non-continuable error. +DATUM should normally be an error symbol, i.e. a symbol defined using +`define-error'. ARGS will be made into a list, and DATUM and ARGS passed +as the two arguments to `signal', the most basic error handling function. + This error is not continuable: you cannot continue execution after the -error using the debugger `r' command. See also `cerror'." - (while t - (apply 'cerror args))) +error using the debugger `r' command. See also `cerror'. + +The correct semantics of ARGS varies from error to error, but for most +errors that need to be generated in Lisp code, the first argument +should be a string describing the *context* of the error (i.e. the +exact operation being performed and what went wrong), and the remaining +arguments or \"frobs\" (most often, there is one) specify the +offending object(s) and/or provide additional details such as the exact +error when a file error occurred, e.g.: + +-- the buffer in which an editing error occurred. +-- an invalid value that was encountered. (In such cases, the string + should describe the purpose or \"semantics\" of the value [e.g. if the + value is an argument to a function, the name of the argument; if the value + is the value corresponding to a keyword, the name of the keyword; if the + value is supposed to be a list length, say this and say what the purpose + of the list is; etc.] as well as specifying why the value is invalid, if + that's not self-evident.) +-- the file in which an error occurred. (In such cases, there should be a + second frob, probably a string, specifying the exact error that occurred. + This does not occur in the string that precedes the first frob, because + that frob describes the exact operation that was happening. + +For historical compatibility, DATUM can also be a string. In this case, +DATUM and ARGS are passed together as the arguments to `format', and then +an error is signalled using the error symbol `error' and formatted string. +Although this usage of `error' is very common, it is deprecated because it +totally defeats the purpose of having structured errors. There is now +a rich set of defined errors you can use: + +error + syntax-error + invalid-read-syntax + list-formation-error + malformed-list + malformed-property-list + circular-list + circular-property-list + + invalid-argument + wrong-type-argument + args-out-of-range + wrong-number-of-arguments + invalid-function + no-catch -(defun cerror (&rest args) + invalid-state + void-function + cyclic-function-indirection + void-variable + cyclic-variable-indirection + + invalid-operation + invalid-change + setting-constant + editing-error + beginning-of-buffer + end-of-buffer + buffer-read-only + io-error + end-of-file + arith-error + range-error + domain-error + singularity-error + overflow-error + underflow-error + +The five most common errors you will probably use or base your new +errors off of are `syntax-error', `invalid-argument', `invalid-state', +`invalid-operation', and `invalid-change'. Note the semantic differences: + +-- `syntax-error' is for errors in complex structures: parsed strings, lists, + and the like. +-- `invalid-argument' is for errors in a simple value. Typically, the entire + value, not just one part of it, is wrong. +-- `invalid-state' means that some settings have been changed in such a way + that their current state is unallowable. More and more, code is being + written more carefully, and catches the error when the settings are being + changed, rather than afterwards. This leads us to the next error: +-- `invalid-change' means that an attempt is being made to change some settings + into an invalid state. `invalid-change' is a type of `invalid-operation'. +-- `invalid-operation' refers to all cases where code is trying to do something + that's disallowed. This includes file errors, buffer errors (e.g. running + off the end of a buffer), `invalid-change' as just mentioned, and + arithmetic errors. + +See also `cerror', `signal', and `signal-error'." + (while t (apply + 'cerror datum args))) + +(defun cerror (datum &rest args) "Like `error' but signals a continuable error." - (signal 'error (list (apply 'format args)))) + (cond ((stringp datum) + (signal 'error (list (apply 'format datum args)))) + ((defined-error-p datum) + (signal datum args)) + (t + (error 'invalid-argument "datum not string or error symbol" datum)))) (defmacro check-argument-type (predicate argument) "Check that ARGUMENT satisfies PREDICATE. -If not, signal a continuable `wrong-type-argument' error until the -returned value satisfies PREDICATE, and assign the returned value -to ARGUMENT." - `(if (not (,(eval predicate) ,argument)) - (setq ,argument - (wrong-type-argument ,predicate ,argument)))) +This is a macro, and ARGUMENT is not evaluated. If ARGUMENT is an lvalue, +this function signals a continuable `wrong-type-argument' error until the +returned value satisfies PREDICATE, and assigns the returned value +to ARGUMENT. Otherwise, this function signals a non-continuable +`wrong-type-argument' error if the returned value does not satisfy PREDICATE." + (if (symbolp argument) + `(if (not (,(eval predicate) ,argument)) + (setq ,argument + (wrong-type-argument ,predicate ,argument))) + `(if (not (,(eval predicate) ,argument)) + (signal-error 'wrong-type-argument (list ,predicate ,argument))))) (defun signal-error (error-symbol data) "Signal a non-continuable error. Args are ERROR-SYMBOL, and associated DATA. @@ -561,6 +739,10 @@ (or conds (signal-error 'error (list "Not an error symbol" error-sym))) (put error-sym 'error-conditions (cons error-sym conds)))) +(defun defined-error-p (sym) + "Returns non-nil if SYM names a currently-defined error." + (and (symbolp sym) (not (null (get sym 'error-conditions))))) + ;;;; Miscellanea. ;; This is now in C. @@ -637,6 +819,12 @@ (t (error "Non-funcallable object: %s" function)))) +(defun function-allows-args (function n) + "Return whether FUNCTION can be called with N arguments." + (and (<= (function-min-args function) n) + (or (null (function-max-args function)) + (<= n (function-max-args function))))) + ;; This function used to be an alias to `buffer-substring', except ;; that FSF Emacs 20.4 added a BUFFER argument in an incompatible way. ;; The new FSF's semantics makes more sense, but we try to support diff -r 72a7cfa4a488 -r abe6d1db359e lisp/toolbar-items.el --- a/lisp/toolbar-items.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/toolbar-items.el Mon Aug 13 11:35:02 2007 +0200 @@ -297,23 +297,22 @@ (require 'gdbsrc) (call-interactively 'gdbsrc))) -(defvar compile-command) -(defvar toolbar-compile-already-run nil) - (defun toolbar-compile () "Run compile without having to touch the keyboard." (interactive) + (declare (special compile-command toolbar-compile-already-run)) (require 'compile) - (if toolbar-compile-already-run + (if (boundp 'toolbar-compile-already-run) (compile compile-command) (setq toolbar-compile-already-run t) (if (should-use-dialog-box-p) - (popup-dialog-box - `(,(concat "Compile:\n " compile-command) - ["Compile" (compile compile-command) t] - ["Edit command" compile t] - nil - ["Cancel" (message "Quit") t])) + (make-dialog-box 'question + :question (concat "Compile:\n " compile-command) + :buttons + '(["Compile" (compile compile-command) t] + ["Edit command" compile t] + nil + ["Cancel" (message "Quit") t])) (compile compile-command)))) ;; diff -r 72a7cfa4a488 -r abe6d1db359e lisp/toolbar.el --- a/lisp/toolbar.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/toolbar.el Mon Aug 13 11:35:02 2007 +0200 @@ -57,10 +57,10 @@ "The location of the default toolbar. It can be 'top, 'bottom, 'left or 'right. This option can be customized through the options menu." :group 'display - :type '(choice (const :tag "top" 'top) - (const :tag "bottom" 'bottom) - (const :tag "left" 'left) - (const :tag "right" 'right)) + :type '(choice (const :tag "top" top) + (const :tag "bottom" bottom) + (const :tag "left" left) + (const :tag "right" right)) :set #'(lambda (var val) (set-default-toolbar-position val) (setq default-toolbar-position val)) @@ -123,6 +123,9 @@ (defvar last-pressed-toolbar-button nil) (defvar toolbar-active nil) +(defvar toolbar-blank-press-function nil + "Function to call if a blank area of the toolbar is pressed.") + ;; ;; It really sucks that we also have to tie onto ;; default-mouse-motion-handler to make sliding buttons work right. @@ -143,9 +146,8 @@ (setq last-pressed-toolbar-button button)) ;; Added by Bob Weiner, Motorola Inc., 10/6/95, to handle ;; presses on blank portions of toolbars. - (and (boundp 'toolbar-blank-press-function) - (functionp toolbar-blank-press-function) - (funcall toolbar-blank-press-function event))))) + (when (functionp toolbar-blank-press-function) + (funcall toolbar-blank-press-function event))))) (defun release-and-activate-toolbar-button (event) "Release a toolbar button and activate its callback. @@ -198,4 +200,21 @@ (setq zmacs-region-stays t) (release-toolbar-button-internal event nil)) +(defun make-toolbar-specifier (spec-list) + "Return a new `toolbar' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Toolbar specifiers are used to specify the format of a toolbar. +The values of the variables `default-toolbar', `top-toolbar', +`left-toolbar', `right-toolbar', and `bottom-toolbar' are always +toolbar specifiers. + +Valid toolbar instantiators are called \"toolbar descriptors\" +and are lists of vectors. See `default-toolbar' for a description +of the exact format." + (make-specifier-and-init 'toolbar spec-list)) + ;;; toolbar.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/update-elc-2.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/update-elc-2.el Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,148 @@ +;;; update-elc-2.el --- Recompile remaining .el files, post-dumping + +;; Copyright (C) 1997 by Free Software Foundation, Inc. +;; Copyright (C) 2000 Ben Wing. + +;; Author: Ben Wing , based on cleantree.el by +;; Steven L Baur +;; 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 file should be used after XEmacs has been dumped, to recompile +;; all remaining out-of-date .els and clean up orphaned .elcs. It should +;; be called as +;; +;; xemacs -batch -vanilla -l update-elc-2.el -f batch-update-elc-2 ${dirname} +;; +;; where ${dirname} is the directory tree to recompile, usually `lisp'. +;; +;; Note that this is very different from update-elc.el, which is called +;; BEFORE dumping, handles only the files needed to dump, and is called +;; from temacs instead of xemacs. +;; +;; The original cleantree.el had the comment: This code is derived +;; from Gnus based on a suggestion by David Moore + +;;; Code: + +(defvar update-elc-ignored-dirs + `("." ".." "CVS" "SCCS" "RCS" ,@(unless (featurep 'mule) '("mule")))) + +(defvar update-elc-ignored-files + ;; note: entries here are regexps + '("^," ;; #### huh? + "^paths.el$" + "^loadup.el$" + "^loadup-el.el$" + "^update-elc.el$" + "^update-elc-2.el$" + "^dumped-lisp.el$" + "^make-docfile.el$" + "^site-start.el$" + "^site-load.el$" + "^site-init.el$" + "^version.el$" + "^very-early-lisp.el$")) + +;; 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)) + ;; Only scan this sub-tree if we haven't been here yet. + (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)))) + + ))) + + +(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))) + ;; 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 + ;; byte-compiling a file. + (message "Removing old or spurious .elcs in directory tree `%s'..." dir) + (do-update-elc-2 dir nil nil) + (message "Removing old or spurious .elcs in directory tree `%s'...done" + dir) + (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)) + (setq command-line-args-left nil)) + +;;; cleantree.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/update-elc.el --- a/lisp/update-elc.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/update-elc.el Mon Aug 13 11:35:02 2007 +0200 @@ -1,8 +1,9 @@ ;;; update-elc.el --- Bytecompile out-of-date dumped files ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Copyright (C) 1996 Unknown +;; Copyright (C) 1996 Sun Microsystems, Inc. +;; Author: Ben Wing , Steven L Baur ;; Maintainer: XEmacs Development Team ;; Keywords: internal @@ -39,8 +40,7 @@ ;; (the idea here is that you can bootstrap if your .ELC files ;; are missing or badly out-of-date) -;; Currently this code gets the list of files to check passed to it from -;; src/Makefile. This must be fixed. -slb +;; See also update-elc-2.el ;;; Code: @@ -62,7 +62,8 @@ ; ;; -batch gets filtered out. ; (nthcdr 3 command-line-args)))) -(setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH"))) +(let ((build-root (expand-file-name ".." invocation-directory))) + (setq load-path (list (expand-file-name "lisp" build-root)))) (load "very-early-lisp" nil t) @@ -83,9 +84,14 @@ ;; (print (prin1-to-string update-elc-files-to-compile)) -(let (preloaded-file-list site-load-packages) +(let (preloaded-file-list site-load-packages need-to-dump dumped-exe) (load (expand-file-name "../lisp/dumped-lisp.el")) + (setq dumped-exe + (cond ((file-exists-p "../src/xemacs.exe") "../src/xemacs.exe") + ((file-exists-p "../src/xemacs") "../src/xemacs") + (t nil))) + ;; Path setup (let ((package-preloaded-file-list (packages-collect-package-dumped-lisps late-package-load-path))) @@ -93,6 +99,7 @@ (setq preloaded-file-list (append package-preloaded-file-list preloaded-file-list + '("bytecomp") packages-hardcoded-lisp))) (load (concat default-directory "../site-packages") t t) @@ -104,6 +111,26 @@ (while preloaded-file-list (let ((arg (car preloaded-file-list))) ;; (print (prin1-to-string arg)) + + ;; now check if .el or .elc is newer than the dumped exe. + ;; if so, need to redump. + (let ((frob + (if (string-match "\\.elc?\\'" arg) + (substring arg 0 (match-beginning 0)) + arg))) + (when (and dumped-exe + (or (and (file-exists-p + (concat "../lisp/" frob ".el")) + (file-newer-than-file-p + (concat "../lisp/" frob ".el") + dumped-exe)) + (and (file-exists-p + (concat "../lisp/" frob ".elc")) + (file-newer-than-file-p + (concat "../lisp/" frob ".elc") + dumped-exe)))) + (setq need-to-dump t))) + (if (null (member (file-name-nondirectory arg) packages-unbytecompiled-lisp)) (progn @@ -123,7 +150,14 @@ (file-newer-than-file-p (concat arg ".el") (concat arg ".elc"))) (setq processed (cons (concat arg ".el") processed))))) - (setq preloaded-file-list (cdr preloaded-file-list))))) + (setq preloaded-file-list (cdr preloaded-file-list)))) + + (if need-to-dump + (condition-case nil + (write-region-internal "foo" nil "../src/NEEDTODUMP") + (file-error nil))) + + ) (setq update-elc-files-to-compile (append update-elc-files-to-compile processed)) @@ -139,7 +173,7 @@ update-elc-files-to-compile)) (load "loadup-el.el")) (condition-case nil - (delete-file "./NOBYTECOMPILE") + (delete-file "../src/NOBYTECOMPILE") (file-error nil))) (kill-emacs) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/userlock.el --- a/lisp/userlock.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/userlock.el Mon Aug 13 11:35:02 2007 +0200 @@ -132,31 +132,38 @@ ;;; dialog-box versions [XEmacs] (defun ask-user-about-lock-dbox (fn opponent) - (let ((echo-keystrokes 0) - (dbox - (cons - (format "%s is locking %s\n + (let ((echo-keystrokes 0)) + (make-dialog-box + 'question + :question (format "%s is locking %s\n It has been detected that you want to modify a file that someone else has already started modifying in XEmacs." - opponent fn) - '(["Steal Lock\n\nThe other user will\nbecome the intruder" steal t] - ["Proceed\n\nEdit file at your own\n\(and the other user's) risk" - proceed t] - nil - ["Abort\n\nDon't modify the buffer\n" yield t])))) - (popup-dialog-box dbox) + opponent fn) + :buttons + '(["Steal Lock\n\nThe other user will\nbecome the intruder" steal t] + ["Proceed\n\nEdit file at your own\n\(and the other user's) risk" + proceed t] + nil + ["Abort\n\nDon't modify the buffer\n" yield t])) (catch 'aual-done (while t (let ((event (next-command-event))) - (cond ((and (misc-user-event-p event) (eq (event-object event) 'proceed)) + (cond ((and (misc-user-event-p event) + (eq (event-object event) 'proceed)) (throw 'aual-done nil)) - ((and (misc-user-event-p event) (eq (event-object event) 'steal)) + ((and (misc-user-event-p event) + (eq (event-object event) 'steal)) (throw 'aual-done t)) - ((and (misc-user-event-p event) (eq (event-object event) 'yield)) + ((and (misc-user-event-p event) + (eq (event-object event) 'yield)) (signal 'file-locked (list "File is locked" fn opponent))) ((and (misc-user-event-p event) (eq (event-object event) 'menu-no-selection-hook)) (signal 'quit nil)) + ;; safety check, so we're not endlessly stuck when no + ;; dialog box up + ((not (popup-up-p)) + (signal 'quit nil)) ((button-release-event-p event) ;; don't beep twice nil) (t @@ -164,20 +171,21 @@ (message "please answer the dialog box")))))))) (defun ask-user-about-supersession-threat-dbox (fn) - (let ((echo-keystrokes 0) - (dbox - (cons - (format "File %s has changed on disk + (let ((echo-keystrokes 0)) + (make-dialog-box + 'question + :question + (format "File %s has changed on disk since its buffer was last read in or saved. Do you really want to edit the buffer? " fn) - '(["Yes\n\nEdit the buffer anyway,\nignoring the disk file" - proceed t] - ["No\n\nDon't modify the buffer\n" yield t] - nil - ["No\n\nDon't modify the buffer\nbut revert it" revert t] - )))) - (popup-dialog-box dbox) + :buttons + '(["Yes\n\nEdit the buffer anyway,\nignoring the disk file" + proceed t] + ["No\n\nDon't modify the buffer\n" yield t] + nil + ["No\n\nDon't modify the buffer\nbut revert it" revert t] + )) (catch 'auast-done (while t (let ((event (next-command-event))) @@ -195,6 +203,10 @@ ((and (misc-user-event-p event) (eq (event-object event) 'menu-no-selection-hook)) (signal 'quit nil)) + ;; safety check, so we're not endlessly stuck when no + ;; dialog box up + ((not (popup-up-p)) + (signal 'quit nil)) ((button-release-event-p event) ;; don't beep twice nil) (t @@ -214,10 +226,7 @@ return nil (edit the file even though it is locked). You can rewrite it to use any criterion you like to choose which one to do." (discard-input) - (if (and (fboundp 'popup-dialog-box) - (or (button-press-event-p last-command-event) - (button-release-event-p last-command-event) - (misc-user-event-p last-command-event))) + (if (should-use-dialog-box-p) (ask-user-about-lock-dbox fn opponent) (ask-user-about-lock-minibuf fn opponent))) @@ -231,10 +240,7 @@ You can rewrite this to use any criterion you like to choose which one to do. The buffer in question is current when this function is called." (discard-input) - (if (and (fboundp 'popup-dialog-box) - (or (button-press-event-p last-command-event) - (button-release-event-p last-command-event) - (misc-user-event-p last-command-event))) + (if (should-use-dialog-box-p) (ask-user-about-supersession-threat-dbox fn) (ask-user-about-supersession-threat-minibuf fn))) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/wid-edit.el --- a/lisp/wid-edit.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/wid-edit.el Mon Aug 13 11:35:02 2007 +0200 @@ -1986,8 +1986,8 @@ (defun widget-url-link-action (widget &optional event) "Open the url specified by WIDGET." - (if (boundp 'browse-url-browser-function) - (funcall browse-url-browser-function (widget-value widget)) + (if (fboundp 'browse-url) + (browse-url (widget-value widget)) (error "Cannot follow URLs in this XEmacs"))) ;;; The `function-link' Widget. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/win32-native.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/win32-native.el Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,280 @@ +;;; win32-native.el --- Lisp routines for MS Windows. + +;; Copyright (C) 1994 Free Software Foundation, Inc. +;; Copyright (C) 2000 Ben Wing. + +;; Maintainer: XEmacs Development Team +;; Keywords: mouse, dumped + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the +;; Free Software Foundation, 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Synched up with: Not synched with FSF. Almost completely divergent. +;;; (FSF has stuff in w32-fns.el and term/w32-win.el.) + +;;; Commentary: + +;; This file is dumped with XEmacs for MS Windows (without cygwin). + +;; Based on NT Emacs version by Geoff Voelker (voelker@cs.washington.edu) +;; Ported to XEmacs by Marc Paquette +;; Largely modified by Kirill M. Katsnelson + +;;; Code: + +;; The cmd.exe shell uses the "/c" switch instead of the "-c" switch +;; for executing its command line argument (from simple.el). +;; #### Oh if we had an alist of shells and their command switches. +(setq shell-command-switch "/c") + +;; For appending suffixes to directories and files in shell +;; completions. This screws up cygwin users so we leave it out for +;; now. Uncomment this if you only ever want to use cmd. + +;(defun nt-shell-mode-hook () +; (setq comint-completion-addsuffix '("\\" . " ") +; comint-process-echoes t)) +;(add-hook 'shell-mode-hook 'nt-shell-mode-hook) + +;; Use ";" instead of ":" as a path separator (from files.el). +(setq path-separator ";") + +;; Set the null device (for compile.el). +;; #### There should be such a global thingy as null-device - kkm +(setq grep-null-device "NUL") + +;; Set the grep regexp to match entries with drive letters. +(setq grep-regexp-alist + '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3))) + +;;---------------------------------------------------------------------- +;; Autosave hack +;;-------------------- + +;; Avoid creating auto-save file names containing invalid characters +;; (primarily "*", eg. for the *mail* buffer). +;; Avoid "doc lost for function" warning +(defun original-make-auto-save-file-name (&optional junk) + "You do not want to call this." + ) +(fset 'original-make-auto-save-file-name + (symbol-function 'make-auto-save-file-name)) + +(defun make-auto-save-file-name () + "Return file name to use for auto-saves of current buffer. +Does not consider `auto-save-visited-file-name' as that variable is checked +before calling this function. You can redefine this for customization. +See also `auto-save-file-name-p'." + (let ((name (original-make-auto-save-file-name)) + (start 0)) + ;; destructively replace occurrences of * or ? with $ + (while (string-match "[?*]" name start) + (aset name (match-beginning 0) ?$) + (setq start (1+ (match-end 0)))) + name)) + +;;---------------------------------------------------------------------- +;; Quoting process args +;;-------------------- + +(defvar debug-mswindows-process-command-lines nil + "If non-nil, output debug information about the command lines constructed. +This can be useful if you are getting process errors where the arguments +to the process appear to be getting passed incorrectly.") + +;; properly quotify one arg for the vc runtime argv constructor. +(defun mswindows-quote-one-vc-runtime-arg (arg &optional quote-shell) + ;; we mess with any arg with whitespace, quotes, or globbing chars in it. + ;; we also include shell metachars if asked. + ;; note that \ is NOT included! it's perfectly OK to include an + ;; arg like c:\ or c:\foo. + (if (string-match (if quote-shell "[ \t\n\r\f*?\"<>|&^%]" "[ \t\n\r\f*?\"]") + arg) + (progn + ;; handle nested quotes, possibly preceded by backslashes + (setq arg (replace-in-string arg "\\([\\]*\\)\"" "\\1\\1\\\\\"")) + ;; handle trailing backslashes + (setq arg (replace-in-string arg "\\([\\]+\\)$" "\\1\\1")) + (concat "\"" arg "\"")) + arg)) + +(defun mswindows-quote-one-simple-arg (arg &optional quote-shell) + ;; just put double quotes around args with spaces (and maybe shell + ;; metachars). + (if (string-match (if quote-shell "[ \t\n\r\f*?\"<>|&^%]" "[ \t\n\r\f*?]") + arg) + (concat "\"" arg "\"") + arg)) + +(defun mswindows-quote-one-command-arg (arg) + ;; quote an arg to get it past COMMAND.COM/CMD.EXE: need to quote shell + ;; metachars with ^. + (replace-in-string "[<>|&^%]" "^\\1" arg)) + +(defun mswindows-construct-verbatim-command-line (program args) + (mapconcat #'identity args " ")) + +;; for use with either standard VC++ compiled programs or Cygwin programs, +;; which emulate the same behavior. +(defun mswindows-construct-vc-runtime-command-line (program args) + (mapconcat #'mswindows-quote-one-vc-runtime-arg args " ")) + +;; note: for pulling apart an arg: +;; each arg consists of either + +;; something surrounded by single quotes + +;; or + +;; one or more of + +;; 1. a non-ws, non-" char +;; 2. a section of double-quoted text +;; 3. a section of double-quoted text with end-of-string instead of the final +;; quote. + +;; 2 and 3 get handled together. + +;; quoted text is one of +;; +;; 1. quote + even number of backslashes + quote, or +;; 2. quote + non-greedy anything + non-backslash + even number of +;; backslashes + quote. + +;; we need to separate the two because we unfortunately have no non-greedy +;; ? operator. (urk! we actually do, but it wasn't documented.) --ben + +;; if you want to mess around, keep this test case in mind: + +;; this string + +;; " as'f 'FOO BAR' '' \"\" \"asdf \\ \\\" \\\\\\\" asdfasdf\\\\\" foo\" " + +;; should tokenize into this: + +;; (" " "as'f" " " "'FOO BAR' " "'' " "\"\"" " " "\"asdf \\ \\\" \\\\\\\" asdfasdf\\\\\"" " " "foo" "\" ") + +;; this regexp actually separates the arg into individual args, like a +;; shell (such as sh) does, but using vc-runtime rules. it's easy to +;; derive the tokenizing regexp from it, and that's exactly what i did. +;; but oh was it hard to get this first regexp right. --ben +;(defvar mswindows-match-one-cmd-exe-arg-regexp +; (concat +; "^\\(" +; "'\\([\\]*\\)\\2'" "\\|" +; "'.*?[^\\]\\(\\([\\]*\\)\\4'\\)" "\\|" +; "\\(" +; "[^ \t\n\r\f\v\"]" "\\|" +; "\"\\([\\]*\\)\\6\"" "\\|" +; "\".*?[^\\]\\(\\([\\]*\\)\\8\"\\|$\\)" +; "\\)+" +; "\\)" +; "\\([ \t\n\r\f\v]+\\|$\\)")) + +(defvar mswindows-match-one-cmd-exe-token-regexp + (concat + "^\\(" + "[ \t\n\r\f\v]+" "\\|" + "'\\([\\]*\\)\\2'" "\\([ \t\n\r\f\v]+\\|$\\)" "\\|" + "'.*?[^\\]\\(\\([\\]*\\)\\5'\\)" "\\([ \t\n\r\f\v]+\\|$\\)" "\\|" + "[^ \t\n\r\f\v\"]+" "\\|" + "\"\\([\\]*\\)\\7\"" "\\|" + "\".*?[^\\]\\(\\([\\]*\\)\\9\"\\|$\\)" + "\\)")) + +(defun mswindows-construct-command-command-line (program args) + ;; for use with COMMAND.COM and CMD.EXE: + ;; for each arg, tokenize it into quoted and non-quoted sections; + ;; then quote all the shell meta-chars with ^; then put everything + ;; back together. the truly hard part is the tokenizing -- typically + ;; we get a single argument (the command to execute) and we have to + ;; worry about quotes that are backslash-quoted and such. + (mapconcat + #'(lambda (arg) + (mapconcat + #'(lambda (part) + (if (string-match "^'" part) + (replace-in-string part "\\([<>|^&%]\\)" "^\\1") + part)) + (let (parts) + (while (and (> (length arg) 0) + (string-match + mswindows-match-one-cmd-exe-token-regexp + arg)) + (push (match-string 0 arg) parts) + (setq arg (substring arg (match-end 0)))) + (if (> (length arg) 0) + (push arg parts)) + (nreverse parts)) + "")) + args " ")) + +(defvar mswindows-construct-process-command-line-alist + '(("[\\/].?.?sh\\." . mswindows-construct-verbatim-command-line) + ("[\\/]command\\.com$" . mswindows-construct-command-command-line) + ("[\\/]cmd\\.exe$" . mswindows-construct-command-command-line) + ("" . mswindows-construct-vc-runtime-command-line)) + "An alist for determining proper argument quoting given executable +file name. Car of each cons should be a string, a regexp against +which the file name is matched. Matching is case-insensitive but does +include the directory, so you should begin your regexp with [\\\\/] if +you don't want the directory to matter. Alternatively, the car can be +a function of one arg, which is called with the executable's name and +should return t if this entry should be processed. Cdr is a function +symbol, which is called with two args, the executable name and a list +of the args passed to it. It should return a string, which includes +the executable's args (but not the executable name itself) properly +quoted and pasted together. The list is matched in order, and the +first matching entry specifies how the processing will happen.") + +(defun mswindows-construct-process-command-line (args) + ;;Properly quote process ARGS for executing (car ARGS). + ;;Called from the C code. + (let ((fname (car args)) + (alist mswindows-construct-process-command-line-alist) + (case-fold-search t) + (return-me nil) + (assoc nil)) + (while (and alist + (null return-me)) + (setq assoc (pop alist)) + (if (if (stringp (car assoc)) + (string-match (car assoc) fname) + (funcall (car assoc) fname)) + (setq return-me (cdr assoc)))) + (let* ((called-fun (or return-me + #'mswindows-construct-vc-runtime-command-line)) + (retval + (let ((str (funcall called-fun fname (cdr args))) + (quoted-fname (mswindows-quote-one-simple-arg fname))) + (if (and str (> (length str) 0)) + (concat quoted-fname " " str) + quoted-fname)))) + (when debug-mswindows-process-command-lines + (debug-print "mswindows-construct-process-command-line called:\n") + (debug-print "received args: \n%s" + (let ((n -1)) + (mapconcat #'(lambda (arg) + (incf n) + (format " %d %s\n" n arg)) + args + ""))) + (debug-print "called fun %s\n" called-fun) + (debug-print "resulting command line: %s\n" retval)) + retval))) + +;;; win32-native.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/window-xemacs.el --- a/lisp/window-xemacs.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/window-xemacs.el Mon Aug 13 11:35:02 2007 +0200 @@ -191,6 +191,29 @@ ;;;;;;;;;;;;; display-buffer, moved here from C. Hallelujah. +(make-variable-buffer-local '__buffer-dedicated-frame) + +(defun buffer-dedicated-frame (&optional buffer) + "Return the frame dedicated to this BUFFER, or nil if there is none. +No argument or nil as argument means use current buffer as BUFFER." + (let ((buffer (decode-buffer buffer))) + (let ((frame (symbol-value-in-buffer '__buffer-dedicated-frame buffer))) + ;; XEmacs addition: if the frame is dead, silently make it go away. + (when (and (framep frame) (not (frame-live-p frame))) + (with-current-buffer buffer + (setq __buffer-dedicated-frame nil)) + (setq frame nil)) + frame))) + +(defun set-buffer-dedicated-frame (buffer frame) + "For this BUFFER, set the FRAME dedicated to it. +FRAME must be a frame or nil." + (let ((buffer (decode-buffer buffer))) + (and frame + (check-argument-type #'frame-live-p frame)) + (with-current-buffer buffer + (setq __buffer-dedicated-frame frame)))) + (defvar display-buffer-function nil "If non-nil, function to call to handle `display-buffer'. It will receive three args: the same as those to `display-buffer'.") diff -r 72a7cfa4a488 -r abe6d1db359e lisp/window.el --- a/lisp/window.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/window.el Mon Aug 13 11:35:02 2007 +0200 @@ -120,13 +120,19 @@ (defmacro save-selected-window (&rest body) "Execute BODY, then select the window that was selected before BODY." - (list 'let - '((save-selected-window-window (selected-window))) - (list 'unwind-protect - (cons 'progn body) - (list 'and ; XEmacs - (list 'window-live-p 'save-selected-window-window) - (list 'select-window 'save-selected-window-window))))) + `(let ((save-selected-window-window (selected-window))) + (unwind-protect + (progn ,@body) + (when (window-live-p save-selected-window-window) + (select-window save-selected-window-window))))) + +(defmacro with-selected-window (window &rest body) + "Execute forms in BODY with WINDOW as the selected window. +The value returned is the value of the last form in BODY." + `(save-selected-window + (select-window ,window) + ,@body)) + (defun count-windows (&optional minibuf) "Return the number of visible windows. @@ -286,8 +292,7 @@ (if (and (not (eobp)) (eq ?\n (char-after (1- (point-max))))) 1 0))) - (mini (frame-property (window-frame window) 'minibuffer)) - (edges (window-pixel-edges (selected-window)))) + (mini (frame-property (window-frame window) 'minibuffer))) (if (and (< 1 (let ((frame (selected-frame))) (select-frame (window-frame window)) (unwind-protect @@ -297,7 +302,6 @@ ;; of the frame (window-leftmost-p window) (window-rightmost-p window) - (zerop (nth 0 edges)) ;; The whole buffer must be visible. (pos-visible-in-window-p (point-min) window) ;; The frame must not be minibuffer-only. @@ -351,5 +355,4 @@ minibuf all-frames device) wins)) - ;;; window.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/winnt.el --- a/lisp/winnt.el Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -;;; winnt.el --- Lisp routines for Windows NT. - -;; Copyright (C) 1994 Free Software Foundation, Inc. - -;; Maintainer: XEmacs Development Team -;; Keywords: mouse, dumped - -;; This file is part of XEmacs. - -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; XEmacs is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Synched up with: Not synched with FSF. Almost completely divergent. - -;;; Commentary: - -;; This file is dumped with XEmacs for MS Windows (without cygwin). - -;; Based on NT Emacs version by Geoff Voelker (voelker@cs.washington.edu) -;; Ported to XEmacs by Marc Paquette -;; Largely modified by Kirill M. Katsnelson - -;;; Code: - -;; The cmd.exe shell uses the "/c" switch instead of the "-c" switch -;; for executing its command line argument (from simple.el). -;; #### Oh if we had an alist of shells and their command switches. -(setq shell-command-switch "/c") - -;; For appending suffixes to directories and files in shell -;; completions. This screws up cygwin users so we leave it out for -;; now. Uncomment this if you only ever want to use cmd. - -;(defun nt-shell-mode-hook () -; (setq comint-completion-addsuffix '("\\" . " ") -; comint-process-echoes t)) -;(add-hook 'shell-mode-hook 'nt-shell-mode-hook) - -;; Use ";" instead of ":" as a path separator (from files.el). -(setq path-separator ";") - -;; Set the null device (for compile.el). -;; #### There should be such a global thingy as null-device - kkm -(setq grep-null-device "NUL") - -;; Set the grep regexp to match entries with drive letters. -(setq grep-regexp-alist - '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3))) - -;;---------------------------------------------------------------------- -;; Autosave hack -;;-------------------- - -;; Avoid creating auto-save file names containing invalid characters -;; (primarily "*", eg. for the *mail* buffer). -;; Avoid "doc lost for function" warning -(defun original-make-auto-save-file-name (&optional junk) - "You do not want to call this." - ) -(fset 'original-make-auto-save-file-name - (symbol-function 'make-auto-save-file-name)) - -(defun make-auto-save-file-name () - "Return file name to use for auto-saves of current buffer. -Does not consider `auto-save-visited-file-name' as that variable is checked -before calling this function. You can redefine this for customization. -See also `auto-save-file-name-p'." - (let ((name (original-make-auto-save-file-name)) - (start 0)) - ;; destructively replace occurrences of * or ? with $ - (while (string-match "[?*]" name start) - (aset name (match-beginning 0) ?$) - (setq start (1+ (match-end 0)))) - name)) - -;;---------------------------------------------------------------------- -;; Quoting process args -;;-------------------- - -(defun nt-quote-args-verbatim (args) - "Copy ARG list verbatim, separating each arg with space." - (mapconcat #'identity args " ")) - -(defun nt-quote-args-prefix-quote (prefix args) - (mapconcat (lambda (str) - (concat "\"" - (mapconcat (lambda (ch) - (concat (if (eq ch ?\") prefix) - (char-to-string ch))) - str nil) - "\"")) - args " ")) - -(defun nt-quote-args-backslash-quote (args) - "Place ARG list in quotes, prefixing quotes in args with backslashes." - (nt-quote-args-prefix-quote "\\" args)) - -(defun nt-quote-args-double-quote (args) - "Place ARG list in quotes, doubling quotes in args." - (nt-quote-args-prefix-quote "\"" args)) - -(defvar nt-quote-args-functions-alist - '(("^.?.?sh\\." . nt-quote-args-double-quote)) - "An alist for determining proper argument quoting given executable file name. -Car of each cons must be a string, a regexp against which a file name sans -directory is matched. Cdr is a function symbol. The list is mathced in -forward order, and mathcing entry cdr's funcrion is called with a list of -strings, process arguments. It must return a string which is passed to -the newly created process. - -If not found, then `nt-quote-args-verbatim' is called on the argument list.") - -(defun nt-quote-process-args (args) - ;;Properly quote process ARGS for executing (car ARGS). - (let ((fname (file-name-nondirectory (car args))) - (alist nt-quote-args-functions-alist) - (case-fold-search nil) - (return-me nil) - (assoc nil)) - (while (and alist - (null return-me)) - (setq assoc (pop alist)) - (if (string-match (car assoc) fname) - (setq return-me (funcall (cdr assoc) (cdr args))))) - (or return-me - (nt-quote-args-verbatim (cdr args))))) - -;;; winnt.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/x-faces.el --- a/lisp/x-faces.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/x-faces.el Mon Aug 13 11:35:02 2007 +0200 @@ -203,7 +203,7 @@ "Given an X font specification, this attempts to make a `bold-italic' font. If it fails, it returns nil." ;; This is haired up to avoid loading the "intermediate" fonts. - (if *try-oblique-before-italic-fonts* + (if try-oblique-before-italic-fonts (or (try-font-name (x-frob-font-slant (x-frob-font-weight font "bold") "o") device) (try-font-name @@ -492,11 +492,13 @@ (or (null locale) (eq locale 'global))) (progn (or fn (setq fn (x-get-resource - "font" "Font" 'string locale))) + "font" "Font" 'string locale nil 'warn))) (or fg (setq fg (x-get-resource - "foreground" "Foreground" 'string locale))) + "foreground" "Foreground" 'string locale nil + 'warn))) (or bg (setq bg (x-get-resource - "background" "Background" 'string locale))))) + "background" "Background" 'string locale nil + 'warn))))) ;; ;; "*cursorColor: foo" is equivalent to setting the background of the ;; text-cursor face. @@ -504,7 +506,8 @@ (if (and (eq (face-name face) 'text-cursor) (or (null locale) (eq locale 'global))) (setq bg (or (x-get-resource - "cursorColor" "CursorColor" 'string locale) bg))) + "cursorColor" "CursorColor" 'string locale nil 'warn) + bg))) ;; #### should issue warnings? I think this should be ;; done when the instancing actually happens, but I'm not ;; sure how it should actually be dealt with. @@ -735,7 +738,8 @@ ;; If reverseVideo was specified, swap the foreground and background ;; of the default and modeline faces. ;; - (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame)) + (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame + nil 'warn)) ;; First make sure the modeline has fg and bg, inherited from the ;; current default face - for the case where only one is specified, ;; so that invert-face doesn't do something weird. diff -r 72a7cfa4a488 -r abe6d1db359e lisp/x-font-menu.el --- a/lisp/x-font-menu.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/x-font-menu.el Mon Aug 13 11:35:02 2007 +0200 @@ -185,6 +185,8 @@ ;; get the truename and use the possibly suboptimal data from that. ;;;###autoload (defun* x-font-menu-font-data (face dcache) + (defvar x-font-regexp) + (defvar x-font-regexp-foundry-and-family) (let* ((case-fold-search t) (domain (if font-menu-this-frame-only-p (selected-frame) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/x-init.el --- a/lisp/x-init.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/x-init.el Mon Aug 13 11:35:02 2007 +0200 @@ -55,7 +55,7 @@ (defun x-activate-region-as-selection () (if (marker-buffer (mark-marker t)) - (x-own-selection (cons (point-marker t) (mark-marker t))))) + (own-selection (cons (point-marker t) (mark-marker t))))) ;; OpenWindows-like "find" processing. These functions are really Sunisms, ;; but we put them here instead of in x-win-sun.el in case someone wants @@ -68,8 +68,8 @@ (defun ow-find (&optional backward-p) "Search forward the next occurrence of the text of the selection." (interactive) - (let ((sel (condition-case () (x-get-selection) (error nil))) - (clip (condition-case () (x-get-clipboard) (error nil))) + (let ((sel (ignore-errors (get-selection))) + (clip (ignore-errors (get-clipboard))) text) (setq text (cond (sel) @@ -305,13 +305,13 @@ (init-x-toolbar)) (if (and (featurep 'infodock) (featurep 'toolbar)) (require 'id-x-toolbar)) - (if (featurep 'mule) - (init-mule-x-win)) + (if (featurep 'gutter) (init-gutter)) + (if (featurep 'mule) (init-mule-x-win)) ;; these are only ever called if zmacs-regions is true. (add-hook 'zmacs-deactivate-region-hook (lambda () (when (console-on-window-system-p) - (x-disown-selection)))) + (disown-selection)))) (add-hook 'zmacs-activate-region-hook (lambda () (when (console-on-window-system-p) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/x-misc.el --- a/lisp/x-misc.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/x-misc.el Mon Aug 13 11:35:02 2007 +0200 @@ -66,7 +66,7 @@ (let* ((name (caar resource-list)) (class (cdar resource-list)) (resource - (x-get-resource name class type locale nil t))) + (x-get-resource name class type locale nil 'warn))) (if resource (progn (add-spec-to-specifier specifier resource locale) @@ -75,12 +75,12 @@ (defun x-get-resource-and-bogosity-check (name class type &optional locale) (x-bogosity-check-resource name class type) - (x-get-resource name class type locale nil t)) + (x-get-resource name class type locale nil 'warn)) (defun x-get-resource-and-maybe-bogosity-check (name class type &optional locale) (if (eq locale 'global) (x-bogosity-check-resource name class type)) - (x-get-resource name class type locale nil t)) + (x-get-resource name class type locale nil 'warn)) ;;; x-misc.el ends here diff -r 72a7cfa4a488 -r abe6d1db359e lisp/x-mouse.el --- a/lisp/x-mouse.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/x-mouse.el Mon Aug 13 11:35:02 2007 +0200 @@ -100,41 +100,48 @@ (if x-pointers-initialized ; only do it when the first device is created nil (set-glyph-image text-pointer-glyph - (or (x-get-resource "textPointer" "Cursor" 'string device) + (or (x-get-resource "textPointer" "Cursor" 'string device nil 'warn) "xterm")) (set-glyph-image selection-pointer-glyph - (or (x-get-resource "selectionPointer" "Cursor" 'string device) + (or (x-get-resource "selectionPointer" "Cursor" 'string device + nil 'warn) "top_left_arrow")) (set-glyph-image nontext-pointer-glyph - (or (x-get-resource "spacePointer" "Cursor" 'string device) + (or (x-get-resource "spacePointer" "Cursor" 'string device nil 'warn) "xterm")) ; was "crosshair" (set-glyph-image modeline-pointer-glyph - (or (x-get-resource "modeLinePointer" "Cursor" 'string device) + (or (x-get-resource "modeLinePointer" "Cursor" 'string device + nil 'warn) ;; "fleur")) "sb_v_double_arrow")) (set-glyph-image gc-pointer-glyph - (or (x-get-resource "gcPointer" "Cursor" 'string device) + (or (x-get-resource "gcPointer" "Cursor" 'string device nil 'warn) "watch")) (when (featurep 'scrollbar) (set-glyph-image scrollbar-pointer-glyph - (or (x-get-resource "scrollbarPointer" "Cursor" 'string device) + (or (x-get-resource "scrollbarPointer" "Cursor" 'string device + nil 'warn) "top_left_arrow"))) (set-glyph-image busy-pointer-glyph - (or (x-get-resource "busyPointer" "Cursor" 'string device) + (or (x-get-resource "busyPointer" "Cursor" 'string device nil 'warn) "watch")) (set-glyph-image toolbar-pointer-glyph - (or (x-get-resource "toolBarPointer" "Cursor" 'string device) + (or (x-get-resource "toolBarPointer" "Cursor" 'string device + nil 'warn) "left_ptr")) (set-glyph-image divider-pointer-glyph - (or (x-get-resource "dividerPointer" "Cursor" 'string device) + (or (x-get-resource "dividerPointer" "Cursor" 'string device + nil 'warn) "sb_h_double_arrow")) (let ((fg - (x-get-resource "pointerColor" "Foreground" 'string device))) + (x-get-resource "pointerColor" "Foreground" 'string device + nil 'warn))) (and fg (set-face-foreground 'pointer fg))) (let ((bg - (x-get-resource "pointerBackground" "Background" 'string device))) + (x-get-resource "pointerBackground" "Background" 'string device + nil 'warn))) (and bg (set-face-background 'pointer bg))) (setq x-pointers-initialized t)) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/x-scrollbar.el --- a/lisp/x-scrollbar.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/x-scrollbar.el Mon Aug 13 11:35:02 2007 +0200 @@ -80,7 +80,7 @@ ;; Now do ScrollBarPlacement.scrollBarPlacement (let ((case-fold-search t) (resval (x-get-resource "ScrollBarPlacement" "scrollBarPlacement" - 'string locale))) + 'string locale nil 'warn))) (cond ((null resval)) ((string-match "^top[_-]left$" resval) diff -r 72a7cfa4a488 -r abe6d1db359e lisp/x-select.el --- a/lisp/x-select.el Mon Aug 13 11:33:40 2007 +0200 +++ b/lisp/x-select.el Mon Aug 13 11:35:02 2007 +0200 @@ -88,36 +88,6 @@ ;(setq x-sent-selection-hooks 'x-notice-selection-failures) -;;; Selections in killed buffers -;;; this function is called by kill-buffer as if it were on the -;;; kill-buffer-hook (though it isn't really). - -(defun xselect-kill-buffer-hook () - ;; Probably the right thing is to write a C function to return a list - ;; of the selections which emacs owns, since it could conceivably own - ;; a user-defined selection type that we've never heard of. - (xselect-kill-buffer-hook-1 'PRIMARY) - (xselect-kill-buffer-hook-1 'SECONDARY) - (xselect-kill-buffer-hook-1 'CLIPBOARD)) - -(defun xselect-kill-buffer-hook-1 (selection) - (let (value) - (if (and (selection-owner-p selection) - (setq value (get-selection-internal selection '_EMACS_INTERNAL)) - ;; The _EMACS_INTERNAL selection type has a converter registered - ;; for it that does no translation. This only works if emacs is - ;; requesting the selection from itself. We could have done this - ;; by writing a C function to return the raw selection data, and - ;; that might be the right way to do this, but this was easy. - (or (and (consp value) - (markerp (car value)) - (eq (current-buffer) (marker-buffer (car value)))) - (and (extent-live-p value) - (eq (current-buffer) (extent-object value))) - (and (extentp value) (not (extent-live-p value))))) - (disown-selection-internal selection)))) - - ;;; Cut Buffer support ;;; FSF name x-get-cut-buffer diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/ChangeLog --- a/lwlib/ChangeLog Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/ChangeLog Mon Aug 13 11:35:02 2007 +0200 @@ -1,3 +1,170 @@ +2000-10-04 Martin Buchholz + + * XEmacs 21.2.36 is released. + +2000-09-19 Martin Buchholz + + * *: Spelling mega-patch + +2000-09-16 Martin Buchholz + + * lwlib.c (ascii_strcasecmp): New. + * lwlib.c (find_in_table): Use ascii_strcasecmp. + Avoid using non-standard non-portable strcasecmp. + +2000-08-02 Stephen J. Turnbull + + * xlwmenu.c (XlwMenuInitialize): make comment on algorithm for + setting fontList match code. Suggest using same algorithm for + X Font Set resources in native lw code. + +2000-07-30 Ben Wing + + * lwlib-Xaw.c (xaw_update_one_widget): + Remove accelerator specs from buttons, since Athena doesn't handle + them. + + * lwlib.c (lw_remove_accelerator_spec): + * lwlib.h: + Define function and prototype to do this. + +2000-07-15 Ben Wing + + * xlwradioP.h: + Remove duplicate definition of streq(). + +2000-07-19 Martin Buchholz + + * XEmacs 21.2.35 is released. + +2000-07-09 Martin Buchholz + + * xlwcheckbox.c: + * xlwgauge.h: + * xlwgaugeP.h: + * xlwradio.h: + * xlwradioP.h: + * xlwgauge.c: + * config.h.in: + * xlwradio.c: + * lwlib-Xaw.c: + Replace SMART_INCLUDE with a dumber, but more reliable method. + + * xlwmenu.c (parameterize_string): Fix C++ compilation warnings. + +2000-06-10 Ben Wing + + * lwlib-Xaw.c (xaw_create_label): add sanity check on arg limit. + (xaw_update_one_value): fix crash due to incorrect arg count. + +2000-05-28 Martin Buchholz + + * XEmacs 21.2.34 is released. + +2000-05-01 Martin Buchholz + + * XEmacs 21.2.33 is released. + +2000-04-19 Martin Buchholz + + * lwlib.c (lw_destroy_everything): Always use full ANSI prototypes. + * lwlib.c (lw_destroy_all_pop_ups): Always use full ANSI prototypes. + +2000-04-12 Andy Piper + + * lwlib-Xaw.c (xaw_update_one_widget): no-op for text widgets. + (xaw_update_one_value): Get strings safely. + (xaw_create_text_field): add some extra properties. + +2000-04-05 Andy Piper + + * lwlib-Xaw.c (lw_xaw_widget_p): include asciiTextWidgetClass as + an athena widget. + +2000-04-05 Andy Piper + + * xlwradio.c (RadioSetValues): resize if position information has + changed. + + * lwlib-Xm.c (xm_create_text_field): text fields should be enabled + even if there is no callback. + * lwlib-Xaw.c (xaw_create_text_field): ditto. + +2000-04-03 Andy Piper + + * lwlib.c (merge_widget_value_args): only merge when the two args + are actually different. + +2000-03-21 Didier Verna + + * config.h.in: move INCLUDE_GLUE_1 and INCLUDE_GLUE_2 to + src/config.h.in. + * config.h.in (ATHENA_INCLUDE): use the `SMART_INCLUDE' macro. + +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-14 Ben Wing + + * xlwmenu.c (massage_resource_name): Handle %_ and %%. + +2000-02-20 Gunnar Evermann + + * xlwscrollbar.c (get_gc): Always check for XmUNSPECIFIED_PIXMAP + even if we are only 'compatible' with the Motif resources. + (XmUNSPECIFIED_PIXMAP): Define unconditionally. + +2000-02-23 Martin Buchholz + + * XEmacs 21.2.31 is released. + +2000-02-22 Andy Piper + + * lwlib-Xm.c (xm_update_one_widget): set widget args last in case + anything messes with them in the meantime. + * lwlib-Xlw.c (xlw_update_one_widget): ditto. + * lwlib-Xaw.c (xaw_update_one_widget): ditto. + +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-21 Andy Piper + + * lwlib.c (merge_widget_value_args): don't delete the args before + copying, lw_copy_widget_value_args will do this for us if + necessary. + (lw_add_widget_value_arg): Allow existing args to be replaced. + (free_widget_value_args): Set args to 0 rather than 0xdeadbeef, + reference couting works better that way. + (lw_copy_widget_value_args): Do the right thing. + + * lwlib-Xm.c (xm_create_progress): Make sensitive as this looks + much better. + * lwlib-Xaw.c (xaw_create_progress): ditto. + +2000-02-12 Jan Vroonhof + + * xlwmenu.h (XmUNSPECIFIED_PIXMAP): Define this if we are using Motif + compatible resource names. + + * xlwmenu.c (make_shadow_gcs): Always check for XmUNSPECIFIED_PIXMAP + even if we are only 'compatible' with the Motif resources. + +2000-02-15 Andy Piper + + * xlwgauge.c (GaugeExpose): remove shadows. + +2000-02-16 Martin Buchholz + + * XEmacs 21.2.29 is released. + +2000-02-09 Valdis Kletnieks + + * config.h.in (ATHENA_INCLUDE): Workaround bugs in both xlc and + old gccs. + 2000-02-07 Martin Buchholz * XEmacs 21.2.28 is released. @@ -76,7 +243,7 @@ 1999-12-12 Daniel Pittman - * lwlib-Xaw.c: + * lwlib-Xaw.c: * xlwcheckbox.c: * xlwgauge.h: * xlwgaugeP.h: @@ -191,11 +358,11 @@ Include to get prototype for atoi(). (GaugeSelect): Call GaugeExpose with the right number of args. (GaugeLoseSel): Call GaugeExpose with the right number of args. - (GaugeConvert): This is a XtConvertSelectionProc, + (GaugeConvert): This is a XtConvertSelectionProc, so 5th parameter must be of type XtPointer, not XPointer. - (GaugeGetValue): This is a XtTimerCallbackProc, + (GaugeGetValue): This is a XtTimerCallbackProc, so 2nd parameter must be of type XtIntervalId *, not XtIntervalId. - + 1999-09-01 Martin Buchholz @@ -231,7 +398,7 @@ * xlwradio.c: * xlwcheckbox.c: * xlwgauge.c: Fix for losing systems without Xmu. - + 1999-08-31 Andy Piper * lwlib-Xm.c (xm_update_one_widget): fix for AIX compiler lossage. @@ -363,7 +530,7 @@ * XEmacs 21.2.18 is released -1999-07-05 Didier Verna +1999-07-05 Didier Verna * lwlib-Xm.c (xm_update_one_widget): add missing #ifdefs around call to xm_update_label. diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/config.h.in --- a/lwlib/config.h.in Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/config.h.in Mon Aug 13 11:35:02 2007 +0200 @@ -29,15 +29,18 @@ #undef NEED_ATHENA #undef NEED_LUCID -/* The path to the Athena widgets - the usual value is `X11/Xaw' */ -#undef ATHENA_H_PATH +/* The exact path to the Athena header files depends on which `flavor' + of Athena is being used - hence configure defines them for us. */ -/* For use in #include statements. - You can't use macros directly within the <> of a #include statement. - The multiply nested macros are necessary to make old gcc's happy. */ -#define INCLUDE_GLUE_2(dirname,basename) <##dirname##/##basename##> -#define INCLUDE_GLUE_1(dirname,basename) INCLUDE_GLUE_2(dirname,basename) -#define ATHENA_INCLUDE(header_file) INCLUDE_GLUE_1(ATHENA_H_PATH,header_file) - +#undef ATHENA_Scrollbar_h_ +#undef ATHENA_Dialog_h_ +#undef ATHENA_Form_h_ +#undef ATHENA_Command_h_ +#undef ATHENA_Label_h_ +#undef ATHENA_LabelP_h_ +#undef ATHENA_Toggle_h_ +#undef ATHENA_ToggleP_h_ +#undef ATHENA_AsciiText_h_ +#undef ATHENA_XawInit_h_ #endif /* _LWLIB_CONFIG_H_ */ diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/lwlib-Xaw.c --- a/lwlib/lwlib-Xaw.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/lwlib-Xaw.c Mon Aug 13 11:35:02 2007 +0200 @@ -33,21 +33,21 @@ #include #ifdef LWLIB_SCROLLBARS_ATHENA -#include ATHENA_INCLUDE(Scrollbar.h) +#include ATHENA_Scrollbar_h_ #endif #ifdef LWLIB_DIALOGS_ATHENA -#include ATHENA_INCLUDE(Dialog.h) -#include ATHENA_INCLUDE(Form.h) -#include ATHENA_INCLUDE(Command.h) -#include ATHENA_INCLUDE(Label.h) +#include ATHENA_Dialog_h_ +#include ATHENA_Form_h_ +#include ATHENA_Command_h_ +#include ATHENA_Label_h_ #endif #ifdef LWLIB_WIDGETS_ATHENA -#include ATHENA_INCLUDE(Toggle.h) +#include ATHENA_Toggle_h_ #include "xlwradio.h" #include "xlwcheckbox.h" #include "xlwgauge.h" #ifndef NEED_MOTIF -#include ATHENA_INCLUDE(AsciiText.h) +#include ATHENA_AsciiText_h_ #endif #endif #include @@ -69,8 +69,8 @@ || XtIsSubclass (widget, labelWidgetClass) || XtIsSubclass (widget, toggleWidgetClass) || XtIsSubclass (widget, gaugeWidgetClass) -#if 0 - || XtIsSubclass (widget, textWidgetClass) +#ifndef NEED_MOTIF + || XtIsSubclass (widget, asciiTextWidgetClass) #endif #endif ); @@ -126,9 +126,6 @@ xaw_update_one_widget (widget_instance *instance, Widget widget, widget_value *val, Boolean deep_p) { - if (val->args && val->args->nargs) - XtSetValues (widget, val->args->args, val->args->nargs); - if (0) ; #ifdef LWLIB_SCROLLBARS_ATHENA @@ -137,6 +134,13 @@ xaw_update_scrollbar (instance, widget, val); } #endif +#ifdef LWLIB_WIDGETS_ATHENA +#ifndef NEED_MOTIF + else if (XtIsSubclass (widget, asciiTextWidgetClass)) + { + } +#endif +#endif #ifdef LWLIB_DIALOGS_ATHENA else if (XtIsSubclass (widget, dialogWidgetClass)) { @@ -175,6 +179,7 @@ } #endif /* ! LWLIB_DIALOGS_ATHENA3D */ + lw_remove_accelerator_spec (val->value); XtSetArg (al [0], XtNlabel, val->value); XtSetArg (al [1], XtNsensitive, val->enabled); /* Force centered button text. See above. */ @@ -193,6 +198,9 @@ #endif /* LWLIB_WIDGETS_ATHENA */ } #endif /* LWLIB_DIALOGS_ATHENA */ + /* Lastly update our global arg values. */ + if (val->args && val->args->nargs) + XtSetValues (widget, val->args->args, val->args->nargs); } void @@ -220,11 +228,19 @@ #ifndef NEED_MOTIF else if (XtIsSubclass (widget, asciiTextWidgetClass)) { - Arg al [1]; + Arg al [2]; + String buf = 0; + XtSetArg (al [0], XtNstring, &buf); + XtGetValues (widget, al, 1); + if (val->value) - free (val->value); - XtSetArg (al [0], XtNstring, &val->value); - XtGetValues (widget, al, 1); + { + free (val->value); + val->value = 0; + } + /* I don't think this causes a leak. */ + if (buf) + val->value = strdup (buf); val->edited = True; } #endif @@ -329,8 +345,8 @@ static Boolean actions_initted = False; static Widget -make_dialog (CONST char* name, Widget parent, Boolean pop_up_p, - CONST char* shell_title, CONST char* icon_name, +make_dialog (const char* name, Widget parent, Boolean pop_up_p, + const char* shell_title, const char* icon_name, Boolean text_input_slot, Boolean radio_box, Boolean list, int left_buttons, int right_buttons) @@ -438,8 +454,8 @@ Widget parent = instance->parent; Widget widget; Boolean pop_up_p = instance->pop_up_p; - CONST char *shell_name = 0; - CONST char *icon_name = 0; + const char *shell_name = 0; + const char *icon_name = 0; Boolean text_input_slot = False; Boolean radio_box = False; Boolean list = False; @@ -776,6 +792,8 @@ /* Do it again for arguments that have no effect until the widget is realized. */ ac = 0; lw_add_value_args_to_args (val, al, &ac); + if (ac > 20) + abort (); /* #### need assert macro in lwlib */ XtSetValues (label, al, ac); return label; @@ -788,7 +806,7 @@ int ac = 0; Widget scale = 0; widget_value* val = instance->info->val; - +#if 0 /* This looks too awful, although more correct. */ if (!val->call_data) { XtSetArg (al [ac], XtNsensitive, False); ac++; @@ -797,6 +815,10 @@ { XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; } +#else + XtSetArg (al [ac], XtNsensitive, True); ac++; +#endif + XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++; XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++; @@ -817,6 +839,7 @@ } #ifndef NEED_MOTIF +#define TEXT_BUFFER_SIZE 128 static Widget xaw_create_text_field (widget_instance *instance) { @@ -825,22 +848,36 @@ Widget text = 0; widget_value* val = instance->info->val; - XtSetArg (al [ac], XtNsensitive, val->enabled && val->call_data); ac++; + XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0); ac++; XtSetArg (al [ac], XtNtype, XawAsciiString); ac++; XtSetArg (al [ac], XtNeditType, XawtextEdit); ac++; + XtSetArg (al [ac], XtNuseStringInPlace, False); ac++; +#if 0 + XtSetArg (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++; +#endif + if (val->value) + { + XtSetArg (al [ac], XtNstring, val->value); ac++; + } /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); text = XtCreateManagedWidget (val->name, asciiTextWidgetClass, instance->parent, al, ac); + + /* add the callback */ + if (val->call_data) + XtAddCallback (text, XtNgetValue, xaw_generic_callback, (XtPointer)instance); + XtManageChild (text); return text; } #endif + #endif /* LWLIB_WIDGETS_ATHENA */ widget_creation_entry diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/lwlib-Xlw.c --- a/lwlib/lwlib-Xlw.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/lwlib-Xlw.c Mon Aug 13 11:35:02 2007 +0200 @@ -536,9 +536,6 @@ widget_value* val, Boolean deep_p) { WidgetClass class = XtClass (widget); - /* Update up global arg values. */ - if (val->args && val->args->nargs) - XtSetValues (widget, val->args->args, val->args->nargs); if (0) ; @@ -567,6 +564,9 @@ xlw_update_tab_control (instance, widget, val); } #endif + /* Lastly update our global arg values. */ + if (val->args && val->args->nargs) + XtSetValues (widget, val->args->args, val->args->nargs); } void diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/lwlib-Xm.c --- a/lwlib/lwlib-Xm.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/lwlib-Xm.c Mon Aug 13 11:35:02 2007 +0200 @@ -255,18 +255,18 @@ { name_string = XmStringCreateLtoR (res_name, XmSTRING_DEFAULT_CHARSET); - + value_name = XtMalloc (strlen (val->value) + 2); *value_name = 0; strcat (value_name, " "); strcat (value_name, val->value); - + val_string = XmStringCreateLtoR (value_name, XmSTRING_DEFAULT_CHARSET); - + built_string = XmStringConcat (name_string, val_string); - + XtFree (value_name); } } @@ -791,8 +791,6 @@ /* Common to all widget types */ XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; XtSetArg (al [ac], XmNuserData, val->call_data); ac++; - lw_add_value_args_to_args (val, al, &ac); - XtSetValues (widget, al, ac); #if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) @@ -856,6 +854,9 @@ xm_update_scrollbar (instance, widget, val); } #endif + /* Lastly update our global arg values. */ + if (val->args && val->args->nargs) + XtSetValues (widget, val->args->args, val->args->nargs); } /* getting the value back */ @@ -926,7 +927,7 @@ val->edited = True; } } - else if (class == xmListWidgetClass + else if (class == xmListWidgetClass #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 || class == xmComboBoxWidgetClass #endif @@ -1038,7 +1039,7 @@ static Widget make_dialog (char* name, Widget parent, Boolean pop_up_p, - CONST char* shell_title, CONST char* icon_name, + const char* shell_title, const char* icon_name, Boolean text_input_slot, Boolean radio_box, Boolean list, int left_buttons, int right_buttons) { @@ -1139,7 +1140,7 @@ n_children++; } - /* invisible seperator button */ + /* invisible separator button */ ac = 0; XtSetArg (al[ac], XmNmappedWhenManaged, FALSE); ac++; children [n_children] = XmCreateLabel (row, "separator_button", @@ -1255,7 +1256,7 @@ XtSetArg(al[ac], XmNrightOffset, 13); ac++; value = XmCreateScrolledList (form, "list", al, ac); - /* this is the easiest way I found to have the dble click in the + /* this is the easiest way I found to have the double click in the list activate the default button */ XtAddCallback (value, XmNdefaultActionCallback, activate_button, button); } @@ -1438,8 +1439,8 @@ Widget parent = instance->parent; Widget widget; Boolean pop_up_p = instance->pop_up_p; - CONST char* shell_name = 0; - CONST char* icon_name = 0; + const char* shell_name = 0; + const char* icon_name = 0; Boolean text_input_slot = False; Boolean radio_box = False; Boolean list = False; @@ -1646,7 +1647,7 @@ int ac = 0; Widget scale = 0; widget_value* val = instance->info->val; - +#if 0 /* This looks too awful, although more correct. */ if (!val->call_data) { XtSetArg (al [ac], XmNsensitive, False); ac++; @@ -1655,6 +1656,9 @@ { XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; } +#else + XtSetArg (al [ac], XmNsensitive, True); ac++; +#endif XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; XtSetArg (al [ac], XmNuserData, val->call_data); ac++; XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; @@ -1684,7 +1688,7 @@ Widget text = 0; widget_value* val = instance->info->val; - XtSetArg (al [ac], XmNsensitive, val->enabled && val->call_data); ac++; + XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; XtSetArg (al [ac], XmNuserData, val->call_data); ac++; XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/lwlib-internal.h --- a/lwlib/lwlib-internal.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/lwlib-internal.h Mon Aug 13 11:35:02 2007 +0200 @@ -39,12 +39,12 @@ typedef struct _widget_creation_entry { - CONST char* type; + const char* type; widget_creation_function function; } widget_creation_entry; /* update all other instances of a widget. Can be used in a callback when - a wiget has been used by the user */ + a widget has been used by the user */ void lw_internal_update_other_instances (Widget widget, XtPointer closure, XtPointer call_data); diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/lwlib.c --- a/lwlib/lwlib.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/lwlib.c Mon Aug 13 11:35:02 2007 +0200 @@ -76,7 +76,7 @@ /* utility functions for widget_instance and widget_info */ static char * -safe_strdup (CONST char *s) +safe_strdup (const char *s) { char *result; if (! s) return 0; @@ -257,11 +257,10 @@ lw_copy_widget_value_args (old, new); changed = True; } - else if (new->args && old->args) + else if (new->args && old->args && new->args != old->args) { /* #### Do something more sensible here than just copying the new values (like actually merging the values). */ - free_widget_value_args (old); lw_copy_widget_value_args (new, old); changed = True; } @@ -273,7 +272,7 @@ /* Make a complete copy of a widget_value tree. Store CHANGE into the widget_value tree's `change' field. */ -static widget_value * +widget_value * copy_widget_value_tree (widget_value *val, change_type change) { widget_value *copy; @@ -330,7 +329,7 @@ } static widget_info * -allocate_widget_info (CONST char *type, CONST char *name, +allocate_widget_info (const char *type, const char *name, LWLIB_ID id, widget_value *val, lw_callback pre_activate_cb, lw_callback selection_cb, lw_callback post_activate_cb) @@ -503,13 +502,13 @@ /* utility function for widget_value */ static Boolean -safe_strcmp (CONST char *s1, CONST char *s2) +safe_strcmp (const char *s1, const char *s2) { if (!!s1 ^ !!s2) return True; return (s1 && s2) ? strcmp (s1, s2) : s1 ? False : !!s2; } -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE static change_type max (change_type i1, change_type i2) { @@ -690,7 +689,7 @@ /* modifying the widgets */ static Widget -name_to_widget (widget_instance *instance, CONST char *name) +name_to_widget (widget_instance *instance, const char *name) { Widget widget = NULL; @@ -825,19 +824,34 @@ val->change = NO_CHANGE; } +/* strcasecmp() is not sufficiently portable or standard, + and it's easier just to write our own. */ +static int +ascii_strcasecmp (const char *s1, const char *s2) +{ + while (1) + { + char c1 = *s1++; + char c2 = *s2++; + if (c1 >= 'A' && c1 <= 'Z') c1 += 'a' - 'A'; + if (c2 >= 'A' && c2 <= 'Z') c2 += 'a' - 'A'; + if (c1 != c2) return c1 - c2; + if (c1 == '\0') return 0; + } +} static widget_creation_function -find_in_table (CONST char *type, widget_creation_entry *table) +find_in_table (const char *type, widget_creation_entry *table) { widget_creation_entry *cur; for (cur = table; cur->type; cur++) - if (!strcasecmp (type, cur->type)) + if (!ascii_strcasecmp (type, cur->type)) return cur->function; return NULL; } static Boolean -dialog_spec_p (CONST char *name) +dialog_spec_p (const char *name) { /* return True if name matches [EILPQeilpq][1-9][Bb] or [EILPQeilpq][1-9][Bb][Rr][1-9] */ @@ -921,7 +935,7 @@ } void -lw_register_widget (CONST char *type, CONST char *name, +lw_register_widget (const char *type, const char *name, LWLIB_ID id, widget_value *val, lw_callback pre_activate_cb, lw_callback selection_cb, lw_callback post_activate_cb) @@ -957,7 +971,7 @@ } Widget -lw_create_widget (CONST char *type, CONST char *name, +lw_create_widget (const char *type, const char *name, LWLIB_ID id, widget_value *val, Widget parent, Boolean pop_up_p, lw_callback pre_activate_cb, lw_callback selection_cb, lw_callback post_activate_cb) @@ -1049,14 +1063,14 @@ } void -lw_destroy_everything () +lw_destroy_everything (void) { while (all_widget_info) lw_destroy_all_widgets (all_widget_info->id); } void -lw_destroy_all_pop_ups () +lw_destroy_all_pop_ups (void) { widget_info *info; widget_info *next; @@ -1365,6 +1379,7 @@ void lw_add_widget_value_arg (widget_value* wv, String name, XtArgVal value) { + int i = 0; if (!wv->args) { wv->args = (widget_args *) malloc (sizeof (widget_args)); @@ -1378,7 +1393,19 @@ if (wv->args->nargs > 10) return; - XtSetArg (wv->args->args [wv->args->nargs], name, value); wv->args->nargs++; + /* If the arg is already there then we must replace it. */ + for (i = 0; i < wv->args->nargs; i++) + { + if (!strcmp (wv->args->args[i].name, name)) + { + XtSetArg (wv->args->args [i], name, value); + break; + } + } + if (i >= wv->args->nargs) + { + XtSetArg (wv->args->args [wv->args->nargs], name, value); wv->args->nargs++; + } } static void free_widget_value_args (widget_value* wv) @@ -1397,23 +1424,46 @@ #endif free (wv->args->args); free (wv->args); - wv->args = (widget_args*)0xDEADBEEF; + wv->args = 0; } } } void lw_copy_widget_value_args (widget_value* val, widget_value* copy) { - if (!val->args) + if (val == copy || val->args == copy->args) + return; + + if (copy->args) { - if (copy->args) - free_widget_value_args (copy); - copy->args = 0; + free_widget_value_args (copy); } - else + + if (val->args) { copy->args = val->args; copy->args->ref_count++; } } +/* Remove %_ and convert %% to %. We can do this in-place because we + are always shortening, never lengthening, the string. */ +void +lw_remove_accelerator_spec (char *val) +{ + char *foo = val, *bar = val; + + while (*bar) + { + if (*bar == '%' && *(bar+1) == '_') + bar += 2; + else if (*bar == '%' && *(bar+1) == '%') + { + *foo++ = *bar++; + bar++; + } + else + *foo++ = *bar++; + } + *foo = '\0'; +} diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/lwlib.h --- a/lwlib/lwlib.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/lwlib.h Mon Aug 13 11:35:02 2007 +0200 @@ -1,17 +1,8 @@ #ifndef INCLUDED_lwlib_h_ #define INCLUDED_lwlib_h_ -#undef CONST - #include -/* To eliminate use of `const' in the lwlib sources, define CONST_IS_LOSING. */ -#ifdef CONST_IS_LOSING -# define CONST -#else -# define CONST const -#endif - #if defined (LWLIB_MENUBARS_LUCID) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_MENUBARS_ATHENA) #define NEED_MENUBARS #endif @@ -193,13 +184,13 @@ #include "xlwtabs.h" #endif -void lw_register_widget (CONST char* type, CONST char* name, LWLIB_ID id, +void lw_register_widget (const char* type, const char* name, LWLIB_ID id, widget_value* val, lw_callback pre_activate_cb, lw_callback selection_cb, lw_callback post_activate_cb); Widget lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p); Widget lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p); -Widget lw_create_widget (CONST char* type, CONST char* name, LWLIB_ID id, +Widget lw_create_widget (const char* type, const char* name, LWLIB_ID id, widget_value* val, Widget parent, Boolean pop_up_p, lw_callback pre_activate_cb, lw_callback selection_cb, @@ -221,6 +212,7 @@ void lw_add_value_args_to_args (widget_value* wv, ArgList addto, int* offset); void lw_add_widget_value_arg (widget_value* wv, String name, XtArgVal value); void lw_copy_widget_value_args (widget_value* copy, widget_value* val); +widget_value * copy_widget_value_tree (widget_value *val, change_type change); widget_value *malloc_widget_value (void); void free_widget_value (widget_value *); @@ -235,4 +227,6 @@ /* Silly Energize hack to invert the "sheet" button */ void lw_show_busy (Widget w, Boolean busy); +void lw_remove_accelerator_spec (char *val); + #endif /* INCLUDED_lwlib_h_ */ diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwcheckbox.c --- a/lwlib/xlwcheckbox.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwcheckbox.c Mon Aug 13 11:35:02 2007 +0200 @@ -25,7 +25,7 @@ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: June 30, 1997 * * Overview: This widget is identical to the Radio widget in behavior, @@ -38,7 +38,7 @@ #include #include -#include ATHENA_INCLUDE(XawInit.h) +#include ATHENA_XawInit_h_ #include "../src/xmu.h" #include "xlwcheckboxP.h" @@ -126,7 +126,7 @@ CheckboxClassRec checkboxClassRec = { { - (WidgetClass) SuperClass, /* superclass */ + (WidgetClass) SuperClass, /* superclass */ "Checkbox", /* class_name */ sizeof(CheckboxRec), /* size */ CheckboxClassInit, /* class_initialize */ @@ -170,7 +170,7 @@ NULL /* extension */ }, /* CoreClass fields initialization */ { - XtInheritChangeSensitive /* change_sensitive */ + XtInheritChangeSensitive /* change_sensitive */ }, /* SimpleClass fields initialization */ #ifdef _ThreeDP_h { @@ -271,7 +271,7 @@ /* Function Name: CheckboxDestroy * Description: Destroy Callback for checkbox widget. * Arguments: w - the checkbox widget that is being destroyed. - * junk, grabage - not used. + * junk, garbage - not used. * Returns: none. */ diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwgauge.c --- a/lwlib/xlwgauge.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwgauge.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,4 +1,4 @@ -/* Gauge Widget for XEmacs. +/* Gauge Widget for XEmacs. Copyright (C) 1999 Edward A. Falk This file is part of XEmacs. @@ -25,7 +25,7 @@ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: July 9, 1997 * * Note: for fun and demonstration purposes, I have added selection @@ -52,7 +52,7 @@ #include #include #include -#include ATHENA_INCLUDE(XawInit.h) +#include ATHENA_XawInit_h_ #include "xlwgaugeP.h" #include "../src/xmu.h" #ifdef HAVE_XMU @@ -160,7 +160,7 @@ GaugeClassRec gaugeClassRec = { { -/* core_class fields */ +/* core_class fields */ /* superclass */ (WidgetClass) &labelClassRec, /* class_name */ "Gauge", /* widget_size */ sizeof(GaugeRec), @@ -334,7 +334,7 @@ } else { - gw->gauge.margin0 = + gw->gauge.margin0 = gw->gauge.margin1 = lh / 2 ; size += lwm + vmargin ; } @@ -404,7 +404,7 @@ } /* if the gauge is selected, signify by drawing the background - * in a constrasting color. + * in a contrasting color. */ if( gw->gauge.selected ) @@ -466,7 +466,7 @@ if( gw->gauge.nlabels > 1 ) { char label[20], *s = label ; - int len, w,h =0 ; + int xlen, wd,h =0 ; if( gw->gauge.orientation == XtorientHorizontal ) y = gw->gauge.lmargin + gw->label.font->max_bounds.ascent - 1 ; @@ -483,13 +483,13 @@ s = gw->gauge.labels[i] ; if( s != NULL ) { x = e0 + i*(e1-e0-1)/(gw->gauge.nlabels-1) ; - len = strlen(s) ; + xlen = strlen(s) ; if( gw->gauge.orientation == XtorientHorizontal ) { - w = XTextWidth(gw->label.font, s, len) ; - XDrawString(dpy,win,gc, x-w/2,y, s,len) ; + wd = XTextWidth(gw->label.font, s, xlen) ; + XDrawString(dpy,win,gc, x-wd/2,y, s,xlen) ; } else { - XDrawString(dpy,win,gc, y,x+h, s,len) ; + XDrawString(dpy,win,gc, y,x+h, s,xlen) ; } } } @@ -540,7 +540,7 @@ else GaugeResize(new) ; } - + if( gw->gauge.update != oldgw->gauge.update ) { if( gw->gauge.update > 0 ) @@ -674,7 +674,7 @@ return True ; } - else + else #endif if( *target == XA_INTEGER ) { @@ -685,10 +685,10 @@ return True ; } - else if( *target == XA_STRING + else if( *target == XA_STRING #ifdef HAVE_XMU - || - *target == XA_TEXT(XtDisplay(w)) + || + *target == XA_TEXT(XtDisplay(w)) #endif ) { @@ -707,7 +707,7 @@ if( XmuConvertStandardSelection(w, req->time, selection, target, type, (XPointer *) value, length, format) ) return True ; - else + else #endif { printf( @@ -787,12 +787,12 @@ XawGaugeSetValue(w, *iptr) ; } - else if( *type == XA_STRING + else if( *type == XA_STRING #ifdef HAVE_XMU || - *type == XA_TEXT(dpy) + *type == XA_TEXT(dpy) #endif - ) + ) { cptr = (char *)value ; XawGaugeSetValue(w, atoi(cptr)) ; diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwgauge.h --- a/lwlib/xlwgauge.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwgauge.h Mon Aug 13 11:35:02 2007 +0200 @@ -25,7 +25,7 @@ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: July 8, 1997 */ @@ -42,7 +42,7 @@ * ***********************************************************************/ -#include ATHENA_INCLUDE(Label.h) +#include ATHENA_Label_h_ /* Resources: @@ -89,7 +89,7 @@ +++ Labels is an array of nul-terminated strings to be used as labels. If this field is NULL but nlabels is > 0, then numeric labels will be provided. NOTE: the labels are not copied to any internal memory; they - must be stored in static memory provided by the appliction. + must be stored in static memory provided by the application. ++++ AutoScale allows the gauge to set its own value limits. Default is False unless upper & lower limits are both 0. @@ -102,7 +102,7 @@ { *(Cardinal *)rval = value ; } - + */ /* diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwgaugeP.h --- a/lwlib/xlwgaugeP.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwgaugeP.h Mon Aug 13 11:35:02 2007 +0200 @@ -40,7 +40,7 @@ ***********************************************************************/ #include "xlwgauge.h" -#include ATHENA_INCLUDE(LabelP.h) +#include ATHENA_LabelP_h_ /* New fields for the Gauge widget class record */ diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwgcs.c --- a/lwlib/xlwgcs.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwgcs.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,25 +1,25 @@ /* Tabs Widget for XEmacs. Copyright (C) 1999 Edward A. Falk - + 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: Gcs.c 1.7 */ - + /* #### This code is duplicated many times within lwlib and XEmacs. It should be modularised. */ @@ -162,7 +162,7 @@ * * If the widget's background is solid white or solid black, * this code just picks some numbers. (The choice is designed - * to be compatibile with ThreeD interface.) + * to be compatible with ThreeD interface.) */ @@ -342,7 +342,7 @@ GCFont|GCSubwindowMode|GCGraphicsExposures| GCDashOffset|GCDashList|GCArcMode) ; } - else + else #endif { values.foreground = AllocShadowPixel(w, 100-contrast) ; diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwgcs.h --- a/lwlib/xlwgcs.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwgcs.h Mon Aug 13 11:35:02 2007 +0200 @@ -1,25 +1,25 @@ /* Tabs Widget for XEmacs. Copyright (C) 1999 Edward A. Falk - + 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: Gcs 1.7 */ - + #ifndef GCS_H #define GCS_H @@ -35,7 +35,7 @@ * AllocShadeGC() * Given foreground, background, a contrast value & be_nice_to_colormap * flag, return a GC suitable for rendering in an intermediate color, - * as determined by constrast. May return a dither pattern or a + * as determined by contrast. May return a dither pattern or a * solid color, as appropriate. * * Contrast 0 = background color, 100 = foreground color. It is legal diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwmenu.c --- a/lwlib/xlwmenu.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwmenu.c Mon Aug 13 11:35:02 2007 +0200 @@ -51,7 +51,7 @@ #include #endif -/* simple, naieve integer maximum */ +/* simple, naive integer maximum */ #ifndef max #define max(a,b) ((a)>(b)?(a):(b)) #endif @@ -88,6 +88,8 @@ {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), offset(menu.font), XtRString, (XtPointer) "XtDefaultFont"}, # ifdef USE_XFONTSET + /* #### Consider using the same method as for Motif; see the comment in + XlwMenuInitialize(). */ {XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet), offset(menu.font_set), XtRString, (XtPointer) "XtDefaultFontSet"}, # endif @@ -457,7 +459,7 @@ } static void -massage_resource_name (CONST char *in, char *out) +massage_resource_name (const char *in, char *out) { /* Turn a random string into something suitable for using as a resource. For example: @@ -479,16 +481,26 @@ Boolean firstp = True; while (*in) { - char ch = massaged_resource_char[(unsigned char) *in++]; - if (ch) + if (*in == '%' && *(in + 1) == '_') + in += 2; + else { - int int_ch = (int) (unsigned char) ch; - *out++ = firstp ? tolower (int_ch) : toupper (int_ch); - firstp = False; - while ((ch = massaged_resource_char[(unsigned char) *in++]) != '\0') - *out++ = ch; - if (!*(in-1)) /* Overshot the NULL byte? */ - break; + char ch; + + if (*in == '%' && *(in + 1) == '%') + in++; + ch = massaged_resource_char[(unsigned char) *in++]; + if (ch) + { + int int_ch = (int) (unsigned char) ch; + *out++ = firstp ? tolower (int_ch) : toupper (int_ch); + firstp = False; + while ((ch = massaged_resource_char[(unsigned char) *in++]) + != '\0') + *out++ = ch; + if (!*(in-1)) /* Overshot the NULL byte? */ + break; + } } } *out = 0; @@ -506,23 +518,21 @@ 0, XtRImmediate, 0 } }; -/* - * This function looks through string searching for parameter - * inserts of the form: - * %[padding]1 - * padding is space (' ') or dash ('-') characters meaning - * padding to the left or right of the inserted parameter. - * In essence all %1 strings are replaced by value in the return - * value (which the caller is expected to free). - * %% means insert one % (like printf). - * %1 means insert value. - * %-1 means insert value followed by one space. The latter is - * not inserted if value is a zero length string. - */ +/* This function searches STRING for parameter inserts of the form: + %[padding]1 + padding is either space (' ') or dash ('-') meaning + padding to the left or right of the inserted parameter. + In essence, all %1 strings are replaced by VALUE in the return value. + The caller is expected to free the return value using XtFree(). + %% means insert one % (like printf). + %1 means insert VALUE. + %-1 means insert VALUE followed by one space. The latter is + not inserted if VALUE is a zero length string. +*/ static char* -parameterize_string (CONST char *string, CONST char *value) +parameterize_string (const char *string, const char *value) { - char *percent; + const char *percent; char *result; unsigned int done = 0; unsigned int ntimes; @@ -531,24 +541,25 @@ { result = XtMalloc(1); result[0] = '\0'; - return (result); + return result; } if (!value) value = ""; - for (ntimes = 1, result = (char *) string; (percent = strchr(result, '%')); + for (ntimes = 1, percent = string; + (percent = strchr (percent, '%')); ntimes++) - result = &percent[1]; + percent++; result = XtMalloc ((ntimes * strlen(value)) + strlen(string) + 4); result[0] = '\0'; - while ((percent = strchr(string, '%'))) + while ((percent = strchr (string, '%'))) { unsigned int left_pad; unsigned int right_pad; - char *p; + const char *p; if (percent[1] == '%') { /* it's a real % */ @@ -679,7 +690,7 @@ /* Unused */ #if 0 -/* These two routines should be a seperate file..djw */ +/* These two routines should be a separate file..djw */ static char * xlw_create_localized_string (Widget w, char *name, @@ -1510,7 +1521,7 @@ else return TEXT_TYPE; #else - else + else abort(); return UNSPECIFIED_TYPE; /* Not reached */ #endif @@ -1873,7 +1884,7 @@ static struct _shadow_names { - CONST char * name; + const char * name; shadow_type type; } shadow_names[] = { @@ -2482,7 +2493,7 @@ mw->menu.old_depth = new_depth; - /* refresh the last seletion */ + /* refresh the last selection */ selection_position.x = 0; selection_position.y = 0; display_menu (mw, last_same, new_selection == old_selection, @@ -2809,30 +2820,22 @@ xgcv.foreground = mw->menu.top_shadow_color; xgcv.background = mw->core.background_pixel; /* xgcv.stipple = mw->menu.top_shadow_pixmap; gtb */ -#ifdef NEED_MOTIF if (mw->menu.top_shadow_pixmap && mw->menu.top_shadow_pixmap != XmUNSPECIFIED_PIXMAP) xgcv.stipple = mw->menu.top_shadow_pixmap; else xgcv.stipple = 0; -#else - xgcv.stipple = mw->menu.top_shadow_pixmap; -#endif /* NEED_MOTIF */ pm = (xgcv.stipple ? GCStipple|GCFillStyle : 0); mw->menu.shadow_top_gc = XtGetGC((Widget)mw, GCForeground|GCBackground|pm, &xgcv); xgcv.foreground = mw->menu.bottom_shadow_color; /* xgcv.stipple = mw->menu.bottom_shadow_pixmap; gtb */ -#ifdef NEED_MOTIF if (mw->menu.bottom_shadow_pixmap && mw->menu.bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP) xgcv.stipple = mw->menu.bottom_shadow_pixmap; else xgcv.stipple = 0; -#else - xgcv.stipple = mw->menu.bottom_shadow_pixmap; -#endif /* NEED_MOTIF */ pm = (xgcv.stipple ? GCStipple|GCFillStyle : 0); mw->menu.shadow_bottom_gc = XtGetGC ((Widget)mw, GCForeground|GCBackground|pm, &xgcv); @@ -3016,10 +3019,12 @@ gray_width, gray_height, 1, 0, 1); #ifdef NEED_MOTIF + /* #### Even if it's a kludge!!!, we should consider doing the same for + X Font Sets. */ /* The menu.font_list slot came from the *fontList resource (Motif standard.) The menu.font_list_2 slot came from the *font resource, for backward compatibility with older versions of this code, and consistency with the - rest of emacs. If both font and fontList are specified, we use font. + rest of emacs. If both font and fontList are specified, we use fontList. If only one is specified, we use that. If neither are specified, we use the "fallback" value. What a kludge!!! diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwmenu.h --- a/lwlib/xlwmenu.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwmenu.h Mon Aug 13 11:35:02 2007 +0200 @@ -56,6 +56,7 @@ # define XmCTopShadowPixmap "TopShadowPixmap" # define XmNbottomShadowPixmap "bottomShadowPixmap" # define XmCBottomShadowPixmap "BottomShadowPixmap" +# define XmUNSPECIFIED_PIXMAP 2 # define XmRHorizontalDimension "HorizontalDimension" # define XmNspacing "spacing" # define XmCSpacing "Spacing" diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwradio.c --- a/lwlib/xlwradio.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwradio.c Mon Aug 13 11:35:02 2007 +0200 @@ -25,7 +25,7 @@ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: June 30, 1997 * * @@ -53,7 +53,7 @@ #include #include -#include ATHENA_INCLUDE(XawInit.h) +#include ATHENA_XawInit_h_ #include "../src/xmu.h" #include "xlwradioP.h" @@ -120,7 +120,7 @@ RadioClassRec radioClassRec = { { - (WidgetClass) SuperClass, /* superclass */ + (WidgetClass) SuperClass, /* superclass */ "Radio", /* class_name */ sizeof(RadioRec), /* size */ RadioClassInit, /* class_initialize */ @@ -154,7 +154,7 @@ NULL /* extension */ }, /* CoreClass fields initialization */ { - XtInheritChangeSensitive /* change_sensitive */ + XtInheritChangeSensitive /* change_sensitive */ }, /* SimpleClass fields initialization */ #ifdef _ThreeDP_h { @@ -241,7 +241,7 @@ /* Function Name: RadioDestroy * Description: Destroy Callback for radio widget. * Arguments: w - the radio widget that is being destroyed. - * junk, grabage - not used. + * junk, garbage - not used. * Returns: none. */ @@ -272,13 +272,13 @@ switch( rw->label.justify ) { case XtJustifyLeft: - rw->label.label_x += bs(rw) + rw->label.internal_width ; + rw->label.label_x += (bs(rw) + rw->label.internal_width) ; break ; case XtJustifyRight: break ; case XtJustifyCenter: default: - rw->label.label_x += (bs(rw) + rw->label.internal_width)/2 ; + rw->label.label_x += (bs(rw) + rw->label.internal_width)/2; break ; } } @@ -375,6 +375,13 @@ RadioSize(newrw, &newrw->core.width, &newrw->core.height) ; } + /* The label set values routine can resize the widget. We need to + * recalculate if this is true. + */ + if (newrw->label.label_x != oldrw->label.label_x) + { + RadioResize (new); + } return FALSE ; } @@ -416,7 +423,7 @@ * border. */ -static void +static void DrawHighlight (Widget w, GC gc) { @@ -466,7 +473,7 @@ /* ARGSUSED */ -void +void RadioSet (Widget w, XEvent *event, String *params, /* unused */ @@ -485,7 +492,7 @@ /* ARGSUSED */ -void +void RadioUnset (Widget w, XEvent *event, String *params, /* unused */ diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwradio.h --- a/lwlib/xlwradio.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwradio.h Mon Aug 13 11:35:02 2007 +0200 @@ -42,7 +42,7 @@ * ***********************************************************************/ -#include ATHENA_INCLUDE(Toggle.h) +#include ATHENA_Toggle_h_ /* Resources: diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwradioP.h --- a/lwlib/xlwradioP.h Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwradioP.h Mon Aug 13 11:35:02 2007 +0200 @@ -32,7 +32,7 @@ #define _XawRadioP_h #include "xlwradio.h" -#include ATHENA_INCLUDE(ToggleP.h) +#include ATHENA_ToggleP_h_ /*********************************************************************** * @@ -40,7 +40,9 @@ * ***********************************************************************/ -#define streq(a, b) ( strcmp((a), (b)) == 0 ) +/* Already in Xaw/ToggleP.h, and not used by us. + #define streq(a, b) ( strcmp((a), (b)) == 0 ) +*/ typedef void (*XawDiamondProc) (Widget); diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwscrollbar.c --- a/lwlib/xlwscrollbar.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwscrollbar.c Mon Aug 13 11:35:02 2007 +0200 @@ -485,11 +485,9 @@ } /*-------------------------- GC and Pixel allocation --------------------*/ -#ifdef NEED_MOTIF #ifndef XmUNSPECIFIED_PIXMAP #define XmUNSPECIFIED_PIXMAP 2 #endif -#endif /* NEED_MOTIF */ static GC get_gc (XlwScrollBarWidget w, Pixel fg, Pixel bg, Pixmap pm) @@ -514,14 +512,10 @@ values.stipple = pm; /* mask = GCForeground | GCBackground | (pm == None ? 0 : GCStipple | GCFillStyle); gtb */ -#ifdef NEED_MOTIF if (pm != None && pm != 0 && pm != XmUNSPECIFIED_PIXMAP) values.stipple = pm; else values.stipple = None; -#else - values.stipple = pm; -#endif /* NEED_MOTIF */ mask = GCForeground | GCBackground | (values.stipple == None ? 0 : GCStipple | GCFillStyle); diff -r 72a7cfa4a488 -r abe6d1db359e lwlib/xlwtabs.c --- a/lwlib/xlwtabs.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwtabs.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,25 +1,25 @@ /* Tabs Widget for XEmacs. Copyright (C) 1999 Edward A. Falk - + 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: Tabs.c 1.27 */ - + /* * Tabs.c - Index Tabs composite widget * @@ -655,7 +655,7 @@ * Window system will handle the redraws. */ - if( tw->tabs.topWidget != curtw->tabs.topWidget ) + if( tw->tabs.topWidget != curtw->tabs.topWidget ) { if( XtIsRealized(tw->tabs.topWidget) ) { @@ -757,7 +757,7 @@ /* * Return preferred size. Happily accept anything >= our preferred size. * (TODO: is that the right thing to do? Should we always return "almost" - * if offerred more than we need?) + * if offered more than we need?) */ static XtGeometryResult @@ -1385,7 +1385,7 @@ if( !XtIsRealized((Widget)tw)) return ; - + /* draw tabs and frames by row except for the top tab, which * is drawn last. (This is inefficiently written, but should not * be too slow as long as there are not a lot of rows.) @@ -1749,7 +1749,7 @@ if (!query_only) tw->tabs.displayChildren++; } - /* If there was only one row, increse the height by TABDELTA */ + /* If there was only one row, increase the height by TABDELTA */ if( ++row == 1 ) { y = TABDELTA ; diff -r 72a7cfa4a488 -r abe6d1db359e man/ChangeLog --- a/man/ChangeLog Mon Aug 13 11:33:40 2007 +0200 +++ b/man/ChangeLog Mon Aug 13 11:35:02 2007 +0200 @@ -1,3 +1,281 @@ +2000-10-04 Martin Buchholz + + * XEmacs 21.2.36 is released. + +2000-09-27 Martin Buchholz + + * lispref/processes.texi (Signals to Processes): Many corrections. + +2000-09-20 Martin Buchholz + + * xemacs/startup.texi (Startup Paths): Minor fixes. + +2000-09-19 Martin Buchholz + + * *: Spelling mega-patch + +2000-09-16 Martin Buchholz + + * internals/internals.texi (Low-Level Modules): + Correct the list of source files. + +2000-08-24 Adrian Aichner + + * emodules.texi (Introduction): Trivial typo fix. + +2000-08-24 Martin Buchholz + + * emodules.texi (Initialization Mode): Spell-Check. + +2000-08-24 Martin Buchholz + + * lispref/databases.texi (Connecting to a Database): + s/berkeley_db/berkeley-db/. Too much C programming. + +2000-08-02 Stephen J. Turnbull + + * xemacs/custom.texi (Menubar Resources): Document FontSet resource. + +2000-07-30 Ben Wing + + * xemacs\search.texi (Regexp Search): + * xemacs\search.texi (Regexps): + Synch up with updated docs below (describing non-greedy + operators and such). + +2000-07-30 Ben Wing + + * lispref\searching.texi (Syntax of Regexps): + Document ??, which we've supported since 20.4. + +2000-07-31 Sandra Wambold + + * xemacs-faq.texi: Minor updates in first two sections + +2000-07-27 Andy Piper + + * lispref/hash-tables.texi: add new hash table type. + +2000-07-19 Martin Buchholz + + * XEmacs 21.2.35 is released. + +2000-07-10 Martin Buchholz + + * Makefile: rm -f ==> $(RM) + +2000-07-09 Martin Buchholz + + * lispref/postgresql.texi: + - Don't mention ".so" extension. + - Make installation instructions more generic. + - Mention M-x describe-installation. + +2000-07-08 Ben Wing + + * xemacs-faq.texi (Q6.4.1): Update the perennial nonstart under + Windows problem with binary locs and latest info. + +2000-06-17 Adrian Aichner + + * lispref/glyphs.texi: Fix trivial typos. + * lispref/gutter.texi: Ditto. + * lispref/loading.texi: Ditto. + * lispref/postgresql.texi: Ditto. + +2000-06-14 Adrian Aichner + + * internals/internals.texi (Markers and Extents): Fix trivial typo. + +2000-06-11 Adrian Aichner + + * make-stds.texi: Fix trivial typos. + * xemacs-faq.texi: Ditto. + * internals/internals.texi: Ditto. + * new-users-guide/edit.texi: Ditto. + * new-users-guide/modes.texi: Ditto. + * new-users-guide/region.texi: Ditto. + +2000-06-10 Ben Wing + + * xemacs-faq.texi (Q6.1.2): + * xemacs-faq.texi (Q6.1.5): + * xemacs-faq.texi (Q6.1.6): + Corrections for Cygwin, MinGW. + +2000-06-07 Adrian Aichner + + * xemacs/basic.texi: Fix trivial typos. + * xemacs/buffers.texi: Fix trivial typos. + * xemacs/building.texi: Ditto. + * xemacs/glossary.texi: Ditto. + * xemacs/gnu.texi: Ditto. + * xemacs/help.texi: Ditto. + * xemacs/keystrokes.texi: Ditto. + * xemacs/programs.texi: Ditto. + * xemacs/search.texi: Ditto. + * xemacs/sending.texi: Ditto. + +2000-05-28 Martin Buchholz + + * XEmacs 21.2.34 is released. + +2000-05-17 Yoshiki Hayashi + + * xemacs/basic.texi: Document translation of tutorial. + * xemacs/startup.texi: Remove lock-directory. + * xemacs/enterings.texi: Update. + +2000-05-17 Yoshiki Hayashi + + * lispref/display.texi: + * lispref/faces.texi: + * lispref/glyphs.texi: + * lispref/gutter.texi: + * lispref/modes.texi: + * lispref/specifiers.texi: + * lispref/toolbar.texi: + Update. Merge Ben's doc-string update. + +2000-05-08 Yoshiki Hayashi + + * xemacs/basic.texi: + * xemacs/enterings.texi: + * xemacs/mini.texi: + Partial sync with FSF Emacs 20.6 and some update. + +2000-05-01 Martin Buchholz + + * XEmacs 21.2.33 is released. + +2000-04-11 Yoshiki Hayashi + + * xemacs-faq.texi (Q2.1.24): Removed wrong header. + +2000-04-01 Oscar Figueiredo + + * lispref/ldap.texi: Documentation of the add/modify/delete and + internationalization APIs + + * lispref/lispref.texi: Updated LDAP-related menus + +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-15 SL Baur + + * lispref/postgresql.texi (Unimplemented libpq Functions): Update + documentation to reflect the latest code. + +2000-03-07 SL Baur + + * lispref/postgresql.texi (PostgreSQL Support): New File. + + * lispref/ldap.texi: Insert PostgreSQL/libpq chapter. + * lispref/lispref.texi (Top): Ditto. + * lispref/internationalization.texi: Ditto. + +2000-03-07 Yoshiki Hayashi + + * lispref/glyphs.texi (Image Specifiers): Remove parenthesis. + +2000-03-06 Yoshiki Hayashi + + * xemacs-faq.texi: Put node before section. + +2000-03-05 Jonathan Harris + + * xemacs-faq.texi (Macintosh port): Made texinfmt-friendly. + +2000-03-01 Sandra Wambold + + * xemacs-faq.texi: Added 6.4.1. XEmacs won't start on Windows + +2000-01-25 Yoshiki Hayashi + + * xemacs/xemacs.texi: Detailed menu update. + +2000-01-28 Yoshiki Hayashi + + * xemacs/help.texi: Synch with FSF 20.5. Update. + +2000-02-21 Yoshiki Hayashi + + * lispref/minibuf.texi: Add default argument documentation. + +2000-02-27 Martin Buchholz + + * internals/internals.texi (lrecords): Update docs for new lisp + object representation. + +2000-02-25 Martin Buchholz + + * internals/internals.texi (Techniques for XEmacs Developers): + Document INLINE_HEADER and how to create macros and inline functions. + Cleanup entire section. + +2000-02-17 Stephen J. Turnbull + + * man/lispref/gutter.texi: New file describing gutter API. + + * man/lispref/lispref.texi, man/lispref/scrollbars.texi, + + * man/lispref/toolbar.texi: Fixup links to new node Gutter. + +2000-02-17 Stephen J. Turnbull + + * man/lispref/frames.texi, man/xemacs/custom.texi, + man/xemacs/frame.texi, man/xemacs/glossary.texi: Mention menubars, + toolbars, and gutters as optional components of frames, with + pointers to descriptions. + +2000-02-17 Stephen J. Turnbull + + * man/lispref/mule.texi: Substantial reorganization and + revision for style of descriptions of character sets, + encodings, and coding systems. Addition of a complete table + of coding systems as of XEmacs 21.2.19. + +2000-02-23 Martin Buchholz + + * XEmacs 21.2.31 is released. + +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-21 Jonathan Harris + + * internals/internals.texi: Made texinfmt-friendly. + +2000-01-20 Mark Thomas + + * lispref/backups.texi (Numbered Backups): + * xemacs/files.texi (Backup Deletion): + Change trim-versions-without-asking to delete-old-versions. + +2000-02-19 Martin Buchholz + + * internals/internals.texi (Conversion to and from External Data): + Document TO_EXTERNAL_FORMAT and friends. + Doc bug fixes. + +2000-02-16 Martin Buchholz + + * XEmacs 21.2.29 is released. + +2000-02-16 Martin Buchholz + + * internals/internals.texi: Integrate Olivier's portable dumping docs. + +2000-02-09 Martin Buchholz + + * lispref/symbols.texi (Object Plists): + Document `object-plist'. + Document `remprop'. + Rework all plist frobbing docs for accuracy. + 2000-02-07 Martin Buchholz * XEmacs 21.2.28 is released. @@ -51,7 +329,7 @@ 2000-01-25 Yoshiki Hayashi * xemacs-faq.texi: Untabify. - + 2000-01-22 Martin Buchholz * internals/internals.texi (General Coding Rules): Document why we @@ -60,7 +338,7 @@ 2000-01-21 Yoshiki Hayashi * xemacs-faq.texi: Change ' -- ' to '---'. - + 2000-01-19 Yoshiki Hayashi * lispref/faces.texi (Face Properties): Document @@ -164,7 +442,7 @@ 1999-12-18 Martin Buchholz - * lispref/functions.texi (Mapping Functions): + * lispref/functions.texi (Mapping Functions): Warn about mapping functions modifying their sequences. 1999-12-15 Sandra Wambold @@ -178,7 +456,7 @@ 1999-12-07 Gunnar Evermann * xemacs/startup.texi (Startup Paths): fix typo: EMACSPACKAGEPATH - instead of PACKAGEPATH + instead of PACKAGEPATH From Marcus Harnisch 1999-12-07 Martin Buchholz @@ -191,9 +469,9 @@ 1999-11-29 Martin Buchholz - * info.texi (Top): + * info.texi (Top): Remove @ifnottex, which gives old makeinfos indigestion. - * texinfo.texi (Top): + * texinfo.texi (Top): Revert to pre-texinfo-4.0 version, plus small changes to make texinfo-3.12, texinfo-3.12f, texinfo-4.0, and TeX happy. @@ -223,7 +501,7 @@ 1999-11-15 Martin Buchholz * xemacs/programs.texi: Upgrade to etags Version 13.32 - + * Makefile: - Make sure the default target is `info' instead of cl.info. - Use $(INFODIR) consistently where appropriate. @@ -330,7 +608,7 @@ * packages.texi: Reword a sentence, fixing @item Decide where to install ... -1999-07-19 Didier Verna +1999-07-19 Didier Verna * custom.texi (Wishlist): removed the Custom Comments wishlist entry. They are implemented. @@ -626,7 +904,7 @@ * info.texi: Fixed @setfilename and a typo. * standards.texi: Added NEXT to @node Preface. See ALL. * texinfo.texi: Fixed section names, quoted usage of @TeX{}, - changed some occurences of `:' to `colon'. + changed some occurrences of `:' to `colon'. * xemacs-faq.texi: See ALL. * internals/internals.texi: See ALL. * lispref/back.texi: Fixed @setfilename. diff -r 72a7cfa4a488 -r abe6d1db359e man/Makefile --- a/man/Makefile Mon Aug 13 11:33:40 2007 +0200 +++ b/man/Makefile Mon Aug 13 11:35:02 2007 +0200 @@ -22,6 +22,7 @@ SHELL = /bin/sh MAKEINFO = makeinfo TEXI2DVI = texi2dvi +RM = rm -f .SUFFIXES: .SUFFIXES: .info .texi .dvi @@ -290,11 +291,11 @@ .PHONY: mostlyclean clean distclean realclean extraclean mostlyclean: - rm -f *.toc *.aux *.log *.op *.cp *.cps *.fn *.fns - rm -f *.ky *.kys *.pg *.pgs *.tp *.tps *.vr *.vrs + $(RM) *.toc *.aux *.log *.op *.cp *.cps *.fn *.fns + $(RM) *.ky *.kys *.pg *.pgs *.tp *.tps *.vr *.vrs clean: mostlyclean - rm -f core *.dvi + $(RM) core *.dvi distclean: clean realclean: distclean extraclean: distclean - rm -f *~ \#* */*~ */\#* + $(RM) *~ \#* */*~ */\#* diff -r 72a7cfa4a488 -r abe6d1db359e man/cl.texi --- a/man/cl.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/cl.texi Mon Aug 13 11:35:02 2007 +0200 @@ -3218,8 +3218,8 @@ @example (declaim (inline foo bar)) (eval-when (compile load eval) (proclaim '(inline foo bar))) -(proclaim-inline foo bar) ; XEmacs only -(defsubst foo (...) ...) ; instead of defun; Emacs 19 only +(proclaim-inline foo bar) ; XEmacs only +(defsubst foo (...) ...) ; instead of defun; Emacs 19 only @end example @strong{Please note:} This declaration remains in effect after the @@ -3297,7 +3297,7 @@ missing from Emacs Lisp. @menu -* Property Lists:: `remprop', `getf', `remf' +* Property Lists:: `getf', `remf' * Creating Symbols:: `gensym', `gentemp' @end menu @@ -3306,20 +3306,9 @@ @noindent These functions augment the standard Emacs Lisp functions @code{get} -and @code{put} for operating on properties attached to symbols. +and @code{put} for operating on properties attached to objects. There are also functions for working with property lists as -first-class data structures not attached to particular symbols. - -@defun remprop symbol property -This function removes the entry for @var{property} from the property -list of @var{symbol}. It returns a true value if the property was -indeed found and removed, or @code{nil} if there was no such property. -(This function was probably omitted from Emacs originally because, -since @code{get} did not allow a @var{default}, it was very difficult -to distinguish between a missing property and a property whose value -was @code{nil}; thus, setting a property to @code{nil} was close -enough to @code{remprop} for most purposes.) -@end defun +first-class data structures not attached to particular objects. @defun getf place property &optional default This function scans the list @var{place} as if it were a property @@ -5560,8 +5549,8 @@ just as well to use a regular quote: @example -(loop for x in y by #'cddr collect (mapcar #'plusp x)) ; Common Lisp -(loop for x in y by 'cddr collect (mapcar 'plusp x)) ; Emacs Lisp +(loop for x in y by #'cddr collect (mapcar #'plusp x)) ; Common Lisp +(loop for x in y by 'cddr collect (mapcar 'plusp x)) ; Emacs Lisp @end example When @code{#'} introduces a @code{lambda} form, it is best to diff -r 72a7cfa4a488 -r abe6d1db359e man/emodules.texi --- a/man/emodules.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/emodules.texi Mon Aug 13 11:35:02 2007 +0200 @@ -117,7 +117,7 @@ support documentation. @menu * Introduction:: Introducing Emacs Modules -* Annatomy of a Module:: Basic module layout and technology +* Anatomy of a Module:: Basic module layout and technology * Using ellcc:: How to use the module compiler * Defining Functions:: Creating new Lisp primitives * Defining Variables:: Creating new Lisp variables @@ -125,12 +125,12 @@ --- The Detailed Node Listing --- -Annatomy of a Module +Anatomy of a Module * Required Header File:: Always include * Required Functions:: Functions you must always provide * Required Variables:: Variables whose values you must provide -* Loading other Modules:: How to load dependant modules +* Loading other Modules:: How to load dependent modules Using @code{ellcc} @@ -148,7 +148,7 @@ @end ifinfo -@node Introduction, Annatomy of a Module, Top, Top +@node Introduction, Anatomy of a Module, Top, Top @chapter Introduction @value{emacs} is a powerful, extensible editor. The traditional way of @@ -161,12 +161,12 @@ implications. Like all other interpreted languages (like Java), Elisp is often suitable only for certain types of application or extension. So although Elisp is a general purpose language, and very high level, -there are times when it is desirable to descend to a lower level compiled +there are times when it is desirable to descend to a lower level compiled language for speed purposes. Secondly, Elisp (or Lisp in general) is not a very common language any more, except for certain circles in the computer industry. C is a far -more commonly known language, and because it is compiled, more suited to +more commonly known language, and because it is compiled, more suited to a wider range of applications, especially those that require low level access to a system or need to be as quick as possible. @@ -175,8 +175,8 @@ @cindex DSO @cindex shared object This manual describes a new way of extending @value{emacs}, by using dynamic -loadable modules (also knows as dynamicaly loadable libraries (DLLs), -dynamic shared objects (DSOs) or just simply shared objectcs), which can +loadable modules (also known as dynamically loadable libraries (DLLs), +dynamic shared objects (DSOs) or just simply shared objects), which can be written in C or C++ and loaded into @value{emacs} at any time. I sometimes refer to this technology as @dfn{CEmacs}, which is short for @dfn{C Extensible Emacs}. @@ -199,7 +199,7 @@ compile and link all objects that will make up the final shared object, and accepts all common C compiler flags. @code{ellcc} also sets up the correct environment for compiling modules by enabling any special -compiler modes (such as PIC mode), setting the correct include paths for +compiler modes (such as PIC mode), setting the correct include paths for the location of @value{emacs} internal header files etc. The program will also invoke the linker correctly to created the final shared object which is loaded into @value{emacs}. @@ -207,13 +207,13 @@ @item @cindex header files CEmacs also makes all of the relevant @value{emacs} internal header files -availible for module authors to use. This is often required to get data +available for module authors to use. This is often required to get data structure definitions and external variable declarations. The header files installed include the module specific header file @file{emodules.h}. Due to the nature of dynamic modules, most of the internals of @value{emacs} are exposed. -@xref{Top,,,internals,@value{emacs} Internals Manual}, for a -more complete discussion on how to extend and understand @value{emacs}. All of +@xref{Top,,,internals,@value{emacs} Internals Manual}, for a +more complete discussion on how to extend and understand @value{emacs}. All of the rules for C modules are discussed there. @item @@ -245,17 +245,17 @@ deal to look at the actual @value{emacs} source code to see how things are done. -@node Annatomy of a Module, Using ellcc, Introduction, Top -@chapter Annatomy of a Module -@cindex annatomy +@node Anatomy of a Module, Using ellcc, Introduction, Top +@chapter Anatomy of a Module +@cindex anatomy @cindex module skeleton @cindex skeleton, module @cindex module format @cindex format, module - Each dynamically loadable @value{emacs} extension (hereafter refered to as a -module) has a certain compulsory format, and must contain several -pieces of information and several mandatory functions. This chapter + Each dynamically loadable @value{emacs} extension (hereafter referred to as a +module) has a certain compulsory format, and must contain several +pieces of information and several mandatory functions. This chapter describes the basic layout of a module, and provides a very simple sample. The source for this sample can be found in the file @file{modules/simple/sample.c} in the main @value{emacs} source code tree. @@ -264,10 +264,10 @@ * Required Header File:: Always include * Required Functions:: Functions you must always provide * Required Variables:: Variables whose values you must provide -* Loading other Modules:: How to load dependant modules +* Loading other Modules:: How to load dependent modules @end menu -@node Required Header File, Required Functions, Annatomy of a Module, Annatomy of a Module +@node Required Header File, Required Functions, Anatomy of a Module, Anatomy of a Module @section Required Header File @cindex required header @cindex include files @@ -275,7 +275,7 @@ @cindex emodules.h @cindex config.h Every module must include the file @file{}. This -will include several other @value{emacs} internal header files, and will set up +will include several other @value{emacs} internal header files, and will set up certain vital macros. One of the most important files included by @file{emodules.h} is the generated @file{config.h} file, which contains all of the required system abstraction macros and definitions. Most @@ -283,20 +283,20 @@ constants defined in @file{config.h}. Please read that file to familiarize yourself with the macros defined there. - Depending on exactly what your module will be doing, you will probably + Depending on exactly what your module will be doing, you will probably need to include one or more of the @value{emacs} internal header files. When -you @code{#include }, you will get a few of the most important +you @code{#include }, you will get a few of the most important @value{emacs} header files included automatically for you. The files included are: @table @file @item lisp.h -This file contains most of the macros required for declaring Lisp object +This file contains most of the macros required for declaring Lisp object types, macros for accessing Lisp objects, and global variable declarations. @item sysdep.h -All system dependant declarations and abstraction macros live here. You +All system dependent declarations and abstraction macros live here. You should never call low level system functions directly. Rather, you should use the abstraction macros provided in this header file. @@ -317,15 +317,15 @@ manipulating @value{emacs} frames. @end table -@node Required Functions, Required Variables, Required Header File, Annatomy of a Module +@node Required Functions, Required Variables, Required Header File, Anatomy of a Module @section Required Functions @cindex initialization @cindex functions, required @cindex required functions Every module requires several initialization functions. It is the -responsibility of these functions to load in any dependant modules, and to -declare all variables and functions which are to be made visibile to the +responsibility of these functions to load in any dependent modules, and to +declare all variables and functions which are to be made visible to the @value{emacs} Lisp reader. Each of these functions performs a very specific task, and they are executed in the correct order by @value{emacs}. All of these functions are @code{void} functions which take no arguments. @@ -339,7 +339,7 @@ @table @code @item syms_of_module @findex syms_of_module -This required function is responsible for introducing to the Lisp reader +This required function is responsible for introducing to the Lisp reader all functions that you have defined in your module using @code{DEFUN()}. Note that @emph{only} functions are declared here, using the @code{DEFSUBR()} macro. No variables are declared. @@ -355,7 +355,7 @@ @item modules_of_module @findex modules_of_module This optional function should be used to load in any modules which your -module depends on. The @value{emacs} module loading code makes sure that the +module depends on. The @value{emacs} module loading code makes sure that the same module is not loaded twice, so several modules can safely call the module load function for the same module. Only one copy of each module (at a given version) will ever be loaded. @@ -368,7 +368,7 @@ functions and variables declared in your module. @end table -@node Required Variables, Loading other Modules, Required Functions, Annatomy of a Module +@node Required Variables, Loading other Modules, Required Functions, Anatomy of a Module @section Required Variables @cindex initialization @cindex variables, required @@ -376,7 +376,7 @@ Not only does a module need to declare the initialization functions mentioned above, it is also required to provide certain variables which -the module loading code searches for in order to determine the viability +the module loading code searches for in order to determine the viability of a module. You are @emph{not} required to provide these variables in your source files. They are automatically set up in the module initialization file by the @code{ellcc} compiler. These variables are @@ -388,7 +388,7 @@ version of the @value{emacs} loading technology that was used to produce the module being loaded. This version number is completely unrelated to the @value{emacs} version number, as a given module may quite well work -regardless of the version of @value{emacs} that was installed at the time the +regardless of the version of @value{emacs} that was installed at the time the module was created. The @value{emacs} modules version is used to differentiate between major @@ -397,11 +397,11 @@ @item emodules_name This is a short (typically 10 characters or less) name for the module, and it is used as a suffix for all of the required functions. This is -also the name by which the module is recognised when loading dependant +also the name by which the module is recognized when loading dependent modules. The name does not necessarily have to be the same as the physical file name, although keeping the two names in sync is a pretty -good idea. The name must not be empty, and it must be a valid part of a -C function name. The value of this variable is appended to the function +good idea. The name must not be empty, and it must be a valid part of a +C function name. The value of this variable is appended to the function names @code{syms_of_}, @code{vars_of_}, @code{modules_of_} and @code{docs_of_} to form the actual function names that the module loading code looks for when loading a module. @@ -423,9 +423,9 @@ @code{--mod-title} argument to @code{ellcc}. @end table -@node Loading other Modules, , Required Variables, Annatomy of a Module +@node Loading other Modules, , Required Variables, Anatomy of a Module @section Loading other Modules -@cindex dependancies +@cindex dependencies @findex modules_of_module @findex emodules_load @@ -433,29 +433,29 @@ @code{modules_of_module} to load in any modules which the current module depends on. If the module is stand-alone, and does not depend on other modules, then this function can be left empty or even undeclared. -However, if it does have dependnacies, it must call +However, if it does have dependencies, it must call @code{emodules_load}: @example @cartouche -int emodules_load (CONST char *module, - CONST char *modname, - CONST char *modver) +int emodules_load (const char *module, + const char *modname, + const char *modver) @end cartouche @end example -The first argument @var{module} is the name of the actual shared object +The first argument @var{module} is the name of the actual shared object or DLL. You can omit the @file{.so}, @file{.ell} or @file{.dll} extension of you wish. If you do not specify an absolute path name, then the same rules as apply to loading Lisp modules are applied when searching for the module. If the module cannot be found in any of the standard places, and an absolute path name was not specified, -@code{emodules_load} will signal an error and loading of the module +@code{emodules_load} will signal an error and loading of the module will stop. The second argument (@var{modname}) is the module name to load, and must match the contents of the variable @var{emodule_name} in the -module to be loaded. A mis-match will cause the module load to fail. If +module to be loaded. A mis-match will cause the module load to fail. If this parameter is @code{NULL} or empty, then no checks are performed against the target module's @var{emodule_name} variable. @@ -465,13 +465,13 @@ or empty, and the match fails, then the load of the module will fail. @code{emodules_load} can be called recursively. If, at any point -during the loading of modules a failure is encountered, then all modules +during the loading of modules a failure is encountered, then all modules that were loaded since the top level call to @code{emodules_load} will be unloaded. This means that if any child modules fail to load, then their parents will also fail to load. This does not include previous successful calls to @code{emodules_load} at the top level. -@node Using ellcc, Defining Functions, Annatomy of a Module, Top +@node Using ellcc, Defining Functions, Anatomy of a Module, Top @chapter Using @code{ellcc} @cindex @code{ellcc} @cindex module compiler @@ -494,7 +494,7 @@ an Emacs module rather than a static C object. @code{ellcc} has three distinct modes of operation. It can be run in -compile, link or initialization mode. These modes are discussed in more +compile, link or initialization mode. These modes are discussed in more detail below. If you want @code{ellcc} to show the commands it is executing, you can specify the option @code{--mode=verbose} to @code{ellcc}. Specifying this option twice will enable certain extra @@ -513,7 +513,7 @@ @cindex compiling By default, @code{ellcc} is in @dfn{compile} mode. This means that it -assumes that all of the command line arguments are C compiler arguments, +assumes that all of the command line arguments are C compiler arguments, and that you want to compile the specified source file or files. You can force compile mode by specifying the @code{--mode=compile} argument to @code{ellcc}. @@ -526,7 +526,7 @@ same exit codes and messages that your C compiler does. By far the easiest way to compile modules is to construct a -@file{Makefile} as you would for a normal program, and simply insert, at +@file{Makefile} as you would for a normal program, and simply insert, at some appropriate place something similar to: @example @@ -554,14 +554,14 @@ and variables passed as static strings in the source code, the documentation is included as a C comment. A special program, called @file{make-docfile}, is used to scan the source code files and extract -the documentation from these comments, producing the @value{emacs} @file{DOC} +the documentation from these comments, producing the @value{emacs} @file{DOC} file, which the internal help engine scans when the documentation for a function or variable is requested. Due to the internal construction of Lisp objects, subrs and other such things, adding documentation for a compiled function or variable in a compiled module, at any time after @value{emacs} has been @dfn{dumped} is -somewhat problematic. Fortunately, as a module writer you are insulated +somewhat problematic. Fortunately, as a module writer you are insulated from the difficulties thanks to your friend @code{ellcc} and some internal trickery in the module loading code. This is all done using the @dfn{initialization} mode of @code{ellcc}. @@ -569,8 +569,8 @@ The result of running @code{ellcc} in initialization mode is a C source file which you compile with (you guessed it) @code{ellcc} in compile mode. Initialization mode is where you set the module name, version, -title and gather together all of the documentaion strings for the -functions and vairables in your module. There are several options that +title and gather together all of the documentation strings for the +functions and variables in your module. There are several options that you are required to pass @code{ellcc} in initialization mode, the first of which is the mode switch itself, @code{--mode=init}. @@ -602,8 +602,8 @@ screen. Following all of these parameters, you need to provide the list of all -source code modules that make up your module. These are the files which -are scanned by @file{make-docfile}, and provide the information required +source code modules that make up your module. These are the files which +are scanned by @file{make-docfile}, and provide the information required to populate the @code{docs_of_module} function. Below is a sample @file{Makefile} fragment which indicates how all of this is used. @@ -656,17 +656,17 @@ searched for a given module when the user attempts to load it. The valid extensions that the loader attempts to use are @file{.so}, @file{.ell} and @file{.dll}. You can use any of these extensions, -although @file{.ell} is the prefered extension. +although @file{.ell} is the preferred extension. @node Link Mode, Other ellcc options, Initialization Mode, Using ellcc @section Link Mode @cindex linking Once all of your source code files have been compiled (including the -generated init file) you need to link them all together to created the +generated init file) you need to link them all together to create the loadable module. To do this, you invoke @code{ellcc} in link mode, by -pasing the @code{--mode-link} command. You need to specify the final -output file using the @code{--mod-output=NAME} command, but other than +passing the @code{--mode-link} option. You need to specify the final +output file using the @code{--mod-output=NAME} option, but other than that all other arguments are passed on directly to the system compiler or linker, along with any other required arguments to create the loadable module. @@ -686,7 +686,7 @@ Aside from the three main @code{ellcc} modes described above, @code{ellcc} can accept several other options. These are typically used -in a @file{Makefile} to determine installation paths. @code{ellcc} also +in a @file{Makefile} to determine installation paths. @code{ellcc} also allows you to over-ride several of its built-in compiler and linker options using environment variables. Here is the complete list of options that @code{ellcc} accepts. @@ -700,16 +700,16 @@ @item --mode=init Used to create the documentation function and to initialize other -required variables. Produces a C source file that must be compiled with +required variables. Produces a C source file that must be compiled with @code{ellcc} in compile mode before linking the final module. @item --mode=verbose Enables verbose mode. This will show you the commands that are being -executed, as well as the version number of @code{ellcc}. If you specify +executed, as well as the version number of @code{ellcc}. If you specify this option twice, then some extra debugging information is displayed. @item --mod-name=NAME -Sets the short internaml module @var{NAME} to the string specified, +Sets the short internal module @var{NAME} to the string specified, which must consist only of valid C identifiers. Required during initialization mode. @@ -729,7 +729,7 @@ final loadable module to @var{FILENAME}. @item --mod-location -This will print the name of the standard module installation path on the +This will print the name of the standard module installation path on the standard output and immediately exit @code{ellcc}. Use this option to determine the directory prefix of where you should install your modules. @@ -737,11 +737,11 @@ This will print the name of the site specific module location and exit. @item --mod-archdir -Prints the name of the root of the architecture-dependant directory that -@value{emacs} searches for architecture-dependant files. +Prints the name of the root of the architecture-dependent directory that +@value{emacs} searches for architecture-dependent files. @item --mod-config -Prints the name of the configuration for which @value{emacs} and @code{ellcc} +Prints the name of the configuration for which @value{emacs} and @code{ellcc} were compiled. @end table @@ -751,10 +751,10 @@ During its normal operation, @code{ellcc} uses the compiler and linker flags that were determined at the time @value{emacs} was configured. In -certain rare circumstances you may wish to over-ride the flags passed to +certain rare circumstances you may wish to over-ride the flags passed to the compiler or linker, and you can do so using environment variables. -The table below lists all of the environment variables that @code{ellcc} -recognises. +The table below lists all of the environment variables that @code{ellcc} +recognizes. @table @code @item ELLCC @@ -802,17 +802,17 @@ One of the main reasons you would ever write a module is to provide one or more @dfn{functions} for the user or the editor to use. -The term +The term @dfn{function} is a bit overloaded here, as it refers to both a C function and the way it appears to Lisp, which is a @dfn{subroutine}, or simply a @dfn{subr}. A Lisp subr is also known as a Lisp primitive, but that term applies less to dynamic modules. @xref{Writing Lisp Primitives,,,internals,@value{emacs} Internals Manual}, for details on how to declare functions. You should familiarize yourself with the -instructions there. The format of the function declaration is identical +instructions there. The format of the function declaration is identical in modules. - Normal Lisp primitives document the functions they defining by including + Normal Lisp primitives document the functions they defining by including the documentation as a C comment. During the build process, a program called @file{make-docfile} is run, which will extract all of these comments, build up a single large documentation file, and will store @@ -826,7 +826,7 @@ When using @code{DEFUN} in normal @value{emacs} C code, the sixth ``parameter'' is a C comment which documents the function. For a dynamic module, we of course need to convert the C comment to a usable -string, and we need to set the documentation pointer of the subr to this +string, and we need to set the documentation pointer of the subr to this string. As a module programmer, you don't actually need to do any work for this to happen. It is all taken care of in the @code{docs_of_module} function created by @code{ellcc}. @@ -843,7 +843,7 @@ @cindex functions, Lisp @cindex functions, defining - Although the full syntax of a function declaration is discussed in the + Although the full syntax of a function declaration is discussed in the @value{emacs} internals manual in greater depth, what follows is a brief description of how to define and implement a new Lisp primitive in a module. This is done using the @code{DEFUN} macro. Here is a small @@ -854,7 +854,7 @@ DEFUN ("my-function", Fmy_function, 1, 1, "FFile name: ", /* Sample Emacs primitive function. -The specified FILE is frobricated before it is fnozzled. +The specified FILE is frobnicated before it is fnozzled. */ (file)) @{ @@ -871,9 +871,9 @@ @end example The first argument is the name of the function as it will appear to the -Lisp reader. This must be provided as a string. The second argument is +Lisp reader. This must be provided as a string. The second argument is the name of the actual C function that will be created. This is -typically the Lisp function name with a preceding capital @code{F}, with +typically the Lisp function name with a preceding capital @code{F}, with hyphens converted to underscores. This must be a valid C function name. Next come the minimum and maximum number of arguments, respectively. This is used to ensure that the correct number of @@ -891,7 +891,7 @@ @cindex functions, declaring Simply writing the code for a function is not enough to make it -availible to the Lisp reader. You have to, during module +available to the Lisp reader. You have to, during module initialization, let the Lisp reader know about the new function. This is done by calling @code{DEFSUBR} with the name of the function. This is the sole purpose of the initialization function @@ -933,25 +933,25 @@ Rarely will you write a module that only contains functions. It is common to also provide variables which can be used to control the -behaviour of the function, or store the results of the function being +behavior of the function, or store the results of the function being executed. The actual C variable types are the same for modules and internal @value{emacs} primitives, and the declaration of the variables is identical. - @xref{Adding Global Lisp Variables,,,internals,XEmacs Internals Manual}, + @xref{Adding Global Lisp Variables,,,internals,XEmacs Internals Manual}, for more information on variables and naming conventions. Once your variables are defined, you need to initialize them and make the Lisp reader aware of them. This is done in the @code{vars_of_module} initialization function using special @value{emacs} -macros such as @code{DEFVAR_LISP}, @code{DEFVAR_BOOL}, @code{DEFVAR_INT} -etc. The best way to see how to use these macros is to look at existing +macros such as @code{DEFVAR_LISP}, @code{DEFVAR_BOOL}, @code{DEFVAR_INT} +etc. The best way to see how to use these macros is to look at existing source code, or read the internals manual. One @emph{very} important difference between @value{emacs} variables and module variables is how you use pure space. Simply put, you @strong{never} use pure space in @value{emacs} modules. The pure space -storage is of a limited size, and is initialized propperly during the +storage is of a limited size, and is initialized properly during the dumping of @value{emacs}. Because variables are being added dynamically to an already running @value{emacs} when you load a module, you cannot use pure space. Be warned: @strong{do not use pure space in modules. Repeat, do diff -r 72a7cfa4a488 -r abe6d1db359e man/info.texi --- a/man/info.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/info.texi Mon Aug 13 11:35:02 2007 +0200 @@ -3,7 +3,7 @@ @setfilename ../info/info.info @settitle Info @comment %**end of header -@comment $Id: info.texi,v 1.4.2.4 2000/01/18 07:27:42 yoshiki Exp $ +@comment $Id: info.texi,v 1.4.2.5 2000/09/13 10:57:18 martinb Exp $ @dircategory Texinfo documentation system @direntry @@ -853,7 +853,7 @@ @node Emacs Info Variables, , Checking, Advanced Info @section Emacs Info-mode Variables -The following variables may modify the behaviour of Info-mode in Emacs; +The following variables may modify the behavior of Info-mode in Emacs; you may wish to set one or several of these variables interactively, or in your @file{~/.emacs} init file. @xref{Examining, Examining and Setting Variables, Examining and Setting Variables, xemacs, XEmacs diff -r 72a7cfa4a488 -r abe6d1db359e man/internals/internals.texi --- a/man/internals/internals.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/internals/internals.texi Mon Aug 13 11:35:02 2007 +0200 @@ -69,6 +69,7 @@ @author Martin Buchholz @author Hrvoje Niksic @author Matthias Neubauer +@author Olivier Galibert @page @vskip 0pt plus 1fill @@ -118,6 +119,7 @@ * Rules When Writing New C Code:: * A Summary of the Various XEmacs Modules:: * Allocation of Objects in XEmacs Lisp:: +* Dumping:: * Events and the Event Loop:: * Evaluation; Stack Frames; Bindings:: * Symbols and Variables:: @@ -134,19 +136,18 @@ * Menus:: * Subprocesses:: * Interface to X Windows:: -* Index:: Index including concepts, functions, variables, - and other terms. - - --- The Detailed Node Listing --- - -Here are other nodes that are inferiors of those already listed, -mentioned here so you can get to them in one step: +* Index:: + +@detailmenu + +--- The Detailed Node Listing --- A History of Emacs * Through Version 18:: Unification prevails. * Lucid Emacs:: One version 19 Emacs. * GNU Emacs 19:: The other version 19 Emacs. +* GNU Emacs 20:: The other version 20 Emacs. * XEmacs:: The continuation of Lucid Emacs. Rules When Writing New C Code @@ -154,8 +155,17 @@ * General Coding Rules:: * Writing Lisp Primitives:: * Adding Global Lisp Variables:: +* Coding for Mule:: * Techniques for XEmacs Developers:: +Coding for Mule + +* Character-Related Data Types:: +* Working With Character and Byte Positions:: +* Conversion to and from External Data:: +* General Guidelines for Writing Mule-Aware Code:: +* An Example of Mule-Aware Code:: + A Summary of the Various XEmacs Modules * Low-Level Modules:: @@ -181,7 +191,6 @@ * Allocation from Frob Blocks:: * lrecords:: * Low-level allocation:: -* Pure Space:: * Cons:: * Vector:: * Bit Vector:: @@ -190,6 +199,32 @@ * String:: * Compiled Function:: +Garbage Collection - Step by Step + +* Invocation:: +* garbage_collect_1:: +* mark_object:: +* gc_sweep:: +* sweep_lcrecords_1:: +* compact_string_chars:: +* sweep_strings:: +* sweep_bit_vectors_1:: + +Dumping + +* Overview:: +* Data descriptions:: +* Dumping phase:: +* Reloading phase:: + +Dumping phase + +* Object inventory:: +* Address allocation:: +* The header:: +* Data dumping:: +* Pointers dumping:: + Events and the Event Loop * Introduction to Events:: @@ -228,6 +263,7 @@ * Character Sets:: * Encodings:: * Internal Mule Encodings:: +* CCL:: Encodings @@ -239,20 +275,25 @@ * Internal String Encoding:: * Internal Character Encoding:: -The Lisp Reader and Compiler - Lstreams +* Creating an Lstream:: Creating an lstream object. +* Lstream Types:: Different sorts of things that are streamed. +* Lstream Functions:: Functions for working with lstreams. +* Lstream Methods:: Creating new lstream types. + Consoles; Devices; Frames; Windows * Introduction to Consoles; Devices; Frames; Windows:: * Point:: * Window Hierarchy:: +* The Window Object:: The Redisplay Mechanism * Critical Redisplay Sections:: * Line Start Cache:: +* Redisplay Piece by Piece:: Extents @@ -260,21 +301,10 @@ * Extent Ordering:: How extents are ordered internally. * Format of the Extent Info:: The extent information in a buffer or string. * Zero-Length Extents:: A weird special case. -* Mathematics of Extent Ordering:: A rigorous foundation. +* Mathematics of Extent Ordering:: A rigorous foundation. * Extent Fragments:: Cached information useful for redisplay. -Faces - -Glyphs - -Specifiers - -Menus - -Subprocesses - -Interface to X Windows - +@end detailmenu @end menu @node A History of Emacs, XEmacs From the Outside, Top, Top @@ -315,7 +345,7 @@ * XEmacs:: The continuation of Lucid Emacs. @end menu -@node Through Version 18 +@node Through Version 18, Lucid Emacs, A History of Emacs, A History of Emacs @section Through Version 18 @cindex Gosling, James @cindex Great Usenet Renaming @@ -428,7 +458,7 @@ version 18.59 released October 31, 1992. @end itemize -@node Lucid Emacs +@node Lucid Emacs, GNU Emacs 19, Through Version 18, A History of Emacs @section Lucid Emacs @cindex Lucid Emacs @cindex Lucid Inc. @@ -516,7 +546,7 @@ version 20.4 released February 28, 1998. @end itemize -@node GNU Emacs 19 +@node GNU Emacs 19, GNU Emacs 20, Lucid Emacs, A History of Emacs @section GNU Emacs 19 @cindex GNU Emacs 19 @cindex FSF Emacs @@ -593,7 +623,7 @@ working on and using GNU Emacs for a long time (back as far as version 16 or 17). -@node GNU Emacs 20 +@node GNU Emacs 20, XEmacs, GNU Emacs 19, A History of Emacs @section GNU Emacs 20 @cindex GNU Emacs 20 @cindex FSF Emacs @@ -612,7 +642,7 @@ version 20.3 released August 19, 1998. @end itemize -@node XEmacs +@node XEmacs, , GNU Emacs 20, A History of Emacs @section XEmacs @cindex XEmacs @@ -937,7 +967,7 @@ Unfortunately, there is no perfect language. Static typing allows a compiler to catch programmer errors and produce more efficient code, but -makes programming more tedious and less fun. For the forseeable future, +makes programming more tedious and less fun. For the foreseeable future, an Ideal Editing and Programming Environment (and that is what XEmacs aspires to) will be programmable in multiple languages: high level ones like Lisp for user customization and prototyping, and lower level ones @@ -1188,7 +1218,7 @@ When the Lisp initialization code is done, the C code enters the event loop, and stays there for the duration of the XEmacs process. The code -for the event loop is contained in @file{keyboard.c}, and is called +for the event loop is contained in @file{cmdloop.c}, and is called @code{Fcommand_loop_1()}. Note that this event loop could very well be written in Lisp, and in fact a Lisp version exists; but apparently, doing this makes XEmacs run noticeably slower. @@ -1590,25 +1620,17 @@ [ 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 ] [ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ] - <---> ^ <------------------------------------------------------> - tag | a pointer to a structure, or an integer - | - mark bit -@end example - -The tag describes the type of the Lisp object. For integers and chars, -the lower 28 bits contain the value of the integer or char; for all -others, the lower 28 bits contain a pointer. The mark bit is used -during garbage-collection, and is always 0 when garbage collection is -not happening. (The way that garbage collection works, basically, is that it -loops over all places where Lisp objects could exist---this includes -all global variables in C that contain Lisp objects [including -@code{Vobarray}, the C equivalent of @code{obarray}; through this, all -Lisp variables will get marked], plus various other places---and -recursively scans through the Lisp objects, marking each object it finds -by setting the mark bit. Then it goes through the lists of all objects -allocated, freeing the ones that are not marked and turning off the mark -bit of the ones that are marked.) + <---------------------------------------------------------> <-> + a pointer to a structure, or an integer tag +@end example + +A tag of 00 is used for all pointer object types, a tag of 10 is used +for characters, and the other two tags 01 and 11 are joined together to +form the integer object type. This representation gives us 31 bit +integers and 30 bit characters, while pointers are represented directly +without any bit masking or shifting. This representation, though, +assumes that pointers to structs are always aligned to multiples of 4, +so the lower 2 bits are always zero. Lisp objects use the typedef @code{Lisp_Object}, but the actual C type used for the Lisp object can vary. It can be either a simple type @@ -1619,105 +1641,24 @@ machine word to represent the object (some compilers will use more general and less efficient code for unions and structs even if they can fit in a machine word). The union type, however, has the advantage of -stricter type checking (if you accidentally pass an integer where a Lisp -object is desired, you get a compile error), and it makes it easier to -decode Lisp objects when debugging. The choice of which type to use is -determined by the preprocessor constant @code{USE_UNION_TYPE} which is -defined via the @code{--use-union-type} option to @code{configure}. - -@cindex record type - -Note that there are only eight types that the tag can represent, but -many more actual types than this. This is handled by having one of the -tag types specify a meta-type called a @dfn{record}; for all such -objects, the first four bytes of the pointed-to structure indicate what -the actual type is. - -Note also that having 28 bits for pointers and integers restricts a lot -of things to 256 megabytes of memory. (Basically, enough pointers and -indices and whatnot get stuffed into Lisp objects that the total amount -of memory used by XEmacs can't grow above 256 megabytes. In older -versions of XEmacs and GNU Emacs, the tag was 5 bits wide, allowing for -32 types, which was more than the actual number of types that existed at -the time, and no ``record'' type was necessary. However, this limited -the editor to 64 megabytes total, which some users who edited large -files might conceivably exceed.) - -Also, note that there is an implicit assumption here that all pointers -are low enough that the top bits are all zero and can just be chopped -off. On standard machines that allocate memory from the bottom up (and -give each process its own address space), this works fine. Some -machines, however, put the data space somewhere else in memory -(e.g. beginning at 0x80000000). Those machines cope by defining -@code{DATA_SEG_BITS} in the corresponding @file{m/} or @file{s/} file to -the proper mask. Then, pointers retrieved from Lisp objects are -automatically OR'ed with this value prior to being used. - -A corollary of the previous paragraph is that @strong{(pointers to) -stack-allocated structures cannot be put into Lisp objects}. The stack -is generally located near the top of memory; if you put such a pointer -into a Lisp object, it will get its top bits chopped off, and you will -lose. - -Actually, there's an alternative representation of a @code{Lisp_Object}, -invented by Kyle Jones, that is used when the -@code{--use-minimal-tagbits} option to @code{configure} is used. In -this case the 2 lower bits are used for the tag bits. This -representation assumes that pointers to structs are always aligned to -multiples of 4, so the lower 2 bits are always zero. - -@example - [ 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 ] - [ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ] - - <---------------------------------------------------------> <-> - a pointer to a structure, or an integer tag -@end example - -A tag of 00 is used for all pointer object types, a tag of 10 is used -for characters, and the other two tags 01 and 11 are joined together to -form the integer object type. The markbit is moved to part of the -structure being pointed at (integers and chars do not need to be marked, -since no memory is allocated). This representation has these -advantages: - -@enumerate -@item -31 bits can be used for Lisp Integers. -@item -@emph{Any} pointer can be represented directly, and no bit masking -operations are necessary. -@end enumerate - -The disadvantages are: - -@enumerate -@item -An extra level of indirection is needed when accessing the object types -that were not record types. So checking whether a Lisp object is a cons -cell becomes a slower operation. -@item -Mark bits can no longer be stored directly in Lisp objects, so another -place for them must be found. This means that a cons cell requires more -memory than merely room for 2 lisp objects, leading to extra memory use. -@end enumerate - -Various macros are used to construct Lisp objects and extract the -components. Macros of the form @code{XINT()}, @code{XCHAR()}, -@code{XSTRING()}, @code{XSYMBOL()}, etc. mask out the pointer/integer -field and cast it to the appropriate type. All of the macros that -construct pointers will @code{OR} with @code{DATA_SEG_BITS} if -necessary. @code{XINT()} needs to be a bit tricky so that negative -numbers are properly sign-extended: Usually it does this by shifting the -number four bits to the left and then four bits to the right. This -assumes that the right-shift operator does an arithmetic shift (i.e. it -leaves the most-significant bit as-is rather than shifting in a zero, so -that it mimics a divide-by-two even for negative numbers). Not all -machines/compilers do this, and on the ones that don't, a more -complicated definition is selected by defining -@code{EXPLICIT_SIGN_EXTEND}. - -Note that when @code{ERROR_CHECK_TYPECHECK} is defined, the extractor +stricter type checking. If you accidentally pass an integer where a Lisp +object is desired, you get a compile error. The choice of which type +to use is determined by the preprocessor constant @code{USE_UNION_TYPE} +which is defined via the @code{--use-union-type} option to +@code{configure}. + +Various macros are used to convert between Lisp_Objects and the +corresponding C type. Macros of the form @code{XINT()}, @code{XCHAR()}, +@code{XSTRING()}, @code{XSYMBOL()}, do any required bit shifting and/or +masking and cast it to the appropriate type. @code{XINT()} needs to be +a bit tricky so that negative numbers are properly sign-extended. Since +integers are stored left-shifted, if the right-shift operator does an +arithmetic shift (i.e. it leaves the most-significant bit as-is rather +than shifting in a zero, so that it mimics a divide-by-two even for +negative numbers) the shift to remove the tag bit is enough. This is +the case on all the systems we support. + +Note that when @code{ERROR_CHECK_TYPECHECK} is defined, the converter macros become more complicated---they check the tag bits and/or the type field in the first four bytes of a record type to ensure that the object is really of the correct type. This is great for catching places @@ -1727,25 +1668,29 @@ There are similar @code{XSET@var{TYPE}()} macros that construct a Lisp object. These macros are of the form @code{XSET@var{TYPE} -(@var{lvalue}, @var{result})}, -i.e. they have to be a statement rather than just used in an expression. -The reason for this is that standard C doesn't let you ``construct'' a -structure (but GCC does). Granted, this sometimes isn't too convenient; -for the case of integers, at least, you can use the function -@code{make_int()}, which constructs and @emph{returns} an integer -Lisp object. Note that the @code{XSET@var{TYPE}()} macros are also -affected by @code{ERROR_CHECK_TYPECHECK} and make sure that the -structure is of the right type in the case of record types, where the -type is contained in the structure. +(@var{lvalue}, @var{result})}, i.e. they have to be a statement rather +than just used in an expression. The reason for this is that standard C +doesn't let you ``construct'' a structure (but GCC does). Granted, this +sometimes isn't too convenient; for the case of integers, at least, you +can use the function @code{make_int()}, which constructs and +@emph{returns} an integer Lisp object. Note that the +@code{XSET@var{TYPE}()} macros are also affected by +@code{ERROR_CHECK_TYPECHECK} and make sure that the structure is of the +right type in the case of record types, where the type is contained in +the structure. The C programmer is responsible for @strong{guaranteeing} that a -Lisp_Object is is the correct type before using the @code{X@var{TYPE}} +Lisp_Object is the correct type before using the @code{X@var{TYPE}} macros. This is especially important in the case of lists. Use @code{XCAR} and @code{XCDR} if a Lisp_Object is certainly a cons cell, else use @code{Fcar()} and @code{Fcdr()}. Trust other C code, but not Lisp code. On the other hand, if XEmacs has an internal logic error, -it's better to crash immediately, so sprinkle ``unreachable'' -@code{abort()}s liberally about the source code. +it's better to crash immediately, so sprinkle @code{assert()}s and +``unreachable'' @code{abort()}s liberally about the source code. Where +performance is an issue, use @code{type_checking_assert}, +@code{bufpos_checking_assert}, and @code{gc_checking_assert}, which do +nothing unless the corresponding configure error checking flag was +specified. @node Rules When Writing New C Code, A Summary of the Various XEmacs Modules, How Lisp Objects Are Represented in C, Top @chapter Rules When Writing New C Code @@ -1765,7 +1710,7 @@ * Techniques for XEmacs Developers:: @end menu -@node General Coding Rules +@node General Coding Rules, Writing Lisp Primitives, Rules When Writing New C Code, Rules When Writing New C Code @section General Coding Rules The C code is actually written in a dialect of C called @dfn{Clean C}, @@ -1799,13 +1744,14 @@ @file{s/} and @file{m/} files work out correctly. When including header files, always use angle brackets, not double -quotes, except when the file to be included is in the same directory as -the including file. If either file is a generated file, then that is -not likely to be the case. In order to understand why we have this -rule, imagine what happens when you do a build in the source directory -using @samp{./configure} and another build in another directory using -@samp{../work/configure}. There will be two different @file{config.h} -files. Which one will be used if you @samp{#include "config.h"}? +quotes, except when the file to be included is always in the same +directory as the including file. If either file is a generated file, +then that is not likely to be the case. In order to understand why we +have this rule, imagine what happens when you do a build in the source +directory using @samp{./configure} and another build in another +directory using @samp{../work/configure}. There will be two different +@file{config.h} files. Which one will be used if you @samp{#include +"config.h"}? @strong{All global and static variables that are to be modifiable must be declared uninitialized.} This means that you may not use the @@ -1815,9 +1761,8 @@ segment is re-mapped so that it becomes part of the (unmodifiable) code segment in the dumped executable. This allows this memory to be shared among multiple running XEmacs processes. XEmacs is careful to place as -much constant data as possible into initialized variables (in -particular, into what's called the @dfn{pure space}---see below) during -the @file{temacs} phase. +much constant data as possible into initialized variables during the +@file{temacs} phase. @cindex copy-on-write @strong{Please note:} This kludge only works on a few systems nowadays, @@ -1851,7 +1796,7 @@ macro style is: @example -#define FOO(var, value) do @{ \ +#define FOO(var, value) do @{ \ Lisp_Object FOO_value = (value); \ ... /* compute using FOO_value */ \ (var) = bar; \ @@ -1880,7 +1825,7 @@ @code{LIST_LOOP_DELETE_IF} delete elements from a lisp list satisfying some predicate. -@node Writing Lisp Primitives +@node Writing Lisp Primitives, Adding Global Lisp Variables, General Coding Rules, Rules When Writing New C Code @section Writing Lisp Primitives Lisp primitives are Lisp functions implemented in C. The details of @@ -2124,7 +2069,7 @@ @file{lisp.h} contains the definitions for important macros and functions. -@node Adding Global Lisp Variables +@node Adding Global Lisp Variables, Coding for Mule, Writing Lisp Primitives, Rules When Writing New C Code @section Adding Global Lisp Variables Global variables whose names begin with @samp{Q} are constants whose @@ -2186,7 +2131,7 @@ Lisp object, and you will be the one who's unhappy when you can't figure out how your variable got overwritten. -@node Coding for Mule +@node Coding for Mule, Techniques for XEmacs Developers, Adding Global Lisp Variables, Rules When Writing New C Code @section Coding for Mule @cindex Coding for Mule @@ -2209,7 +2154,7 @@ * An Example of Mule-Aware Code:: @end menu -@node Character-Related Data Types +@node Character-Related Data Types, Working With Character and Byte Positions, Coding for Mule, Coding for Mule @subsection Character-Related Data Types First, let's review the basic character-related datatypes used by @@ -2236,19 +2181,22 @@ The data representing the text in a buffer or string is logically a set of @code{Bufbyte}s. -XEmacs does not work with 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 +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 @code{unsigned char}) is the basic unit of XEmacs internal buffers and -strings format. +strings format. A @code{Bufbyte *} 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 -current implementation, an ASCII character is represented by the same -@code{Bufbyte}, and extended characters are represented by a sequence of -@code{Bufbyte}s. - -Without Mule support, a @code{Bufbyte} is equivalent to an -@code{Emchar}. +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. + +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. @item Bufpos @itemx Charcount @@ -2258,8 +2206,8 @@ 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 -@code{int}, we use them in preference to @code{int} to make it clear -what sort of position is being used. +@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. @@ -2269,7 +2217,7 @@ @cindex Bytind @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. +@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}. @@ -2283,7 +2231,7 @@ and Extcounts are not all that frequent in XEmacs code. @end table -@node Working With Character and Byte Positions +@node Working With Character and Byte Positions, Conversion to and from External Data, Character-Related Data Types, Coding for Mule @subsection Working With Character and Byte Positions Now that we have defined the basic character-related types, we can look @@ -2296,10 +2244,10 @@ @table @code @item MAX_EMCHAR_LEN @cindex MAX_EMCHAR_LEN -This preprocessor constant is the maximum number of buffer bytes per -Emacs character, i.e. the byte length of an @code{Emchar}. It is useful -when allocating temporary strings to keep a known number of characters. -For instance: +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 +characters. For instance: @example @group @@ -2407,7 +2355,7 @@ @end example @end table -@node Conversion to and from External Data +@node Conversion to and from External Data, General Guidelines for Writing Mule-Aware Code, Working With Character and Byte Positions, Coding for Mule @subsection Conversion to and from External Data When an external function, such as a C library function, returns a @@ -2420,108 +2368,136 @@ The interface to conversion between the internal and external representations of text are the numerous conversion macros defined in -@file{buffer.h}. Before looking at them, we'll look at the external -formats supported by these macros. - -Currently meaningful formats are @code{FORMAT_BINARY}, -@code{FORMAT_FILENAME}, @code{FORMAT_OS}, and @code{FORMAT_CTEXT}. Here -is a description of these. - -@table @code -@item FORMAT_BINARY -Binary format. This is the simplest format and is what we use in the -absence of a more appropriate format. This converts according to the -@code{binary} coding system: - -@enumerate a -@item -On input, bytes 0--255 are converted into characters 0--255. -@item -On output, characters 0--255 are converted into bytes 0--255 and other -characters are converted into `X'. -@end enumerate - -@item FORMAT_FILENAME -Format used for filenames. In the original Mule, this is user-definable -with the @code{pathname-coding-system} variable. For the moment, we -just use the @code{binary} coding system. - -@item FORMAT_OS -Format used for the external Unix environment---@code{argv[]}, stuff -from @code{getenv()}, stuff from the @file{/etc/passwd} file, etc. - -Perhaps should be the same as FORMAT_FILENAME. - -@item FORMAT_CTEXT -Compound--text format. This is the standard X format used for data -stored in properties, selections, and the like. This is an 8-bit -no-lock-shift ISO2022 coding system. -@end table - -The macros to convert between these formats and the internal format, and -vice versa, follow. +@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 +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). @table @code -@item GET_CHARPTR_INT_DATA_ALLOCA -@itemx GET_CHARPTR_EXT_DATA_ALLOCA -These two are the most basic conversion macros. -@code{GET_CHARPTR_INT_DATA_ALLOCA} converts external data to internal -format, and @code{GET_CHARPTR_EXT_DATA_ALLOCA} converts the other way -around. The arguments each of these receives are @var{ptr} (pointer to -the text in external format), @var{len} (length of texts in bytes), -@var{fmt} (format of the external text), @var{ptr_out} (lvalue to which -new text should be copied), and @var{len_out} (lvalue which will be -assigned the length of the internal text in bytes). The resulting text -is stored to a stack-allocated buffer. If the text doesn't need -changing, these macros will do nothing, except for setting -@var{len_out}. - -The macros above take many arguments which makes them unwieldy. For -this reason, a number of convenience macros are defined with obvious -functionality, but accepting less arguments. The general rule is that -macros with @samp{INT} in their name convert text to internal Emacs -representation, whereas the @samp{EXT} macros convert to external -representation. - -@item GET_C_CHARPTR_INT_DATA_ALLOCA -@itemx GET_C_CHARPTR_EXT_DATA_ALLOCA -As their names imply, these macros work on C char pointers, which are -zero-terminated, and thus do not need @var{len} or @var{len_out} -parameters. - -@item GET_STRING_EXT_DATA_ALLOCA -@itemx GET_C_STRING_EXT_DATA_ALLOCA -These two macros convert a Lisp string into an external representation. -The difference between them is that @code{GET_STRING_EXT_DATA_ALLOCA} -stores its output to a generic string, providing @var{len_out}, the -length of the resulting external string. On the other hand, -@code{GET_C_STRING_EXT_DATA_ALLOCA} assumes that the caller will be -satisfied with output string being zero-terminated. - -Note that for Lisp strings only one conversion direction makes sense. - -@item GET_C_CHARPTR_EXT_BINARY_DATA_ALLOCA -@itemx GET_CHARPTR_EXT_BINARY_DATA_ALLOCA -@itemx GET_STRING_BINARY_DATA_ALLOCA -@itemx GET_C_STRING_BINARY_DATA_ALLOCA -@itemx GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA -@itemx ... -These macros convert internal text to a specific external -representation, with the external format being encoded into the name of -the macro. Note that the @code{GET_STRING_...} and -@code{GET_C_STRING...} macros lack the @samp{EXT} tag, because they -only make sense in that direction. - -@item GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA -@itemx GET_CHARPTR_INT_BINARY_DATA_ALLOCA -@itemx GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA -@itemx ... -These macros convert external text of a specific format to its internal -representation, with the external format being incoded into the name of -the macro. +@item Qbinary +This is the simplest format and is what we use in the absence of a more +appropriate format. This converts according to the @code{binary} coding +system: + +@enumerate a +@item +On input, bytes 0--255 are converted into (implicitly Latin-1) +characters 0--255. A non-Mule xemacs doesn't really know about +different character sets and the fonts to display them, so the bytes can +be treated as text in different 1-byte encodings by simply setting the +appropriate fonts. So in a sense, non-Mule xemacs is a multi-lingual +editor if, for example, different fonts are used to display text in +different buffers, faces, or windows. The specifier mechanism gives the +user complete control over this kind of behavior. +@item +On output, characters 0--255 are converted into bytes 0--255 and other +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. + +@item Qctext +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. @end table -@node General Guidelines for Writing Mule-Aware Code +There are two fundamental macros to convert between external and +internal format. + +@code{TO_INTERNAL_FORMAT} converts external data to internal format, and +@code{TO_EXTERNAL_FORMAT} converts the other way around. The arguments +each of these receives are a source type, a source, a sink type, a sink, +and a coding system (or a symbol naming a coding system). + +A typical call looks like +@example +TO_EXTERNAL_FORMAT (LISP_STRING, str, C_STRING_MALLOC, ptr, Qfile_name); +@end example + +which means that the contents of the lisp string @code{str} are written +to a malloc'ed memory area which will be pointed to by @code{ptr}, after +the function returns. The conversion will be done using the +@code{file-name} coding system, which will be controlled by the user +indirectly by setting or binding the variable +@code{file-name-coding-system}. + +Some sources and sinks require two C variables to specify. We use some +preprocessor magic to allow different source and sink types, and even +different numbers of arguments to specify different types of sources and +sinks. + +So we can have a call that looks like +@example +TO_INTERNAL_FORMAT (DATA, (ptr, len), + MALLOC, (ptr, len), + coding_system); +@end example + +The parenthesized argument pairs are required to make the preprocessor +magic work. + +Here are the different source and sink types: + +@table @code +@item @code{DATA, (ptr, len),} +input data is a fixed buffer of size @var{len} at address @var{ptr} +@item @code{ALLOCA, (ptr, len),} +output data is placed in an alloca()ed buffer of size @var{len} pointed to by @var{ptr} +@item @code{MALLOC, (ptr, len),} +output data is in a malloc()ed buffer of size @var{len} pointed to by @var{ptr} +@item @code{C_STRING_ALLOCA, ptr,} +equivalent to @code{ALLOCA (ptr, len_ignored)} on output. +@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 +@item @code{LISP_STRING, string,} +input or output is a Lisp_Object of type string +@item @code{LISP_BUFFER, buffer,} +output is written to @code{(point)} in lisp buffer @var{buffer} +@item @code{LISP_LSTREAM, lstream,} +input or output is a Lisp_Object of type lstream +@item @code{LISP_OPAQUE, object,} +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. + +The sinks to be specified must be lvalues, unless they are the lisp +object types @code{LISP_LSTREAM} or @code{LISP_BUFFER}. + +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 +types @code{MALLOC} and @code{C_STRING_MALLOC} return @code{xmalloc()}ed +memory. The caller is responsible for freeing this memory using +@code{xfree()}. + +Note that it doesn't make sense for @code{LISP_STRING} to be a source +for @code{TO_INTERNAL_FORMAT} or a sink for @code{TO_EXTERNAL_FORMAT}. +You'll get an assertion failure if you try. + + +@node General Guidelines for Writing Mule-Aware Code, An Example of Mule-Aware Code, Conversion to and from External Data, Coding for Mule @subsection General Guidelines for Writing Mule-Aware Code This section contains some general guidance on how to write Mule-aware @@ -2548,10 +2524,23 @@ buffers literally. This means that when a system function, such as @code{readdir}, returns -a string, you need to convert it using one of the conversion macros +a string, you may need to convert it using one of the conversion macros described in the previous chapter, before passing it further to Lisp. -In the case of @code{readdir}, you would use the -@code{GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA} macro. + +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 Also note that many internal functions, such as @code{make_string}, accept Bufbytes, which removes the need for them to convert the data @@ -2560,13 +2549,12 @@ passed around in internal format. @end table -@node An Example of Mule-Aware Code +@node An Example of Mule-Aware Code, , General Guidelines for Writing Mule-Aware Code, Coding for Mule @subsection An Example of Mule-Aware Code -As an example of Mule-aware code, we shall will analyze the -@code{string} function, which conses up a Lisp string from the character -arguments it receives. Here is the definition, pasted from -@code{alloc.c}: +As an example of Mule-aware code, we will analyze the @code{string} +function, which conses up a Lisp string from the character arguments it +receives. Here is the definition, pasted from @code{alloc.c}: @example @group @@ -2611,16 +2599,22 @@ understood this section of the manual and studied the examples, you can proceed writing new Mule-aware code. -@node Techniques for XEmacs Developers +@node Techniques for XEmacs Developers, , Coding for Mule, Rules When Writing New C Code @section Techniques for XEmacs Developers +To make a purified XEmacs, do: @code{make puremacs}. To make a quantified XEmacs, do: @code{make quantmacs}. -You simply can't dump Quantified and Purified images. Run the image -like so: @code{quantmacs -batch -l loadup.el run-temacs @var{xemacs-args...}}. +You simply can't dump Quantified and Purified images (unless using the +portable dumper). Purify gets confused when xemacs frees memory in one +process that was allocated in a @emph{different} process on a different +machine!. Run it like so: +@example +temacs -batch -l loadup.el run-temacs @var{xemacs-args...} +@end example Before you go through the trouble, are you compiling with all -debugging and error-checking off? If not try that first. Be warned +debugging and error-checking off? If not, try that first. Be warned that while Quantify is directly responsible for quite a few optimizations which have been made to XEmacs, doing a run which generates results which can be acted upon is not necessarily a trivial @@ -2659,14 +2653,116 @@ calls in elisp are especially expensive. Iterating over a long list is going to be 30 times faster implemented in C than in Elisp. +Heavily used small code fragments need to be fast. The traditional way +to implement such code fragments in C is with macros. But macros in C +are known to be broken. + +Macro arguments that are repeatedly evaluated may suffer from repeated +side effects or suboptimal performance. + +Variable names used in macros may collide with caller's variables, +causing (at least) unwanted compiler warnings. + +In order to solve these problems, and maintain statement semantics, one +should use the @code{do @{ ... @} while (0)} trick while trying to +reference macro arguments exactly once using local variables. + +Let's take a look at this poor macro definition: + +@example +#define MARK_OBJECT(obj) \ + if (!marked_p (obj)) mark_object (obj), did_mark = 1 +@end example + +This macro evaluates its argument twice, and also fails if used like this: +@example + if (flag) MARK_OBJECT (obj); else do_something(); +@end example + +A much better definition is + +@example +#define MARK_OBJECT(obj) do @{ \ + Lisp_Object mo_obj = (obj); \ + if (!marked_p (mo_obj)) \ + @{ \ + mark_object (mo_obj); \ + did_mark = 1; \ + @} \ +@} while (0) +@end example + +Notice the elimination of double evaluation by using the local variable +with the obscure name. Writing safe and efficient macros requires great +care. The one problem with macros that cannot be portably worked around +is, since a C block has no value, a macro used as an expression rather +than a statement cannot use the techniques just described to avoid +multiple evaluation. + +In most cases where a macro has function semantics, an inline function +is a better implementation technique. Modern compiler optimizers tend +to inline functions even if they have no @code{inline} keyword, and +configure magic ensures that the @code{inline} keyword can be safely +used as an additional compiler hint. Inline functions used in a single +.c files are easy. The function must already be defined to be +@code{static}. Just add another @code{inline} keyword to the +definition. + +@example +inline static int +heavily_used_small_function (int arg) +@{ + ... +@} +@end example + +Inline functions in header files are trickier, because we would like to +make the following optimization if the function is @emph{not} inlined +(for example, because we're compiling for debugging). We would like the +function to be defined externally exactly once, and each calling +translation unit would create an external reference to the function, +instead of including a definition of the inline function in the object +code of every translation unit that uses it. This optimization is +currently only available for gcc. But you don't have to worry about the +trickiness; just define your inline functions in header files using this +pattern: + +@example +INLINE_HEADER int +i_used_to_be_a_crufty_macro_but_look_at_me_now (int arg); +INLINE_HEADER int +i_used_to_be_a_crufty_macro_but_look_at_me_now (int arg) +@{ + ... +@} +@end example + +The declaration right before the definition is to prevent warnings when +compiling with @code{gcc -Wmissing-declarations}. I consider issuing +this warning for inline functions a gcc bug, but the gcc maintainers disagree. + +Every header which contains inline functions, either directly by using +@code{INLINE_HEADER} or indirectly by using @code{DECLARE_LRECORD} must +be added to @file{inline.c}'s includes to make the optimization +described above work. (Optimization note: if all INLINE_HEADER +functions are in fact inlined in all translation units, then the linker +can just discard @code{inline.o}, since it contains only unreferenced code). + To get started debugging XEmacs, take a look at the @file{.gdbinit} and -@file{.dbxrc} files in the @file{src} directory. -@xref{Q2.1.15 - How to Debug an XEmacs problem with a debugger,,, -xemacs-faq, XEmacs FAQ}. +@file{.dbxrc} files in the @file{src} directory. See the section in the +XEmacs FAQ on How to Debug an XEmacs problem with a debugger. After making source code changes, run @code{make check} to ensure that -you haven't introduced any regressions. If you're feeling ambitious, -you can try to improve the test suite in @file{tests/automated}. +you haven't introduced any regressions. If you want to make xemacs more +reliable, please improve the test suite in @file{tests/automated}. + +Did you make sure you didn't introduce any new compiler warnings? + +Before submitting a patch, please try compiling at least once with + +@example +configure --with-mule --with-union-type --error-checking=all +@end example Here are things to know when you create a new source file: @@ -2679,7 +2775,7 @@ Generated header files should be included using the @code{#include <...>} syntax, not the @code{#include "..."} syntax. The generated headers are: -@file{config.h puresize-adjust.h sheap-adjust.h paths.h Emacs.ad.h} +@file{config.h sheap-adjust.h paths.h Emacs.ad.h} The basic rule is that you should assume builds using @code{--srcdir} and the @code{#include <...>} syntax needs to be used when the @@ -2693,25 +2789,32 @@ @code{"lisp.h"}. It is the responsibility of the @file{.c} files that use it to do so. -@item -If the header uses @code{INLINE}, either directly or through -@code{DECLARE_LRECORD}, then it must be added to @file{inline.c}'s -includes. - -@item -Try compiling at least once with - -@example -gcc --with-mule --with-union-type --error-checking=all -@end example - -@item -Did I mention that you should run the test suite? -@example -make check -@end example @end itemize +Here is a checklist of things to do when creating a new lisp object type +named @var{foo}: + +@enumerate +@item +create @var{foo}.h +@item +create @var{foo}.c +@item +add definitions of @code{syms_of_@var{foo}}, etc. to @file{@var{foo}.c} +@item +add declarations of @code{syms_of_@var{foo}}, etc. to @file{symsinit.h} +@item +add calls to @code{syms_of_@var{foo}}, etc. to @file{emacs.c} +@item +add definitions of macros like @code{CHECK_@var{FOO}} and +@code{@var{FOO}P} to @file{@var{foo}.h} +@item +add the new type index to @code{enum lrecord_type} +@item +add a DEFINE_LRECORD_IMPLEMENTATION call to @file{@var{foo}.c} +@item +add an INIT_LRECORD_IMPLEMENTATION call to @code{syms_of_@var{foo}.c} +@end enumerate @node A Summary of the Various XEmacs Modules, Allocation of Objects in XEmacs Lisp, Rules When Writing New C Code, Top @chapter A Summary of the Various XEmacs Modules @@ -2733,7 +2836,7 @@ * Modules for Internationalization:: @end menu -@node Low-Level Modules +@node Low-Level Modules, Basic Lisp Modules, A Summary of the Various XEmacs Modules, A Summary of the Various XEmacs Modules @section Low-Level Modules @example @@ -2807,7 +2910,7 @@ @example -crt0.c +ecrt0.c lastfile.c pre-crt0.c @end example @@ -2942,14 +3045,6 @@ @example -prefix-args.c -@end example - -This is actually the source for a small, self-contained program -used during building. - - -@example universe.h @end example @@ -2957,11 +3052,10 @@ -@node Basic Lisp Modules +@node Basic Lisp Modules, Modules for Standard Editing Operations, Low-Level Modules, A Summary of the Various XEmacs Modules @section Basic Lisp Modules @example -emacsfns.h lisp-disunion.h lisp-union.h lisp.h @@ -3010,8 +3104,6 @@ @example alloc.c -pure.c -puresize.h @end example The large module @file{alloc.c} implements all of the basic allocation and @@ -3037,35 +3129,6 @@ subtypes in the subsystem; this provides a great deal of robustness to the XEmacs code. -@cindex pure space -@file{pure.c} contains the declaration of the @dfn{purespace} array. -Pure space is a hack used to place some constant Lisp data into the code -segment of the XEmacs executable, even though the data needs to be -initialized through function calls. (See above in section VIII for more -info about this.) During startup, certain sorts of data is -automatically copied into pure space, and other data is copied manually -in some of the basic Lisp files by calling the function @code{purecopy}, -which copies the object if possible (this only works in temacs, of -course) and returns the new object. In particular, while temacs is -executing, the Lisp reader automatically copies all compiled-function -objects that it reads into pure space. Since compiled-function objects -are large, are never modified, and typically comprise the majority of -the contents of a compiled-Lisp file, this works well. While XEmacs is -running, any attempt to modify an object that resides in pure space -causes an error. Objects in pure space are never garbage collected -- -almost all of the time, they're intended to be permanent, and in any -case you can't write into pure space to set the mark bits. - -@file{puresize.h} contains the declaration of the size of the pure space -array. This depends on the optional features that are compiled in, any -extra purespace requested by the user at compile time, and certain other -factors (e.g. 64-bit machines need more pure space because their Lisp -objects are larger). The smallest size that suffices should be used, so -that there's no wasted space. If there's not enough pure space, you -will get an error during the build process, specifying how much more -pure space is needed. - - @example eval.c @@ -3163,7 +3226,7 @@ -@node Modules for Standard Editing Operations +@node Modules for Standard Editing Operations, Editor-Level Control Flow Modules, Basic Lisp Modules, A Summary of the Various XEmacs Modules @section Modules for Standard Editing Operations @example @@ -3333,13 +3396,17 @@ -@node Editor-Level Control Flow Modules +@node Editor-Level Control Flow Modules, Modules for the Basic Displayable Lisp Objects, Modules for Standard Editing Operations, A Summary of the Various XEmacs Modules @section Editor-Level Control Flow Modules @example event-Xt.c +event-msw.c event-stream.c event-tty.c +events-mod.h +gpmevent.c +gpmevent.h events.c events.h @end example @@ -3394,10 +3461,10 @@ @example -keyboard.c -@end example - -@file{keyboard.c} contains functions that implement the actual editor +cmdloop.c +@end example + +@file{cmdloop.c} contains functions that implement the actual editor command loop---i.e. the event loop that cyclically retrieves and dispatches events. This code is also rather tricky, just like @file{event-stream.c}. @@ -3431,17 +3498,35 @@ -@node Modules for the Basic Displayable Lisp Objects +@node Modules for the Basic Displayable Lisp Objects, Modules for other Display-Related Lisp Objects, Editor-Level Control Flow Modules, A Summary of the Various XEmacs Modules @section Modules for the Basic Displayable Lisp Objects @example -device-ns.h -device-stream.c -device-stream.h +console-msw.c +console-msw.h +console-stream.c +console-stream.h +console-tty.c +console-tty.h +console-x.c +console-x.h +console.c +console.h +@end example + +These modules implement the @dfn{console} Lisp object type. A console +contains multiple display devices, but only one keyboard and mouse. +Most of the time, a console will contain exactly one device. + +Consoles are the top of a lisp object inclusion hierarchy. Consoles +contain devices, which contain frames, which contain windows. + + + +@example +device-msw.c device-tty.c -device-tty.h device-x.c -device-x.h device.c device.h @end example @@ -3462,10 +3547,9 @@ @example -frame-ns.h +frame-msw.c frame-tty.c frame-x.c -frame-x.h frame.c frame.h @end example @@ -3505,7 +3589,7 @@ -@node Modules for other Display-Related Lisp Objects +@node Modules for other Display-Related Lisp Objects, Modules for the Redisplay Mechanism, Modules for the Basic Displayable Lisp Objects, A Summary of the Various XEmacs Modules @section Modules for other Display-Related Lisp Objects @example @@ -3517,7 +3601,10 @@ @example bitmaps.h -glyphs-ns.h +glyphs-eimage.c +glyphs-msw.c +glyphs-msw.h +glyphs-widget.c glyphs-x.c glyphs-x.h glyphs.c @@ -3527,7 +3614,8 @@ @example -objects-ns.h +objects-msw.c +objects-msw.h objects-tty.c objects-tty.h objects-x.c @@ -3539,13 +3627,18 @@ @example +menubar-msw.c +menubar-msw.h menubar-x.c menubar.c -@end example - - - -@example +menubar.h +@end example + + + +@example +scrollbar-msw.c +scrollbar-msw.h scrollbar-x.c scrollbar-x.h scrollbar.c @@ -3555,6 +3648,7 @@ @example +toolbar-msw.c toolbar-x.c toolbar.c toolbar.h @@ -3581,14 +3675,16 @@ @end example These modules decode GIF-format image files, for use with glyphs. - - - -@node Modules for the Redisplay Mechanism +These files were removed due to Unisys patent infringement concerns. + + + +@node Modules for the Redisplay Mechanism, Modules for Interfacing with the File System, Modules for other Display-Related Lisp Objects, A Summary of the Various XEmacs Modules @section Modules for the Redisplay Mechanism @example redisplay-output.c +redisplay-msw.c redisplay-tty.c redisplay-x.c redisplay.c @@ -3656,7 +3752,7 @@ -@node Modules for Interfacing with the File System +@node Modules for Interfacing with the File System, Modules for Other Aspects of the Lisp Interpreter and Object System, Modules for the Redisplay Mechanism, A Summary of the Various XEmacs Modules @section Modules for Interfacing with the File System @example @@ -3683,7 +3779,7 @@ Similar to other subsystems in XEmacs, lstreams are separated into generic functions and a set of methods for the different types of lstreams. @file{lstream.c} provides implementations of many different -types of streams; others are provided, e.g., in @file{mule-coding.c}. +types of streams; others are provided, e.g., in @file{file-coding.c}. @@ -3757,7 +3853,7 @@ -@node Modules for Other Aspects of the Lisp Interpreter and Object System +@node Modules for Other Aspects of the Lisp Interpreter and Object System, Modules for Interfacing with the Operating System, Modules for Interfacing with the File System, A Summary of the Various XEmacs Modules @section Modules for Other Aspects of the Lisp Interpreter and Object System @example @@ -3919,7 +4015,7 @@ -@node Modules for Interfacing with the Operating System +@node Modules for Interfacing with the Operating System, Modules for Interfacing with X Windows, Modules for Other Aspects of the Lisp Interpreter and Object System, A Summary of the Various XEmacs Modules @section Modules for Interfacing with the Operating System @example @@ -4148,17 +4244,7 @@ -@example -msdos.c -msdos.h -@end example - -These modules are used for MS-DOS support, which does not work in -XEmacs. - - - -@node Modules for Interfacing with X Windows +@node Modules for Interfacing with X Windows, Modules for Internationalization, Modules for Interfacing with the Operating System, A Summary of the Various XEmacs Modules @section Modules for Interfacing with X Windows @example @@ -4225,7 +4311,10 @@ @example -xselect.c +select-msw.c +select-x.c +select.c +select.h @end example @cindex selections @@ -4300,7 +4389,7 @@ -@node Modules for Internationalization +@node Modules for Internationalization, , Modules for Interfacing with X Windows, A Summary of the Various XEmacs Modules @section Modules for Internationalization @example @@ -4308,8 +4397,8 @@ mule-ccl.c mule-charset.c mule-charset.h -mule-coding.c -mule-coding.h +file-coding.c +file-coding.h mule-mcpath.c mule-mcpath.h mule-wnnfns.c @@ -4321,13 +4410,13 @@ just Asian languages (although they are generally the most complicated to support). This code is still in beta. -@file{mule-charset.*} and @file{mule-coding.*} provide the heart of the +@file{mule-charset.*} and @file{file-coding.*} provide the heart of the XEmacs MULE support. @file{mule-charset.*} implements the @dfn{charset} Lisp object type, which encapsulates a character set (an ordered one- or two-dimensional set of characters, such as US ASCII or JISX0208 Japanese Kanji). -@file{mule-coding.*} implements the @dfn{coding-system} Lisp object +@file{file-coding.*} implements the @dfn{coding-system} Lisp object type, which encapsulates a method of converting between different encodings. An encoding is a representation of a stream of characters, possibly from multiple character sets, using a stream of bytes or words, @@ -4377,7 +4466,7 @@ -@node Allocation of Objects in XEmacs Lisp, Events and the Event Loop, A Summary of the Various XEmacs Modules, Top +@node Allocation of Objects in XEmacs Lisp, Dumping, A Summary of the Various XEmacs Modules, Top @chapter Allocation of Objects in XEmacs Lisp @menu @@ -4389,7 +4478,6 @@ * Allocation from Frob Blocks:: * lrecords:: * Low-level allocation:: -* Pure Space:: * Cons:: * Vector:: * Bit Vector:: @@ -4399,7 +4487,7 @@ * Compiled Function:: @end menu -@node Introduction to Allocation +@node Introduction to Allocation, Garbage Collection, Allocation of Objects in XEmacs Lisp, Allocation of Objects in XEmacs Lisp @section Introduction to Allocation Emacs Lisp, like all Lisps, has garbage collection. This means that @@ -4420,10 +4508,10 @@ have no corresponding Lisp primitives. Every Lisp object, though, has at least one C primitive for creating it. - Recall from section (VII) that a Lisp object, as stored in a 32-bit -or 64-bit word, has a mark bit, a few tag bits, and a ``value'' that -occupies the remainder of the bits. We can separate the different -Lisp object types into four broad categories: + Recall from section (VII) that a Lisp object, as stored in a 32-bit or +64-bit word, has a few tag bits, and a ``value'' that occupies the +remainder of the bits. We can separate the different Lisp object types +into three broad categories: @itemize @bullet @item @@ -4434,54 +4522,28 @@ @code{GCPRO}ed. @end itemize - In the remaining three categories, the value is a pointer to a -structure. + In the remaining two categories, the type is stored in the object +itself. The tag for all such objects is the generic @dfn{lrecord} +(Lisp_Type_Record) tag. The first bytes of the object's structure are an +integer (actually a char) characterising the object's type and some +flags, in particular the mark bit used for garbage collection. A +structure describing the type is accessible thru the +lrecord_implementation_table indexed with said integer. This structure +includes the method pointers and a pointer to a string naming the type. @itemize @bullet @item -@cindex frob block -(b) Those for whom the tag directly specifies the type. Recall that -there are only three tag bits; this means that at most five types can be -specified this way. The most commonly-used types are stored in this -format; this includes conses, strings, vectors, and sometimes symbols. -With the exception of vectors, objects in this category are allocated in -@dfn{frob blocks}, i.e. large blocks of memory that are subdivided into -individual objects. This saves a lot on malloc overhead, since there -are typically quite a lot of these objects around, and the objects are -small. (A cons, for example, occupies 8 bytes on 32-bit machines---4 -bytes for each of the two objects it contains.) Vectors are individually -@code{malloc()}ed since they are of variable size. (It would be -possible, and desirable, to allocate vectors of certain small sizes out -of frob blocks, but it isn't currently done.) Strings are handled -specially: Each string is allocated in two parts, a fixed size structure -containing a length and a data pointer, and the actual data of the -string. The former structure is allocated in frob blocks as usual, and -the latter data is stored in @dfn{string chars blocks} and is relocated -during garbage collection to eliminate holes. -@end itemize - - In the remaining two categories, the type is stored in the object -itself. The tag for all such objects is the generic @dfn{lrecord} -(Lisp_Record) tag. The first four bytes (or eight, for 64-bit machines) -of the object's structure are a pointer to a structure that describes -the object's type, which includes method pointers and a pointer to a -string naming the type. Note that it's possible to save some space by -using a one- or two-byte tag, rather than a four- or eight-byte pointer -to store the type, but it's not clear it's worth making the change. - -@itemize @bullet -@item -(c) Those lrecords that are allocated in frob blocks (see above). This +(b) Those lrecords that are allocated in frob blocks (see above). This includes the objects that are most common and relatively small, and -includes floats, compiled functions, symbols (when not in category (b)), +includes conses, strings, subrs, floats, compiled functions, symbols, extents, events, and markers. With the cleanup of frob blocks done in 19.12, it's not terribly hard to add more objects to this category, but -it's a bit trickier than adding an object type to type (d) (esp. if the +it's a bit trickier than adding an object type to type (c) (esp. if the object needs a finalization method), and is not likely to save much space unless the object is small and there are many of them. (In fact, if there are very few of them, it might actually waste space.) @item -(d) Those lrecords that are individually @code{malloc()}ed. These are +(c) Those lrecords that are individually @code{malloc()}ed. These are called @dfn{lcrecords}. All other types are in this category. Adding a new type to this category is comparatively easy, and all types added since 19.8 (when the current allocation scheme was devised, by Richard @@ -4490,19 +4552,13 @@ @end itemize Note that bit vectors are a bit of a special case. They are -simple lrecords as in category (c), but are individually @code{malloc()}ed +simple lrecords as in category (b), but are individually @code{malloc()}ed like vectors. You can basically view them as exactly like vectors except that their type is stored in lrecord fashion rather than in directly-tagged fashion. - Note that FSF Emacs redesigned their object system in 19.29 to follow -a similar scheme. However, given RMS's expressed dislike for data -abstraction, the FSF scheme is not nearly as clean or as easy to -extend. (FSF calls items of type (c) @code{Lisp_Misc} and items of type -(d) @code{Lisp_Vectorlike}, with separate tags for each, although -@code{Lisp_Vectorlike} is also used for vectors.) - -@node Garbage Collection + +@node Garbage Collection, GCPROing, Introduction to Allocation, Allocation of Objects in XEmacs Lisp @section Garbage Collection @cindex garbage collection @@ -4520,63 +4576,13 @@ all vectors (which are chained in one big list), and all lcrecords (which are likewise chained). - Note that, when an object is marked, the mark has to occur -inside of the object's structure, rather than in the 32-bit -@code{Lisp_Object} holding the object's pointer; i.e. you can't just -set the pointer's mark bit. This is because there may be many -pointers to the same object. This means that the method of -marking an object can differ depending on the type. The -different marking methods are approximately as follows: - -@enumerate -@item -For conses, the mark bit of the car is set. -@item -For strings, the mark bit of the string's plist is set. -@item -For symbols when not lrecords, the mark bit of the -symbol's plist is set. -@item -For vectors, the length is negated after adding 1. -@item -For lrecords, the pointer to the structure describing -the type is changed (see below). -@item -Integers and characters do not need to be marked, since -no allocation occurs for them. -@end enumerate - - The details of this are in the @code{mark_object()} function. - - Note that any code that operates during garbage collection has -to be especially careful because of the fact that some objects -may be marked and as such may not look like they normally do. -In particular: - -@itemize @bullet -Some object pointers may have their mark bit set. This will make -@code{FOOBARP()} predicates fail. Use @code{GC_FOOBARP()} to deal with -this. -@item -Even if you clear the mark bit, @code{FOOBARP()} will still fail -for lrecords because the implementation pointer has been -changed (see below). @code{GC_FOOBARP()} will correctly deal with -this. -@item -Vectors have their size field munged, so anything that -looks at this field will fail. -@item -Note that @code{XFOOBAR()} macros @emph{will} work correctly on object -pointers with their mark bit set, because the logical shift operations -that remove the tag also remove the mark bit. -@end itemize - - Finally, note that garbage collection can be invoked explicitly -by calling @code{garbage-collect} but is also called automatically -by @code{eval}, once a certain amount of memory has been allocated -since the last garbage collection (according to @code{gc-cons-threshold}). - -@node GCPROing + Garbage collection can be invoked explicitly by calling +@code{garbage-collect} but is also called automatically by @code{eval}, +once a certain amount of memory has been allocated since the last +garbage collection (according to @code{gc-cons-threshold}). + + +@node GCPROing, Garbage Collection - Step by Step, Garbage Collection, Allocation of Objects in XEmacs Lisp @section @code{GCPRO}ing @code{GCPRO}ing is one of the ugliest and trickiest parts of Emacs @@ -4587,14 +4593,17 @@ @enumerate @item -All objects that have been @code{staticpro()}d. This is used for -any global C variables that hold Lisp objects. A call to -@code{staticpro()} happens implicitly as a result of any symbols -declared with @code{defsymbol()} and any variables declared with -@code{DEFVAR_FOO()}. You need to explicitly call @code{staticpro()} -(in the @code{vars_of_foo()} method of a module) for other global -C variables holding Lisp objects. (This typically includes -internal lists and such things.) +All objects that have been @code{staticpro()}d or +@code{staticpro_nodump()}ed. This is used for any global C variables +that hold Lisp objects. A call to @code{staticpro()} happens implicitly +as a result of any symbols declared with @code{defsymbol()} and any +variables declared with @code{DEFVAR_FOO()}. You need to explicitly +call @code{staticpro()} (in the @code{vars_of_foo()} method of a module) +for other global C variables holding Lisp objects. (This typically +includes internal lists and such things.). Use +@code{staticpro_nodump()} only in the rare cases when you do not want +the pointed variable to be saved at dump time but rather recompute it at +startup. Note that @code{obarray} is one of the @code{staticpro()}d things. Therefore, all functions and variables get marked through this. @@ -4729,7 +4738,7 @@ it obviates the need for @code{GCPRO}ing, and allows garbage collection to happen at any point at all, such as during object allocation. -@node Garbage Collection - Step by Step +@node Garbage Collection - Step by Step, Integers and Characters, GCPROing, Allocation of Objects in XEmacs Lisp @section Garbage Collection - Step by Step @cindex garbage collection step by step @@ -4744,12 +4753,12 @@ * sweep_bit_vectors_1:: @end menu -@node Invocation +@node Invocation, garbage_collect_1, Garbage Collection - Step by Step, Garbage Collection - Step by Step @subsection Invocation @cindex garbage collection, invocation The first thing that anyone should know about garbage collection is: -when and how the garbage collector is invoked. One might think that this +when and how the garbage collector is invoked. One might think that this could happen every time new memory is allocated, e.g. new objects are created, but this is @emph{not} the case. Instead, we have the following situation: @@ -4758,7 +4767,7 @@ of the function @code{garbage_collect_1} in file @code{alloc.c}. The invocation can occur @emph{explicitly} by calling the function @code{Fgarbage_collect} (in addition this function provides information -about the freed memory), or can occur @emph{implicitly} in four different +about the freed memory), or can occur @emph{implicitly} in four different situations: @enumerate @item @@ -4769,7 +4778,7 @@ @item In function @code{disksave_object_finalization} in file @code{alloc.c}. The only purpose of this function is to clear the -objects from memory which need not be stored with xemacs when we dump out +objects from memory which need not be stored with xemacs when we dump out an executable. This is only done by @code{Fdump_emacs} or by @code{Fdump_emacs_data} respectively (both in @code{emacs.c}). The actual clearing is accomplished by making these objects unreachable and @@ -4793,18 +4802,18 @@ The upshot is that garbage collection can basically occur everywhere @code{Feval}, respectively @code{Ffuncall}, is used - either directly or -through another function. Since calls to these two functions are -hidden in various other functions, many calls to -@code{garabge_collect_1} are not obviously foreseeable, and therefore -unexpected. Instances where they are used that are worth remembering are -various elisp commands, as for example @code{or}, -@code{and}, @code{if}, @code{cond}, @code{while}, @code{setq}, etc., -miscellaneous @code{gui_item_...} functions, everything related to -@code{eval} (@code{Feval_buffer}, @code{call0}, ...) and inside -@code{Fsignal}. The latter is used to handle signals, as for example the -ones raised by every @code{QUITE}-macro triggered after pressing Ctrl-g. - -@node garbage_collect_1 +through another function. Since calls to these two functions are hidden +in various other functions, many calls to @code{garbage_collect_1} are +not obviously foreseeable, and therefore unexpected. Instances where +they are used that are worth remembering are various elisp commands, as +for example @code{or}, @code{and}, @code{if}, @code{cond}, @code{while}, +@code{setq}, etc., miscellaneous @code{gui_item_...} functions, +everything related to @code{eval} (@code{Feval_buffer}, @code{call0}, +...) and inside @code{Fsignal}. The latter is used to handle signals, as +for example the ones raised by every @code{QUITE}-macro triggered after +pressing Ctrl-g. + +@node garbage_collect_1, mark_object, Invocation, Garbage Collection - Step by Step @subsection @code{garbage_collect_1} @cindex @code{garbage_collect_1} @@ -4812,7 +4821,7 @@ place. @enumerate @item -There are several cases in which the garbage collector is left immediately: +There are several cases in which the garbage collector is left immediately: when we are already garbage collecting (@code{gc_in_progress}), when the garbage collection is somehow forbidden (@code{gc_currently_forbidden}), when we are currently displaying something @@ -4823,14 +4832,14 @@ all the output occurring during garbage collecting is determined. In order to be able to restore the old display's state after displaying the message, some data about the current cursor position has to be -saved. The variables @code{pre_gc_curser} and @code{cursor_changed} take +saved. The variables @code{pre_gc_cursor} and @code{cursor_changed} take care of that. @item The state of @code{gc_currently_forbidden} must be restored after the garbage collection, no matter what happens during the process. We accomplish this by @code{record_unwind_protect}ing the suitable function @code{restore_gc_inhibit} together with the current value of -@code{gc_currently_forbidden}. +@code{gc_currently_forbidden}. @item If we are concurrently running an interactive xemacs session, the next step is simply to show the garbage collector's cursor/message. @@ -4844,7 +4853,7 @@ Before actually starting to go over all live objects, references to objects that are no longer used are pruned. We only have to do this for events (@code{clear_event_resource}) and for specifiers -(@code{cleanup_specifiers}). +(@code{cleanup_specifiers}). @item Now the mark phase begins and marks all accessible elements. In order to start from @@ -4856,13 +4865,13 @@ @item all constant symbols and static variables that are registered via @code{staticpro}@ in the array @code{staticvec}. -@xref{Adding Global Lisp Variables}. +@xref{Adding Global Lisp Variables}. @item all Lisp objects that are created in C functions and that must be protected from freeing them. They are registered in the global list @code{gcprolist}. @xref{GCPROing}. -@item +@item all local variables (i.e. their name fields @code{symbol} and old values @code{old_values}) that are bound during the evaluation by the Lisp engine. They are stored in @code{specbinding} structs pushed on a stack @@ -4875,13 +4884,13 @@ are freshly created objects and therefore have to be marked. @xref{Catch and Throw}. @item -every function application pushes new structs @code{backtrace} -on the call stack of the Lisp engine (@code{backtrace_list}). The unique +every function application pushes new structs @code{backtrace} +on the call stack of the Lisp engine (@code{backtrace_list}). The unique parts that have to be marked are the fields for each function (@code{function}) and all their arguments (@code{args}). @xref{Evaluation}. @item -all objects that are used by the redisplay engine that must not be freed +all objects that are used by the redisplay engine that must not be freed are marked by a special function called @code{mark_redisplay} (in @code{redisplay.c}). @item @@ -4899,8 +4908,8 @@ anyway, and the reference to it is cleared. In hash tables there are different usage patterns of them, manifesting in different types of hash tables, namely 'non-weak', 'weak', 'key-weak' and 'value-weak' -(internally also 'key-car-weak' and 'value-car-weak') hash tables, each -clearing entries depending on different conditions. More information can +(internally also 'key-car-weak' and 'value-car-weak') hash tables, each +clearing entries depending on different conditions. More information can be found in the documentation to the function @code{make-hash-table}. Because there are complicated dependency rules about when and what to @@ -4911,13 +4920,13 @@ function @code{finish_marking_weak_hash_tables}. This function iterates over each hash table entry @code{hentries} for each weak hash table in @code{Vall_weak_hash_tables}. Depending on the type of a table, the -appropriate action is performed. +appropriate action is performed. If a table is acting as @code{HASH_TABLE_KEY_WEAK}, and a key already marked, -everything reachable from the @code{value} component is marked. If it is +everything reachable from the @code{value} component is marked. If it is acting as a @code{HASH_TABLE_VALUE_WEAK} and the value component is -already marked, the marking starts beginning only from the +already marked, the marking starts beginning only from the @code{key} component. -If it is a @code{HASH_TABLE_KEY_CAR_WEAK} and the car +If it is a @code{HASH_TABLE_KEY_CAR_WEAK} and the car of the key entry is already marked, we mark both the @code{key} and @code{value} components. Finally, if the table is of the type @code{HASH_TABLE_VALUE_CAR_WEAK} @@ -4929,9 +4938,9 @@ @code{simple}, @code{assoc}, @code{key-assoc} and @code{value-assoc}. You can find further details about them in the description to the function @code{make-weak-list}. The scheme of their -marking is similar: all weak lists are listed in @code{Qall_weak_lists}, +marking is similar: all weak lists are listed in @code{Qall_weak_lists}, therefore we iterate over them. The marking is advanced until we hit an -already marked pair. Then we know that during a former run all +already marked pair. Then we know that during a former run all the rest has been marked completely. Again, depending on the special type of the weak list, our jobs differ. If it is a @code{WEAK_LIST_SIMPLE} and the elem is marked, we mark the @code{cons} part. If it is a @@ -4944,7 +4953,7 @@ Since, by marking objects in reach from weak hash tables and weak lists, other objects could get marked, this perhaps implies further marking of -other weak objects, both finishing functions are redone as long as +other weak objects, both finishing functions are redone as long as yet unmarked objects get freshly marked. @item @@ -4956,7 +4965,7 @@ The function @code{prune_weak_hash_tables} does the job for weak hash tables. Totally unmarked hash tables are removed from the list @code{Vall_weak_hash_tables}. The other ones are treated more carefully -by scanning over all entries and removing one as soon as one of +by scanning over all entries and removing one as soon as one of the components @code{key} and @code{value} is unmarked. The same idea applies to the weak lists. It is accomplished by @@ -4966,12 +4975,12 @@ @item The function @code{prune_specifiers} checks all listed specifiers held -in @code{Vall_speficiers} and removes the ones from the lists that are +in @code{Vall_specifiers} and removes the ones from the lists that are unmarked. @item All syntax tables are stored in a list called -@code{Vall_syntax_tables}. The function @code{prune_syntax_tables} walks +@code{Vall_syntax_tables}. The function @code{prune_syntax_tables} walks through it and unlinks the tables that are unmarked. @item @@ -4979,11 +4988,11 @@ @code{gc_sweep} which holds the predominance. @item First, all the variables with respect to garbage collection are -reset. @code{consing_since_gc} - the counter of the created cells since +reset. @code{consing_since_gc} - the counter of the created cells since the last garbage collection - is set back to 0, and @code{gc_in_progress} is not @code{true} anymore. @item -In case the session is interactive, the displayed cursor and message are +In case the session is interactive, the displayed cursor and message are removed again. @item The state of @code{gc_inhibit} is restored to the former value by @@ -4991,10 +5000,10 @@ @item A small memory reserve is always held back that can be reached by @code{breathing_space}. If nothing more is left, we create a new reserve -and exit. +and exit. @end enumerate -@node mark_object +@node mark_object, gc_sweep, garbage_collect_1, Garbage Collection - Step by Step @subsection @code{mark_object} @cindex @code{mark_object} @@ -5002,7 +5011,7 @@ object is a real Lisp object @code{Lisp_Type_Record} or just an integer or a character. Integers and characters are the only two types that are stored directly - without another level of indirection, and therefore they -don't have to be marked and collected. +don't have to be marked and collected. @xref{How Lisp Objects Are Represented in C}. The second case is the one we have to handle. It is the one when we are @@ -5013,14 +5022,14 @@ already marked, and need not be marked for the second time (checked by @code{MARKED_RECORD_HEADER_P}). If it is a special, unmarkable object (@code{UNMARKABLE_RECORD_HEADER_P}, apparently, these are objects that -sit in some CONST space, and can therefore not be marked, see +sit in some const space, and can therefore not be marked, see @code{this_one_is_unmarkable} in @code{alloc.c}). Now, the actual marking is feasible. We do so by once using the macro @code{MARK_RECORD_HEADER} to mark the object itself (actually the special flag in the lrecord header), and calling its special marker "method" @code{marker} if available. The marker method marks every -other object that is in reach from our current object. Note, that these +other object that is in reach from our current object. Note, that these marker methods should not call @code{mark_object} recursively, but instead should return the next object from where further marking has to be performed. @@ -5028,11 +5037,11 @@ In case another object was returned, as mentioned before, we reiterate the whole @code{mark_object} process beginning with this next object. -@node gc_sweep +@node gc_sweep, sweep_lcrecords_1, mark_object, Garbage Collection - Step by Step @subsection @code{gc_sweep} @cindex @code{gc_sweep} -The job of this function is to free all unmarked records from memory. As +The job of this function is to free all unmarked records from memory. As we know, there are different types of objects implemented and managed, and consequently different ways to free them from memory. @xref{Introduction to Allocation}. @@ -5041,7 +5050,7 @@ bulkier objects are allocated and handled using that scheme of @code{lcrecords}. Each object is @code{malloc}ed separately instead of placing it in one of the contiguous frob blocks. All types -that are currently stored +that are currently stored using @code{lcrecords}'s @code{alloc_lcrecord} and @code{make_lcrecord_list} are the types: vectors, buffers, char-table, char-table-entry, console, weak-list, database, device, @@ -5059,7 +5068,7 @@ Our next candidates are the other objects that behave quite differently than everything else: the strings. They consists of two parts, a -fixed-size portion (@code{struct Lisp_string}) holding the string's +fixed-size portion (@code{struct Lisp_String}) holding the string's length, its property list and a pointer to the second part, and the actual string data, which is stored in string-chars blocks comparable to frob blocks. In this block, the data is not only freed, but also a @@ -5076,12 +5085,12 @@ compiled-functions, symbol, marker, extent, and event stored in so-called "frob blocks", and therefore we can basically do the same on every type objects, using the same macros, especially defined only to -handle everything with respect to fixed-size blocks. The only fixed-size +handle everything with respect to fixed-size blocks. The only fixed-size type that is not handled here are the fixed-size portion of strings, because we took special care of them earlier. The only big exceptions are bit vectors stored differently and -therefore treated differently by the function @code{sweep_bit_vectors_1} +therefore treated differently by the function @code{sweep_bit_vectors_1} described later. At first, we need some brief information about how @@ -5090,7 +5099,7 @@ stored in big blocks of memory - allocated at once - that can hold a certain amount of objects of one type. The macro @code{DECLARE_FIXED_TYPE_ALLOC} creates the suitable structures for -every type. More precisely, we have the block struct +every type. More precisely, we have the block struct (holding a pointer to the previous block @code{prev} and the objects in @code{block[]}), a pointer to current block (@code{current_..._block)}) and its last index @@ -5106,45 +5115,45 @@ macro @code{ADDITIONAL_FREE_...} that defines additional work that has to be done when converting an object from in use to not in use (so far, only markers use it in order to unchain them). Then, they all call -the macro @code{SWEEP_FIXED_TYPE_BLOCK} instantiated with their type name +the macro @code{SWEEP_FIXED_TYPE_BLOCK} instantiated with their type name and their struct name. This call in particular does the following: we go over all blocks starting with the current moving towards the oldest. For each block, we look at every object in it. If the object already freed (checked with @code{FREE_STRUCT_P} using the first pointer of the -object), or if it is +object), or if it is set to read only (@code{C_READONLY_RECORD_HEADER_P}, nothing must be done. If it is unmarked (checked with @code{MARKED_RECORD_HEADER_P}), it is put in the free list and set free (using the macro -@code{FREE_FIXED_TYPE}, otherwise it stays in the block, but is unmarked +@code{FREE_FIXED_TYPE}, otherwise it stays in the block, but is unmarked (by @code{UNMARK_...}). While going through one block, we note if the whole block is empty. If so, the whole block is freed (using @code{xfree}) and the free list state is set to the state it had before handling this block. -@node sweep_lcrecords_1 +@node sweep_lcrecords_1, compact_string_chars, gc_sweep, Garbage Collection - Step by Step @subsection @code{sweep_lcrecords_1} @cindex @code{sweep_lcrecords_1} After nullifying the complete lcrecord statistics, we go over all -lcrecords two separate times. They are all chained together in a list with -a head called @code{all_lcrecords}. - -The first loop calls for each object its @code{finalizer} method, but only +lcrecords two separate times. They are all chained together in a list with +a head called @code{all_lcrecords}. + +The first loop calls for each object its @code{finalizer} method, but only in the case that it is not read only (@code{C_READONLY_RECORD_HEADER_P)}, it is not already marked (@code{MARKED_RECORD_HEADER_P}), it is not already in a free list (list of freed objects, field @code{free}) and finally it owns a finalizer method. - -The second loop actually frees the appropriate objects again by iterating -through the whole list. In case an object is read only or marked, it + +The second loop actually frees the appropriate objects again by iterating +through the whole list. In case an object is read only or marked, it has to persist, otherwise it is manually freed by calling @code{xfree}. During this loop, the lcrecord statistics are kept up to -date by calling @code{tick_lcrecord_stats} with the right arguments, - -@node compact_string_chars +date by calling @code{tick_lcrecord_stats} with the right arguments, + +@node compact_string_chars, sweep_strings, sweep_lcrecords_1, Garbage Collection - Step by Step @subsection @code{compact_string_chars} @cindex @code{compact_string_chars} @@ -5156,7 +5165,7 @@ positions in the @code{string_chars_block}s using two pointer/integer pairs, namely @code{from_sb}/@code{from_pos} and @code{to_sb}/@code{to_pos}. They stand for the actual positions, from -where to where, to copy the actually handled string. +where to where, to copy the actually handled string. While going over all chained @code{string_char_block}s and their held strings, staring at @code{first_string_chars_block}, both pointers @@ -5167,7 +5176,7 @@ @itemize @bullet @item The string at @code{from_sb}'s position could be marked as free, which -is indicated by an invalid pointer to the pointer that should point back +is indicated by an invalid pointer to the pointer that should point back to the fixed size string object, and which is checked by @code{FREE_STRUCT_P}. In this case, the @code{from_sb}/@code{from_pos} is advanced to the next string, and nothing has to be copied. @@ -5176,7 +5185,7 @@ copied. We likewise advance the @code{from_sb}/@code{from_pos} pair as described above. @item -In all other cases, we have a marked string at hand. The string data +In all other cases, we have a marked string at hand. The string data must be moved from the from-position to the to-position. In case there is not enough space in the actual @code{to_sb}-block, we advance this pointer to the beginning of the next block before copying. In case the @@ -5190,7 +5199,7 @@ i.e. @code{to_block}, and all remaining blocks (we know that they just carry garbage) are explicitly @code{xfree}d. -@node sweep_strings +@node sweep_strings, sweep_bit_vectors_1, compact_string_chars, Garbage Collection - Step by Step @subsection @code{sweep_strings} @cindex @code{sweep_strings} @@ -5202,7 +5211,7 @@ definitions are a little bit special compared to the ones used for the other fixed size types. -@code{UNMARK_string} is defined the same way except some additional code +@code{UNMARK_string} is defined the same way except some additional code used for updating the bookkeeping information. For strings, @code{ADDITIONAL_FREE_string} has to do something in @@ -5211,7 +5220,7 @@ therefore it was @code{malloc}ed separately, we know also @code{xfree} it explicitly. -@node sweep_bit_vectors_1 +@node sweep_bit_vectors_1, , sweep_strings, Garbage Collection - Step by Step @subsection @code{sweep_bit_vectors_1} @cindex @code{sweep_bit_vectors_1} @@ -5220,12 +5229,12 @@ bit vectors must be freed by hand. This is done, as one might imagine, the expected way: since they are all registered in a list called @code{all_bit_vectors}, all elements of that list are traversed, -all unmarked bit vectors are unlinked by calling @code{xfree} and all of +all unmarked bit vectors are unlinked by calling @code{xfree} and all of them become unmarked. -In addition, the bookkeeping information used for garbage +In addition, the bookkeeping information used for garbage collector's output purposes is updated. -@node Integers and Characters +@node Integers and Characters, Allocation from Frob Blocks, Garbage Collection - Step by Step, Allocation of Objects in XEmacs Lisp @section Integers and Characters Integer and character Lisp objects are created from integers using the @@ -5239,7 +5248,7 @@ are too big; i.e. you won't get the value you expected but the tag bits will at least be correct. -@node Allocation from Frob Blocks +@node Allocation from Frob Blocks, lrecords, Integers and Characters, Allocation of Objects in XEmacs Lisp @section Allocation from Frob Blocks The uninitialized memory required by a @code{Lisp_Object} of a particular type @@ -5266,31 +5275,23 @@ none. (There are actually two versions of these macros, one of which is more defensive but less efficient and is used for error-checking.) -@node lrecords +@node lrecords, Low-level allocation, Allocation from Frob Blocks, Allocation of Objects in XEmacs Lisp @section lrecords [see @file{lrecord.h}] All lrecords have at the beginning of their structure a @code{struct -lrecord_header}. This just contains a pointer to a @code{struct +lrecord_header}. This just contains a type number and some flags, +including the mark bit. All builtin type numbers are defined as +constants in @code{enum lrecord_type}, to allow the compiler to generate +more efficient code for @code{@var{type}P}. The type number, thru the +@code{lrecord_implementation_table}, gives access to a @code{struct lrecord_implementation}, which is a structure containing method pointers and such. There is one of these for each type, and it is a global, constant, statically-declared structure that is declared in the -@code{DEFINE_LRECORD_IMPLEMENTATION()} macro. (This macro actually -declares an array of two @code{struct lrecord_implementation} -structures. The first one contains all the standard method pointers, -and is used in all normal circumstances. During garbage collection, -however, the lrecord is @dfn{marked} by bumping its implementation -pointer by one, so that it points to the second structure in the array. -This structure contains a special indication in it that it's a -@dfn{marked-object} structure: the finalize method is the special -function @code{this_marks_a_marked_record()}, and all other methods are -null pointers. At the end of garbage collection, all lrecords will -either be reclaimed or unmarked by decrementing their implementation -pointers, so this second structure pointer will never remain past -garbage collection. - - Simple lrecords (of type (c) above) just have a @code{struct +@code{DEFINE_LRECORD_IMPLEMENTATION()} macro. + + Simple lrecords (of type (b) above) just have a @code{struct lrecord_header} at their beginning. lcrecords, however, actually have a @code{struct lcrecord_header}. This, in turn, has a @code{struct lrecord_header} at its beginning, so sanity is preserved; but it also @@ -5318,21 +5319,21 @@ Whenever you create an lrecord, you need to call either @code{DEFINE_LRECORD_IMPLEMENTATION()} or @code{DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION()}. This needs to be -specified in a C file, at the top level. What this actually does is -define and initialize the implementation structure for the lrecord. (And -possibly declares a function @code{error_check_foo()} that implements -the @code{XFOO()} macro when error-checking is enabled.) The arguments -to the macros are the actual type name (this is used to construct the C -variable name of the lrecord implementation structure and related -structures using the @samp{##} macro concatenation operator), a string -that names the type on the Lisp level (this may not be the same as the C -type name; typically, the C type name has underscores, while the Lisp -string has dashes), various method pointers, and the name of the C -structure that contains the object. The methods are used to encapsulate -type-specific information about the object, such as how to print it or -mark it for garbage collection, so that it's easy to add new object -types without having to add a specific case for each new type in a bunch -of different places. +specified in a @file{.c} file, at the top level. What this actually +does is define and initialize the implementation structure for the +lrecord. (And possibly declares a function @code{error_check_foo()} that +implements the @code{XFOO()} macro when error-checking is enabled.) The +arguments to the macros are the actual type name (this is used to +construct the C variable name of the lrecord implementation structure +and related structures using the @samp{##} macro concatenation +operator), a string that names the type on the Lisp level (this may not +be the same as the C type name; typically, the C type name has +underscores, while the Lisp string has dashes), various method pointers, +and the name of the C structure that contains the object. The methods +are used to encapsulate type-specific information about the object, such +as how to print it or mark it for garbage collection, so that it's easy +to add new object types without having to add a specific case for each +new type in a bunch of different places. The difference between @code{DEFINE_LRECORD_IMPLEMENTATION()} and @code{DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION()} is that the former is @@ -5346,21 +5347,20 @@ For the purpose of keeping allocation statistics, the allocation engine keeps a list of all the different types that exist. Note that, since @code{DEFINE_LRECORD_IMPLEMENTATION()} is a macro that is -specified at top-level, there is no way for it to add to the list of all -existing types. What happens instead is that each implementation -structure contains in it a dynamically assigned number that is -particular to that type. (Or rather, it contains a pointer to another -structure that contains this number. This evasiveness is done so that -the implementation structure can be declared const.) In the sweep stage -of garbage collection, each lrecord is examined to see if its -implementation structure has its dynamically-assigned number set. If -not, it must be a new type, and it is added to the list of known types -and a new number assigned. The number is used to index into an array -holding the number of objects of each type and the total memory -allocated for objects of that type. The statistics in this array are -also computed during the sweep stage. These statistics are returned by -the call to @code{garbage-collect} and are printed out at the end of the -loadup phase. +specified at top-level, there is no way for it to initialize the global +data structures containing type information, like +@code{lrecord_implementations_table}. For this reason a call to +@code{INIT_LRECORD_IMPLEMENTATION} must be added to the same source file +containing @code{DEFINE_LRECORD_IMPLEMENTATION}, but instead of to the +top level, to one of the init functions, typically +@code{syms_of_@var{foo}.c}. @code{INIT_LRECORD_IMPLEMENTATION} must be +called before an object of this type is used. + +The type number is also used to index into an array holding the number +of objects of each type and the total memory allocated for objects of +that type. The statistics in this array are computed during the sweep +stage. These statistics are returned by the call to +@code{garbage-collect}. Note that for every type defined with a @code{DEFINE_LRECORD_*()} macro, there needs to be a @code{DECLARE_LRECORD_IMPLEMENTATION()} @@ -5372,6 +5372,15 @@ file. To create one of these, copy an existing model and modify as necessary. + @strong{Please note:} If you define an lrecord in an external +dynamically-loaded module, you must use @code{DECLARE_EXTERNAL_LRECORD}, +@code{DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION}, and +@code{DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION} instead of the +non-EXTERNAL forms. These macros will dynamically add new type numbers +to the global enum that records them, whereas the non-EXTERNAL forms +assume that the programmer has already inserted the correct type numbers +into the enum's code at compile-time. + The various methods in the lrecord implementation structure are: @enumerate @@ -5505,7 +5514,7 @@ For an example, see the methods for window configurations and opaques. @end enumerate -@node Low-level allocation +@node Low-level allocation, Cons, lrecords, Allocation of Objects in XEmacs Lisp @section Low-level allocation Memory that you want to allocate directly should be allocated using @@ -5566,23 +5575,17 @@ (On some systems, the memory warnings are not functional.) Allocated memory that is going to be used to make a Lisp object -is created using @code{allocate_lisp_storage()}. This calls @code{xmalloc()} -but also verifies that the pointer to the memory can fit into -a Lisp word (remember that some bits are taken away for a type -tag and a mark bit). If not, an error is issued through @code{memory_full()}. -@code{allocate_lisp_storage()} is called by @code{alloc_lcrecord()}, -@code{ALLOCATE_FIXED_TYPE()}, and the vector and bit-vector creation -routines. These routines also call @code{INCREMENT_CONS_COUNTER()} at the -appropriate times; this keeps statistics on how much memory is -allocated, so that garbage-collection can be invoked when the -threshold is reached. - -@node Pure Space -@section Pure Space - - Not yet documented. - -@node Cons +is created using @code{allocate_lisp_storage()}. This just calls +@code{xmalloc()}. It used to verify that the pointer to the memory can +fit into a Lisp word, before the current Lisp object representation was +introduced. @code{allocate_lisp_storage()} is called by +@code{alloc_lcrecord()}, @code{ALLOCATE_FIXED_TYPE()}, and the vector +and bit-vector creation routines. These routines also call +@code{INCREMENT_CONS_COUNTER()} at the appropriate times; this keeps +statistics on how much memory is allocated, so that garbage-collection +can be invoked when the threshold is reached. + +@node Cons, Vector, Low-level allocation, Allocation of Objects in XEmacs Lisp @section Cons Conses are allocated in standard frob blocks. The only thing to @@ -5596,7 +5599,7 @@ If you mess this up, you will get BADLY BURNED, and it has happened before. -@node Vector +@node Vector, Bit Vector, Cons, Allocation of Objects in XEmacs Lisp @section Vector As mentioned above, each vector is @code{malloc()}ed individually, and @@ -5607,7 +5610,7 @@ is actually @code{malloc()}ed with the right size, however, and access to any element through the @code{contents} array works fine. -@node Bit Vector +@node Bit Vector, Symbol, Vector, Allocation of Objects in XEmacs Lisp @section Bit Vector Bit vectors work exactly like vectors, except for more complicated @@ -5617,21 +5620,16 @@ tag field in bit vector Lisp words is ``lrecord'' rather than ``vector''.) -@node Symbol +@node Symbol, Marker, Bit Vector, Allocation of Objects in XEmacs Lisp @section Symbol - Symbols are also allocated in frob blocks. Note that the code -exists for symbols to be either lrecords (category (c) above) -or simple types (category (b) above), and are lrecords by -default (I think), although there is no good reason for this. - - Note that symbols in the awful horrible obarray structure are -chained through their @code{next} field. + Symbols are also allocated in frob blocks. Symbols in the awful +horrible obarray structure are chained through their @code{next} field. Remember that @code{intern} looks up a symbol in an obarray, creating one if necessary. -@node Marker +@node Marker, String, Symbol, Allocation of Objects in XEmacs Lisp @section Marker Markers are allocated in frob blocks, as usual. They are kept @@ -5642,7 +5640,7 @@ markers from a buffer.) Markers are removed from a buffer in the finalize stage, in @code{ADDITIONAL_FREE_marker()}. -@node String +@node String, Compiled Function, Marker, Allocation of Objects in XEmacs Lisp @section String As mentioned above, strings are a special case. A string is logically @@ -5703,12 +5701,379 @@ The string compactor recognizes this special 0xFFFFFFFF marker and handles it correctly. -@node Compiled Function +@node Compiled Function, , String, Allocation of Objects in XEmacs Lisp @section Compiled Function Not yet documented. -@node Events and the Event Loop, Evaluation; Stack Frames; Bindings, Allocation of Objects in XEmacs Lisp, Top + +@node Dumping, Events and the Event Loop, Allocation of Objects in XEmacs Lisp, Top +@chapter Dumping + +@section What is dumping and its justification + +The C code of XEmacs is just a Lisp engine with a lot of built-in +primitives useful for writing an editor. The editor itself is written +mostly in Lisp, and represents around 100K lines of code. Loading and +executing the initialization of all this code takes a bit a time (five +to ten times the usual startup time of current xemacs) and requires +having all the lisp source files around. Having to reload them each +time the editor is started would not be acceptable. + +The traditional solution to this problem is called dumping: the build +process first creates the lisp engine under the name @file{temacs}, then +runs it until it has finished loading and initializing all the lisp +code, and eventually creates a new executable called @file{xemacs} +including both the object code in @file{temacs} and all the contents of +the memory after the initialization. + +This solution, while working, has a huge problem: the creation of the +new executable from the actual contents of memory is an extremely +system-specific process, quite error-prone, and which interferes with a +lot of system libraries (like malloc). It is even getting worse +nowadays with libraries using constructors which are automatically +called when the program is started (even before main()) which tend to +crash when they are called multiple times, once before dumping and once +after (IRIX 6.x libz.so pulls in some C++ image libraries thru +dependencies which have this problem). Writing the dumper is also one +of the most difficult parts of porting XEmacs to a new operating system. +Basically, `dumping' is an operation that is just not officially +supported on many operating systems. + +The aim of the portable dumper is to solve the same problem as the +system-specific dumper, that is to be able to reload quickly, using only +a small number of files, the fully initialized lisp part of the editor, +without any system-specific hacks. + +@menu +* Overview:: +* Data descriptions:: +* Dumping phase:: +* Reloading phase:: +* Remaining issues:: +@end menu + +@node Overview, Data descriptions, Dumping, Dumping +@section Overview + +The portable dumping system has to: + +@enumerate +@item +At dump time, write all initialized, non-quickly-rebuildable data to a +file [Note: currently named @file{xemacs.dmp}, but the name will +change], along with all informations needed for the reloading. + +@item +When starting xemacs, reload the dump file, relocate it to its new +starting address if needed, and reinitialize all pointers to this +data. Also, rebuild all the quickly rebuildable data. +@end enumerate + +@node Data descriptions, Dumping phase, Overview, Dumping +@section Data descriptions + +The more complex task of the dumper is to be able to write lisp objects +(lrecords) and C structs to disk and reload them at a different address, +updating all the pointers they include in the process. This is done by +using external data descriptions that give information about the layout +of the structures in memory. + +The specification of these descriptions is in lrecord.h. A description +of an lrecord is an array of struct lrecord_description. Each of these +structs include a type, an offset in the structure and some optional +parameters depending on the type. For instance, here is the string +description: + +@example +static const struct lrecord_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) @}, + @{ XD_END @} +@}; +@end example + +The first line indicates a member of type Bytecount, which is used by +the next, indirect directive. The second means "there is a pointer to +some opaque data in the field @code{data}". The length of said data is +given by the expression @code{XD_INDIRECT(0, 1)}, which means "the value +in the 0th line of the description (welcome to C) plus one". The third +line means "there is a Lisp_Object member @code{plist} in the Lisp_String +structure". @code{XD_END} then ends the description. + +This gives us all the information we need to move around what is pointed +to by a structure (C or lrecord) and, by transitivity, everything that +it points to. The only missing information for dumping is the size of +the structure. For lrecords, this is part of the +lrecord_implementation, so we don't need to duplicate it. For C +structures we use a struct struct_description, which includes a size +field and a pointer to an associated array of lrecord_description. + +@node Dumping phase, Reloading phase, Data descriptions, Dumping +@section Dumping phase + +Dumping is done by calling the function pdump() (in dumper.c) which is +invoked from Fdump_emacs (in emacs.c). This function performs a number +of tasks. + +@menu +* Object inventory:: +* Address allocation:: +* The header:: +* Data dumping:: +* Pointers dumping:: +@end menu + +@node Object inventory, Address allocation, Dumping phase, Dumping phase +@subsection Object inventory + +The first task is to build the list of the objects to dump. This +includes: + +@itemize @bullet +@item lisp objects +@item C structures +@end itemize + +We end up with one @code{pdump_entry_list_elmt} per object group (arrays +of C structs are kept together) which includes a pointer to the first +object of the group, the per-object size and the count of objects in the +group, along with some other information which is initialized later. + +These entries are linked together in @code{pdump_entry_list} structures +and can be enumerated thru either: + +@enumerate +@item +the @code{pdump_object_table}, an array of @code{pdump_entry_list}, one +per lrecord type, indexed by type number. + +@item +the @code{pdump_opaque_data_list}, used for the opaque data which does +not include pointers, and hence does not need descriptions. + +@item +the @code{pdump_struct_table}, which is a vector of +@code{struct_description}/@code{pdump_entry_list} pairs, used for +non-opaque C structures. +@end enumerate + +This uses a marking strategy similar to the garbage collector. Some +differences though: + +@enumerate +@item +We do not use the mark bit (which does not exist for C structures +anyway), we use a big hash table instead. + +@item +We do not use the mark function of lrecords but instead rely on the +external descriptions. This happens essentially because we need to +follow pointers to C structures and opaque data in addition to +Lisp_Object members. +@end enumerate + +This is done by @code{pdump_register_object}, which handles Lisp_Object +variables, and pdump_register_struct which handles C structures, which +both delegate the description management to pdump_register_sub. + +The hash table doubles as a map object to pdump_entry_list_elmt (i.e. +allows us to look up a pdump_entry_list_elmt with the object it points +to). Entries are added with @code{pdump_add_entry()} and looked up with +@code{pdump_get_entry()}. There is no need for entry removal. The hash +value is computed quite basically from the object pointer by +@code{pdump_make_hash()}. + +The roots for the marking are: + +@enumerate +@item +the @code{staticpro}'ed variables (there is a special @code{staticpro_nodump()} +call for protected variables we do not want to dump). + +@item +the @code{pdump_wire}'d variables (@code{staticpro} is equivalent to +@code{staticpro_nodump()} + @code{pdump_wire()}). + +@item +the @code{dumpstruct}'ed variables, which points to C structures. +@end enumerate + +This does not include the GCPRO'ed variables, the specbinds, the +catchtags, the backlist, the redisplay or the profiling info, since we +do not want to rebuild the actual chain of lisp calls which end up to +the dump-emacs call, only the global variables. + +Weak lists and weak hash tables are dumped as if they were their +non-weak equivalent (without changing their type, of course). This has +not yet been a problem. + +@node Address allocation, The header, Object inventory, Dumping phase +@subsection Address allocation + + +The next step is to allocate the offsets of each of the objects in the +final dump file. This is done by @code{pdump_allocate_offset()} which +is called indirectly by @code{pdump_scan_by_alignment()}. + +The strategy to deal with alignment problems uses these facts: + +@enumerate +@item +real world alignment requirements are powers of two. + +@item +the C compiler is required to adjust the size of a struct so that you +can have an array of them next to each other. This means you can have a +upper bound of the alignment requirements of a given structure by +looking at which power of two its size is a multiple. + +@item +the non-variant part of variable size lrecords has an alignment +requirement of 4. +@end enumerate + +Hence, for each lrecord type, C struct type or opaque data block the +alignment requirement is computed as a power of two, with a minimum of +2^2 for lrecords. @code{pdump_scan_by_alignment()} then scans all the +@code{pdump_entry_list_elmt}'s, the ones with the highest requirements +first. This ensures the best packing. + +The maximum alignment requirement we take into account is 2^8. + +@code{pdump_allocate_offset()} only has to do a linear allocation, +starting at offset 256 (this leaves room for the header and keep the +alignments happy). + +@node The header, Data dumping, Address allocation, Dumping phase +@subsection The header + +The next step creates the file and writes a header with a signature and +some random informations in it (number of staticpro, number of assigned +lrecord types, etc...). The reloc_address field, which indicates at +which address the file should be loaded if we want to avoid post-reload +relocation, is set to 0. It then seeks to offset 256 (base offset for +the objects). + +@node Data dumping, Pointers dumping, The header, Dumping phase +@subsection Data dumping + +The data is dumped in the same order as the addresses were allocated by +@code{pdump_dump_data()}, called from @code{pdump_scan_by_alignment()}. +This function copies the data to a temporary buffer, relocates all +pointers in the object to the addresses allocated in step Address +Allocation, and writes it to the file. Using the same order means that, +if we are careful with lrecords whose size is not a multiple of 4, we +are ensured that the object is always written at the offset in the file +allocated in step Address Allocation. + +@node Pointers dumping, , Data dumping, Dumping phase +@subsection Pointers dumping + +A bunch of tables needed to reassign properly the global pointers are +then written. They are: + +@enumerate +@item +the staticpro array +@item +the dumpstruct array +@item +the lrecord_implementation_table array +@item +a vector of all the offsets to the objects in the file that include a +description (for faster relocation at reload time) +@item +the pdump_wired and pdump_wired_list arrays +@end enumerate + +For each of the arrays we write both the pointer to the variables and +the relocated offset of the object they point to. Since these variables +are global, the pointers are still valid when restarting the program and +are used to regenerate the global pointers. + +The @code{pdump_wired_list} array is a special case. The variables it +points to are the head of weak linked lists of lisp objects of the same +type. Not all objects of this list are dumped so the relocated pointer +we associate with them points to the first dumped object of the list, or +Qnil if none is available. This is also the reason why they are not +used as roots for the purpose of object enumeration. + +This is the end of the dumping part. + +@node Reloading phase, Remaining issues, Dumping phase, Dumping +@section Reloading phase + +@subsection File loading + +The file is mmap'ed in memory (which ensures a PAGESIZE alignment, at +least 4096), or if mmap is unavailable or fails, a 256-bytes aligned +malloc is done and the file is loaded. + +Some variables are reinitialized from the values found in the header. + +The difference between the actual loading address and the reloc_address +is computed and will be used for all the relocations. + + +@subsection Putting back the staticvec + +The staticvec array is memcpy'd from the file and the variables it +points to are reset to the relocated objects addresses. + + +@subsection Putting back the dumpstructed variables + +The variables pointed to by dumpstruct in the dump phase are reset to +the right relocated object addresses. + + +@subsection lrecord_implementations_table + +The lrecord_implementations_table is reset to its dump time state and +the right lrecord_type_index values are put in. + + +@subsection Object relocation + +All the objects are relocated using their description and their offset +by @code{pdump_reloc_one}. This step is unnecessary if the +reloc_address is equal to the file loading address. + + +@subsection Putting back the pdump_wire and pdump_wire_list variables + +Same as Putting back the dumpstructed variables. + + +@subsection Reorganize the hash tables + +Since some of the hash values in the lisp hash tables are +address-dependent, their layout is now wrong. So we go through each of +them and have them resorted by calling @code{pdump_reorganize_hash_table}. + +@node Remaining issues, , Reloading phase, Dumping +@section Remaining issues + +The build process will have to start a post-dump xemacs, ask it the +loading address (which will, hopefully, be always the same between +different xemacs invocations) and relocate the file to the new address. +This way the object relocation phase will not have to be done, which +means no writes in the objects and that, because of the use of mmap, the +dumped data will be shared between all the xemacs running on the +computer. + +Some executable signature will be necessary to ensure that a given dump +file is really associated with a given executable, or random crashes +will occur. Maybe a random number set at compile or configure time thru +a define. This will also allow for having differently-compiled xemacsen +on the same system (mule and no-mule comes to mind). + +The DOC file contents should probably end up in the dump file. + + +@node Events and the Event Loop, Evaluation; Stack Frames; Bindings, Dumping, Top @chapter Events and the Event Loop @menu @@ -5722,7 +6087,7 @@ * Dispatching Events; The Command Builder:: @end menu -@node Introduction to Events +@node Introduction to Events, Main Loop, Events and the Event Loop, Events and the Event Loop @section Introduction to Events An event is an object that encapsulates information about an @@ -5761,7 +6126,7 @@ Emacs events are documented in @file{events.h}; I'll discuss them later. -@node Main Loop +@node Main Loop, Specifics of the Event Gathering Mechanism, Introduction to Events, Events and the Event Loop @section Main Loop The @dfn{command loop} is the top-level loop that the editor is always @@ -5828,7 +6193,7 @@ invoking @code{top_level_1()}, just like when it invokes @code{command_loop_2()}. -@node Specifics of the Event Gathering Mechanism +@node Specifics of the Event Gathering Mechanism, Specifics About the Emacs Event, Main Loop, Events and the Event Loop @section Specifics of the Event Gathering Mechanism Here is an approximate diagram of the collection processes @@ -6067,13 +6432,13 @@ using `dispatch-event' @end example -@node Specifics About the Emacs Event +@node Specifics About the Emacs Event, The Event Stream Callback Routines, Specifics of the Event Gathering Mechanism, Events and the Event Loop @section Specifics About the Emacs Event -@node The Event Stream Callback Routines +@node The Event Stream Callback Routines, Other Event Loop Functions, Specifics About the Emacs Event, Events and the Event Loop @section The Event Stream Callback Routines -@node Other Event Loop Functions +@node Other Event Loop Functions, Converting Events, The Event Stream Callback Routines, Events and the Event Loop @section Other Event Loop Functions @code{detect_input_pending()} and @code{input-pending-p} look for @@ -6095,7 +6460,7 @@ the right kind of input method support, it is possible for (read-char) to return a Kanji character. -@node Converting Events +@node Converting Events, Dispatching Events; The Command Builder, Other Event Loop Functions, Events and the Event Loop @section Converting Events @code{character_to_event()}, @code{event_to_character()}, @@ -6106,7 +6471,7 @@ between character representation and the split-up event representation (keysym plus mod keys). -@node Dispatching Events; The Command Builder +@node Dispatching Events; The Command Builder, , Converting Events, Events and the Event Loop @section Dispatching Events; The Command Builder Not yet documented. @@ -6121,7 +6486,7 @@ * Catch and Throw:: @end menu -@node Evaluation +@node Evaluation, Dynamic Binding; The specbinding Stack; Unwind-Protects, Evaluation; Stack Frames; Bindings, Evaluation; Stack Frames; Bindings @section Evaluation @code{Feval()} evaluates the form (a Lisp object) that is passed to @@ -6190,13 +6555,13 @@ are converted into an internal form for faster execution. When a compiled function is executed for the first time by -@code{funcall_compiled_function()}, or when it is @code{Fpurecopy()}ed -during the dump phase of building XEmacs, the byte-code instructions are -converted from a @code{Lisp_String} (which is inefficient to access, -especially in the presence of MULE) into a @code{Lisp_Opaque} object -containing an array of unsigned char, which can be directly executed by -the byte-code interpreter. At this time the byte code is also analyzed -for validity and transformed into a more optimized form, so that +@code{funcall_compiled_function()}, or during the dump phase of building +XEmacs, the byte-code instructions are converted from a +@code{Lisp_String} (which is inefficient to access, especially in the +presence of MULE) into a @code{Lisp_Opaque} object containing an array +of unsigned char, which can be directly executed by the byte-code +interpreter. At this time the byte code is also analyzed for validity +and transformed into a more optimized form, so that @code{execute_optimized_program()} can really fly. Here are some of the optimizations performed by the internal byte-code @@ -6211,7 +6576,7 @@ @code{nil}, or @code{keywordp}) symbols, so that the byte interpreter doesn't have to. @item -The maxiumum number of variable bindings in the byte-code is +The maximum number of variable bindings in the byte-code is pre-computed, so that space on the @code{specpdl} stack can be pre-reserved once for the whole function execution. @item @@ -6251,7 +6616,7 @@ an array). @code{apply1()} uses @code{Fapply()} while the others use @code{Ffuncall()} to do the real work. -@node Dynamic Binding; The specbinding Stack; Unwind-Protects +@node Dynamic Binding; The specbinding Stack; Unwind-Protects, Simple Special Forms, Evaluation, Evaluation; Stack Frames; Bindings @section Dynamic Binding; The specbinding Stack; Unwind-Protects @example @@ -6305,7 +6670,7 @@ the symbol's value). @end enumerate -@node Simple Special Forms +@node Simple Special Forms, Catch and Throw, Dynamic Binding; The specbinding Stack; Unwind-Protects, Evaluation; Stack Frames; Bindings @section Simple Special Forms @code{or}, @code{and}, @code{if}, @code{cond}, @code{progn}, @@ -6317,12 +6682,12 @@ @code{let} and @code{let*}) using @code{specbind()} to create bindings and @code{unbind_to()} to undo the bindings when finished. -Note that, with the exeption of @code{Fprogn}, these functions are +Note that, with the exception of @code{Fprogn}, these functions are typically called in real life only in interpreted code, since the byte compiler knows how to convert calls to these functions directly into byte code. -@node Catch and Throw +@node Catch and Throw, , Simple Special Forms, Evaluation; Stack Frames; Bindings @section Catch and Throw @example @@ -6390,7 +6755,7 @@ * Symbol Values:: @end menu -@node Introduction to Symbols +@node Introduction to Symbols, Obarrays, Symbols and Variables, Symbols and Variables @section Introduction to Symbols A symbol is basically just an object with four fields: a name (a @@ -6407,7 +6772,7 @@ additional values with particular names, and once again the namespace is independent of the function and variable namespaces. -@node Obarrays +@node Obarrays, Symbol Values, Introduction to Symbols, Symbols and Variables @section Obarrays The identity of symbols with their names is accomplished through a @@ -6474,7 +6839,7 @@ into any obarray.) Finally, @code{mapatoms} maps over all of the symbols in an obarray. -@node Symbol Values +@node Symbol Values, , Obarrays, Symbols and Variables @section Symbol Values The value field of a symbol normally contains a Lisp object. However, @@ -6529,7 +6894,7 @@ * The Buffer Object:: The Lisp object corresponding to a buffer. @end menu -@node Introduction to Buffers +@node Introduction to Buffers, The Text in a Buffer, Buffers and Textual Representation, Buffers and Textual Representation @section Introduction to Buffers A buffer is logically just a Lisp object that holds some text. @@ -6582,7 +6947,7 @@ window. (This latter distinction is explained in detail in the section on windows.) -@node The Text in a Buffer +@node The Text in a Buffer, Buffer Lists, Introduction to Buffers, Buffers and Textual Representation @section The Text in a Buffer The text in a buffer consists of a sequence of zero or more @@ -6722,7 +7087,7 @@ number of possible alternative representations (e.g. EUC-encoded text, etc.). -@node Buffer Lists +@node Buffer Lists, Markers and Extents, The Text in a Buffer, Buffers and Textual Representation @section Buffer Lists Recall earlier that buffers are @dfn{permanent} objects, i.e. that @@ -6758,7 +7123,7 @@ a unique name from this by appending a number, and then creates the buffer. This is basically like the symbol operation @code{gensym}. -@node Markers and Extents +@node Markers and Extents, Bufbytes and Emchars, Buffer Lists, Buffers and Textual Representation @section Markers and Extents Among the things associated with a buffer are things that are @@ -6784,7 +7149,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) and stored in Meminds. +extents (there's one per marker, two per extent) are stored in Meminds. 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 @@ -6798,12 +7163,12 @@ (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 +@node Bufbytes and Emchars, The Buffer Object, Markers and Extents, Buffers and Textual Representation @section Bufbytes and Emchars Not yet documented. -@node The Buffer Object +@node The Buffer Object, , Bufbytes and Emchars, Buffers and Textual Representation @section The Buffer Object Buffers contain fields not directly accessible by the Lisp programmer. @@ -6922,7 +7287,7 @@ * CCL:: @end menu -@node Character Sets +@node Character Sets, Encodings, MULE Character Sets and Encodings, MULE Character Sets and Encodings @section Character Sets A character set (or @dfn{charset}) is an ordered set of characters. A @@ -7003,7 +7368,7 @@ This is a bit ad-hoc but gets the job done. -@node Encodings +@node Encodings, Internal Mule Encodings, Character Sets, MULE Character Sets and Encodings @section Encodings An @dfn{encoding} is a way of numerically representing characters from @@ -7030,7 +7395,7 @@ * JIS7:: @end menu -@node Japanese EUC (Extended Unix Code) +@node Japanese EUC (Extended Unix Code), JIS7, Encodings, Encodings @subsection Japanese EUC (Extended Unix Code) This encompasses the character sets Printing-ASCII, Japanese-JISX0201, @@ -7052,7 +7417,7 @@ @end example -@node JIS7 +@node JIS7, , Japanese EUC (Extended Unix Code), Encodings @subsection JIS7 This encompasses the character sets Printing-ASCII, @@ -7087,7 +7452,7 @@ Initially, Printing-ASCII is invoked. -@node Internal Mule Encodings +@node Internal Mule Encodings, CCL, Encodings, MULE Character Sets and Encodings @section Internal Mule Encodings In XEmacs/Mule, each character set is assigned a unique number, called a @@ -7133,7 +7498,7 @@ * Internal Character Encoding:: @end menu -@node Internal String Encoding +@node Internal String Encoding, Internal Character Encoding, Internal Mule Encodings, Internal Mule Encodings @subsection Internal String Encoding ASCII characters are encoded using their position code directly. Other @@ -7183,7 +7548,7 @@ Shift-JIS and Big5 (not yet described) satisfy only (2). (All non-modal encodings must satisfy (2), in order to be unambiguous.) -@node Internal Character Encoding +@node Internal Character Encoding, , Internal String Encoding, Internal Mule Encodings @subsection Internal Character Encoding One 19-bit word represents a single character. The word is @@ -7218,7 +7583,7 @@ Note that character codes 0 - 255 are the same as the ``binary encoding'' described above. -@node CCL +@node CCL, , Internal Mule Encodings, MULE Character Sets and Encodings @section CCL @example @@ -7272,7 +7637,7 @@ other encoded/decoded data has been written out. This is not used for charset CCL programs. -REGISTER: 0..7 -- refered by RRR or rrr +REGISTER: 0..7 -- referred by RRR or rrr OPERATOR BIT FIELD (27-bit): XXXXXXXXXXXXXXX RRR TTTTT TTTTT (5-bit): operator type @@ -7409,7 +7774,7 @@ * Lstream Methods:: Creating new lstream types. @end menu -@node Creating an Lstream +@node Creating an Lstream, Lstream Types, Lstreams, Lstreams @section Creating an Lstream Lstreams come in different types, depending on what is being interfaced @@ -7440,7 +7805,7 @@ Open for writing, but never writes partial MULE characters. @end table -@node Lstream Types +@node Lstream Types, Lstream Functions, Creating an Lstream, Lstreams @section Lstream Types @table @asis @@ -7465,10 +7830,10 @@ @item encoding @end table -@node Lstream Functions +@node Lstream Functions, Lstream Methods, Lstream Types, Lstreams @section Lstream Functions -@deftypefun {Lstream *} Lstream_new (Lstream_implementation *@var{imp}, CONST char *@var{mode}) +@deftypefun {Lstream *} Lstream_new (Lstream_implementation *@var{imp}, const char *@var{mode}) Allocate and return a new Lstream. This function is not really meant to be called directly; rather, each stream type should provide its own stream creation function, which creates the stream and does any other @@ -7548,7 +7913,7 @@ Rewind the stream to the beginning. @end deftypefun -@node Lstream Methods +@node Lstream Methods, , Lstream Functions, Lstreams @section Lstream Methods @deftypefn {Lstream Method} ssize_t reader (Lstream *@var{stream}, unsigned char *@var{data}, size_t @var{size}) @@ -7568,7 +7933,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} ssize_t writer (Lstream *@var{stream}, const unsigned char *@var{data}, size_t @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 @@ -7623,7 +7988,7 @@ * The Window Object:: @end menu -@node Introduction to Consoles; Devices; Frames; Windows +@node Introduction to Consoles; Devices; Frames; Windows, Point, Consoles; Devices; Frames; Windows, Consoles; Devices; Frames; Windows @section Introduction to Consoles; Devices; Frames; Windows A window-system window that you see on the screen is called a @@ -7658,14 +8023,14 @@ @dfn{selected display}, @dfn{selected frame}, and @dfn{selected window}. Each of these objects is distinguished in various ways, such as being the default object for various functions that act on objects of that type. -Note that every containing object rememembers the ``selected'' object +Note that every containing object remembers the ``selected'' object among the objects that it contains: e.g. not only is there a selected window, but every frame remembers the last window in it that was selected, and changing the selected frame causes the remembered window within it to become the selected window. Similar relationships apply for consoles to devices and devices to frames. -@node Point +@node Point, Window Hierarchy, Introduction to Consoles; Devices; Frames; Windows, Consoles; Devices; Frames; Windows @section Point Recall that every buffer has a current insertion position, called @@ -7686,7 +8051,7 @@ buffer's point instead. This is related to why @code{save-window-excursion} does not save the selected window's value of @code{point}. -@node Window Hierarchy +@node Window Hierarchy, The Window Object, Point, Consoles; Devices; Frames; Windows @section Window Hierarchy @cindex window hierarchy @cindex hierarchy of windows @@ -7784,7 +8149,7 @@ artifact that should be fixed.) @end enumerate -@node The Window Object +@node The Window Object, , Window Hierarchy, Consoles; Devices; Frames; Windows @section The Window Object Windows have the following accessible fields: @@ -7916,7 +8281,7 @@ * Redisplay Piece by Piece:: @end menu -@node Critical Redisplay Sections +@node Critical Redisplay Sections, Line Start Cache, The Redisplay Mechanism, The Redisplay Mechanism @section Critical Redisplay Sections @cindex critical redisplay sections @@ -7948,7 +8313,7 @@ #### If a frame-size change does occur we should probably actually be preempting redisplay. -@node Line Start Cache +@node Line Start Cache, Redisplay Piece by Piece, Critical Redisplay Sections, The Redisplay Mechanism @section Line Start Cache @cindex line start cache @@ -8009,7 +8374,7 @@ In case you're wondering, the Second Golden Rule of Redisplay is not applicable. -@node Redisplay Piece by Piece +@node Redisplay Piece by Piece, , Line Start Cache, The Redisplay Mechanism @section Redisplay Piece by Piece @cindex Redisplay Piece by Piece @@ -8031,7 +8396,7 @@ @code{redisplay-x.c}, @code{redisplay-msw.c} and @code{redisplay-tty.c} @end enumerate -Steps 1 and 2 are device-independant and relatively complex. Step 3 is +Steps 1 and 2 are device-independent and relatively complex. Step 3 is mostly device-dependent. Determining the desired display @@ -8042,7 +8407,7 @@ dynarr's of @code{display_line}'s are held by each window representing the current display and the desired display. -The @code{display_line} structures are tighly tied to buffers which +The @code{display_line} structures are tightly tied to buffers which presents a problem for redisplay as this connection is bogus for the modeline. Hence the @code{display_line} generation routines are duplicated for generating the modeline. This means that the modeline @@ -8051,7 +8416,7 @@ The guts of @code{display_line} generation are in @code{create_text_block}, which creates a single display line for the desired locale. This incrementally parses the characters on the current -line and generates redisplay structures for each. +line and generates redisplay structures for each. Gutter redisplay is different. Because the data to display is stored in a string we cannot use @code{create_text_block}. Instead we use @@ -8068,11 +8433,11 @@ * Extent Ordering:: How extents are ordered internally. * Format of the Extent Info:: The extent information in a buffer or string. * Zero-Length Extents:: A weird special case. -* Mathematics of Extent Ordering:: A rigorous foundation. +* Mathematics of Extent Ordering:: A rigorous foundation. * Extent Fragments:: Cached information useful for redisplay. @end menu -@node Introduction to Extents +@node Introduction to Extents, Extent Ordering, Extents, Extents @section Introduction to Extents Extents are regions over a buffer, with a start and an end position @@ -8094,7 +8459,7 @@ however, and just ended up complexifying and buggifying all the rest of the code.) -@node Extent Ordering +@node Extent Ordering, Format of the Extent Info, Introduction to Extents, Extents @section Extent Ordering Extents are compared using memory indices. There are two orderings @@ -8128,7 +8493,7 @@ all occurrences of ``display order'' and ``e-order'', ``less than'' and ``greater than'', and ``extent start'' and ``extent end''. -@node Format of the Extent Info +@node Format of the Extent Info, Zero-Length Extents, Extent Ordering, Extents @section Format of the Extent Info An extent-info structure consists of a list of the buffer or string's @@ -8162,7 +8527,7 @@ array, except for the fact that positions are integers (this should be generalized to handle integers and linked list equally well). -@node Zero-Length Extents +@node Zero-Length Extents, Mathematics of Extent Ordering, Format of the Extent Info, Extents @section Zero-Length Extents Extents can be zero-length, and will end up that way if their endpoints @@ -8191,7 +8556,7 @@ exactly like markers and that open-closed, non-detachable zero-length extents behave like the ``point-type'' marker in Mule. -@node Mathematics of Extent Ordering +@node Mathematics of Extent Ordering, Extent Fragments, Zero-Length Extents, Extents @section Mathematics of Extent Ordering @cindex extent mathematics @cindex mathematics of extents @@ -8326,7 +8691,7 @@ @math{S}, including @math{F}. Otherwise, @math{F2} includes @math{I} and thus is in @math{S}, and thus @math{F2 >= F}. -@node Extent Fragments +@node Extent Fragments, , Mathematics of Extent Ordering, Extents @section Extent Fragments @cindex extent fragment @@ -8375,7 +8740,7 @@ domains. For instance if we create a Pixmap, we can actually display this on multiple windows - even though we only need a single Pixmap instance to do this. If caching wasn't done then it would be necessary -to create image-instances for every displayable occurrance of a glyph - +to create image-instances for every displayable occurrence of a glyph - and every usage - and this would be extremely memory and cpu intensive. Widget-glyphs (a.k.a native widgets) are not cached in this way. This is @@ -8409,9 +8774,9 @@ tree recursively. This has desirable properties such as lw_modify_all_widgets which is -called from glyphs-x.c and updates all the properties of a widget +called from @file{glyphs-x.c} and updates all the properties of a widget without having to know what the widget is or what toolkit it is from. -Unfortunately this also has hairy properrties such as making the lwlib +Unfortunately this also has hairy properties such as making the lwlib code quite complex. And of course lwlib has to know at some level what the widget is and how to set its properties. @@ -8545,7 +8910,7 @@ or @code{nil} if it is using pipes. @end table -@node Interface to X Windows, Index, Subprocesses, Top +@node Interface to X Windows, Index , Subprocesses, Top @chapter Interface to X Windows Not yet documented. @@ -8558,4 +8923,3 @@ @c That's all @bye - diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/backups.texi --- a/man/lispref/backups.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/backups.texi Mon Aug 13 11:35:02 2007 +0200 @@ -226,7 +226,7 @@ (@pxref{Backup Names}) is responsible for determining which backup versions to delete, but does not delete them itself. -@defopt trim-versions-without-asking +@defopt delete-old-versions If this variable is non-@code{nil}, then saving a file deletes excess backup versions silently. Otherwise, it asks the user whether to delete them. diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/buffers.texi --- a/man/lispref/buffers.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/buffers.texi Mon Aug 13 11:35:02 2007 +0200 @@ -46,7 +46,7 @@ Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special -data type. You can think of the contents of a buffer as an extendable +data type. You can think of the contents of a buffer as an extendible string; insertions and deletions may occur in any part of the buffer. @xref{Text}. diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/compile.texi --- a/man/lispref/compile.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/compile.texi Mon Aug 13 11:35:02 2007 +0200 @@ -235,7 +235,7 @@ will not, of course, produce any compiled code.) @example -% emacs -batch -f batch-byte-compile *.el +% xemacs -batch -f batch-byte-compile *.el @end example @end defun diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/consoles-devices.texi --- a/man/lispref/consoles-devices.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/consoles-devices.texi Mon Aug 13 11:35:02 2007 +0200 @@ -152,12 +152,12 @@ @defun valid-device-type-p device-type This function returns whether @var{device-type} (which should be a symbol) -species a valid device type. +specifies a valid device type. @end defun @defun valid-device-class-p device-class This function returns whether @var{device-class} (which should be a symbol) -species a valid device class. +specifies a valid device class. @end defun @defvar terminal-device diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/databases.texi --- a/man/lispref/databases.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/databases.texi Mon Aug 13 11:35:02 2007 +0200 @@ -26,16 +26,16 @@ permissions @var{mode}. @var{access} can be any combination of @code{r} @code{w} and @code{+}, for read, write, and creation flags. -@var{type} can have the value @code{'dbm} or @code{'berkeley_db} to +@var{type} can have the value @code{'dbm} or @code{'berkeley-db} to select the type of database file to use. (Note: XEmacs may not support both of these types.) For a @var{type} of @code{'dbm}, there are no subtypes, so -@var{subtype} should by @code{nil}. +@var{subtype} should be @code{nil}. -For a @var{type} of @code{'berkeley_db}, the following subtypes are +For a @var{type} of @code{'berkeley-db}, the following subtypes are available: @code{'hash}, @code{'btree}, and @code{'recno}. See the -manpages for the Berkeley DB functions to more information about these +manpages for the Berkeley DB functions for more information about these types. @end defun diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/display.texi --- a/man/lispref/display.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/display.texi Mon Aug 13 11:35:02 2007 +0200 @@ -996,6 +996,71 @@ to a ``glyph table'' and such. Note that ``glyph'' has a different meaning in XEmacs.) +@defvar current-display-table + +The display table currently in use. This is a specifier. + +Display tables are used to control how characters are displayed. Each +time that redisplay processes a character, it is looked up in all the +display tables that apply (obtained by calling @code{specifier-instance} +on @code{current-display-table} and any overriding display tables +specified in currently active faces). The first entry found that +matches the character determines how the character is displayed. If +there is no matching entry, the default display method is +used. (Non-control characters are displayed as themselves and control +characters are displayed according to the buffer-local variable +@code{ctl-arrow}. Control characters are further affected by +@code{control-arrow-glyph} and @code{octal-escape-glyph}.) + +Each instantiator in this specifier and the display-table specifiers +in faces is a display table or a list of such tables. If a list, each +table will be searched in turn for an entry matching a particular +character. Each display table is one of + +@itemize @bullet +@item +A vector, specifying values for characters starting at 0. +@item +A char table, either of type @code{char} or @code{generic}. +@item +A range table. +@end itemize + +Each entry in a display table should be one of + +@itemize @bullet +@item +nil (this entry is ignored and the search continues). +@item +A character (use this character; if it happens to be the same as +the original character, default processing happens, otherwise +redisplay attempts to display this character directly; +#### At some point recursive display-table lookup will be +implemented). +@item +A string (display each character in the string directly; +#### At some point recursive display-table lookup will be +implemented). +@item +A glyph (display the glyph; +#### At some point recursive display-table lookup will be +implemented when a string glyph is being processed). +@item +A cons of the form (format "@var{string}") where @var{string} is a +printf-like spec used to process the character. #### Unfortunately no +formatting directives other than %% are implemented. +@item +A vector (each element of the vector is processed recursively; +in such a case, nil elements in the vector are simply ignored). + +#### At some point in the near future, display tables are likely to +be expanded to include other features, such as referencing characters +in particular fonts and allowing the character search to continue +all the way up the chain of specifier instantiators. These features +are necessary to properly display Unicode characters. +@end itemize +@end defvar + Individual faces can also specify an overriding display table; this is set using @code{set-face-display-table}. @xref{Faces}. diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/extents.texi --- a/man/lispref/extents.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/extents.texi Mon Aug 13 11:35:02 2007 +0200 @@ -94,9 +94,9 @@ information, @xref{Annotations}. If an extent has its @code{detachable} property set, it will become -@dfn{detached} (i.e. no longer in the buffer) when all its text its +@dfn{detached} (i.e. no longer in the buffer) when all its text is deleted. Otherwise, it will simply shrink down to zero-length and -sit it the same place in the buffer. By default, the @code{detachable} +sit in the same place in the buffer. By default, the @code{detachable} property is set on newly-created extents. @xref{Detached Extents}. If an extent has its @code{duplicable} property set, it will be diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/faces.texi --- a/man/lispref/faces.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/faces.texi Mon Aug 13 11:35:02 2007 +0200 @@ -476,6 +476,33 @@ @code{nil} otherwise. @end defun +@defun make-font-specifier spec-list + +Return a new @code{font} specifier object with the given specification +list. @var{spec-list} can be a list of specifications (each of which is +a cons of a locale and a list of instantiators), a single instantiator, +or a list of instantiators. @xref{Specifiers}, for more information +about specifiers. + +Valid instantiators for font specifiers are: + +@itemize @bullet + +@item +A string naming a font (e.g. under X this might be +"-*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-*" for a 14-point +upright medium-weight Courier font). +@item +A font instance (use that instance directly if the device matches, +or use the string that generated it). +@item +A vector of no elements (only on TTY's; this means to set no font +at all, thus using the "natural" font of the terminal's text). +@item +A vector of one element (a face to inherit from). +@end itemize +@end defun + @node Font Instances @subsection Font Instances @@ -634,6 +661,63 @@ This function returns non-@code{nil} if @var{object} is a color specifier. @end defun +@defun make-color-specifier spec-list + +Return a new @code{color} specifier object with the given specification +list. @var{spec-list} can be a list of specifications (each of which is +a cons of a locale and a list of instantiators), a single instantiator, +or a list of instantiators. @xref{Specifiers}, for a detailed +description of how specifiers work. + +Valid instantiators for color specifiers are: + +@itemize @bullet +@item +A string naming a color (e.g. under X this might be "lightseagreen2" or +"#F534B2"). + +@item +A color instance (use that instance directly if the device matches, +or use the string that generated it). + +@item +A vector of no elements (only on TTY's; this means to set no color at +all, thus using the "natural" color of the terminal's text). + +@item +A vector of one or two elements: a face to inherit from, and optionally +a symbol naming which property of that face to inherit, either +@code{foreground} or @code{background} (if omitted, defaults to the same +property that this color specifier is used for; if this specifier is not +part of a face, the instantiator would not be valid). +@end itemize +@end defun + +@defun make-face-boolean-specifier spec-list + +Return a new @code{face-boolean} specifier object with the given spec +list. @var{spec-list} can be a list of specifications (each of which is +a cons of a locale and a list of instantiators), a single instantiator, +or a list of instantiators. @xref{Specifiers}, for a detailed +description of how specifiers work. + +Valid instantiators for face-boolean specifiers are + +@itemize @bullet +@item +t or nil. +@item +A vector of two or three elements: a face to inherit from, optionally a +symbol naming the property of that face to inherit from (if omitted, +defaults to the same property that this face-boolean specifier is used +for; if this specifier is not part of a face, the instantiator would not +be valid), and optionally a value which, if non-nil, means to invert the +sense of the inherited property. +@end itemize + +@end defun + + @node Color Instances @subsection Color Instances @cindex color instances diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/frames.texi --- a/man/lispref/frames.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/frames.texi Mon Aug 13 11:35:02 2007 +0200 @@ -9,9 +9,19 @@ @cindex frame A @var{frame} is a rectangle on the screen that contains one or more -XEmacs windows. A frame initially contains a single main window (plus -perhaps a minibuffer window), which you can subdivide vertically or -horizontally into smaller windows. +XEmacs windows (@pxref{Windows}). A frame initially contains a single +main window (plus perhaps an echo area), which you can subdivide +vertically or horizontally into smaller windows. Each window is +associated with a modeline (@pxref{Modeline Format}), and optionally two +scrollbars (@pxref{Scrollbars}). By default the vertical scrollbar is +on, the horizontal scrollbar is off. + + The frame may also contain menubars (@pxref{Menubar}), toolbars +(@pxref{Toolbar Intro}), and gutters (@pxref{Gutter Intro}). By default +there is one of each at the top of the frame, with menubar topmost, +toolbar next, and gutter lowest, immediately above the windows. +(Warning: the gutter is a new, experimental, and unstable feature of +XEmacs version 21.2.) @cindex terminal frame @cindex X window frame diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/glyphs.texi --- a/man/lispref/glyphs.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/glyphs.texi Mon Aug 13 11:35:02 2007 +0200 @@ -7,15 +7,15 @@ @chapter Glyphs @cindex glyphs - A @dfn{glyph} is an object that is used for pixmaps and images of all -sorts, as well as for things that ``act'' like pixmaps, such as -non-textual strings (@dfn{annotations}) displayed in a buffer or in the -margins. It is used in begin-glyphs and end-glyphs attached to extents, -marginal and textual annotations, overlay arrows (@code{overlay-arrow-*} -variables), toolbar buttons, mouse pointers, frame icons, truncation and -continuation markers, and the like. (Basically, any place there is an -image or something that acts like an image, there will be a glyph object -representing it.) + A @dfn{glyph} is an object that is used for pixmaps, widgets and +images of all sorts, as well as for things that ``act'' like pixmaps, +such as non-textual strings (@dfn{annotations}) displayed in a buffer or +in the margins. It is used in begin-glyphs and end-glyphs attached to +extents, marginal and textual annotations, overlay arrows +(@code{overlay-arrow-*} variables), toolbar buttons, mouse pointers, +frame icons, truncation and continuation markers, and the +like. (Basically, any place there is an image or something that acts +like an image, there will be a glyph object representing it.) The actual image that is displayed (as opposed to its position or clipping) is defined by an @dfn{image specifier} object contained @@ -71,6 +71,179 @@ toolbar, or elsewhere in a buffer), @code{pointer} (used for the mouse-pointer), or @code{icon} (used for a frame's icon), and defaults to @code{buffer}. @xref{Glyph Types}. + +A glyph in XEmacs does @strong{NOT} refer to a single unit of textual +display (the XEmacs term for this is @dfn{rune}), but rather is an +object encapsulating a graphical element, such as an image or widget (an +element such as a button or text field; @dfn{widget} is the term for +this under X Windows, and it's called a @dfn{control} under MS Windows). +This graphical element could appear in a buffer, a margin, a gutter, or +a toolbar, or as a mouse pointer or an icon, for example. + +Creating a glyph using @code{make-glyph} does not specify @emph{where} +the glyph will be used, but it does specify @emph{what} the glyph will +look like. In particular, SPEC-LIST is used to specify this, and it's +used to initialize the glyph's @code{image} property, which is an image +specifier. (Note that @dfn{image} as used in the context of a glyph's +@code{image} property or in the terms @dfn{image specifier}, @dfn{image +instantiator}, or @dfn{image instance} does not refer to what people +normally think of as an image (which in XEmacs is called a +@dfn{pixmap}), but to any graphical element---a pixmap, a widget, or +even a block of text, when used in the places that call for a glyph.) +The format of the SPEC-LIST is typically an image instantiator (a string +or a vector; @ref{Image Specifiers}), but can also be a list of such +instantiators (each one in turn is tried until an image is successfully +produced), a cons of a locale (frame, buffer, etc.) and an +instantiator, a list of such conses, or any other form accepted by +@code{canonicalize-spec-list}. @xref{Specifiers}, for more information +about specifiers. + +If you're not familiar with specifiers, you should be in order to +understand how glyphs work. The clearest introduction to specifiers +is in the Lispref manual, available under Info. (Choose +Help->Info->Info Contents on the menubar or type C-h i.) You can +also see @code{make-specifier} for a capsule summary. What's important to +keep in mind is that a specifier lets you set a different value for +any particular buffer, window, frame, device, or console. This allows +for a great deal of flexibility; in particular, only one global glyph +needs to exist for a particular purpose (e.g. the icon used to represent +an iconified frame, the mouse pointer used over particular areas of a +frame, etc.), and in these cases you do not create your own glyph, but +rather modify the existing one. + +As well as using @var{spec-list} to initialize the glyph, you can set +specifications using @code{set-glyph-image}. Note that, due to a +possibly questionable historical design decision, a glyph itself is not +actually a specifier, but rather is an object containing an image +specifier (as well as other, seldom-used properties). Therefore, you +cannot set or access specifications for the glyph's image by directly +using @code{set-specifier}, @code{specifier-instance} or the like on the +glyph; instead use them on @code{(glyph-image @var{glyph})} or use the +convenience functions @code{set-glyph-image}, +@code{glyph-image-instance}, and @code{glyph-image}. + +Once you have created a glyph, you specify where it will be used as +follows: + +@itemize @bullet +@item +To insert a glyph into a buffer, create an extent in the buffer and then +use @code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set +a glyph to be displayed at the corresponding edge of the extent. (It is +common to create zero-width extents for this purpose.) + +@item +To insert a glyph into the left or right margin of a buffer, first +make sure the margin is visible by setting a value for the specifiers +@code{left-margin-width} or @code{right-margin-width}. (Not strictly necessary +when using margin glyphs with layout policy @code{whitespace}.) Then follow +the same procedure above for inserting a glyph in a buffer, and then +set a non-default layout policy for the glyph using +@code{set-extent-begin-glyph-layout} or @code{set-extent-end-glyph-layout}. +Alternatively, use the high-level annotations API (see +@code{make-annotation}). (In point of fact, you can also use the annotations +API for glyphs in a buffer, by setting a layout policy of @code{text}.) + +@item +To insert a glyph into the modeline, just put the glyph directly as one +of the modeline elements. (Unfortunately you can't currently put a begin +glyph or end glyph on one of the modeline extents---they're ignored.) + +@item +To insert a glyph into a toolbar, specify it as part of a toolbar +instantiator (typically set on the specifier @code{default-toolbar}). +See @code{default-toolbar} for more information. (Note that it is +standard practice to use a symbol in place of the glyph list in the +toolbar instantiator; the symbol is evalled to get the glyph list. This +facilitates both creating the toolbar instantiator and modifying +individual glyphs in a toolbar later on. For example, you can change +the way that the Mail toolbar button looks by modifying the value of the +variable @code{toolbar-mail-icon} (in general, @code{toolbar-*-icon}) +and then calling @code{(set-specifier-dirty-flag default-toolbar)}. +(#### Unfortunately this doesn't quite work the way it should; the +change will appear in new frames, but not existing ones. + +@item +To insert a glyph into a gutter, create or modify a gutter instantiator +(typically set on the specifier @code{default-gutter}). Gutter +instantiators consist of strings or lists of strings, so to insert a +glyph, create an extent over the string, and use +@code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set a +glyph to be displayed at the corresponding edge of the extent, just like +for glyphs in a buffer. + +@item +To use a glyph as the icon for a frame, you do not actually create a new +glyph; rather, you change the specifications for the existing glyph +@code{frame-icon-glyph}. (Remember that, because of the specifier nature +of glyphs, you can set different values for any particular buffer or +frame.) + +@item +To use a glyph as the mouse pointer, in general you do not create a new +glyph, but rather you change the specifications of various existing +glyphs, such as @code{text-pointer-glyph} for the pointer used over +text, @code{modeline-pointer-glyph} for the pointer used over the +modeline, etc. Do an apropos over @code{*-pointer-glyph} to find all of +them. (Note also that you can temporarily set the mouse pointer to some +specific shape by using @code{set-frame-pointer}, which takes an image +instance, as obtained from calling @code{glyph-image-instance} on a glyph +of type @code{pointer} -- either one of the above-mentioned variables or +one you created yourself. (See below for what it means to create a +glyph of type @code{pointer}.) This pointer will last only until the +next mouse motion event is processed or certain other things happen, +such as creating or deleting a window. (In fact, the above-mentioned +pointer glyph variables are implemented as part of the default handler +for mouse motion events. If you want to customize this behavior, take a +look at @code{mode-motion-hook}, or @code{mouse-motion-handler} if you +really want to get low-level.) + +@item +To use a glyph to control the shape of miscellaneous redisplay effects +such as the truncation and continuation markers, set the appropriate +existing glyph variables, as for icons and pointers above. See +@code{continuation-glyph}, @code{control-arrow-glyph}, +@code{hscroll-glyph}, @code{invisible-text-glyph}, +@code{octal-escape-glyph}, and @code{truncation-glyph}. See also +@code{overlay-arrow-string}, an odd redisplay leftover which can be set +to a glyph you created, and will cause the glyph to be displayed on top +of the text position specified in the marker stored in +@code{overlay-arrow-position}. + +@item +To use a glyph in a display table (i.e. to control the appearance of any +individual character), create the appropriate character glyphs and then +set a specification for the specifier @code{current-display-table}, +which controls the appearance of characters. You can also set an +overriding display table for use with text displayed in a particular +face; see @code{set-face-display-table} and @code{make-display-table}. +#### Note: Display tables do not currently support general Mule +characters. They will be overhauled at some point to support this +and to provide other features required under Mule. + +@item +To use a glyph as the background pixmap of a face: Note that the +background pixmap of a face is actually an image specifier -- probably +the only place in XEmacs where an image specifier occurs outside of a +glyph. Similarly to how the glyph's image specifier works, you don't +create your own image specifier, but rather add specifications to the +existing one (using @code{set-face-background-pixmap}). Note that the +image instance that is generated in order to actually display the +background pixmap is of type @code{mono-pixmap}, meaning that it's a +two-color image and the foreground and background of the image get +filled in with the corresponding colors from the face. +@end itemize + +It is extremely rare that you will ever have to specify a value for +TYPE, which should be one of @code{buffer} (used for glyphs in an +extent, the modeline, the toolbar, or elsewhere in a buffer), +@code{pointer} (used for the mouse-pointer), or @code{icon} (used for a +frame's icon), and defaults to @code{buffer}. The only cases where it +needs to be specified is when creating icon or pointer glyphs, and in +both cases the necessary glyphs have already been created at startup and +are accessed through the appropriate variables, +e.g. @code{text-pointer-glyph} (or in general, @code{*-pointer-glyph}) +and @code{frame-icon-glyph}. @xref{Glyph Types}. @end defun @defun make-glyph-internal &optional type @@ -78,13 +251,25 @@ @end defun @defun make-pointer-glyph &optional spec-list -This function is equivalent to calling @code{make-glyph} with a -@var{type} of @code{pointer}. + +Return a new @code{pointer-glyph} object with the specification list +@var{spec-list}. This function is equivalent to calling +@code{make-glyph} with a @var{type} of @code{pointer}. + +It is extremely unlikely that you will ever need to create a pointer +glyph. Instead, you probably want to be calling @code{set-glyph-image} +on an existing glyph, e.g. @code{text-pointer-glyph}. @end defun @defun make-icon-glyph &optional spec-list -This function is equivalent to calling @code{make-glyph} with a -@var{type} of @code{icon}. + +Return a new @code{pointer-glyph} object with the specification list +@var{spec-list}. This function is equivalent to calling +@code{make-glyph} with a @var{type} of @code{icon}. + +It is extremely unlikely that you will ever need to create a pointer +glyph. Instead, you probably want to be calling @code{set-glyph-image} +on an existing glyph, e.g. @code{text-pointer-glyph}. @end defun @node Glyph Properties @@ -420,10 +605,21 @@ @end defun @defun make-image-specifier spec-list -This function creates a new image specifier object and initializes -it according to @var{spec-list}. It is unlikely that you will ever -want to do this, but this function is provided for completeness and -for experimentation purposes. @xref{Specifiers}. +This function creates a new image specifier object and initializes it +according to @var{spec-list}. @xref{Specifiers}. + +Note that, in practice, you rarely, if ever, need to actually create an +image specifier! (This function exists mainly for completeness.) Pretty +much the only use for image specifiers is to control how glyphs are +displayed, and the image specifier associated with a glyph (the +@code{image} property of a glyph) is created automatically when a glyph +is created and need not (and cannot, for that matter) ever be changed +(@pxref{Glyphs}). In fact, the design decision to create a separate +image specifier type, rather than make glyphs themselves be specifiers, +is debatable---the other properties of glyphs are rarely used and could +conceivably have been incorporated into the glyph's instantiator. The +rarely used glyph types (buffer, pointer, icon) could also have been +incorporated into the instantiator. @end defun Image instantiators come in many formats: @code{xbm}, @code{xpm}, @@ -462,65 +658,105 @@ @table @code @item nothing -(Don't display anything; no keywords are valid for this. Can only be -instanced as @code{nothing}.) +Don't display anything; no keywords are valid for this. Can only be +instanced as @code{nothing}. @item string -(Display this image as a text string. Can only be instanced +Display this image as a text string. Can only be instanced as @code{text}, although support for instancing as @code{mono-pixmap} -should be added.) +should be added. @item formatted-string -(Display this image as a text string with replaceable fields, -similar to a modeline format string; not currently implemented.) +Display this image as a text string with replaceable fields, +similar to a modeline format string; not currently implemented. @item xbm -(An X bitmap; only if X support was compiled into this XEmacs. Can be +An X bitmap; only if X support was compiled into this XEmacs. Can be instanced as @code{mono-pixmap}, @code{color-pixmap}, or -@code{pointer}.) +@code{pointer}. @item xpm -(An XPM pixmap; only if XPM support was compiled into this XEmacs. Can +An XPM pixmap; only if XPM support was compiled into this XEmacs. Can be instanced as @code{color-pixmap}, @code{mono-pixmap}, or @code{pointer}. XPM is an add-on library for X that was designed to rectify the shortcomings of the XBM format. Most implementations of X include the XPM library as a standard part. If your vendor does not, it is highly recommended that you download it and install it. You can get -it from the standard XEmacs FTP site, among other places.) +it from the standard XEmacs FTP site, among other places. @item xface -(An X-Face bitmap, used to encode people's faces in e-mail messages; +An X-Face bitmap, used to encode people's faces in e-mail messages; only if X-Face support was compiled into this XEmacs. Can be instanced -as @code{mono-pixmap}, @code{color-pixmap}, or @code{pointer}.) +as @code{mono-pixmap}, @code{color-pixmap}, or @code{pointer}. @item gif -(A GIF87 or GIF89 image; only if GIF support was compiled into this +A GIF87 or GIF89 image; only if GIF support was compiled into this XEmacs. Can be instanced as @code{color-pixmap}. Note that XEmacs includes GIF decoding functions as a standard part of it, so if you have X support, you will normally have GIF support, unless you explicitly -disable it at configure time.) +disable it at configure time. @item jpeg -(A JPEG-format image; only if JPEG support was compiled into this +A JPEG-format image; only if JPEG support was compiled into this XEmacs. Can be instanced as @code{color-pixmap}. If you have the JPEG libraries present on your system when XEmacs is built, XEmacs will automatically detect this and use them, unless you explicitly disable it -at configure time.) +at configure time. @item png -(A PNG/GIF24 image; only if PNG support was compiled into this XEmacs. -Can be instanced as @code{color-pixmap}.) +A PNG/GIF24 image; only if PNG support was compiled into this XEmacs. +Can be instanced as @code{color-pixmap}. @item tiff -(A TIFF-format image; only if TIFF support was compiled into this XEmacs. -Not currently implemented.) +A TIFF-format image; only if TIFF support was compiled into this XEmacs. @item cursor-font -(One of the standard cursor-font names, such as @samp{watch} or +One of the standard cursor-font names, such as @samp{watch} or @samp{right_ptr} under X. Under X, this is, more specifically, any of the standard cursor names from appendix B of the Xlib manual [also known as the file @file{}] minus the @samp{XC_} prefix. On other window systems, the valid names will be specific to the type of -window system. Can only be instanced as @code{pointer}.) +window system. Can only be instanced as @code{pointer}. @item font -(A glyph from a font; i.e. the name of a font, and glyph index into it +A glyph from a font; i.e. the name of a font, and glyph index into it of the form @samp{@var{font} fontname index [[mask-font] mask-index]}. Only if X support was compiled into this XEmacs. Currently can only be -instanced as @code{pointer}, although this should probably be fixed.) +instanced as @code{pointer}, although this should probably be fixed. +@item mswindows-resource +An MS Windows pointer resource. Specifies a resource to retrieve +directly from the system (an OEM resource) or from a file, particularly +an executable file. If the resource is to be retrieved from a file, use +:file and optionally :resource-id. Otherwise use :resource-id. Always +specify :resource-type to specify the type (cursor, bitmap or icon) of +the resource. Possible values for :resource-id are listed below. Can +be instanced as @code{pointer} or @code{color-pixmap}. @item subwindow -(An embedded X window; not currently implemented.) +An embedded windowing system window. Can only be instanced as +@code{subwindow}. +@item button +A button widget; either a push button, radio button or toggle button. +Can only be instanced as @code{widget}. +@item combo-box +A drop list of selectable items in a widget, for editing text. +Can only be instanced as @code{widget}. +@item edit-field +A text editing widget. Can only be instanced as @code{widget}. +@item label +A static, text-only, widget; for displaying text. Can only be instanced +as @code{widget}. +@item layout +A widget for controlling the positioning of children underneath it. +Through the use of nested layouts, a widget hierarchy can be created +which can have the appearance of any standard dialog box or similar +arrangement; all of this is counted as one @dfn{glyph} and could appear +in many of the places that expect a single glyph. Can only be instanced +as @code{widget}. +@item native-layout +@c #### Document me better! +The native version of a layout widget. +Can only be instanced as @code{widget}. +@item progress-gauge +A sliding widget, for showing progress. Can only be instanced as +@code{widget}. +@item tab-control +A tab widget; a series of user selectable tabs. Can only be instanced +as @code{widget}. +@item tree-view +A folding widget. Can only be instanced as @code{widget}. +@item scrollbar +A scrollbar widget. Can only be instanced as @code{widget}. @item autodetect -(XEmacs tries to guess what format the data is in. If X support exists, +XEmacs tries to guess what format the data is in. If X support exists, the data string will be checked to see if it names a filename. If so, and this filename contains XBM or XPM data, the appropriate sort of pixmap or pointer will be created. [This includes picking up any @@ -528,68 +764,107 @@ is one of the allowable image-instance types and the string names a valid cursor-font name, the image will be created as a pointer. Otherwise, the image will be displayed as text. If no X support exists, -the image will always be displayed as text.) +the image will always be displayed as text. +@item inherit +Inherit from the background-pixmap property of a face. Can only be +instanced as @code{mono-pixmap}. @end table The valid keywords are: @table @code @item :data -(Inline data. For most formats above, this should be a string. For +Inline data. For most formats above, this should be a string. For XBM images, this should be a list of three elements: width, height, and a string of bit data. This keyword is not valid for instantiator -format @code{nothing}.) +format @code{nothing}. @item :file -(Data is contained in a file. The value is the name of this file. If +Data is contained in a file. The value is the name of this file. If both @code{:data} and @code{:file} are specified, the image is created from what is specified in @code{:data} and the string in @code{:file} becomes the value of the @code{image-instance-file-name} function when applied to the resulting image-instance. This keyword is not valid for instantiator formats @code{nothing}, @code{string}, @code{formatted-string}, @code{cursor-font}, @code{font}, and -@code{autodetect}.) +@code{autodetect}. @item :foreground @itemx :background -(For @code{xbm}, @code{xface}, @code{cursor-font}, and @code{font}. +For @code{xbm}, @code{xface}, @code{cursor-font}, and @code{font}. These keywords allow you to explicitly specify foreground and background colors. The argument should be anything acceptable to @code{make-color-instance}. This will cause what would be a @code{mono-pixmap} to instead be colorized as a two-color color-pixmap, and specifies the foreground and/or background colors for a pointer -instead of black and white.) +instead of black and white. @item :mask-data -(For @code{xbm} and @code{xface}. This specifies a mask to be used with the +For @code{xbm} and @code{xface}. This specifies a mask to be used with the bitmap. The format is a list of width, height, and bits, like for -@code{:data}.) +@code{:data}. @item :mask-file -(For @code{xbm} and @code{xface}. This specifies a file containing the +For @code{xbm} and @code{xface}. This specifies a file containing the mask data. If neither a mask file nor inline mask data is given for an XBM image, and the XBM image comes from a file, XEmacs will look for a mask file with the same name as the image file but with @samp{Mask} or @samp{msk} appended. For example, if you specify the XBM file @file{left_ptr} [usually located in @file{/usr/include/X11/bitmaps}], the associated mask file @file{left_ptrmsk} will automatically be picked -up.) +up. @item :hotspot-x @itemx :hotspot-y -(For @code{xbm} and @code{xface}. These keywords specify a hotspot if +For @code{xbm} and @code{xface}. These keywords specify a hotspot if the image is instantiated as a @code{pointer}. Note that if the XBM image file specifies a hotspot, it will automatically be picked up if no -explicit hotspot is given.) +explicit hotspot is given. @item :color-symbols -(Only for @code{xpm}. This specifies an alist that maps strings that +Only for @code{xpm}. This specifies an alist that maps strings that specify symbolic color names to the actual color to be used for that symbolic color (in the form of a string or a color-specifier object). If this is not specified, the contents of @code{xpm-color-symbols} are -used to generate the alist.) +used to generate the alist. +@item :resource-id +Only for @code{mswindows-resource}. This must be either an integer +(which directly specifies a resource number) or a string. Valid strings +are + +For bitmaps: + +"close", "uparrow", "dnarrow", "rgarrow", "lfarrow", +"reduce", "zoom", "restore", "reduced", "zoomd", +"restored", "uparrowd", "dnarrowd", "rgarrowd", "lfarrowd", +"mnarrow", "combo", "uparrowi", "dnarrowi", "rgarrowi", +"lfarrowi", "size", "btsize", "check", "checkboxes", and +"btncorners". + +For cursors: + +"normal", "ibeam", "wait", "cross", "up", "sizenwse", +"sizenesw", "sizewe", "sizens", "sizeall", and "no". + +For icons: + +"sample", "hand", "ques", "bang", "note", and "winlogo". +@item :resource-type +Only for @code{mswindows-resource}. This must be a symbol, either +@code{cursor}, @code{icon}, or @code{bitmap}, specifying the type of +resource to be retrieved. +@item :face +Only for @code{inherit}. This specifies the face to inherit from. For +widgets this also specifies the face to use for display. It defaults to +gui-element-face. @end table +Keywords accepted as menu item specs are also accepted by widgets. +These are @code{:selected}, @code{:active}, @code{:suffix}, +@code{:keys}, @code{:style}, @code{:filter}, @code{:config}, +@code{:included}, @code{:key-sequence}, @code{:accelerator}, +@code{:label} and @code{:callback}. + If instead of a vector, the instantiator is a string, it will be converted into a vector by looking it up according to the specs in the @code{console-type-image-conversion-list} for the console type of @@ -771,10 +1046,14 @@ instance of type @code{nothing}. @end defun +@defun widget-image-instance-p object +Return t if @var{object} is an image instance of type @code{widget}. +@end defun + @node Image Instance Functions @subsubsection Image Instance Functions -@defun make-image-instance data &optional device dest-types no-error +@defun make-image-instance data &optional domain dest-types no-error This function creates a new image-instance object. @var{data} is an image instantiator, which describes the image @@ -790,14 +1069,47 @@ by @code{mono-pixmap}, followed by @code{pointer}. For the string and formatted-string formats, the most natural types are @code{text}, followed by @code{mono-pixmap} (not currently implemented), followed by -@code{color-pixmap} (not currently implemented). The other formats can -only be instantiated as one type. (If you want to control more -specifically the order of the types into which an image is instantiated, -just call @code{make-image-instance} repeatedly until it succeeds, -passing less and less preferred destination types each time. +@code{color-pixmap} (not currently implemented). For MS Windows +resources, the most natural type for pointer resources is +@code{pointer}, and for the others it's @code{color-pixmap}. The other +formats can only be instantiated as one type. (If you want to control +more specifically the order of the types into which an image is +instantiated, just call @code{make-image-instance} repeatedly until it +succeeds, passing less and less preferred destination types each time. If @var{dest-types} is omitted, all possible types are allowed. +@var{domain} specifies the domain to which the image instance will be +attached. This domain is termed the @dfn{governing domain}. The type +of the governing domain depends on the image instantiator +format. (Although, more correctly, it should probably depend on the +image instance type.) For example, pixmap image instances are specific +to a device, but widget image instances are specific to a particular +XEmacs window because in order to display such a widget when two windows +onto the same buffer want to display the widget, two separate underlying +widgets must be created. (That's because a widget is actually a child +window-system window, and all window-system windows have a unique +existence on the screen.) This means that the governing domain for a +pixmap image instance will be some device (most likely, the only +existing device), whereas the governing domain for a widget image +instance will be some XEmacs window. + +If you specify an overly general @var{domain} (e.g. a frame when a +window was wanted), an error is signaled. If you specify an overly +specific @var{domain} (e.g. a window when a device was wanted), the +corresponding general domain is fetched and used instead. For +@code{make-image-instance}, it makes no difference whether you specify +an overly specific domain or the properly general domain derived from +it. However, it does matter when creating an image instance by +instantiating a specifier or glyph (e.g. with +@code{glyph-image-instance}), because the more specific domain causes +spec lookup to start there and proceed to more general domains. (It +would also matter when creating an image instance with an instantiator +format of @code{inherit}, but we currently disallow this. #### We should +fix this.) +n +If omitted, @var{domain} defaults to the selected window. + @var{no-error} controls what happens when the image cannot be generated. If @var{nil}, an error message is generated. If @var{t}, no messages are generated and this function returns @var{nil}. If anything else, a @@ -819,6 +1131,17 @@ This function returns the name of the given image instance. @end defun +@defun image-instance-domain image-instance + +Return the governing domain of the given @var{image-instance}. The +governing domain of an image instance is the domain that the image +instance is specific to. It is @emph{NOT} necessarily the domain that +was given to the call to @code{specifier-instance} that resulted in the +creation of this image instance. See @code{make-image-instance} for +more information on governing domains. +@end defun + + @defun image-instance-string image-instance This function returns the string of the given image instance. This will only be non-@code{nil} for text image instances. diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/gutter.texi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/lispref/gutter.texi Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,460 @@ +@c -*-texinfo-*- +@c This is part of the XEmacs Lisp Reference Manual. +@c Copyright (C) 1994, 1995 Ben Wing. +@c Copyright (C) 1999 Andy Piper. +@c Copyright (C) 1999 Stephen J. Turnbull. +@c See the file lispref.texi for copying conditions. +@setfilename ../../info/gutter.info +@node Gutter, Scrollbars, Toolbar, top +@chapter Gutter +@cindex gutter + + A gutter is a rectangle displayed along one edge of a frame. It +can contain arbitrary text or graphics. + +@menu +* Gutter Intro:: An introduction. +* Creating Gutter:: How to create a gutter. +* Gutter Descriptor Format:: Accessing and modifying a gutter's + properties. +* Specifying a Gutter:: Setting a gutter's contents. +* Other Gutter Variables:: Controlling the size of gutters. +* Common Gutter Widgets:: Things to put in gutters. +@end menu + +@node Gutter Intro, Creating Gutter, Gutter, Gutter +@section Gutter Intro + + A @dfn{gutter} is a rectangle displayed along one edge of a frame. It +can contain arbitrary text or graphics. It could be considered a +generalization of a toolbar, although toolbars are not currently +implemented using gutters. + + In XEmacs, a gutter can be displayed along any of the four edges +of the frame, and two or more different edges can be displaying +gutters simultaneously. The contents, thickness, and visibility of +the gutters can be controlled separately, and the values can +be per-buffer, per-frame, etc., using specifiers (@pxref{Specifiers}). + + Normally, there is one gutter displayed in a frame. Usually, this is +the default gutter, containing buffer tabs, but modes cab override this +and substitute their own gutter. This default gutter is usually +positioned along the top of the frame, but this can be changed using +@code{set-default-gutter-position}. + + Note that, for each of the gutter properties (contents, thickness, +and visibility), there is a separate specifier for each of the four +gutter positions (top, bottom, left, and right), and an additional +specifier for the ``default'' gutter, i.e. the gutter whose +position is controlled by @code{set-default-gutter-position}. The +way this works is that @code{set-default-gutter-position} arranges +things so that the appropriate position-specific specifiers for the +default position inherit from the corresponding default specifiers. +That way, if the position-specific specifier does not give a value +(which it usually doesn't), then the value from the default +specifier applies. If you want to control the default gutter, you +just change the default specifiers, and everything works. A package +such as VM that wants to put its own gutter in a different location +from the default just sets the position-specific specifiers, and if +the user sets the default gutter to the same position, it will just +not be visible. + +@node Creating Gutter, Gutter Descriptor Format, Gutter Intro, Gutter +@section Creating Gutter + +@defun make-gutter-specifier spec-list + +Return a new @code{gutter} specifier object with the given specification +list. @var{spec-list} can be a list of specifications (each of which is +a cons of a locale and a list of instantiators), a single instantiator, +or a list of instantiators. @xref{Specifiers}, for more information +about specifiers. + +Gutter specifiers are used to specify the format of a gutter. The +values of the variables @code{default-gutter}, @code{top-gutter}, +@code{left-gutter}, @code{right-gutter}, and @code{bottom-gutter} are +always gutter specifiers. + +Valid gutter instantiators are called "gutter descriptors" and are +either strings or property-lists of strings. See @code{default-gutter} +for a description of the exact format. +@end defun + +@defun make-gutter-size-specifier spec-list + +Return a new @code{gutter-size} specifier object with the given spec +list. @var{spec-list} can be a list of specifications (each of which is +a cons of a locale and a list of instantiators), a single instantiator, +or a list of instantiators. @xref{Specifiers}, for more information +about specifiers. + +Gutter-size specifiers are used to specify the size of a gutter. The +values of the variables @code{default-gutter-size}, +@code{top-gutter-size}, @code{left-gutter-size}, +@code{right-gutter-size}, and @code{bottom-gutter-size} are always +gutter-size specifiers. + +Valid gutter-size instantiators are either integers or the special +symbol @code{autodetect}. If a gutter-size is set to @code{autodetect} +them the size of the gutter will be adjusted to just accommodate the +gutters contents. @code{autodetect} only works for top and bottom +gutters. +@end defun + +@defun make-gutter-visible-specifier spec-list + +Return a new @code{gutter-visible} specifier object with the given spec +list. @var{spec-list} can be a list of specifications (each of which is +a cons of a locale and a list of instantiators), a single instantiator, +or a list of instantiators. @xref{Specifiers}, for more information +about specifiers. + +Gutter-visible specifiers are used to specify the visibility of a +gutter. The values of the variables @code{default-gutter-visible-p}, +@code{top-gutter-visible-p}, @code{left-gutter-visible-p}, +@code{right-gutter-visible-p}, and @code{bottom-gutter-visible-p} are +always gutter-visible specifiers. + +Valid gutter-visible instantiators are t, nil or a list of symbols. If +a gutter-visible instantiator is set to a list of symbols, and the +corresponding gutter specification is a property-list strings, then +elements of the gutter specification will only be visible if the +corresponding symbol occurs in the gutter-visible instantiator. +@end defun + +@node Gutter Descriptor Format, Specifying a Gutter, Creating Gutter, Gutter +@section Gutter Descriptor Format + + The contents of a gutter are specified using a @dfn{gutter descriptor}. +The format of a gutter descriptor is a list of @dfn{gutter button +descriptors}. Each gutter button descriptor is a vector in one of the +following formats: + +@itemize @bullet +@item +@code{[@var{glyph-list} @var{function} @var{enabled-p} @var{help}]} +@item +@code{[:style @var{2d-or-3d}]} +@item +@code{[:style @var{2d-or-3d} :size @var{width-or-height}]} +@item +@code{[:size @var{width-or-height} :style @var{2d-or-3d}]} +@end itemize + + Optionally, one of the gutter button descriptors may be @code{nil} +instead of a vector; this signifies the division between the gutter +buttons that are to be displayed flush-left, and the buttons to be +displayed flush-right. + + The first vector format above specifies a normal gutter button; +the others specify blank areas in the gutter. + + For the first vector format: + +@itemize @bullet +@item +@var{glyph-list} should be a list of one to six glyphs (as created by +@code{make-glyph}) or a symbol whose value is such a list. The first +glyph, which must be provided, is the glyph used to display the gutter +button when it is in the ``up'' (not pressed) state. The optional +second glyph is for displaying the button when it is in the ``down'' +(pressed) state. The optional third glyph is for when the button is +disabled. The last three glyphs are for displaying the button in the +``up'', ``down'', and ``disabled'' states, respectively, but are used +when the user has called for captioned gutter buttons (using +@code{gutter-buttons-captioned-p}). The function +@code{gutter-make-button-list} is useful in creating these glyph lists. + +@item +Even if you do not provide separate down-state and disabled-state +glyphs, the user will still get visual feedback to indicate which +state the button is in. Buttons in the up-state are displayed +with a shadowed border that gives a raised appearance to the +button. Buttons in the down-state are displayed with shadows that +give a recessed appearance. Buttons in the disabled state are +displayed with no shadows, giving a 2-d effect. + +@item +If some of the gutter glyphs are not provided, they inherit as follows: + +@example + UP: up + DOWN: down -> up + DISABLED: disabled -> up + CAP-UP: cap-up -> up + CAP-DOWN: cap-down -> cap-up -> down -> up + CAP-DISABLED: cap-disabled -> cap-up -> disabled -> up +@end example + +@item +The second element @var{function} is a function to be called when the +gutter button is activated (i.e. when the mouse is released over the +gutter button, if the press occurred in the gutter). It can be any +form accepted by @code{call-interactively}, since this is how it is +invoked. + +@item +The third element @var{enabled-p} specifies whether the gutter button +is enabled (disabled buttons do nothing when they are activated, and are +displayed differently; see above). It should be either a boolean or a +form that evaluates to a boolean. + +@item +The fourth element @var{help}, if non-@code{nil}, should be a string. +This string is displayed in the echo area when the mouse passes over the +gutter button. +@end itemize + + For the other vector formats (specifying blank areas of the gutter): + +@itemize @bullet +@item +@var{2d-or-3d} should be one of the symbols @code{2d} or @code{3d}, +indicating whether the area is displayed with shadows (giving it a +raised, 3-d appearance) or without shadows (giving it a flat +appearance). + +@item +@var{width-or-height} specifies the length, in pixels, of the blank +area. If omitted, it defaults to a device-specific value (8 pixels for +X devices). +@end itemize + +@defun gutter-make-button-list up &optional down disabled cap-up cap-down cap-disabled +This function calls @code{make-glyph} on each arg and returns a list of +the results. This is useful for setting the first argument of a gutter +button descriptor (typically, the result of this function is assigned +to a symbol, which is specified as the first argument of the gutter +button descriptor). +@end defun + +@defun check-gutter-button-syntax button &optional noerror +Verify the syntax of entry @var{button} in a gutter description list. +If you want to verify the syntax of a gutter description list as a +whole, use @code{check-valid-instantiator} with a specifier type of +@code{gutter}. +@end defun + +@node Specifying a Gutter, Other Gutter Variables, Gutter Descriptor Format, Gutter +@section Specifying a Gutter + + In order to specify the contents of a gutter, set one of the specifier +variables @code{default-gutter}, @code{top-gutter}, +@code{bottom-gutter}, @code{left-gutter}, or @code{right-gutter}. +These are specifiers, which means you set them with @code{set-specifier} +and query them with @code{specifier-specs} or @code{specifier-instance}. +You will get an error if you try to set them using @code{setq}. The +valid instantiators for these specifiers are gutter descriptors, as +described above. @xref{Specifiers}, for more information. + + Most of the time, you will set @code{default-gutter}, which allows +the user to choose where the gutter should go. + +@defvr Specifier default-gutter +The position of this gutter is specified in the function +@code{default-gutter-position}. If the corresponding +position-specific gutter (e.g. @code{top-gutter} if +@code{default-gutter-position} is @code{top}) does not specify a +gutter in a particular domain, then the value of @code{default-gutter} +in that domain, of any, will be used instead. +@end defvr + + Note that the gutter at any particular position will not be displayed +unless its thickness (width or height, depending on orientation) is +non-zero and its visibility status is true. The thickness is controlled +by the specifiers @code{top-gutter-height}, +@code{bottom-gutter-height}, @code{left-gutter-width}, and +@code{right-gutter-width}, and the visibility status is controlled by +the specifiers @code{top-gutter-visible-p}, +@code{bottom-gutter-visible-p}, @code{left-gutter-visible-p}, and +@code{right-gutter-visible-p} (@pxref{Other Gutter Variables}). + +@defun set-default-gutter-position position +This function sets the position that the @code{default-gutter} will be +displayed at. Valid positions are the symbols @code{top}, +@code{bottom}, @code{left} and @code{right}. What this actually does is +set the fallback specifier for the position-specific specifier +corresponding to the given position to @code{default-gutter}, and set +the fallbacks for the other position-specific specifiers to @code{nil}. +It also does the same thing for the position-specific thickness and +visibility specifiers, which inherit from one of +@code{default-gutter-height} or @code{default-gutter-width}, and from +@code{default-gutter-visible-p}, respectively (@pxref{Other Gutter +Variables}). +@end defun + +@defun default-gutter-position +This function returns the position that the @code{default-gutter} will +be displayed at. +@end defun + + You can also explicitly set a gutter at a particular position. When +redisplay determines what to display at a particular position in a +particular domain (i.e. window), it first consults the position-specific +gutter. If that does not yield a gutter descriptor, the +@code{default-gutter} is consulted if @code{default-gutter-position} +indicates this position. + +@defvr Specifier top-gutter +Specifier for the gutter at the top of the frame. +@end defvr + +@defvr Specifier bottom-gutter +Specifier for the gutter at the bottom of the frame. +@end defvr + +@defvr Specifier left-gutter +Specifier for the gutter at the left edge of the frame. +@end defvr + +@defvr Specifier right-gutter +Specifier for the gutter at the right edge of the frame. +@end defvr + +@defun gutter-specifier-p object +This function returns non-nil if @var{object} is a gutter specifier. +Gutter specifiers are the actual objects contained in the gutter +variables described above, and their valid instantiators are +gutter descriptors (@pxref{Gutter Descriptor Format}). +@end defun + +@node Other Gutter Variables, Common Gutter Widgets, Specifying a Gutter, Gutter +@section Other Gutter Variables + + The variables to control the gutter thickness, visibility status, and +captioned status are all specifiers. @xref{Specifiers}. + +@defvr Specifier default-gutter-height +This specifies the height of the default gutter, if it's oriented +horizontally. The position of the default gutter is specified by the +function @code{set-default-gutter-position}. If the corresponding +position-specific gutter thickness specifier +(e.g. @code{top-gutter-height} if @code{default-gutter-position} is +@code{top}) does not specify a thickness in a particular domain (a +window or a frame), then the value of @code{default-gutter-height} or +@code{default-gutter-width} (depending on the gutter orientation) in +that domain, if any, will be used instead. +@end defvr + +@defvr Specifier default-gutter-width +This specifies the width of the default gutter, if it's oriented +vertically. This behaves like @code{default-gutter-height}. +@end defvr + + Note that @code{default-gutter-height} is only used when +@code{default-gutter-position} is @code{top} or @code{bottom}, and +@code{default-gutter-width} is only used when +@code{default-gutter-position} is @code{left} or @code{right}. + +@defvr Specifier top-gutter-height +This specifies the height of the top gutter. +@end defvr + +@defvr Specifier bottom-gutter-height +This specifies the height of the bottom gutter. +@end defvr + +@defvr Specifier left-gutter-width +This specifies the width of the left gutter. +@end defvr + +@defvr Specifier right-gutter-width +This specifies the width of the right gutter. +@end defvr + + Note that all of the position-specific gutter thickness specifiers +have a fallback value of zero when they do not correspond to the +default gutter. Therefore, you will have to set a non-zero thickness +value if you want a position-specific gutter to be displayed. + +@defvr Specifier default-gutter-visible-p +This specifies whether the default gutter is visible. The position of +the default gutter is specified by the function +@code{set-default-gutter-position}. If the corresponding position-specific +gutter visibility specifier (e.g. @code{top-gutter-visible-p} if +@code{default-gutter-position} is @code{top}) does not specify a +visible-p value in a particular domain (a window or a frame), then the +value of @code{default-gutter-visible-p} in that domain, if any, will +be used instead. +@end defvr + +@defvr Specifier top-gutter-visible-p +This specifies whether the top gutter is visible. +@end defvr + +@defvr Specifier bottom-gutter-visible-p +This specifies whether the bottom gutter is visible. +@end defvr + +@defvr Specifier left-gutter-visible-p +This specifies whether the left gutter is visible. +@end defvr + +@defvr Specifier right-gutter-visible-p +This specifies whether the right gutter is visible. +@end defvr + +@code{default-gutter-visible-p} and all of the position-specific +gutter visibility specifiers have a fallback value of true. + + Internally, gutter thickness and visibility specifiers are instantiated +in both window and frame domains, for different purposes. The value in +the domain of a frame's selected window specifies the actual gutter +thickness or visibility that you will see in that frame. The value in +the domain of a frame itself specifies the gutter thickness or +visibility that is used in frame geometry calculations. + + Thus, for example, if you set the frame width to 80 characters and the +left gutter width for that frame to 68 pixels, then the frame will be +sized to fit 80 characters plus a 68-pixel left gutter. If you then +set the left gutter width to 0 for a particular buffer (or if that +buffer does not specify a left gutter or has a nil value specified for +@code{left-gutter-visible-p}), you will find that, when that buffer is +displayed in the selected window, the window will have a width of 86 or +87 characters -- the frame is sized for a 68-pixel left gutter but the +selected window specifies that the left gutter is not visible, so it is +expanded to take up the slack. + +@defvr Specifier gutter-buttons-captioned-p +Whether gutter buttons are captioned. This affects which glyphs from a +gutter button descriptor are chosen. @xref{Gutter Descriptor Format}. +@end defvr + + You can also reset the gutter to what it was when XEmacs started up. + +@defvr Constant initial-gutter-spec +The gutter descriptor used to initialize @code{default-gutter} at +startup. +@end defvr + +@node Common Gutter Widgets, , Other Gutter Variables, Gutter +@section Common Gutter Widgets + + A gutter can contain arbitrary text. So, for example, in an Info +buffer you could put the title of the current node in the top gutter, +and it would not scroll out of view in a long node. (This is an +artificial example, since usually the node name is sufficiently +descriptive, and Info puts that in the mode line.) + + A more common use for the gutter is to hold some kind of active +widget. The buffer-tab facility, available in all XEmacs frames, +creates an array of file-folder-like tabs, which the user can click with +the mouse to switch buffers. W3 uses a progress-bar widget in the +bottom gutter to give a visual indication of the progress of +time-consuming operations like downloading. + +@menu +* Buffer Tabs:: Tabbed divider index metaphor for switching buffers. +* Progress Bars:: Visual indication of operation progress. +@end menu + +@node Buffer Tabs, Progress Bars, ,Common Gutter Widgets +@subsection Buffer Tabs + + Not documented yet. + +@node Progress Bars, , Buffer Tabs, Common Gutter Widgets +@subsection Progress Bars + + Not documented yet. + diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/hash-tables.texi --- a/man/lispref/hash-tables.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/hash-tables.texi Mon Aug 13 11:35:02 2007 +0200 @@ -89,15 +89,17 @@ Keyword @code{:rehash-threshold} must be a float between 0.0 and 1.0, and specifies the load factor of the hash table which triggers enlarging. -Keyword @code{:weakness} can be @code{nil} (default), @code{t}, -@code{key} or @code{value}. +Non-standard keyword @code{:weakness} can be @code{nil} (default), +@code{t}, @code{key-and-value}, @code{key}, @code{value} or +@code{key-or-value}. @code{t} is an alias for @code{key-and-value}. -A weak hash table is one whose pointers do not count as GC referents: -for any key-value pair in the hash table, if the only remaining pointer -to either the key or the value is in a weak hash table, then the pair -will be removed from the hash table, and the key and value collected. -A non-weak hash table (or any other pointer) would prevent the object -from being collected. +A key-and-value-weak hash table, also known as a fully-weak or simply +as a weak hash table, is one whose pointers do not count as GC +referents: for any key-value pair in the hash table, if the only +remaining pointer to either the key or the value is in a weak hash +table, then the pair will be removed from the hash table, and the key +and value collected. A non-weak hash table (or any other pointer) +would prevent the object from being collected. A key-weak hash table is similar to a fully-weak hash table except that a key-value pair will be removed only if the key remains unmarked @@ -110,6 +112,12 @@ unmarked outside of weak hash tables. The pair will remain in the hash table if the value is pointed to by something other than a weak hash table, even if the key is not. + +A key-or-value-weak hash table is similar to a fully-weak hash table except +that a key-value pair will be removed only if the value and the key remain +unmarked outside of weak hash tables. The pair will remain in the +hash table if the value or key are pointed to by something other than a weak +hash table, even if the other is not. @end defun @defun copy-hash-table hash-table @@ -204,18 +212,22 @@ (Otherwise, you'd have to explicitly map over the hash table every so often and remove unnecessary elements.) -There are three types of weak hash tables: +There are four types of weak hash tables: @table @asis -@item fully weak hash tables -In these hash tables, a pair disappears if either the key or the value -is unreferenced outside of the table. +@item key-and-value-weak hash tables +In these hash tables, also known as fully weak or simply as weak hash +tables, a pair disappears if either the key or the value is unreferenced +outside of the table. @item key-weak hash tables In these hash tables, a pair disappears if the key is unreferenced outside of the table, regardless of how the value is referenced. @item value-weak hash tables In these hash tables, a pair disappears if the value is unreferenced outside of the table, regardless of how the key is referenced. +@item key-or-value-weak hash tables +In these hash tables, a pair disappears if both the key and the value +are unreferenced outside of the table. @end table Also see @ref{Weak Lists}. diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/internationalization.texi --- a/man/lispref/internationalization.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/internationalization.texi Mon Aug 13 11:35:02 2007 +0200 @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/internationalization.info -@node Internationalization, MULE, LDAP Support, top +@node Internationalization, MULE, PostgreSQL Support, top @chapter Internationalization @menu diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/ldap.texi --- a/man/lispref/ldap.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/ldap.texi Mon Aug 13 11:35:02 2007 +0200 @@ -3,7 +3,7 @@ @c Copyright (C) 1998 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/ldap.info -@node LDAP Support, Internationalization, ToolTalk Support, top +@node LDAP Support, PostgreSQL Support, ToolTalk Support, top @chapter LDAP Support @cindex LDAP @@ -25,7 +25,7 @@ successfully built and tested with @itemize @bullet -@item OpenLDAP 1.0.3 (@url{http://www.openldap.org/}) +@item OpenLDAP 1.2 (@url{http://www.openldap.org/}) @item University of Michigan's LDAP 3.3 (@url{http://www.umich.edu/~dirsvcs/ldap/}) @item LDAP SDK 1.0 from Netscape Corp. (@url{http://developer.netscape.com/}) @end itemize @@ -33,7 +33,7 @@ Other libraries conforming to RFC 1823 will probably work also but may require some minor tweaking at C level. -The standard XEmacs configure script autodetects an installed LDAP +The standard XEmacs configure script auto-detects an installed LDAP library provided the library itself and the corresponding header files can be found in the library and include paths. A successful detection will be signalled in the final output of the configure script. @@ -49,13 +49,18 @@ higher-level layer which provides more convenient primitives to effectively use LDAP. -As of XEmacs 21.0, only interfaces to basic LDAP search functions are -provided, broader support is planned in future versions. +The low-level API should be used directly for very specific purposes +(such as multiple operations on a connection) only. The higher-level +functions provide a more convenient way to access LDAP directories +hiding the subtleties of handling the connection, translating arguments +and ensuring compliance with LDAP internationalization rules and formats +(currently partly implemented only). @menu * LDAP Variables:: Lisp variables related to LDAP * The High-Level LDAP API:: High-level LDAP lisp functions * The Low-Level LDAP API:: Low-level LDAP lisp primitives +* LDAP Internationalization:: I18n variables and functions @end menu @@ -77,7 +82,7 @@ @defvar ldap-default-base Default base for LDAP searches. This is a string using the syntax of RFC 1779. -For instance, "o¬ME, cÿ" limits the search to the +For instance, "o=ACME, c=US" limits the search to the Acme organization in the United States. @end defvar @@ -92,7 +97,7 @@ @table @code @item binddn The distinguished name of the user to bind as. This may look like -@samp{cÿ, o¬me, cnÿnny Bugs}, see RFC 1779 for details. +@samp{cn=Babs Jensen,o=ACME,c=US}, see RFC 1779 for details. @item passwd The password to use for authentication. @item auth @@ -127,41 +132,99 @@ @end table @end defvar +@defvar ldap-verbose +If non-@code{nil}, LDAP operations will echo progress messages. Defaults to @code{nil}. +@end defvar @node The High-Level LDAP API, The Low-Level LDAP API, LDAP Variables, XEmacs LDAP API @comment node-name, next, previous, up @subsection The High-Level LDAP API -As of this writing the high-level Lisp LDAP API only provides for LDAP -searches. Further support is planned in the future. +The following functions provide the most convenient interface to perform +LDAP operations. All of them open a connection to a host, perform an +operation (add/search/modify/delete) on one or several entries and +cleanly close the connection thus insulating the user from all the +details of the low-level interface such as LDAP Lisp objects @pxref{The +Low-Level LDAP API}. -The @code{ldap-search} function provides the most convenient interface -to perform LDAP searches. It opens a connection to a host, performs the -query and cleanly closes the connection thus insulating the user from -all the details of the low-level interface such as LDAP Lisp objects -@pxref{The Low-Level LDAP API} +Note that @code{ldap-search} which used to be the name of the high-level +search function in XEmacs 21.1 is now obsolete. For consistency in the +naming as well as backward compatibility, that function now acts as a +wrapper that calls either @code{ldap-search-basic} (low-level search +function) or @code{ldap-search-entries} (high-level search function) +according to the actual parameters. A direct call to one of these two +functions is preferred since it is faster and unambiguous. -@defun ldap-search filter &optional host attributes attrsonly +@defun ldap-search-entries filter &optional host attributes attrsonly withdn Perform an LDAP search. @var{filter} is the search filter @pxref{Syntax of Search Filters} -@var{host} is the LDAP host on which to perform the search +@var{host} is the LDAP host on which to perform the search. @var{attributes} is the specific attributes to retrieve, @code{nil} means -retrieve all +retrieve all. @var{attrsonly} if non-@code{nil} retrieves the attributes only without their associated values. +If @var{withdn} is non-@code{nil} each entry in the result will be prepended with +its distinguished name DN. Additional search parameters can be specified through @code{ldap-host-parameters-alist}. +The function returns a list of matching entries. Each entry is itself +an alist of attribute/value pairs optionally preceded by the DN of the +entry according to the value of @var{withdn}. +@end defun + +@defun ldap-add-entries entries &optional host binddn passwd +Add entries to an LDAP directory. @var{entries} is a list of entry +specifications of the form @code{(DN (ATTR . VALUE) (ATTR . VALUE) ...)} +where @var{dn} the distinguished name of an entry to add, the following +are cons cells containing attribute/value string pairs. @var{host} is +the LDAP host, defaulting to `ldap-default-host' @var{binddn} is the DN +to bind as to the server @var{passwd} is the corresponding password. @end defun -@node The Low-Level LDAP API, , The High-Level LDAP API, XEmacs LDAP API +@defun ldap-modify-entries entry-mods &optional host binddn passwd +Modify entries of an LDAP directory. +@var{entry_mods} is a list of entry modifications of the form +@code{(DN MOD-SPEC1 MOD-SPEC2 ...)} where @var{dn} is the distinguished name of +the entry to modify, the following are modification specifications. +A modification specification is itself a list of the form +@code{(MOD-OP ATTR VALUE1 VALUE2 ...)} @var{mod-op} and @var{attr} are mandatory, +@var{values} are optional depending on @var{mod-op}. +@var{mod-op} is the type of modification, one of the symbols @code{add}, @code{delete} +or @code{replace}. @var{attr} is the LDAP attribute type to modify. +@var{host} is the LDAP host, defaulting to @code{ldap-default-host} +@var{binddn} is the DN to bind as to the server +@var{passwd} is the corresponding password" +@end defun + +@defun ldap-delete-entries dn &optional host binddn passwd +Delete an entry from an LDAP directory. +@var{dn} is the distinguished name of an entry to delete or +a list of those. +@var{host} is the LDAP host, defaulting to @code{ldap-default-host} +@var{binddn} is the DN to bind as to the server +@var{passwd} is the corresponding password. +@end defun + + +@node The Low-Level LDAP API, LDAP Internationalization, The High-Level LDAP API, XEmacs LDAP API @comment node-name, next, previous, up @subsection The Low-Level LDAP API +The low-level API should be used directly for very specific purposes +(such as multiple operations on a connection) only. The higher-level +functions provide a more convenient way to access LDAP directories +hiding the subtleties of handling the connection, translating arguments +and ensuring compliance with LDAP internationalization rules and formats +(currently partly implemented only). See @pxref{The High-Level LDAP API} + +Note that the former functions @code{ldap-*-internal} functions have been +renamed in XEmacs 21.2 + @menu * The LDAP Lisp Object:: * Opening and Closing a LDAP Connection:: -* Searching on a LDAP Server (Low-level):: +* Low-level Operations on a LDAP Server:: @end menu @node The LDAP Lisp Object, Opening and Closing a LDAP Connection, The Low-Level LDAP API, The Low-Level LDAP API @@ -184,7 +247,7 @@ @end defun -@node Opening and Closing a LDAP Connection, Searching on a LDAP Server (Low-level), The LDAP Lisp Object, The Low-Level LDAP API +@node Opening and Closing a LDAP Connection, Low-level Operations on a LDAP Server, The LDAP Lisp Object, The Low-Level LDAP API @comment node-name, next, previous, up @subsubsection Opening and Closing a LDAP Connection @@ -202,7 +265,7 @@ @code{krbv41} and @code{krbv42}. @item binddn The distinguished name of the user to bind as. This may look like -@samp{cÿ, o¬me, cnÿnny Bugs}, see RFC 1779 for details. +@samp{c=com, o=Acme, cn=Babs Jensen}, see RFC 1779 for details. @item passwd The password to use for authentication. @item deref @@ -232,18 +295,17 @@ @end defun -@node Searching on a LDAP Server (Low-level), , Opening and Closing a LDAP Connection, The Low-Level LDAP API +@node Low-level Operations on a LDAP Server, , Opening and Closing a LDAP Connection, The Low-Level LDAP API @comment node-name, next, previous, up -@subsubsection Searching on a LDAP Server (Low-level) +@subsubsection Low-level Operations on a LDAP Server -@code{ldap-search-internal} is the low-level primitive to perform a +@code{ldap-search-basic} is the low-level primitive to perform a search on a LDAP server. It works directly on an open LDAP connection thus requiring a preliminary call to @code{ldap-open}. Multiple searches can be made on the same connection, then the session must be closed with @code{ldap-close}. - -@defun ldap-search-internal ldap filter base scope attrs attrsonly +@defun ldap-search-basic ldap filter base scope attrs attrsonly Perform a search on an open connection @var{ldap} created with @code{ldap-open}. @var{filter} is a filter string for the search @pxref{Syntax of Search Filters} @var{base} is the distinguished name at which to start the search. @@ -255,12 +317,138 @@ for each matching entry. If @code{nil} all available attributes are returned. If @code{attrsonly} is non-@code{nil} then only the attributes are retrieved, not their associated values -The function returns a list of matching entries. Each entry being itself -an alist of attribute/values. +If @code{withdn} is non-@code{nil} then each entry in the result is prepended with +its distinguished name DN +If @code{verbose} is non-@code{nil} then progress messages are echoed +The function returns a list of matching entries. Each entry is itself +an alist of attribute/value pairs optionally preceded by the DN of the +entry according to the value of @code{withdn}. +@end defun + +@defun ldap-add ldap dn entry +Add @var{entry} to a LDAP directory which a connection @var{ldap} has +been opened to with @code{ldap-open}. +@var{dn} is the distinguished name of the entry to add. +@var{entry} is an entry specification, i.e., a list of cons cells +containing attribute/value string pairs. +@end defun + +@defun ldap-modify ldap dn mods +Modify an entry in an LDAP directory. +@var{ldap} is an LDAP connection object created with @code{ldap-open}. +@var{dn} is the distinguished name of the entry to modify. +@var{mods} is a list of modifications to apply. +A modification is a list of the form @code{(MOD-OP ATTR VALUE1 VALUE2 ...)} +@var{mod-op} and @var{attr} are mandatory, @var{values} are optional depending on @var{mod-op}. +@var{mod-op} is the type of modification, one of the symbols @code{add}, @code{delete} +or @code{replace}. @var{attr} is the LDAP attribute type to modify +@end defun + +@defun ldap-delete ldap dn +Delete an entry to an LDAP directory. +@var{ldap} is an LDAP connection object created with @code{ldap-open}. +@var{dn} is the distinguished name of the entry to delete @end defun +@node LDAP Internationalization, , The Low-Level LDAP API, XEmacs LDAP API +@comment node-name, next, previous, up +@subsection LDAP Internationalization + +The XEmacs LDAP API provides basic internationalization features based +on the LDAP v3 specification (essentially RFC2252 on "LDAP v3 Attribute +Syntax Definitions"). Unfortunately since there is currently no free +LDAP v3 server software, this part has not received much testing and +should be considered experimental. The framework is in place though. + +@defun ldap-decode-attribute attr +Decode the attribute/value pair @var{attr} according to LDAP rules. +The attribute name is looked up in @code{ldap-attribute-syntaxes-alist} +and the corresponding decoder is then retrieved from +@code{ldap-attribute-syntax-decoders}' and applied on the value(s). +@end defun + +@menu +* LDAP Internationalization Variables:: +* Encoder/Decoder Functions:: +@end menu + +@node LDAP Internationalization Variables, Encoder/Decoder Functions, LDAP Internationalization, LDAP Internationalization +@comment node-name, next, previous, up +@subsubsection LDAP Internationalization Variables + +@defvar ldap-ignore-attribute-codings +If non-@code{nil}, no encoding/decoding will be performed LDAP attribute values +@end defvar + +@defvar ldap-coding-system +Coding system of LDAP string values. +LDAP v3 specifies the coding system of strings to be UTF-8. +You need an XEmacs with Mule support for this. +@end defvar + +@defvar ldap-default-attribute-decoder +Decoder function to use for attributes whose syntax is unknown. Such a +function receives an encoded attribute value as a string and should +return the decoded value as a string +@end defvar + +@defvar ldap-attribute-syntax-encoders +A vector of functions used to encode LDAP attribute values. +The sequence of functions corresponds to the sequence of LDAP attribute syntax +object identifiers of the form 1.3.6.1.4.1.1466.1115.121.1.* as defined in +RFC2252 section 4.3.2. As of this writing, only a few encoder functions +are available. +@end defvar + +@defvar ldap-attribute-syntax-decoders +A vector of functions used to decode LDAP attribute values. +The sequence of functions corresponds to the sequence of LDAP attribute syntax +object identifiers of the form 1.3.6.1.4.1.1466.1115.121.1.* as defined in +RFC2252 section 4.3.2. As of this writing, only a few decoder functions +are available. +@end defvar + +@defvar ldap-attribute-syntaxes-alist +A map of LDAP attribute names to their type object id minor number. +This table is built from RFC2252 Section 5 and RFC2256 Section 5 +@end defvar + +@node Encoder/Decoder Functions, , LDAP Internationalization Variables, LDAP Internationalization +@comment node-name, next, previous, up +@subsubsection Encoder/Decoder Functions + +@defun ldap-encode-boolean bool +A function that encodes an elisp boolean @var{bool} into a LDAP +boolean string representation +@end defun + +@defun ldap-decode-boolean str +A function that decodes a LDAP boolean string representation +@var{str} into an elisp boolean +@end defun + +@defun ldap-decode-string str +Decode a string @var{str} according to `ldap-coding-system' +@end defun + +@defun ldap-encode-string str +Encode a string @var{str} according to `ldap-coding-system' +@end defun + +@defun ldap-decode-address str +Decode an address @var{str} according to `ldap-coding-system' and +replacing $ signs with newlines as specified by LDAP encoding rules for +addresses +@end defun + +@defun ldap-encode-address str +Encode an address @var{str} according to `ldap-coding-system' and +replacing newlines with $ signs as specified by LDAP encoding rules for +addresses +@end defun + @node Syntax of Search Filters, , XEmacs LDAP API, LDAP Support @@ -299,6 +487,3 @@ matches records of class @code{Person} containing a @code{mail} attribute and corresponding to people whose last name is @code{Smith} or whose first name is @code{John}. - - - diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/lispref.texi --- a/man/lispref/lispref.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/lispref.texi Mon Aug 13 11:35:02 2007 +0200 @@ -159,6 +159,7 @@ * Menus:: Defining pull-down and pop-up menus. * Dialog Boxes:: Creating dialog boxes. * Toolbar:: Controlling the toolbar. +* Gutter:: Controlling the gutter. * Scrollbars:: Controlling the scrollbars. * Drag and Drop:: Generic API to inter-application communication via specific protocols. @@ -204,6 +205,7 @@ * ToolTalk Support:: Interfacing with the ToolTalk message service. * LDAP Support:: Interfacing with the Lightweight Directory Access Protocol. +* PostgreSQL Support:: Interfacing to the PostgreSQL libpq library. * Internationalization:: How Emacs supports different languages and cultural conventions. * MULE:: Specifics of the Asian-language support. @@ -623,6 +625,8 @@ * Specifying the Toolbar:: Setting a toolbar. * Other Toolbar Variables:: Controlling the size of toolbars. +Gutter + Scrollbars Major and Minor Modes @@ -1095,12 +1099,18 @@ * LDAP Variables:: Lisp variables related to LDAP * The High-Level LDAP API:: High-level LDAP lisp functions * The Low-Level LDAP API:: Low-level LDAP lisp primitives +* LDAP Internationalization:: I18n variables and functions The Low-Level LDAP API * The LDAP Lisp Object:: * Opening and Closing a LDAP Connection:: -* Searching on a LDAP Server (Low-level):: +* Low-level Operations on a LDAP Server:: + +LDAP Internationalization + +* LDAP Internationalization Variables:: +* Encoder/Decoder Functions:: Internationalization @@ -1163,6 +1173,7 @@ @include menus.texi @include dialog.texi @include toolbar.texi +@include gutter.texi @include scrollbars.texi @include dragndrop.texi @include modes.texi @@ -1199,6 +1210,7 @@ @include x-windows.texi @include tooltalk.texi @include ldap.texi +@include postgresql.texi @include internationalization.texi @include mule.texi diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/loading.texi --- a/man/lispref/loading.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/loading.texi Mon Aug 13 11:35:02 2007 +0200 @@ -199,7 +199,7 @@ function to search through @code{load-path}.) It searches for @var{filename} through @var{path-list}, expanded by one of the optional @var{suffixes} (string of suffixes separated by @samp{:}s), checking for -access @var{mode} (0|1|2|4 = exists|executable|writeable|readable), +access @var{mode} (0|1|2|4 = exists|executable|writable|readable), default readable. @code{locate-file} keeps hash tables of the directories it searches @@ -673,7 +673,7 @@ This command unloads the library that provided feature @var{feature}. It undefines all functions, macros, and variables defined in that library with @code{defconst}, @code{defvar}, @code{defun}, -@code{defmacro}, @code{defsubst}, @code{definf-function} and +@code{defmacro}, @code{defsubst}, @code{define-function} and @code{defalias}. It then restores any autoloads formerly associated with those symbols. (Loading saves these in the @code{autoload} property of the symbol.) diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/minibuf.texi --- a/man/lispref/minibuf.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/minibuf.texi Mon Aug 13 11:35:02 2007 +0200 @@ -150,23 +150,26 @@ default value, @var{initial-contents} may be preferred. @end defun -@defun read-string prompt &optional initial history +@defun read-string prompt &optional initial history default-value This function reads a string from the minibuffer and returns it. The arguments @var{prompt} and @var{initial} are used as in @code{read-from-minibuffer}. The keymap used is @code{minibuffer-local-map}. The optional argument @var{history}, if non-nil, specifies a history -list and optionally the initial position in the list. +list and optionally the initial position in the list. The optional +argument @var{default} specifies a default value to return if the user +enters null input; it should be a string. This function is a simplified interface to the @code{read-from-minibuffer} function: @smallexample @group -(read-string @var{prompt} @var{initial}) +(read-string @var{prompt} @var{initial} @var{history} @var{default}) @equiv{} -(read-from-minibuffer @var{prompt} @var{initial} nil nil nil) +(read-from-minibuffer @var{prompt} @var{initial} nil nil + @var{history} nil @var{default}))) @end group @end smallexample @end defun @@ -205,19 +208,25 @@ This section describes functions for reading Lisp objects with the minibuffer. -@defun read-minibuffer prompt &optional initial +@defun read-expression prompt &optional initial history default-value This function reads a Lisp object using the minibuffer, and returns it without evaluating it. The arguments @var{prompt} and @var{initial} are used as in @code{read-from-minibuffer}. +The optional argument @var{history}, if non-nil, specifies a history +list and optionally the initial position in the list. The optional +argument @var{default-value} specifies a default value to return if the +user enters null input; it should be a string. + This is a simplified interface to the @code{read-from-minibuffer} function: @smallexample @group -(read-minibuffer @var{prompt} @var{initial}) +(read-expression @var{prompt} @var{initial} @var{history} @var{default-value}) @equiv{} -(read-from-minibuffer @var{prompt} @var{initial} nil t) +(read-from-minibuffer @var{prompt} @var{initial} nil t + @var{history} nil @var{default-value}) @end group @end smallexample @@ -226,7 +235,7 @@ @smallexample @group -(read-minibuffer +(read-expression "Enter an expression: " (format "%s" '(testing))) ;; @r{Here is how the minibuffer is displayed:} @@ -244,27 +253,38 @@ default, or can edit the input. @end defun -@defun eval-minibuffer prompt &optional initial +@defun read-minibuffer prompt &optional initial history default-value + +This is a FSF Emacs compatible function. Use @code{read-expression} +instead. +@end defun + +@defun eval-minibuffer prompt &optional initial history default-value This function reads a Lisp expression using the minibuffer, evaluates it, then returns the result. The arguments @var{prompt} and @var{initial} are used as in @code{read-from-minibuffer}. +The optional argument @var{history}, if non-nil, specifies a history +list and optionally the initial position in the list. The optional +argument @var{default-value} specifies a default value to return if the +user enters null input; it should be a string. + This function simply evaluates the result of a call to -@code{read-minibuffer}: +@code{read-expression}: @smallexample @group (eval-minibuffer @var{prompt} @var{initial}) @equiv{} -(eval (read-minibuffer @var{prompt} @var{initial})) +(eval (read-expression @var{prompt} @var{initial})) @end group @end smallexample @end defun -@defun edit-and-eval-command prompt form +@defun edit-and-eval-command prompt command &optional history This function reads a Lisp expression in the minibuffer, and then evaluates it. The difference between this command and -@code{eval-minibuffer} is that here the initial @var{form} is not +@code{eval-minibuffer} is that here the initial @var{command} is not optional and it is treated as a Lisp object to be converted to printed representation rather than as a string of text. It is printed with @code{prin1}, so if it is a string, double-quote characters (@samp{"}) @@ -605,7 +625,7 @@ is included in @var{collection}. The function @code{completing-read} works by calling -@code{read-minibuffer}. It uses @code{minibuffer-local-completion-map} +@code{read-expression}. It uses @code{minibuffer-local-completion-map} as the keymap if @var{require-match} is @code{nil}, and uses @code{minibuffer-local-must-match-map} if @var{require-match} is non-@code{nil}. @xref{Completion Commands}. @@ -755,7 +775,7 @@ @samp{*Completions*}. @end deffn -@defun display-completion-list completions +@defun display-completion-list completions &rest cl-keys This function displays @var{completions} to the stream in @code{standard-output}, usually a buffer. (@xref{Read and Print}, for more information about streams.) The argument @var{completions} is normally @@ -832,13 +852,19 @@ @end example @end defun -@defun read-command prompt +@defun read-command prompt &optional default-value This function reads the name of a command and returns it as a Lisp symbol. The argument @var{prompt} is used as in @code{read-from-minibuffer}. Recall that a command is anything for which @code{commandp} returns @code{t}, and a command name is a symbol for which @code{commandp} returns @code{t}. @xref{Interactive Call}. +The argument @var{default-value} specifies what to return if the user +enters null input. It can be a symbol or a string; if it is a string, +@code{read-command} interns it before returning it. If @var{default} is +@code{nil}, that means no default has been specified; then if the user +enters null input, the return value is @code{nil}. + @example (read-command "Command name? ") @@ -874,10 +900,16 @@ @end example @end defun -@defun read-variable prompt +@defun read-variable prompt &optional default-value This function reads the name of a user variable and returns it as a symbol. +The argument @var{default-value} specifies what to return if the user +enters null input. It can be a symbol or a string; if it is a string, +@code{read-variable} interns it before returning it. If @var{default} +is @code{nil}, that means no default has been specified; then if the +user enters null input, the return value is @code{nil}. + @example @group (read-variable "Variable name? ") @@ -920,7 +952,7 @@ file name. It provides special features including automatic insertion of the default directory. -@defun read-file-name prompt &optional directory default existing initial +@defun read-file-name prompt &optional directory default existing initial history This function reads a file name in the minibuffer, prompting with @var{prompt} and providing completion. If @var{default} is non-@code{nil}, then the function returns @var{default} if the user just diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/modes.texi --- a/man/lispref/modes.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/modes.texi Mon Aug 13 11:35:02 2007 +0200 @@ -920,7 +920,7 @@ The modeline contents are controlled by a data structure of lists, strings, symbols, and numbers kept in the buffer-local variable -@code{mode-line-format}. The data structure is called a @dfn{modeline +@code{modeline-format}. The data structure is called a @dfn{modeline construct}, and it is built in recursive fashion out of simpler modeline constructs. The same data structure is used for constructing frame titles (@pxref{Frame Titles}). @@ -943,8 +943,8 @@ For most purposes, it is sufficient to alter the variables referenced by @code{modeline-format}. - A modeline construct may be a list, a symbol, or a string. If the -value is a list, each element may be a list, a symbol, or a string. + A modeline construct may be a string, symbol, glyph, generic +specifier, list or cons cell. @table @code @cindex percent symbol in modeline @@ -956,13 +956,22 @@ @item @var{symbol} A symbol as a modeline construct stands for its value. The value of -@var{symbol} is used as a modeline construct, in place of @var{symbol}. -However, the symbols @code{t} and @code{nil} are ignored; so is any -symbol whose value is void. +@var{symbol} is processed as a modeline construct, in place of +@var{symbol}. However, the symbols @code{t} and @code{nil} are ignored; +so is any symbol whose value is void. There is one exception: if the value of @var{symbol} is a string, it is displayed verbatim: the @code{%}-constructs are not recognized. +@item @var{glyph} +A glyph is displayed as is. + +@item @var{generic-specifier} +A @var{generic-specifier} (i.e. a specifier of type @code{generic}) +stands for its instance. The instance of @var{generic-specifier} is +computed in the current window using the equivalent of +@code{specifier-instance} and the value is processed. + @item (@var{string} @var{rest}@dots{}) @r{or} (@var{list} @var{rest}@dots{}) A list whose first element is a string or list means to process all the elements recursively and concatenate the results. This is the most @@ -987,6 +996,19 @@ For example, the usual way to show what percentage of a buffer is above the top of the window is to use a list like this: @code{(-3 "%p")}. + +@item (@var{extent} @var{rest}@dots{}) + +A list whose car is an extent means the cdr of the list is processed +normally but the results are displayed using the face of the extent, and +mouse clicks over this section are processed using the keymap of the +extent. (In addition, if the extent has a help-echo property, that +string will be echoed when the mouse moves over this section.) If +extents are nested, all keymaps are properly consulted when processing +mouse clicks, but multiple faces are not correctly merged (only the +first face is used), and lists of faces are not correctly handled. +@c #### Document generate-modeline-string. +@c See `generated-modeline-string' for more information. @end table If you do alter @code{modeline-format} itself, the new value should @@ -1202,10 +1224,10 @@ @c The following two may only apply in XEmacs. @item %l -the current line number. +The current line number. @item %S -the name of the selected frame; this is only meaningful under the +The name of the selected frame; this is only meaningful under the X Window System. @xref{Frame Name}. @item %t @@ -1226,6 +1248,9 @@ @samp{Narrow} when narrowing is in effect; nothing otherwise (see @code{narrow-to-region} in @ref{Narrowing}). +@item %C +Under XEmacs/mule, the mnemonic for @code{buffer-file-coding-system}. + @item %[ An indication of the depth of recursive editing levels (not counting minibuffer levels): one @samp{[} for each editing level. diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/mule.texi --- a/man/lispref/mule.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/mule.texi Mon Aug 13 11:35:02 2007 +0200 @@ -6,13 +6,13 @@ @node MULE, Tips, Internationalization, top @chapter MULE -@dfn{MULE} is the name originally given to the version of GNU Emacs + @dfn{MULE} is the name originally given to the version of GNU Emacs extended for multi-lingual (and in particular Asian-language) support. -``MULE'' is short for ``MUlti-Lingual Emacs''. It was originally called -Nemacs (``Nihon Emacs'' where ``Nihon'' is the Japanese word for -``Japan''), when it only provided support for Japanese. XEmacs -refers to its multi-lingual support as @dfn{MULE support} since it -is based on @dfn{MULE}. +``MULE'' is short for ``MUlti-Lingual Emacs''. It is an extension and +complete rewrite of Nemacs (``Nihon Emacs'' where ``Nihon'' is the +Japanese word for ``Japan''), which only provided support for Japanese. +XEmacs refers to its multi-lingual support as @dfn{MULE support} since +it is based on @dfn{MULE}. @menu * Internationalization Terminology:: @@ -20,25 +20,40 @@ * Charsets:: Sets of related characters. * MULE Characters:: Working with characters in XEmacs/MULE. * Composite Characters:: Making new characters by overstriking other ones. -* ISO 2022:: An international standard for charsets and encodings. * Coding Systems:: Ways of representing a string of chars using integers. * CCL:: A special language for writing fast converters. * Category Tables:: Subdividing charsets into groups. @end menu -@node Internationalization Terminology +@node Internationalization Terminology, Charsets, , MULE @section Internationalization Terminology - In internationalization terminology, a string of text is divided up + In internationalization terminology, a string of text is divided up into @dfn{characters}, which are the printable units that make up the text. A single character is (for example) a capital @samp{A}, the -number @samp{2}, a Katakana character, a Kanji ideograph (an -@dfn{ideograph} is a ``picture'' character, such as is used in Japanese -Kanji, Chinese Hanzi, and Korean Hangul; typically there are thousands -of such ideographs in each language), etc. The basic property of a -character is its shape. Note that the same character may be drawn by -two different people (or in two different fonts) in slightly different -ways, although the basic shape will be the same. +number @samp{2}, a Katakana character, a Hangul character, a Kanji +ideograph (an @dfn{ideograph} is a ``picture'' character, such as is +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. + + Human beings normally process text visually, so to a first approximation +a character may be identified with its shape. Note that the same +character may be drawn by two different people (or in two different +fonts) in slightly different ways, although the "basic shape" will be the +same. But consider the works of Scott Kim; human beings can recognize +hugely variant shapes as the "same" character. Sometimes, especially +where characters are extremely complicated to write, completely +different shapes may be defined as the "same" character in national +standards. The Taiwanese variant of Hanzi is generally the most +complicated; over the centuries, the Japanese, Koreans, and the People's +Republic of China have adopted simplifications of the shape, but the +line of descent from the original shape is recorded, and the meanings +and pronunciation of different forms of the same character are +considered to be identical within each language. (Of course, it may +take a specialist to recognize the related form; the point is that the +relations are standardized, despite the differing shapes.) In some cases, the differences will be significant enough that it is actually possible to identify two or more distinct shapes that both @@ -57,101 +72,137 @@ Note that @dfn{character} and @dfn{glyph} are used differently here than elsewhere in XEmacs. - A @dfn{character set} is simply a set of related characters. ASCII, + A @dfn{character set} is essentially a set of related characters. ASCII, for example, is a set of 94 characters (or 128, if you count non-printing characters). Other character sets are ISO8859-1 (ASCII plus various accented characters and other international symbols), -JISX0201 (ASCII, more or less, plus half-width Katakana), JISX0208 -(Japanese Kanji), JISX0212 (a second set of less-used Japanese Kanji), +JIS X 0201 (ASCII, more or less, plus half-width Katakana), JIS X 0208 +(Japanese Kanji), JIS X 0212 (a second set of less-used Japanese Kanji), GB2312 (Mainland Chinese Hanzi), etc. - Every character set has one or more @dfn{orderings}, which can be -viewed as a way of assigning a number (or set of numbers) to each -character in the set. For most character sets, there is a standard -ordering, and in fact all of the character sets mentioned above define a -particular ordering. ASCII, for example, places letters in their -``natural'' order, puts uppercase letters before lowercase letters, -numbers before letters, etc. Note that for many of the Asian character -sets, there is no natural ordering of the characters. The actual -orderings are based on one or more salient characteristic, of which -there are many to choose from---e.g. number of strokes, common -radicals, phonetic ordering, etc. + The definition of a character set will implicitly or explicitly give +it an @dfn{ordering}, a way of assigning a number to each character in +the set. For many character sets, there is a natural ordering, for +example the ``ABC'' ordering of the Roman letters. But it is not clear +whether digits should come before or after the letters, and in fact +different European languages treat the ordering of accented characters +differently. It is useful to use the natural order where available, of +course. The number assigned to any particular character is called the +character's @dfn{code point}. (Within a given character set, each +character has a unique code point. Thus the word "set" is ill-chosen; +different orderings of the same characters are different character sets. +Identifying characters is simple enough for alphabetic character sets, +but the difference in ordering can cause great headaches when the same +thousands of characters are used by different cultures as in the Hanzi.) - The set of numbers assigned to any particular character are called -the character's @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. 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 0 through -127 (if non-printing characters are included) or 33 through 126 -(if only the printing characters are considered). JISX0208, 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 -33 through 126. (Note that the choice of the range here is somewhat -arbitrary. Although a character set such as JISX0208 defines an -@emph{ordering} of all its characters, it does not define the actual -mapping between numbers and characters. You could just as easily -index the characters in JISX0208 using numbers in the range 0 through -93, 1 through 94, 2 through 95, etc. The reason for the actual range -chosen is so that the position codes match up with the actual values -used in the common encodings.) + 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. 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 ASCII, and as a result, most people do -not understand the difference between a character set and an encoding.) -This is not possible, however, 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, JISX0208, and -JISX0212, to be specific. Each of these is indexed using one or more -position codes in the range 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 JISX0208 and JISX0212, and -puts a special extra byte before each JISX0212 character; etc. (JIS, -EUC, and most of the other encodings you will encounter 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 generally used internally in -programs to simplify the code that manipulates them; however, they are -not much used externally because they are not very space-efficient.) +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.) + + 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 +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.) + + A general method of handling text using multiple character sets +(whether for multilingual text, or simply text in an extremely +complicated single language like Japanese) is defined in the +international standard ISO 2022. ISO 2022 will be discussed in more +detail later (@pxref{ISO 2022}), but for now suffice it to say that text +needs control functions (at least spacing), and if escape sequences are +to be used, an escape sequence introducer. It was decided to make all +text streams compatible with ASCII in the sense that the codes 0--31 +(and 128-159) would always be control codes, never graphic characters, +and where defined by the character set the @samp{SPC} character would be +assigned code 32, and @samp{DEL} would be assigned 127. Thus there are +94 code points remaining if 7 bits are used. This is the reason that +most character sets are defined using position codes in the range 1 +through 94. Then ISO 2022 compatible encodings are produced by shifting +the position codes 1 to 94 into character codes 33 to 126, or (if 8 bit +codes are available) into character codes 161 to 254. Encodings are classified as either @dfn{modal} or @dfn{non-modal}. In -a @dfn{modal encoding}, there are multiple states that the encoding can be in, -and the interpretation of the values in the stream depends on the +a @dfn{modal encoding}, there are multiple states that the encoding can +be in, and the interpretation of the values in the stream depends on the current global state of the encoding. Special values in the encoding, called @dfn{escape sequences}, are used to change the global state. JIS, for example, is a modal encoding. The bytes @samp{ESC $ B} indicate that, from then on, bytes are to be interpreted as position -codes for JISX0208, rather than as ASCII. This effect is cancelled +codes for JIS X 0208, rather than as ASCII. This effect is cancelled using the bytes @samp{ESC ( B}, which mean ``switch from whatever the -current state is to ASCII''. To switch to JISX0212, the escape sequence -@samp{ESC $ ( D}. (Note that here, as is common, the escape sequences do -in fact begin with @samp{ESC}. This is not necessarily the case, -however.) +current state is to ASCII''. To switch to JIS X 0212, the escape +sequence @samp{ESC $ ( D}. (Note that here, as is common, the escape +sequences do in fact begin with @samp{ESC}. This is not necessarily the +case, however. Some encodings use control characters called "locking +shifts" (effect persists until cancelled) to switch character sets.) -A @dfn{non-modal encoding} has no global state that extends past the + A @dfn{non-modal encoding} has no global state that extends past the character currently being interpreted. EUC, for example, is a -non-modal encoding. Characters in JISX0208 are encoded by setting -the high bit of the position codes, and characters in JISX0212 are +non-modal encoding. Characters in JIS X 0208 are encoded by setting +the high bit of the position codes, and characters in JIS X 0212 are encoded by doing the same but also prefixing the character with the byte 0x8F. The advantage of a modal encoding is that it is generally more -space-efficient, and is easily extendable because there are essentially +space-efficient, and is easily extendible because there are essentially an arbitrary number of escape sequences that can be created. The disadvantage, however, is that it is much more difficult to work with if it is not being processed in a sequential manner. In the non-modal EUC encoding, for example, the byte 0x41 always refers to the letter @samp{A}; whereas in JIS, it could either be the letter @samp{A}, or -one of the two position codes in a JISX0208 character, or one of the -two position codes in a JISX0212 character. Determining exactly which +one of the two position codes in a JIS X 0208 character, or one of the +two position codes in a JIS X 0212 character. Determining exactly which one is meant could be difficult and time-consuming if the previous -bytes in the string have not already been processed. +bytes in the string have not already been processed, or impossible if +they are drawn from an external stream that cannot be rewound. Non-modal encodings are further divided into @dfn{fixed-width} and @dfn{variable-width} formats. A fixed-width encoding always uses @@ -163,14 +214,18 @@ an encoding with a larger word size. The advantages of fixed-width encodings should be obvious. The advantages of variable-width encodings are that they are generally more space-efficient and allow -for compatibility with existing 8-bit encodings such as ASCII. +for compatibility with existing 8-bit encodings such as ASCII. (For +example, in Unicode ASCII characters are simply promoted to a 16-bit +representation. That means that every ASCII character contains a +@samp{NUL} byte; evidently all of the standard string manipulation +functions will lose badly in a fixed-width Unicode environment.) - Note that the bytes in an 8-bit encoding are often referred to -as @dfn{octets} rather than simply as bytes. This terminology -dates back to the days before 8-bit bytes were universal, when -some computers had 9-bit bytes, others had 10-bit bytes, etc. + The bytes in an 8-bit encoding are often referred to as @dfn{octets} +rather than simply as bytes. This terminology dates back to the days +before 8-bit bytes were universal, when some computers had 9-bit bytes, +others had 10-bit bytes, etc. -@node Charsets +@node Charsets, MULE Characters, Internationalization Terminology, MULE @section Charsets A @dfn{charset} in MULE is an object that encapsulates a @@ -189,7 +244,7 @@ * Predefined Charsets:: Predefined charset objects. @end menu -@node Charset Properties +@node Charset Properties, Basic Charset Functions, , Charsets @subsection Charset Properties Charsets have the following properties: @@ -261,7 +316,7 @@ then passed through the CCL program, with the resulting values used to index the font. -This is used, for example, in the Big5 character set (used in Taiwan). + This is used, for example, in the Big5 character set (used in Taiwan). This character set is not ISO-2022-compliant, and its size (94x157) does not fit within the maximum 96x96 size of ISO-2022-compliant character sets. As a result, XEmacs/MULE splits it (in a rather complex fashion, @@ -272,10 +327,11 @@ from a Big5 font. @end table -Most of the above properties can only be changed when the charset -is created. @xref{Charset Property Functions}. + Most of the above properties can only be set when the charset is +initialized, and cannot be changed later. +@xref{Charset Property Functions}. -@node Basic Charset Functions +@node Basic Charset Functions, Charset Property Functions, Charset Properties, Charsets @subsection Basic Charset Functions @defun find-charset charset-or-name @@ -298,7 +354,7 @@ @defun make-charset name doc-string props This function defines a new character set. This function is for use -with Mule support. @var{name} is a symbol, the name by which the +with MULE support. @var{name} is a symbol, the name by which the character set is normally referred. @var{doc-string} is a string describing the character set. @var{props} is a property list, describing the specific nature of the character set. The recognized @@ -326,17 +382,17 @@ displayed in the opposite direction. @end defun -@node Charset Property Functions +@node Charset Property Functions, Predefined Charsets, Basic Charset Functions, Charsets @subsection Charset Property Functions -All of these functions accept either a charset name or charset object. + All of these functions accept either a charset name or charset object. @defun charset-property charset prop This function returns property @var{prop} of @var{charset}. @xref{Charset Properties}. @end defun -Convenience functions are also provided for retrieving individual + Convenience functions are also provided for retrieving individual properties of a charset. @defun charset-name charset @@ -386,7 +442,7 @@ position codes of characters in @var{charset} into font indices. @end defun -The only property of a charset that can currently be set after + The only property of a charset that can currently be set after the charset has been created is the CCL program. @defun set-charset-ccl-program charset ccl-program @@ -394,10 +450,10 @@ @var{ccl-program}. @end defun -@node Predefined Charsets +@node Predefined Charsets, , Charset Property Functions, Charsets @subsection Predefined Charsets -The following charsets are predefined in the C code. + The following charsets are predefined in the C code. @example Name Type Fi Gr Dir Registry @@ -428,7 +484,7 @@ composite 96x96 0 l2r --- @end example -The following charsets are predefined in the Lisp code. + The following charsets are predefined in the Lisp code. @example Name Type Fi Gr Dir Registry @@ -452,11 +508,11 @@ For all of the above charsets, the dimension and number of columns are the same. -Note that ASCII, Control-1, and Composite are handled specially. + Note that ASCII, Control-1, and Composite are handled specially. This is why some of the fields are blank; and some of the filled-in fields (e.g. the type) are not really accurate. -@node MULE Characters +@node MULE Characters, Composite Characters, Charsets, MULE @section MULE Characters @defun make-char charset arg1 &optional arg2 @@ -483,10 +539,10 @@ This function returns a list of the charsets in @var{string}. @end defun -@node Composite Characters +@node Composite Characters, Coding Systems, MULE Characters, MULE @section Composite Characters -Composite characters are not yet completely implemented. + Composite characters are not yet completely implemented. @defun make-composite-char string This function converts a string into a single composite character. The @@ -514,70 +570,259 @@ left as-is. @var{buffer} defaults to the current buffer if omitted. @end defun -@node ISO 2022 -@section ISO 2022 +@node Coding Systems, CCL, Composite Characters, MULE +@section Coding Systems + + A coding system is an object that defines how text containing multiple +character sets is encoded into a stream of (typically 8-bit) bytes. The +coding system is used to decode the stream into a series of characters +(which may be from multiple charsets) when the text is read from a file +or process, and is used to encode the text back into the same format +when it is written out to a file or process. + + For example, many ISO-2022-compliant coding systems (such as Compound +Text, which is used for inter-client data under the X Window System) use +escape sequences to switch between different charsets -- Japanese Kanji, +for example, is invoked with @samp{ESC $ ( B}; ASCII is invoked with +@samp{ESC ( B}; and Cyrillic is invoked with @samp{ESC - L}. See +@code{make-coding-system} for more information. + + Coding systems are normally identified using a symbol, and the symbol is +accepted in place of the actual coding system object whenever a coding +system is called for. (This is similar to how faces and charsets work.) + +@defun coding-system-p object +This function returns non-@code{nil} if @var{object} is a coding system. +@end defun -This section briefly describes the ISO 2022 encoding standard. For more -thorough understanding, please refer to the original document of ISO -2022. +@menu +* Coding System Types:: Classifying coding systems. +* ISO 2022:: An international standard for + charsets and encodings. +* EOL Conversion:: Dealing with different ways of denoting + the end of a line. +* Coding System Properties:: Properties of a coding system. +* Basic Coding System Functions:: Working with coding systems. +* Coding System Property Functions:: Retrieving a coding system's properties. +* Encoding and Decoding Text:: Encoding and decoding text. +* Detection of Textual Encoding:: Determining how text is encoded. +* Big5 and Shift-JIS Functions:: Special functions for these non-standard + encodings. +* Predefined Coding Systems:: Coding systems implemented by MULE. +@end menu -Character sets (@dfn{charsets}) are classified into the following four -categories, according to the number of characters of charset: -94-charset, 96-charset, 94x94-charset, and 96x96-charset. +@node Coding System Types, ISO 2022, , Coding Systems +@subsection Coding System Types + + The coding system type determines the basic algorithm XEmacs will use to +decode or encode a data stream. Character encodings will be converted +to the MULE encoding, escape sequences processed, and newline sequences +converted to XEmacs's internal representation. There are three basic +classes of coding system type: no-conversion, ISO-2022, and special. + + No conversion allows you to look at the file's internal representation. +Since XEmacs is basically a text editor, "no conversion" does convert +newline conventions by default. (Use the 'binary coding-system if this +is not desired.) -@need 1000 -@table @asis -@item 94-charset - ASCII(B), left(J) and right(I) half of JISX0201, ... -@item 96-charset - Latin-1(A), Latin-2(B), Latin-3(C), ... -@item 94x94-charset - GB2312(A), JISX0208(B), KSC5601(C), ... -@item 96x96-charset - none for the moment + ISO 2022 (@pxref{ISO 2022}) is the basic international standard regulating +use of "coded character sets for the exchange of data", ie, text +streams. ISO 2022 contains functions that make it possible to encode +text streams to comply with restrictions of the Internet mail system and +de facto restrictions of most file systems (eg, use of the separator +character in file names). Coding systems which are not ISO 2022 +conformant can be difficult to handle. Perhaps more important, they are +not adaptable to multilingual information interchange, with the obvious +exception of ISO 10646 (Unicode). (Unicode is partially supported by +XEmacs with the addition of the Lisp package ucs-conv.) + + The special class of coding systems includes automatic detection, CCL (a +"little language" embedded as an interpreter, useful for translating +between variants of a single character set), non-ISO-2022-conformant +encodings like Unicode, Shift JIS, and Big5, and MULE internal coding. +(NB: this list is based on XEmacs 21.2. Terminology may vary slightly +for other versions of XEmacs and for GNU Emacs 20.) + +@table @code +@item no-conversion +No conversion, for binary files, and a few special cases of non-ISO-2022 +coding systems where conversion is done by hook functions (usually +implemented in CCL). On output, graphic characters that are not in +ASCII or Latin-1 will be replaced by a @samp{?}. (For a +no-conversion-encoded buffer, these characters will only be present if +you explicitly insert them.) +@item iso2022 +Any ISO-2022-compliant encoding. Among others, this includes JIS (the +Japanese encoding commonly used for e-mail), national variants of EUC +(the standard Unix encoding for Japanese and other languages), and +Compound Text (an encoding used in X11). You can specify more specific +information about the conversion with the @var{flags} argument. +@item ucs-4 +ISO 10646 UCS-4 encoding. A 31-bit fixed-width superset of Unicode. +@item utf-8 +ISO 10646 UTF-8 encoding. A ``file system safe'' transformation format +that can be used with both UCS-4 and Unicode. +@item undecided +Automatic conversion. XEmacs attempts to detect the coding system used +in the file. +@item shift-jis +Shift-JIS (a Japanese encoding commonly used in PC operating systems). +@item big5 +Big5 (the encoding commonly used for Taiwanese). +@item ccl +The conversion is performed using a user-written pseudo-code program. +CCL (Code Conversion Language) is the name of this pseudo-code. For +example, CCL is used to map KOI8-R characters (an encoding for Russian +Cyrillic) to ISO8859-5 (the form used internally by MULE). +@item internal +Write out or read in the raw contents of the memory representing the +buffer's text. This is primarily useful for debugging purposes, and is +only enabled when XEmacs has been compiled with @code{DEBUG_XEMACS} set +(the @samp{--debug} configure option). @strong{Warning}: Reading in a +file using @code{internal} conversion can result in an internal +inconsistency in the memory representing a buffer's text, which will +produce unpredictable results and may cause XEmacs to crash. Under +normal circumstances you should never use @code{internal} conversion. @end table -The character in parentheses after the name of each charset -is the @dfn{final character} @var{F}, which can be regarded as -the identifier of the charset. ECMA allocates @var{F} to each -charset. @var{F} is in the range of 0x30..0x7F, but 0x30..0x3F -are only for private use. +@node ISO 2022, EOL Conversion, Coding System Types, Coding Systems +@section ISO 2022 + + This section briefly describes the ISO 2022 encoding standard. A more +thorough treatment is available in the original document of ISO +2022 as well as various national standards (such as JIS X 0202). -Note: @dfn{ECMA} = European Computer Manufacturers Association + Character sets (@dfn{charsets}) are classified into the following four +categories, according to the number of characters in the charset: +94-charset, 96-charset, 94x94-charset, and 96x96-charset. This means +that although an ISO 2022 coding system may have variable width +characters, each charset used is fixed-width (in contrast to the MULE +character set and UTF-8, for example). + + ISO 2022 provides for switching between character sets via escape +sequences. This switching is somewhat complicated, because ISO 2022 +provides for both legacy applications like Internet mail that accept +only 7 significant bits in some contexts (RFC 822 headers, for example), +and more modern "8-bit clean" applications. It also provides for +compact and transparent representation of languages like Japanese which +mix ASCII and a national script (even outside of computer programs). -There are four @dfn{registers of charsets}, called G0 thru G3. -You can designate (or assign) any charset to one of these -registers. + First, ISO 2022 codified prevailing practice by dividing the code space +into "control" and "graphic" regions. The code points 0x00-0x1F and +0x80-0x9F are reserved for "control characters", while "graphic +characters" must be assigned to code points in the regions 0x20-0x7F and +0xA0-0xFF. The positions 0x20 and 0x7F are special, and under some +circumstances must be assigned the graphic character "ASCII SPACE" and +the control character "ASCII DEL" respectively. -The code space contained within one octet (of size 256) is divided into -4 areas: C0, GL, C1, and GR. GL and GR are the areas into which a -register of charset can be invoked into. + The various regions are given the name C0 (0x00-0x1F), GL (0x20-0x7F), +C1 (0x80-0x9F), and GR (0xA0-0xFF). GL and GR stand for "graphic left" +and "graphic right", respectively, because of the standard method of +displaying graphic character sets in tables with the high byte indexing +columns and the low byte indexing rows. I don't find it very intuitive, +but these are called "registers". + + An ISO 2022-conformant encoding for a graphic character set must use a +fixed number of bytes per character, and the values must fit into a +single register; that is, each byte must range over either 0x20-0x7F, or +0xA0-0xFF. It is not allowed to extend the range of the repertoire of a +character set by using both ranges at the same. This is why a standard +character set such as ISO 8859-1 is actually considered by ISO 2022 to +be an aggregation of two character sets, ASCII and LATIN-1, and why it +is technically incorrect to refer to ISO 8859-1 as "Latin 1". Also, a +single character's bytes must all be drawn from the same register; this +is why Shift JIS (for Japanese) and Big 5 (for Chinese) are not ISO +2022-compatible encodings. -@example -@group - C0: 0x00 - 0x1F - GL: 0x20 - 0x7F - C1: 0x80 - 0x9F - GR: 0xA0 - 0xFF -@end group -@end example + The reason for this restriction becomes clear when you attempt to define +an efficient, robust encoding for a language like Japanese. Like ISO +8859, Japanese encodings are aggregations of several character sets. In +practice, the vast majority of characters are drawn from the "JIS Roman" +character set (a derivative of ASCII; it won't hurt to think of it as +ASCII) and the JIS X 0208 standard "basic Japanese" character set +including not only ideographic characters ("kanji") but syllabic +Japanese characters ("kana"), a wide variety of symbols, and many +alphabetic characters (Roman, Greek, and Cyrillic) as well. Although +JIS X 0208 includes the whole Roman alphabet, as a 2-byte code it is not +suited to programming; thus the inclusion of ASCII in the standard +Japanese encodings. -Usually, in the initial state, G0 is invoked into GL, and G1 -is invoked into GR. + For normal Japanese text such as in newspapers, a broad repertoire of +approximately 3000 characters is used. Evidently this won't fit into +one byte; two must be used. But much of the text processed by Japanese +computers is computer source code, nearly all of which is ASCII. A not +insignificant portion of ordinary text is English (as such or as +borrowed Japanese vocabulary) or other languages which can represented +at least approximately in ASCII, as well. It seems reasonable then to +represent ASCII in one byte, and JIS X 0208 in two. And this is exactly +what the Extended Unix Code for Japanese (EUC-JP) does. ASCII is +invoked to the GL register, and JIS X 0208 is invoked to the GR +register. Thus, each byte can be tested for its character set by +looking at the high bit; if set, it is Japanese, if clear, it is ASCII. +Furthermore, since control characters like newline can never be part of +a graphic character, even in the case of corruption in transmission the +stream will be resynchronized at every line break, on the order of 60-80 +bytes. This coding system requires no escape sequences or special +control codes to represent 99.9% of all Japanese text. -ISO 2022 distinguishes 7-bit environments and 8-bit environments. In -7-bit environments, only C0 and GL are used. + Note carefully the distinction between the character sets (ASCII and JIS +X 0208), the encoding (EUC-JP), and the coding system (ISO 2022). The +JIS X 0208 character set is used in three different encodings for +Japanese, but in ISO-2022-JP it is invoked into GL (so the high bit is +always clear), in EUC-JP it is invoked into GR (setting the high bit in +the process), and in Shift JIS the high bit may be set or reset, and the +significant bits are shifted within the 16-bit character so that the two +main character sets can coexist with a third (the "halfwidth katakana" +of JIS X 0201). As the name implies, the ISO-2022-JP encoding is also a +version of the ISO-2022 coding system. -Charset designation is done by escape sequences of the form: + In order to systematically treat subsidiary character sets (like the +"halfwidth katakana" already mentioned, and the "supplementary kanji" of +JIS X 0212), four further registers are defined: G0, G1, G2, and G3. +Unlike GL and GR, they are not logically distinguished by internal +format. Instead, the process of "invocation" mentioned earlier is +broken into two steps: first, a character set is @dfn{designated} to one +of the registers G0-G3 by use of an @dfn{escape sequence} of the form: @example ESC [@var{I}] @var{I} @var{F} @end example -where @var{I} is an intermediate character in the range 0x20 - 0x2F, and -@var{F} is the final character identifying this charset. +where @var{I} is an intermediate character or characters in the range +0x20 - 0x3F, and @var{F}, from the range 0x30-0x7Fm is the final +character identifying this charset. (Final characters in the range +0x30-0x3F are reserved for private use and will never have a publicly +registered meaning.) + + Then that register is @dfn{invoked} to either GL or GR, either +automatically (designations to G0 normally involve invocation to GL as +well), or by use of shifting (affecting only the following character in +the data stream) or locking (effective until the next designation or +locking) control sequences. An encoding conformant to ISO 2022 is +typically defined by designating the initial contents of the G0-G3 +registers, specifying an 7 or 8 bit environment, and specifying whether +further designations will be recognized. + + Some examples of character sets and the registered final characters +@var{F} used to designate them: -The meaning of intermediate characters are: +@need 1000 +@table @asis +@item 94-charset + ASCII (B), left (J) and right (I) half of JIS X 0201, ... +@item 96-charset + Latin-1 (A), Latin-2 (B), Latin-3 (C), ... +@item 94x94-charset + GB2312 (A), JIS X 0208 (B), KSC5601 (C), ... +@item 96x96-charset + none for the moment +@end table + + The meanings of the various characters in these sequences, where not +specified by the ISO 2022 standard (such as the ESC character), are +assigned by @dfn{ECMA}, the European Computer Manufacturers Association. + + The meaning of intermediate characters are: @example @group @@ -586,19 +831,19 @@ ) [0x29]: designate to G1 a 94-charset whose final byte is @var{F}. * [0x2A]: designate to G2 a 94-charset whose final byte is @var{F}. + [0x2B]: designate to G3 a 94-charset whose final byte is @var{F}. + , [0x2C]: designate to G0 a 96-charset whose final byte is @var{F}. - [0x2D]: designate to G1 a 96-charset whose final byte is @var{F}. . [0x2E]: designate to G2 a 96-charset whose final byte is @var{F}. / [0x2F]: designate to G3 a 96-charset whose final byte is @var{F}. @end group @end example -The following rule is not allowed in ISO 2022 but can be used in Mule. + The comma may be used in files read and written only by MULE, as a MULE +extension, but this is illegal in ISO 2022. (The reason is that in ISO +2022 G0 must be a 94-member character set, with 0x20 assigned the value +SPACE, and 0x7F assigned the value DEL.) -@example - , [0x2C]: designate to G0 a 96-charset whose final byte is @var{F}. -@end example - -Here are examples of designations: + Here are examples of designations: @example @group @@ -610,12 +855,15 @@ @end group @end example -To use a charset designated to G2 or G3, and to use a charset designated +(The short forms used to designate GB2312 and JIS X 0208 are for +backwards compatibility; the long forms are preferred.) + + To use a charset designated to G2 or G3, and to use a charset designated to G1 in a 7-bit environment, you must explicitly invoke G1, G2, or G3 into GL. There are two types of invocation, Locking Shift (forever) and Single Shift (one character only). -Locking Shift is done as follows: + Locking Shift is done as follows: @example LS0 or SI (0x0F): invoke G0 into GL @@ -627,7 +875,7 @@ LS3R: invoke G3 into GR @end example -Single Shift is done as follows: + Single Shift is done as follows: @example @group @@ -636,48 +884,53 @@ @end group @end example + The shift functions (such as LS1R and SS3) are represented by control +characters (from C1) in 8 bit environments and by escape sequences in 7 +bit environments. + (#### Ben says: I think the above is slightly incorrect. It appears that SS2 invokes G2 into GR and SS3 invokes G3 into GR, whereas ESC N and ESC O behave as indicated. The above definitions will not parse EUC-encoded text correctly, and it looks like the code in mule-coding.c has similar problems.) -You may realize that there are a lot of ISO-2022-compliant ways of -encoding multilingual text. Now, in the world, there exist many coding -systems such as X11's Compound Text, Japanese JUNET code, and so-called -EUC (Extended UNIX Code); all of these are variants of ISO 2022. + Evidently there are a lot of ISO-2022-compliant ways of encoding +multilingual text. Now, in the world, there exist many coding systems +such as X11's Compound Text, Japanese JUNET code, and so-called EUC +(Extended UNIX Code); all of these are variants of ISO 2022. -In Mule, we characterize ISO 2022 by the following attributes: + In MULE, we characterize a version of ISO 2022 by the following +attributes: @enumerate @item -Initial designation to G0 thru G3. +The character sets initially designated to G0 thru G3. @item -Allow designation of short form for Japanese and Chinese. +Whether short form designations are allowed for Japanese and Chinese. @item -Should we designate ASCII to G0 before control characters? +Whether ASCII should be designated to G0 before control characters. @item -Should we designate ASCII to G0 at the end of line? +Whether ASCII should be designated to G0 at the end of line. @item 7-bit environment or 8-bit environment. @item -Use Locking Shift or not. +Whether Locking Shifts are used or not. @item -Use ASCII or JIS0201-1976-Roman. +Whether to use ASCII or the variant JIS X 0201-1976-Roman. @item -Use JISX0208-1983 or JISX0208-1976. +Whether to use JIS X 0208-1983 or the older version JIS X 0208-1976. @end enumerate (The last two are only for Japanese.) -By specifying these attributes, you can create any variant + By specifying these attributes, you can create any variant of ISO 2022. -Here are several examples: + Here are several examples: @example @group -junet -- Coding system used in JUNET. +ISO-2022-JP -- Coding system used in Japanese email (RFC 1463 #### check). 1. G0 <- ASCII, G1..3 <- never used 2. Yes. 3. Yes. @@ -685,125 +938,50 @@ 5. 7-bit environment 6. No. 7. Use ASCII - 8. Use JISX0208-1983 + 8. Use JIS X 0208-1983 @end group @group -ctext -- Compound Text - 1. G0 <- ASCII, G1 <- Latin-1, G2,3 <- never used +ctext -- X11 Compound Text + 1. G0 <- ASCII, G1 <- Latin-1, G2,3 <- never used. 2. No. 3. No. 4. Yes. - 5. 8-bit environment + 5. 8-bit environment. 6. No. - 7. Use ASCII - 8. Use JISX0208-1983 + 7. Use ASCII. + 8. Use JIS X 0208-1983. @end group @group -euc-china -- Chinese EUC. Although many people call this -as "GB encoding", the name may cause misunderstanding. - 1. G0 <- ASCII, G1 <- GB2312, G2,3 <- never used +euc-china -- Chinese EUC. Often called the "GB encoding", but that is +technically incorrect. + 1. G0 <- ASCII, G1 <- GB 2312, G2,3 <- never used. 2. No. 3. Yes. 4. Yes. - 5. 8-bit environment + 5. 8-bit environment. 6. No. - 7. Use ASCII - 8. Use JISX0208-1983 + 7. Use ASCII. + 8. Use JIS X 0208-1983. @end group @group -korean-mail -- Coding system used in Korean network. - 1. G0 <- ASCII, G1 <- KSC5601, G2,3 <- never used +ISO-2022-KR -- Coding system used in Korean email. + 1. G0 <- ASCII, G1 <- KSC 5601, G2,3 <- never used. 2. No. 3. Yes. 4. Yes. - 5. 7-bit environment + 5. 7-bit environment. 6. Yes. - 7. No. - 8. No. + 7. Use ASCII. + 8. Use JIS X 0208-1983. @end group @end example -Mule creates all these coding systems by default. - -@node Coding Systems -@section Coding Systems - -A coding system is an object that defines how text containing multiple -character sets is encoded into a stream of (typically 8-bit) bytes. The -coding system is used to decode the stream into a series of characters -(which may be from multiple charsets) when the text is read from a file -or process, and is used to encode the text back into the same format -when it is written out to a file or process. - -For example, many ISO-2022-compliant coding systems (such as Compound -Text, which is used for inter-client data under the X Window System) use -escape sequences to switch between different charsets---Japanese Kanji, -for example, is invoked with @samp{ESC $ ( B}; ASCII is invoked with -@samp{ESC ( B}; and Cyrillic is invoked with @samp{ESC - L}. See -@code{make-coding-system} for more information. - -Coding systems are normally identified using a symbol, and the symbol is -accepted in place of the actual coding system object whenever a coding -system is called for. (This is similar to how faces and charsets work.) - -@defun coding-system-p object -This function returns non-@code{nil} if @var{object} is a coding system. -@end defun +MULE creates all of these coding systems by default. -@menu -* Coding System Types:: Classifying coding systems. -* EOL Conversion:: Dealing with different ways of denoting - the end of a line. -* Coding System Properties:: Properties of a coding system. -* Basic Coding System Functions:: Working with coding systems. -* Coding System Property Functions:: Retrieving a coding system's properties. -* Encoding and Decoding Text:: Encoding and decoding text. -* Detection of Textual Encoding:: Determining how text is encoded. -* Big5 and Shift-JIS Functions:: Special functions for these non-standard - encodings. -@end menu - -@node Coding System Types -@subsection Coding System Types - -@table @code -@item nil -@itemx autodetect -Automatic conversion. XEmacs attempts to detect the coding system used -in the file. -@item no-conversion -No conversion. Use this for binary files and such. On output, graphic -characters that are not in ASCII or Latin-1 will be replaced by a -@samp{?}. (For a no-conversion-encoded buffer, these characters will -only be present if you explicitly insert them.) -@item shift-jis -Shift-JIS (a Japanese encoding commonly used in PC operating systems). -@item iso2022 -Any ISO-2022-compliant encoding. Among other things, this includes JIS -(the Japanese encoding commonly used for e-mail), national variants of -EUC (the standard Unix encoding for Japanese and other languages), and -Compound Text (an encoding used in X11). You can specify more specific -information about the conversion with the @var{flags} argument. -@item big5 -Big5 (the encoding commonly used for Taiwanese). -@item ccl -The conversion is performed using a user-written pseudo-code program. -CCL (Code Conversion Language) is the name of this pseudo-code. -@item internal -Write out or read in the raw contents of the memory representing the -buffer's text. This is primarily useful for debugging purposes, and is -only enabled when XEmacs has been compiled with @code{DEBUG_XEMACS} set -(the @samp{--debug} configure option). @strong{Warning}: Reading in a -file using @code{internal} conversion can result in an internal -inconsistency in the memory representing a buffer's text, which will -produce unpredictable results and may cause XEmacs to crash. Under -normal circumstances you should never use @code{internal} conversion. -@end table - -@node EOL Conversion +@node EOL Conversion, Coding System Properties, ISO 2022, Coding Systems @subsection EOL Conversion @table @code @@ -830,7 +1008,7 @@ internally, and @code{coding-system-property} will return @code{nil}.) @end table -@node Coding System Properties +@node Coding System Properties, Basic Coding System Functions, EOL Conversion, Coding Systems @subsection Coding System Properties @table @code @@ -842,6 +1020,18 @@ End-of-line conversion to be used. It should be one of the types listed in @ref{EOL Conversion}. +@item eol-lf +The coding system which is the same as this one, except that it uses the +Unix line-breaking convention. + +@item eol-crlf +The coding system which is the same as this one, except that it uses the +DOS line-breaking convention. + +@item eol-cr +The coding system which is the same as this one, except that it uses the +Macintosh line-breaking convention. + @item post-read-conversion Function called after a file has been read in, to perform the decoding. Called with two arguments, @var{beg} and @var{end}, denoting a region of @@ -853,7 +1043,7 @@ the current buffer to be encoded. @end table -The following additional properties are recognized if @var{type} is + The following additional properties are recognized if @var{type} is @code{iso2022}: @table @code @@ -931,7 +1121,7 @@ specification is the same as for @code{input-charset-conversion}. @end table -The following additional properties are recognized (and required) if + The following additional properties are recognized (and required) if @var{type} is @code{ccl}: @table @code @@ -942,13 +1132,16 @@ CCL program used for encoding (converting to external format). @end table -@node Basic Coding System Functions + The following properties are used internally: @var{eol-cr}, +@var{eol-crlf}, @var{eol-lf}, and @var{base}. + +@node Basic Coding System Functions, Coding System Property Functions, Coding System Properties, Coding Systems @subsection Basic Coding System Functions @defun find-coding-system coding-system-or-name This function retrieves the coding system of the given name. -If @var{coding-system-or-name} is a coding-system object, it is simply + If @var{coding-system-or-name} is a coding-system object, it is simply returned. Otherwise, @var{coding-system-or-name} should be a symbol. If there is no such coding system, @code{nil} is returned. Otherwise the associated coding system object is returned. @@ -968,6 +1161,11 @@ This function returns the name of the given coding system. @end defun +@defun coding-system-base coding-system +Returns the base coding system (undecided EOL convention) +coding system. +@end defun + @defun make-coding-system name type &optional doc-string props This function registers symbol @var{name} as a coding system. @@ -992,7 +1190,7 @@ @var{coding-system} with eol type @var{eol-type}. @end defun -@node Coding System Property Functions +@node Coding System Property Functions, Encoding and Decoding Text, Basic Coding System Functions, Coding Systems @subsection Coding System Property Functions @defun coding-system-doc-string coding-system @@ -1007,7 +1205,7 @@ This function returns the @var{prop} property of @var{coding-system}. @end defun -@node Encoding and Decoding Text +@node Encoding and Decoding Text, Detection of Textual Encoding, Coding System Property Functions, Coding Systems @subsection Encoding and Decoding Text @defun decode-coding-region start end coding-system &optional buffer @@ -1028,7 +1226,7 @@ defaults to the current buffer if unspecified. @end defun -@node Detection of Textual Encoding +@node Detection of Textual Encoding, Big5 and Shift-JIS Functions, Encoding and Decoding Text, Coding Systems @subsection Detection of Textual Encoding @defun coding-category-list @@ -1064,20 +1262,20 @@ defaults to the current buffer. @end defun -@node Big5 and Shift-JIS Functions +@node Big5 and Shift-JIS Functions, Predefined Coding Systems, Detection of Textual Encoding, Coding Systems @subsection Big5 and Shift-JIS Functions -These are special functions for working with the non-standard + These are special functions for working with the non-standard Shift-JIS and Big5 encodings. @defun decode-shift-jis-char code -This function decodes a JISX0208 character of Shift-JIS coding-system. +This function decodes a JIS X 0208 character of Shift-JIS coding-system. @var{code} is the character code in Shift-JIS as a cons of type bytes. The corresponding character is returned. @end defun @defun encode-shift-jis-char ch -This function encodes a JISX0208 character @var{ch} to SHIFT-JIS +This function encodes a JIS X 0208 character @var{ch} to SHIFT-JIS coding-system. The corresponding character code in SHIFT-JIS is returned as a cons of two bytes. @end defun @@ -1093,10 +1291,379 @@ coding-system. The corresponding character code in Big5 is returned. @end defun +@node Predefined Coding Systems, , Big5 and Shift-JIS Functions, Coding Systems +@subsection Coding Systems Implemented + + MULE initializes most of the commonly used coding systems at XEmacs's +startup. A few others are initialized only when the relevant language +environment is selected and support libraries are loaded. (NB: The +following list is based on XEmacs 21.2.19, the development branch at the +time of writing. The list may be somewhat different for other +versions. Recent versions of GNU Emacs 20 implement a few more rare +coding systems; work is being done to port these to XEmacs.) + + Unfortunately, there is not a consistent naming convention for character +sets, and for practical purposes coding systems often take their name +from their principal character sets (ASCII, KOI8-R, Shift JIS). Others +take their names from the coding system (ISO-2022-JP, EUC-KR), and a few +from their non-text usages (internal, binary). To provide for this, and +for the fact that many coding systems have several common names, an +aliasing system is provided. Finally, some effort has been made to use +names that are registered as MIME charsets (this is why the name +'shift_jis contains that un-Lisp-y underscore). + + There is a systematic naming convention regarding end-of-line (EOL) +conventions for different systems. A coding system whose name ends in +"-unix" forces the assumptions that lines are broken by newlines (0x0A). +A coding system whose name ends in "-mac" forces the assumptions that +lines are broken by ASCII CRs (0x0D). A coding system whose name ends +in "-dos" forces the assumptions that lines are broken by CRLF sequences +(0x0D 0x0A). These subsidiary coding systems are automatically derived +from a base coding system. Use of the base coding system implies +autodetection of the text file convention. (The fact that the -unix, +-mac, and -dos are derived from a base system results in them showing up +as "aliases" in `list-coding-systems'.) These subsidiaries have a +consistent modeline indicator as well. "-dos" coding systems have ":T" +appended to their modeline indicator, while "-mac" coding systems have +":t" appended (eg, "ISO8:t" for iso-2022-8-mac). + + In the following table, each coding system is given with its mode line +indicator in parentheses. Non-textual coding systems are listed first, +followed by textual coding systems and their aliases. (The coding system +subsidiary modeline indicators ":T" and ":t" will be omitted from the +table of coding systems.) + + ### SJT 1999-08-23 Maybe should order these by language? Definitely +need language usage for the ISO-8859 family. + + Note that although true coding system aliases have been implemented for +XEmacs 21.2, the coding system initialization has not yet been converted +as of 21.2.19. So coding systems described as aliases have the same +properties as the aliased coding system, but will not be equal as Lisp +objects. + +@table @code + +@item automatic-conversion +@itemx undecided +@itemx undecided-dos +@itemx undecided-mac +@itemx undecided-unix + +Modeline indicator: @code{Auto}. A type @code{undecided} coding system. +Attempts to determine an appropriate coding system from file contents or +the environment. + +@item raw-text +@itemx no-conversion +@itemx raw-text-dos +@itemx raw-text-mac +@itemx raw-text-unix +@itemx no-conversion-dos +@itemx no-conversion-mac +@itemx no-conversion-unix + +Modeline indicator: @code{Raw}. A type @code{no-conversion} coding system, +which converts only line-break-codes. An implementation quirk means +that this coding system is also used for ISO8859-1. + +@item binary +Modeline indicator: @code{Binary}. A type @code{no-conversion} coding +system which does no character coding or EOL conversions. An alias for +@code{raw-text-unix}. + +@item alternativnyj +@itemx alternativnyj-dos +@itemx alternativnyj-mac +@itemx alternativnyj-unix + +Modeline indicator: @code{Cy.Alt}. A type @code{ccl} coding system used for +Alternativnyj, an encoding of the Cyrillic alphabet. + +@item big5 +@itemx big5-dos +@itemx big5-mac +@itemx big5-unix + +Modeline indicator: @code{Zh/Big5}. A type @code{big5} coding system used for +BIG5, the most common encoding of traditional Chinese as used in Taiwan. + +@item cn-gb-2312 +@itemx cn-gb-2312-dos +@itemx cn-gb-2312-mac +@itemx cn-gb-2312-unix + +Modeline indicator: @code{Zh-GB/EUC}. A type @code{iso2022} coding system used +for simplified Chinese (as used in the People's Republic of China), with +the @code{ascii} (G0), @code{chinese-gb2312} (G1), and @code{sisheng} +(G2) character sets initially designated. Chinese EUC (Extended Unix +Code). + +@item ctext-hebrew +@itemx ctext-hebrew-dos +@itemx ctext-hebrew-mac +@itemx ctext-hebrew-unix + +Modeline indicator: @code{CText/Hbrw}. A type @code{iso2022} coding system +with the @code{ascii} (G0) and @code{hebrew-iso8859-8} (G1) character +sets initially designated for Hebrew. + +@item ctext +@itemx ctext-dos +@itemx ctext-mac +@itemx ctext-unix + +Modeline indicator: @code{CText}. A type @code{iso2022} 8-bit coding system +with the @code{ascii} (G0) and @code{latin-iso8859-1} (G1) character +sets initially designated. X11 Compound Text Encoding. Often +mistakenly recognized instead of EUC encodings; usual cause is +inappropriate setting of @code{coding-priority-list}. + +@item escape-quoted + +Modeline indicator: @code{ESC/Quot}. A type @code{iso2022} 8-bit coding +system with the @code{ascii} (G0) and @code{latin-iso8859-1} (G1) +character sets initially designated and escape quoting. Unix EOL +conversion (ie, no conversion). It is used for .ELC files. + +@item euc-jp +@itemx euc-jp-dos +@itemx euc-jp-mac +@itemx euc-jp-unix + +Modeline indicator: @code{Ja/EUC}. A type @code{iso2022} 8-bit coding system +with @code{ascii} (G0), @code{japanese-jisx0208} (G1), +@code{katakana-jisx0201} (G2), and @code{japanese-jisx0212} (G3) +initially designated. Japanese EUC (Extended Unix Code). + +@item euc-kr +@itemx euc-kr-dos +@itemx euc-kr-mac +@itemx euc-kr-unix + +Modeline indicator: @code{ko/EUC}. A type @code{iso2022} 8-bit coding system +with @code{ascii} (G0) and @code{korean-ksc5601} (G1) initially +designated. Korean EUC (Extended Unix Code). + +@item hz-gb-2312 +Modeline indicator: @code{Zh-GB/Hz}. A type @code{no-conversion} coding +system with Unix EOL convention (ie, no conversion) using +post-read-decode and pre-write-encode functions to translate the Hz/ZW +coding system used for Chinese. + +@item iso-2022-7bit +@itemx iso-2022-7bit-unix +@itemx iso-2022-7bit-dos +@itemx iso-2022-7bit-mac +@itemx iso-2022-7 + +Modeline indicator: @code{ISO7}. A type @code{iso2022} 7-bit coding system +with @code{ascii} (G0) initially designated. Other character sets must +be explicitly designated to be used. + +@item iso-2022-7bit-ss2 +@itemx iso-2022-7bit-ss2-dos +@itemx iso-2022-7bit-ss2-mac +@itemx iso-2022-7bit-ss2-unix + +Modeline indicator: @code{ISO7/SS}. A type @code{iso2022} 7-bit coding system +with @code{ascii} (G0) initially designated. Other character sets must +be explicitly designated to be used. SS2 is used to invoke a +96-charset, one character at a time. + +@item iso-2022-8 +@itemx iso-2022-8-dos +@itemx iso-2022-8-mac +@itemx iso-2022-8-unix + +Modeline indicator: @code{ISO8}. A type @code{iso2022} 8-bit coding system +with @code{ascii} (G0) and @code{latin-iso8859-1} (G1) initially +designated. Other character sets must be explicitly designated to be +used. No single-shift or locking-shift. + +@item iso-2022-8bit-ss2 +@itemx iso-2022-8bit-ss2-dos +@itemx iso-2022-8bit-ss2-mac +@itemx iso-2022-8bit-ss2-unix + +Modeline indicator: @code{ISO8/SS}. A type @code{iso2022} 8-bit coding system +with @code{ascii} (G0) and @code{latin-iso8859-1} (G1) initially +designated. Other character sets must be explicitly designated to be +used. SS2 is used to invoke a 96-charset, one character at a time. + +@item iso-2022-int-1 +@itemx iso-2022-int-1-dos +@itemx iso-2022-int-1-mac +@itemx iso-2022-int-1-unix + +Modeline indicator: @code{INT-1}. A type @code{iso2022} 7-bit coding system +with @code{ascii} (G0) and @code{korean-ksc5601} (G1) initially +designated. ISO-2022-INT-1. + +@item iso-2022-jp-1978-irv +@itemx iso-2022-jp-1978-irv-dos +@itemx iso-2022-jp-1978-irv-mac +@itemx iso-2022-jp-1978-irv-unix + +Modeline indicator: @code{Ja-78/7bit}. A type @code{iso2022} 7-bit coding +system. For compatibility with old Japanese terminals; if you need to +know, look at the source. + +@item iso-2022-jp +@itemx iso-2022-jp-2 (ISO7/SS) +@itemx iso-2022-jp-dos +@itemx iso-2022-jp-mac +@itemx iso-2022-jp-unix +@itemx iso-2022-jp-2-dos +@itemx iso-2022-jp-2-mac +@itemx iso-2022-jp-2-unix + +Modeline indicator: @code{MULE/7bit}. A type @code{iso2022} 7-bit coding +system with @code{ascii} (G0) initially designated, and complex +specifications to insure backward compatibility with old Japanese +systems. Used for communication with mail and news in Japan. The "-2" +versions also use SS2 to invoke a 96-charset one character at a time. + +@item iso-2022-kr +Modeline indicator: @code{Ko/7bit} A type @code{iso2022} 7-bit coding +system with @code{ascii} (G0) and @code{korean-ksc5601} (G1) initially +designated. Used for e-mail in Korea. + +@item iso-2022-lock +@itemx iso-2022-lock-dos +@itemx iso-2022-lock-mac +@itemx iso-2022-lock-unix + +Modeline indicator: @code{ISO7/Lock}. A type @code{iso2022} 7-bit coding +system with @code{ascii} (G0) initially designated, using Locking-Shift +to invoke a 96-charset. + +@item iso-8859-1 +@itemx iso-8859-1-dos +@itemx iso-8859-1-mac +@itemx iso-8859-1-unix + +Due to implementation, this is not a type @code{iso2022} coding system, +but rather an alias for the @code{raw-text} coding system. + +@item iso-8859-2 +@itemx iso-8859-2-dos +@itemx iso-8859-2-mac +@itemx iso-8859-2-unix + +Modeline indicator: @code{MIME/Ltn-2}. A type @code{iso2022} coding +system with @code{ascii} (G0) and @code{latin-iso8859-2} (G1) initially +invoked. + +@item iso-8859-3 +@itemx iso-8859-3-dos +@itemx iso-8859-3-mac +@itemx iso-8859-3-unix + +Modeline indicator: @code{MIME/Ltn-3}. A type @code{iso2022} coding system +with @code{ascii} (G0) and @code{latin-iso8859-3} (G1) initially +invoked. + +@item iso-8859-4 +@itemx iso-8859-4-dos +@itemx iso-8859-4-mac +@itemx iso-8859-4-unix + +Modeline indicator: @code{MIME/Ltn-4}. A type @code{iso2022} coding system +with @code{ascii} (G0) and @code{latin-iso8859-4} (G1) initially +invoked. + +@item iso-8859-5 +@itemx iso-8859-5-dos +@itemx iso-8859-5-mac +@itemx iso-8859-5-unix + +Modeline indicator: @code{ISO8/Cyr}. A type @code{iso2022} coding system with +@code{ascii} (G0) and @code{cyrillic-iso8859-5} (G1) initially invoked. + +@item iso-8859-7 +@itemx iso-8859-7-dos +@itemx iso-8859-7-mac +@itemx iso-8859-7-unix + +Modeline indicator: @code{Grk}. A type @code{iso2022} coding system with +@code{ascii} (G0) and @code{greek-iso8859-7} (G1) initially invoked. + +@item iso-8859-8 +@itemx iso-8859-8-dos +@itemx iso-8859-8-mac +@itemx iso-8859-8-unix + +Modeline indicator: @code{MIME/Hbrw}. A type @code{iso2022} coding system with +@code{ascii} (G0) and @code{hebrew-iso8859-8} (G1) initially invoked. + +@item iso-8859-9 +@itemx iso-8859-9-dos +@itemx iso-8859-9-mac +@itemx iso-8859-9-unix + +Modeline indicator: @code{MIME/Ltn-5}. A type @code{iso2022} coding system +with @code{ascii} (G0) and @code{latin-iso8859-9} (G1) initially +invoked. + +@item koi8-r +@itemx koi8-r-dos +@itemx koi8-r-mac +@itemx koi8-r-unix + +Modeline indicator: @code{KOI8}. A type @code{ccl} coding-system used for +KOI8-R, an encoding of the Cyrillic alphabet. + +@item shift_jis +@itemx shift_jis-dos +@itemx shift_jis-mac +@itemx shift_jis-unix + +Modeline indicator: @code{Ja/SJIS}. A type @code{shift-jis} coding-system +implementing the Shift-JIS encoding for Japanese. The underscore is to +conform to the MIME charset implementing this encoding. + +@item tis-620 +@itemx tis-620-dos +@itemx tis-620-mac +@itemx tis-620-unix + +Modeline indicator: @code{TIS620}. A type @code{ccl} encoding for Thai. The +external encoding is defined by TIS620, the internal encoding is +peculiar to MULE, and called @code{thai-xtis}. + +@item viqr + +Modeline indicator: @code{VIQR}. A type @code{no-conversion} coding +system with Unix EOL convention (ie, no conversion) using +post-read-decode and pre-write-encode functions to translate the VIQR +coding system for Vietnamese. + +@item viscii +@itemx viscii-dos +@itemx viscii-mac +@itemx viscii-unix + +Modeline indicator: @code{VISCII}. A type @code{ccl} coding-system used +for VISCII 1.1 for Vietnamese. Differs slightly from VSCII; VISCII is +given priority by XEmacs. + +@item vscii +@itemx vscii-dos +@itemx vscii-mac +@itemx vscii-unix + +Modeline indicator: @code{VSCII}. A type @code{ccl} coding-system used +for VSCII 1.1 for Vietnamese. Differs slightly from VISCII, which is +given priority by XEmacs. Use +@code{(prefer-coding-system 'vietnamese-vscii)} to give priority to VSCII. + +@end table + @node CCL, Category Tables, Coding Systems, MULE @section CCL -CCL (Code Conversion Language) is a simple structured programming + CCL (Code Conversion Language) is a simple structured programming language designed for character coding conversions. A CCL program is compiled to CCL code (represented by a vector of integers) and executed by the CCL interpreter embedded in Emacs. The CCL interpreter @@ -1107,7 +1674,7 @@ statements and operations, especially for multiple return values and I/O operations). -CCL is used for code conversion during process I/O and file I/O for + CCL is used for code conversion during process I/O and file I/O for non-ISO2022 coding systems. (It is the only way for a user to specify a code conversion function.) It is also used for calculating the code point of an X11 font from a character code. However, since CCL is @@ -1116,14 +1683,14 @@ three or more arithmetic operations can be calculated faster by CCL than by Emacs Lisp. -@strong{Warning:} The code in @file{src/mule-ccl.c} and + @strong{Warning:} The code in @file{src/mule-ccl.c} and @file{$packages/lisp/mule-base/mule-ccl.el} is the definitive description of CCL's semantics. The previous version of this section contained several typos and obsolete names left from earlier versions of MULE, and many may remain. (I am not an experienced CCL programmer; the few who know CCL well find writing English painful.) -A CCL program transforms an input data stream into an output data + A CCL program transforms an input data stream into an output data stream. The input stream, held in a buffer of constant bytes, is left unchanged. The buffer may be filled by an external input operation, taken from an Emacs buffer, or taken from a Lisp string. The output @@ -1131,7 +1698,7 @@ output operation, inserted into an Emacs buffer, or returned as a Lisp string. -A CCL program is a (Lisp) list containing two or three members. The + A CCL program is a (Lisp) list containing two or three members. The first member is the @dfn{buffer magnification}, which indicates the required minimum size of the output buffer as a multiple of the input buffer. It is followed by the @dfn{main block} which executes while @@ -1139,7 +1706,7 @@ executed when the input is exhausted. Both the main block and the EOF block are CCL blocks. -A @dfn{CCL block} is either a CCL statement or list of CCL statements. + A @dfn{CCL block} is either a CCL statement or list of CCL statements. A @dfn{CCL statement} is either a @dfn{set statement} (either an integer or an @dfn{assignment}, which is a list of a register to receive the assignment, an assignment operator, and an expression) or a @dfn{control @@ -1154,11 +1721,11 @@ * CCL Examples:: The encoding functions for Big5 and KOI-8. @end menu -@node CCL Syntax, CCL Statements, CCL, CCL +@node CCL Syntax, CCL Statements, , CCL @comment Node, Next, Previous, Up @subsection CCL Syntax -The full syntax of a CCL program in BNF notation: + The full syntax of a CCL program in BNF notation: @format CCL_PROGRAM := @@ -1217,13 +1784,13 @@ @comment Node, Next, Previous, Up @subsection CCL Statements -The Emacs Code Conversion Language provides the following statement + The Emacs Code Conversion Language provides the following statement types: @dfn{set}, @dfn{if}, @dfn{branch}, @dfn{loop}, @dfn{repeat}, @dfn{break}, @dfn{read}, @dfn{write}, @dfn{call}, and @dfn{end}. @heading Set statement: -The @dfn{set} statement has three variants with the syntaxes + The @dfn{set} statement has three variants with the syntaxes @samp{(@var{reg} = @var{expression})}, @samp{(@var{reg} @var{assignment_operator} @var{expression})}, and @samp{@var{integer}}. The assignment operator variation of the @@ -1236,10 +1803,10 @@ @heading I/O statements: -The @dfn{read} statement takes one or more registers as arguments. It + The @dfn{read} statement takes one or more registers as arguments. It reads one byte (a C char) from the input into each register in turn. -The @dfn{write} takes several forms. In the form @samp{(write @var{reg} + The @dfn{write} takes several forms. In the form @samp{(write @var{reg} ...)} it takes one or more registers as arguments and writes each in turn to the output. The integer in a register (interpreted as an Emchar) is encoded to multibyte form (ie, Bufbytes) and written to the @@ -1253,13 +1820,13 @@ @heading Conditional statements: -The @dfn{if} statement takes an @var{expression}, a @var{CCL block}, and + The @dfn{if} statement takes an @var{expression}, a @var{CCL block}, and an optional @var{second CCL block} as arguments. If the @var{expression} evaluates to non-zero, the first @var{CCL block} is executed. Otherwise, if there is a @var{second CCL block}, it is executed. -The @dfn{read-if} variant of the @dfn{if} statement takes an + The @dfn{read-if} variant of the @dfn{if} statement takes an @var{expression}, a @var{CCL block}, and an optional @var{second CCL block} as arguments. The @var{expression} must have the form @code{(@var{reg} @var{operator} @var{operand})} (where @var{operand} is @@ -1268,7 +1835,7 @@ then conditionally executes a CCL block just as the @code{if} statement does. -The @dfn{branch} statement takes an @var{expression} and one or more CCL + The @dfn{branch} statement takes an @var{expression} and one or more CCL blocks as arguments. The CCL blocks are treated as a zero-indexed array, and the @code{branch} statement uses the @var{expression} as the index of the CCL block to execute. Null CCL blocks may be used as @@ -1276,7 +1843,7 @@ @code{branch} statement in the containing CCL block. Out-of-range values for the @var{EXPRESSION} are also treated as no-ops. -The @dfn{read-branch} variant of the @dfn{branch} statement takes an + The @dfn{read-branch} variant of the @dfn{branch} statement takes an @var{register}, a @var{CCL block}, and an optional @var{second CCL block} as arguments. The @code{read-branch} statement first reads from the input into the @var{register}, then conditionally executes a CCL @@ -1284,16 +1851,16 @@ @heading Loop control statements: -The @dfn{loop} statement creates a block with an implied jump from the + The @dfn{loop} statement creates a block with an implied jump from the end of the block back to its head. The loop is exited on a @code{break} statement, and continued without executing the tail by a @code{repeat} statement. -The @dfn{break} statement, written @samp{(break)}, terminates the + The @dfn{break} statement, written @samp{(break)}, terminates the current loop and continues with the next statement in the current block. -The @dfn{repeat} statement has three variants, @code{repeat}, + The @dfn{repeat} statement has three variants, @code{repeat}, @code{write-repeat}, and @code{write-read-repeat}. Each continues the current loop from its head, possibly after performing I/O. @code{repeat} takes no arguments and does no I/O before jumping. @@ -1309,11 +1876,11 @@ @heading Other control statements: -The @dfn{call} statement, written @samp{(call @var{ccl-program-name})}, + The @dfn{call} statement, written @samp{(call @var{ccl-program-name})}, executes a CCL program as a subroutine. It does not return a value to the caller, but can modify the register status. -The @dfn{end} statement, written @samp{(end)}, terminates the CCL + The @dfn{end} statement, written @samp{(end)}, terminates the CCL program successfully, and returns to caller (which may be a CCL program). It does not alter the status of the registers. @@ -1321,13 +1888,13 @@ @comment Node, Next, Previous, Up @subsection CCL Expressions -CCL, unlike Lisp, uses infix expressions. The simplest CCL expressions + CCL, unlike Lisp, uses infix expressions. The simplest CCL expressions consist of a single @var{operand}, either a register (one of @code{r0}, ..., @code{r0}) or an integer. Complex expressions are lists of the form @code{( @var{expression} @var{operator} @var{operand} )}. Unlike C, assignments are not expressions. -In the following table, @var{X} is the target resister for a @dfn{set}. + In the following table, @var{X} is the target resister for a @dfn{set}. In subexpressions, this is implicitly @code{r7}. This means that @code{>8}, @code{//}, @code{de-sjis}, and @code{en-sjis} cannot be used freely in subexpressions, since they return parts of their values in @@ -1361,7 +1928,7 @@ @item @tab @tab @tab r[7] = LOWER_BYTE (DE-SJIS (Y, Z)) @end multitable -The CCL operators are as in C, with the addition of CCL_LSH8, CCL_RSH8, + The CCL operators are as in C, with the addition of CCL_LSH8, CCL_RSH8, CCL_DIVMOD, CCL_ENCODE_SJIS, and CCL_DECODE_SJIS. The CCL_ENCODE_SJIS and CCL_DECODE_SJIS treat their first and second bytes as the high and low bytes of a two-byte character code. (SJIS stands for Shift JIS, an @@ -1370,11 +1937,11 @@ Shift JIS. CCL_DECODE_SJIS is its inverse.) It is somewhat odd to represent the SJIS operations in infix form. -@node Calling CCL, CCL Examples, CCL Expressions, CCL +@node Calling CCL, CCL Examples, CCL Expressions, CCL @comment Node, Next, Previous, Up @subsection Calling CCL -CCL programs are called automatically during Emacs buffer I/O when the + CCL programs are called automatically during Emacs buffer I/O when the external representation has a coding system type of @code{shift-jis}, @code{big5}, or @code{ccl}. The program is specified by the coding system (@pxref{Coding Systems}). You can also call CCL programs from @@ -1411,7 +1978,7 @@ registers and IC. Returns the resulting string. @end defun -To call a CCL program from another CCL program, it must first be + To call a CCL program from another CCL program, it must first be registered: @defun register-ccl-program name ccl-program @@ -1421,7 +1988,7 @@ program. @end defun -Information about the processor time used by the CCL interpreter can be + Information about the processor time used by the CCL interpreter can be obtained using these functions: @defun ccl-elapsed-time @@ -1436,11 +2003,11 @@ Resets the CCL interpreter's internal elapsed time registers. @end defun -@node CCL Examples, , Calling CCL, CCL +@node CCL Examples, , Calling CCL, CCL @comment Node, Next, Previous, Up @subsection CCL Examples -This section is not yet written. + This section is not yet written. @node Category Tables, , CCL, MULE @section Category Tables diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/postgresql.texi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/lispref/postgresql.texi Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,1257 @@ +@c -*-texinfo-*- +@c This is part of the XEmacs Lisp Reference Manual. +@c Copyright (C) 2000 Electrotechnical Laboratory, JAPAN +@c Licensed to the Free Software Foundation +@c See the file lispref.texi for copying conditions. +@c Thank you Oscar Figueiredo! This file was shamelessly cloned from +@c ldap.texi. +@setfilename ../../info/postgresql.info +@node PostgreSQL Support, Internationalization, LDAP Support, top +@chapter PostgreSQL Support +@cindex PostgreSQL + +XEmacs can be linked with PostgreSQL libpq run-time support to provide +relational database access from Emacs Lisp code. + +@menu +* Building XEmacs with PostgreSQL support:: +* XEmacs PostgreSQL libpq API:: +* XEmacs PostgreSQL libpq Examples:: +@end menu + +@node Building XEmacs with PostgreSQL support, XEmacs PostgreSQL libpq API, ,PostgreSQL Support +@comment node-name, next, previous, up +@section Building XEmacs with PostgreSQL support + +XEmacs PostgreSQL support requires linking to the PostgreSQL libpq +library. Describing how to build and install PostgreSQL is beyond the +scope of this document. See the PostgreSQL manual for details. + +If you have installed XEmacs from one of the binary kits on +(@url{ftp://ftp.xemacs.org/}), or are using an XEmacs binary from a CD +ROM, you may have XEmacs PostgreSQL support by default. @code{M-x +describe-installation} will tell you if you do. + +If you are building XEmacs from source, you need to install PostgreSQL +first. On some systems, PostgreSQL will come pre-installed in /usr. In +this case, it should be autodetected when you run configure. If +PostgreSQL is installed into its default location, +@file{/usr/local/pgsql}, you must specify +@code{--site-prefixes=/usr/local/pgsql} when you run configure. If +PostgreSQL is installed into another location, use that instead of +@file{/usr/local/pgsql} when specifying @code{--site-prefixes}. + +As of XEmacs 21.2, PostgreSQL versions 6.5.3 and 7.0 are supported. +XEmacs Lisp support for V7.0 is somewhat more extensive than support for +V6.5. In particular, asynchronous queries are supported. + +@node XEmacs PostgreSQL libpq API, XEmacs PostgreSQL libpq Examples, Building XEmacs with PostgreSQL support, PostgreSQL Support +@comment node-name, next, previous, up +@section XEmacs PostgreSQL libpq API + +The XEmacs PostgreSQL API is intended to be a policy-free, low-level +binding to libpq. The intent is to provide all the basic functionality +and then let high level Lisp code decide its own policies. + +This documentation assumes that the reader has knowledge of SQL, but +requires no prior knowledge of libpq. + +There are many examples in this manual and some setup will be required. +In order to run most of the following examples, the following code needs +to be executed. In addition to the data is in this table, nearly all of +the examples will assume that the free variable @code{P} refers to this +database connection. The examples in the original edition of this +manual were run against Postgres 7.0beta1. + +@example +(progn + (setq P (pq-connectdb "")) + ;; id is the primary key, shikona is a Japanese word that + ;; means `the professional name of a Sumo wrestler', and + ;; rank is the Sumo rank name. + (pq-exec P (concat "CREATE TABLE xemacs_test" + " (id int, shikona text, rank text);")) + (pq-exec P "COPY xemacs_test FROM stdin;") + (pq-put-line P "1\tMusashimaru\tYokuzuna\n") + (pq-put-line P "2\tDejima\tOozeki\n") + (pq-put-line P "3\tMusoyama\tSekiwake\n") + (pq-put-line P "4\tMiyabiyama\tSekiwake\n") + (pq-put-line P "5\tWakanoyama\tMaegashira\n") + (pq-put-line P "\\.\n") + (pq-end-copy P)) + @result{} nil +@end example + +@menu +* libpq Lisp Variables:: +* libpq Lisp Symbols and DataTypes:: +* Synchronous Interface Functions:: +* Asynchronous Interface Functions:: +* Large Object Support:: +* Other libpq Functions:: +* Unimplemented libpq Functions:: +@end menu + +@node libpq Lisp Variables, libpq Lisp Symbols and DataTypes, XEmacs PostgreSQL libpq API, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection libpq Lisp Variables + +Various Unix environment variables are used by libpq to provide defaults +to the many different parameters. In the XEmacs Lisp API, these +environment variables are bound to Lisp variables to provide more +convenient access to Lisp Code. These variables are passed to the +backend database server during the establishment of a database +connection and when the @code{pq-setenv} call is made. + +@defvar pg:host +Initialized from the @var{PGHOST} environment variable. The default +host to connect to. +@end defvar + +@defvar pg:user +Initialized from the @var{PGUSER} environment variable. The default +database user name. +@end defvar + +@defvar pg:options +Initialized from the @var{PGOPTIONS} environment variable. Default +additional server options. +@end defvar + +@defvar pg:port +Initialized from the @var{PGPORT} environment variable. The default TCP +port to connect to. +@end defvar + +@defvar pg:tty +Initialized from the @var{PGTTY} environment variable. The default +debugging TTY. + +Compatibility note: Debugging TTYs are turned off in the XEmacs Lisp +binding. +@end defvar + +@defvar pg:database +Initialized from the @var{PGDATABASE} environment variable. The default +database to connect to. +@end defvar + +@defvar pg:realm +Initialized from the @var{PGREALM} environment variable. The default +Kerberos realm. +@end defvar + +@defvar pg:client-encoding +Initialized from the @var{PGCLIENTENCODING} environment variable. The +default client encoding. + +Compatibility note: This variable is not present in non-Mule XEmacsen. +This variable is not present in versions of libpq prior to 7.0. +In the current implementation, client encoding is equivalent to the +@code{file-name-coding-system} format. +@end defvar + +@c unused +@defvar pg:authtype +Initialized from the @var{PGAUTHTYPE} environment variable. The default +authentication scheme used. + +Compatibility note: This variable is unused in versions of libpq after +6.5. It is not implemented at all in the XEmacs Lisp binding. +@end defvar + +@defvar pg:geqo +Initialized from the @var{PGGEQO} environment variable. Genetic +optimizer options. +@end defvar + +@defvar pg:cost-index +Initialized from the @var{PGCOSTINDEX} environment variable. Cost index +options. +@end defvar + +@defvar pg:cost-heap +Initialized from the @var{PGCOSTHEAP} environment variable. Cost heap +options. +@end defvar + +@defvar pg:tz +Initialized from the @var{PGTZ} environment variable. Default +timezone. +@end defvar + +@defvar pg:date-style +Initialized from the @var{PGDATESTYLE} environment variable. Default +date style in returned date objects. +@end defvar + +@defvar pg-coding-system +This is a variable controlling which coding system is used to encode +non-ASCII strings sent to the database. + +Compatibility Note: This variable is not present in InfoDock. +@end defvar + +@node libpq Lisp Symbols and DataTypes, Synchronous Interface Functions, libpq Lisp Variables, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection libpq Lisp Symbols and Datatypes + +The following set of symbols are used to represent the intermediate +states involved in the asynchronous interface. + +@defvr {Symbol} pgres::polling-failed +Undocumented. A fatal error has occurred during processing of an +asynchronous operation. +@end defvr + +@defvr {Symbol} pgres::polling-reading +An intermediate status return during an asynchronous operation. It +indicates that one may use @code{select} before polling again. +@end defvr + +@defvr {Symbol} pgres::polling-writing +An intermediate status return during an asynchronous operation. It +indicates that one may use @code{select} before polling again. +@end defvr + +@defvr {Symbol} pgres::polling-ok +An asynchronous operation has successfully completed. +@end defvr + +@defvr {Symbol} pgres::polling-active +An intermediate status return during an asynchronous operation. One can +call the poll function again immediately. +@end defvr + +@defun pq-pgconn conn field +@var{conn} A database connection object. +@var{field} A symbol indicating which field of PGconn to fetch. Possible +values are shown in the following table. +@table @code +@item pq::db +Database name +@item pq::user +Database user name +@item pq::pass +Database user's password +@item pq::host +Hostname database server is running on +@item pq::port +TCP port number used in the connection +@item pq::tty +Debugging TTY + +Compatibility note: Debugging TTYs are not used in the XEmacs Lisp API. +@item pq::options +Additional server options +@item pq::status +Connection status. Possible return values are shown in the following +table. +@table @code +@item pg::connection-ok +The normal, connected status. +@item pg::connection-bad +The connection is not open and the PGconn object needs to be deleted by +@code{pq-finish}. +@item pg::connection-started +An asynchronous connection has been started, but is not yet complete. +@item pg::connection-made +An asynchronous connect has been made, and there is data waiting to be sent. +@item pg::connection-awaiting-response +Awaiting data from the backend during an asynchronous connection. +@item pg::connection-auth-ok +Received authentication, waiting for the backend to start up. +@item pg::connection-setenv +Negotiating environment during an asynchronous connection. +@end table +@item pq::error-message +The last error message that was delivered to this connection. +@item pq::backend-pid +The process ID of the backend database server. +@end table +@end defun + +The @code{PGresult} object is used by libpq to encapsulate the results +of queries. The printed representation takes on four forms. When the +PGresult object contains tuples from an SQL @code{SELECT} it will look +like: + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +@end example + +The number in brackets indicates how many rows of data are available. +When the PGresult object is the result of a command query that doesn't +return anything, it will look like: + +@example +(pq-exec P "CREATE TABLE a_new_table (i int);") + @result{} # +@end example + +When either the query is a command-type query that can affect a number +of different rows, but doesn't return any of them it will look like: + +@example +(progn + (pq-exec P "INSERT INTO a_new_table VALUES (1);") + (pq-exec P "INSERT INTO a_new_table VALUES (2);") + (pq-exec P "INSERT INTO a_new_table VALUES (3);") + (setq R (pq-exec P "DELETE FROM a_new_table;"))) + @result{} # +@end example + +Lastly, when the underlying PGresult object has been deallocated +directly by @code{pq-clear} the printed representation will look like: + +@example +(progn + (setq R (pq-exec P "SELECT * FROM xemacs_test;")) + (pq-clear R) + R) + @result{} # +@end example + +The following set of functions are accessors to various data in the PGresult +object. + +@defun pq-result-status result +Return status of a query result. +@var{result} is a PGresult object. The return value is one of the +symbols in the following table. +@table @code +@item pgres::empty-query +A query contained no text. This is usually the result of a recoverable +error, or a minor programming error. +@item pgres::command-ok +A query command that doesn't return anything was executed properly by +the backend. +@item pgres::tuples-ok +A query command that returns tuples was executed properly by the +backend. +@item pgres::copy-out +Copy Out data transfer is in progress. +@item pgres::copy-in +Copy In data transfer is in progress. +@item pgres::bad-response +An unexpected response was received from the backend. +@item pgres::nonfatal-error +Undocumented. This value is returned when the libpq function +@code{PQresultStatus} is called with a @var{NULL} pointer. +@item pgres::fatal-error +Undocumented. An error has occurred in processing the query and the +operation was not completed. +@end table +@end defun + +@defun pq-res-status result +Return the query result status as a string, not a symbol. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-res-status R) + @result{} "PGRES_TUPLES_OK" +@end example +@end defun + +@defun pq-result-error-message result +Return an error message generated by the query, if any. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs-test;")) + @result{} +(pq-result-error-message R) + @result{} "ERROR: parser: parse error at or near \"-\" +" +@end example +@end defun + +@defun pq-ntuples result +Return the number of tuples in the query result. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-ntuples R) + @result{} 5 +@end example +@end defun + +@defun pq-nfields result +Return the number of fields in each tuple of the query result. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-nfields R) + @result{} 3 +@end example +@end defun + +@defun pq-binary-tuples result +Returns t if binary tuples are present in the results, nil otherwise. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-binary-tuples R) + @result{} nil +@end example +@end defun + +@defun pq-fname result field-index +Returns the name of a specific field. +@var{result} is a PGresult object. +@var{field-index} is the number of the column to select from. The first +column is number zero. + +@example +(let (i l) + (setq R (pq-exec P "SELECT * FROM xemacs_test;")) + (setq i (pq-nfields R)) + (while (>= (decf i) 0) + (push (pq-fname R i) l)) + l) + @result{} ("id" "shikona" "rank") +@end example +@end defun + +@defun pq-fnumber result field-name +Return the field number corresponding to the given field name. +-1 is returned on a bad field name. +@var{result} is a PGresult object. +@var{field-name} is a string representing the field name to find. +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-fnumber R "id") + @result{} 0 +(pq-fnumber R "Not a field") + @result{} -1 +@end example +@end defun + +@defun pq-ftype result field-num +Return an integer code representing the data type of the specified column. +@var{result} is a PGresult object. +@var{field-num} is the field number. + +The return value of this function is the Object ID (Oid) in the database +of the type. Further queries need to be made to various system tables +in order to convert this value into something useful. +@end defun + +@defun pq-fmod result field-num +Return the type modifier code associated with a field. Field numbers +start at zero. +@var{result} is a PGresult object. +@var{field-index} selects which field to use. +@end defun + +@defun pq-fsize result field-index +Return size of the given field. +@var{result} is a PGresult object. +@var{field-index} selects which field to use. + +@example +(let (i l) + (setq R (pq-exec P "SELECT * FROM xemacs_test;")) + (setq i (pq-nfields R)) + (while (>= (decf i) 0) + (push (list (pq-ftype R i) (pq-fsize R i)) l)) + l) + @result{} ((23 23) (25 25) (25 25)) +@end example +@end defun + +@defun pq-get-value result tup-num field-num +Retrieve a return value. +@var{result} is a PGresult object. +@var{tup-num} selects which tuple to fetch from. +@var{field-num} selects which field to fetch from. + +Both tuples and fields are numbered from zero. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-get-value R 0 1) + @result{} "Musashimaru" +(pq-get-value R 1 1) + @result{} "Dejima" +(pq-get-value R 2 1) + @result{} "Musoyama" +@end example +@end defun + +@defun pq-get-length result tup-num field-num +Return the length of a specific value. +@var{result} is a PGresult object. +@var{tup-num} selects which tuple to fetch from. +@var{field-num} selects which field to fetch from. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-get-length R 0 1) + @result{} 11 +(pq-get-length R 1 1) + @result{} 6 +(pq-get-length R 2 1) + @result{} 8 +@end example +@end defun + +@defun pq-get-is-null result tup-num field-num +Return t if the specific value is the SQL @var{NULL}. +@var{result} is a PGresult object. +@var{tup-num} selects which tuple to fetch from. +@var{field-num} selects which field to fetch from. +@end defun + +@defun pq-cmd-status result +Return a summary string from the query. +@var{result} is a PGresult object. +@example +@comment This example was written on day 3 of the 2000 Haru Basho. +(pq-exec P "INSERT INTO xemacs_test + VALUES (6, 'Wakanohana', 'Yokozuna');") + @result{} # +(pq-cmd-status R) + @result{} "INSERT 542086 1" +(setq R (pq-exec P "UPDATE xemacs_test SET rank='retired' + WHERE shikona='Wakanohana';")) + @result{} # +(pq-cmd-status R) + @result{} "UPDATE 1" +@end example + +Note that the first number returned from an insertion, like in the +example, is an object ID number and will almost certainly vary from +system to system since object ID numbers in Postgres must be unique +across all databases. +@end defun + +@defun pq-cmd-tuples result +Return the number of tuples if the last command was an INSERT/UPDATE/DELETE. +If the last command was something else, the empty string is returned. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "INSERT INTO xemacs_test VALUES + (7, 'Takanohana', 'Yokuzuna');")) + @result{} # +(pq-cmd-tuples R) + @result{} "1" +(setq R (pq-exec P "SELECT * from xemacs_test;")) + @result{} # +(pq-cmd-tuples R) + @result{} "" +(setq R (pq-exec P "DELETE FROM xemacs_test + WHERE shikona LIKE '%hana';")) + @result{} # +(pq-cmd-tuples R) + @result{} "2" +@end example +@end defun + +@defun pq-oid-value result +Return the object id of the insertion if the last command was an INSERT. +0 is returned if the last command was not an insertion. +@var{result} is a PGresult object. + +In the first example, the numbers you will see on your local system will +almost certainly be different, however the second number from the right +in the unprintable PGresult object and the number returned by +@code{pq-oid-value} should match. +@example +(setq R (pq-exec P "INSERT INTO xemacs_test VALUES + (8, 'Terao', 'Maegashira');")) + @result{} # +(pq-oid-value R) + @result{} 542089 +(setq R (pq-exec P "SELECT shikona FROM xemacs_test + WHERE rank='Maegashira';")) + @result{} # +(pq-oid-value R) + @result{} 0 +@end example +@end defun + +@defun pq-make-empty-pgresult conn status +Create an empty pgresult with the given status. +@var{conn} a database connection object +@var{status} a value that can be returned by @code{pq-result-status}. + +The caller is responsible for making sure the return value gets properly +freed. +@end defun + +@node Synchronous Interface Functions, Asynchronous Interface Functions, libpq Lisp Symbols and DataTypes, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Synchronous Interface Functions + +@defun pq-connectdb conninfo +Establish a (synchronous) database connection. +@var{conninfo} A string of blank separated options. Options are of the +form ``@var{option} = @var{value}''. If @var{value} contains blanks, it +must be single quoted. Blanks around the equal sign are optional. +Multiple option assignments are blank separated. +@example +(pq-connectdb "dbname=japanese port = 25432") + @result{} # +@end example +The printed representation of a database connection object has four +fields. The first field is the hostname where the database server is +running (in this case localhost), the second field is the port number, +the third field is the database user name, and the fourth field is the +name of the database. + +Database connection objects which have been disconnected and will +generate an immediate error if they are used look like: +@example + # +@end example +Bad connections can be reestablished with @code{pq-reset}, or deleted +entirely with @code{pq-finish}. + +A database connection object that has been deleted looks like: +@example +(let ((P1 (pq-connectdb ""))) + (pq-finish P1) + P1) + @result{} # +@end example + +Note that database connection objects are the most heavy weight objects +in XEmacs Lisp at this writing, usually representing as much as several +megabytes of virtual memory on the machine the database server is +running on. It is wisest to explicitly delete them when you are +finished with them, rather than letting garbage collection do it. An +example idiom is: + +@example +(let ((P (pq-connectiondb ""))) + (unwind-protect + (progn + (...)) ; access database here + (pq-finish P))) +@end example + +The following options are available in the options string: +@table @code +@item authtype +Authentication type. Same as @var{PGAUTHTYPE}. This is no longer used. +@item user +Database user name. Same as @var{PGUSER}. +@item password +Database password. +@item dbname +Database name. Same as @var{PGDATABASE} +@item host +Symbolic hostname. Same as @var{PGHOST}. +@item hostaddr +Host address as four octets (eg. like 192.168.1.1). +@item port +TCP port to connect to. Same as @var{PGPORT}. +@item tty +Debugging TTY. Same as @var{PGTTY}. This value is suppressed in the +XEmacs Lisp API. +@item options +Extra backend database options. Same as @var{PGOPTIONS}. +@end table +A database connection object is returned regardless of whether a +connection was established or not. +@end defun + +@defun pq-reset conn +Reestablish database connection. +@var{conn} A database connection object. + +This function reestablishes a database connection using the original +connection parameters. This is useful if something has happened to the +TCP link and it has become broken. +@end defun + +@defun pq-exec conn query +Make a synchronous database query. +@var{conn} A database connection object. +@var{query} A string containing an SQL query. +A PGresult object is returned, which in turn may be queried by its many +accessor functions to retrieve state out of it. If the query string +contains multiple SQL commands, only results from the final command are +returned. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test; +DELETE FROM xemacs_test WHERE id=8;")) + @result{} # +@end example +@end defun + +@defun pq-notifies conn +Return the latest async notification that has not yet been handled. +@var{conn} A database connection object. +If there has been a notification, then a list of two elements will be returned. +The first element contains the relation name being notified, the second +element contains the backend process ID number. nil is returned if there +aren't any notifications to process. +@end defun + +@defun PQsetenv conn +Synchronous transfer of environment variables to a backend +@var{conn} A database connection object. + +Environment variable transfer is done as a normal part of database +connection. + +Compatibility note: This function was present but not documented in versions +of libpq prior to 7.0. +@end defun + +@node Asynchronous Interface Functions, Large Object Support, Synchronous Interface Functions, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Asynchronous Interface Functions + +Making command by command examples is too complex with the asynchronous +interface functions. See the examples section for complete calling +sequences. + +@defun pq-connect-start conninfo +Begin establishing an asynchronous database connection. +@var{conninfo} A string containing the connection options. See the +documentation of @code{pq-connectdb} for a listing of all the available +flags. +@end defun + +@defun pq-connect-poll conn +An intermediate function to be called during an asynchronous database +connection. +@var{conn} A database connection object. +The result codes are documented in a previous section. +@end defun + +@defun pq-is-busy conn +Returns t if @code{pq-get-result} would block waiting for input. +@var{conn} A database connection object. +@end defun + +@defun pq-consume-input conn +Consume any available input from the backend. +@var{conn} A database connection object. + +Nil is returned if anything bad happens. +@end defun + +@defun pq-reset-start conn +Reset connection to the backend asynchronously. +@var{conn} A database connection object. +@end defun + +@defun pq-reset-poll conn +Poll an asynchronous reset for completion +@var{conn} A database connection object. +@end defun + +@defun pq-reset-cancel conn +Attempt to request cancellation of the current operation. +@var{conn} A database connection object. + +The return value is t if the cancel request was successfully +dispatched, nil if not (in which case conn->errorMessage is set). +Note: successful dispatch is no guarantee that there will be any effect at +the backend. The application must read the operation result as usual. +@end defun + +@defun pq-send-query conn query +Submit a query to Postgres and don't wait for the result. +@var{conn} A database connection object. +Returns: t if successfully submitted + nil if error (conn->errorMessage is set) +@end defun + +@defun pq-get-result conn +Retrieve an asynchronous result from a query. +@var{conn} A database connection object. + +NIL is returned when no more query work remains. +@end defun + +@defun pq-set-nonblocking conn arg +Sets the PGconn's database connection non-blocking if the arg is TRUE +or makes it non-blocking if the arg is FALSE, this will not protect +you from PQexec(), you'll only be safe when using the non-blocking API. +@var{conn} A database connection object. +@end defun + +@defun pq-is-nonblocking conn +Return the blocking status of the database connection +@var{conn} A database connection object. +@end defun + +@defun pq-flush conn +Force the write buffer to be written (or at least try) +@var{conn} A database connection object. +@end defun + +@defun PQsetenvStart conn +Start asynchronously passing environment variables to a backend. +@var{conn} A database connection object. + +Compatibility note: this function is only available with libpq-7.0. +@end defun + +@defun PQsetenvPoll conn +Check an asynchronous environment variables transfer for completion. +@var{conn} A database connection object. + +Compatibility note: this function is only available with libpq-7.0. +@end defun + +@defun PQsetenvAbort conn +Attempt to terminate an asynchronous environment variables transfer. +@var{conn} A database connection object. + +Compatibility note: this function is only available with libpq-7.0. +@end defun + +@node Large Object Support, Other libpq Functions, Asynchronous Interface Functions, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Large Object Support + +@defun pq-lo-import conn filename +Import a file as a large object into the database. +@var{conn} a database connection object +@var{filename} filename to import + +On success, the object id is returned. +@end defun + +@defun pq-lo-export conn oid filename +Copy a large object in the database into a file. +@var{conn} a database connection object. +@var{oid} object id number of a large object. +@var{filename} filename to export to. +@end defun + +@node Other libpq Functions, Unimplemented libpq Functions, Large Object Support, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Other libpq Functions + +@defun pq-finish conn +Destroy a database connection object by calling free on it. +@var{conn} a database connection object + +It is possible to not call this routine because the usual XEmacs garbage +collection mechanism will call the underlying libpq routine whenever it +is releasing stale @code{PGconn} objects. However, this routine is +useful in @code{unwind-protect} clauses to make connections go away +quickly when unrecoverable errors have occurred. + +After calling this routine, the printed representation of the XEmacs +wrapper object will contain the string ``DEAD''. +@end defun + +@defun pq-client-encoding conn +Return the client encoding as an integer code. +@var{conn} a database connection object + +@example +(pq-client-encoding P) + @result{} 1 +@end example + +Compatibility note: This function did not exist prior to libpq-7.0 and +does not exist in a non-Mule XEmacs. +@end defun + +@defun pq-set-client-encoding conn encoding +Set client coding system. +@var{conn} a database connection object +@var{encoding} a string representing the desired coding system + +@example +(pq-set-client-encoding P "EUC_JP") + @result{} 0 +@end example + +The current idiom for ensuring proper coding system conversion is the +following (illustrated for EUC Japanese encoding): +@example +(setq P (pq-connectdb "...")) +(let ((file-name-coding-system 'euc-jp) + (pg-coding-system 'euc-jp)) + (pq-set-client-encoding "EUC_JP") + ...) +(pq-finish P) +@end example +Compatibility note: This function did not exist prior to libpq-7.0 and +does not exist in a non-Mule XEmacs. +@end defun + +@defun pq-env-2-encoding +Return the integer code representing the coding system in @var{PGCLIENTENCODING}. + +@example +(pq-env-2-encoding) + @result{} 0 +@end example +Compatibility note: This function did not exist prior to libpq-7.0 and +does not exist in a non-Mule XEmacs. +@end defun + +@defun pq-clear res +Destroy a query result object by calling free() on it. +@var{res} a query result object + +Note: The memory allocation systems of libpq and XEmacs are different. +The XEmacs representation of a query result object will have both the +XEmacs version and the libpq version freed at the next garbage collection +when the object is no longer being referenced. Calling this function does +not release the XEmacs object, it is still subject to the usual rules for +Lisp objects. The printed representation of the XEmacs object will contain +the string ``DEAD'' after this routine is called indicating that it is no +longer useful for anything. +@end defun + +@defun pq-conn-defaults +Return a data structure that represents the connection defaults. +The data is returned as a list of lists, where each sublist contains +info regarding a single option. +@end defun + +@node Unimplemented libpq Functions, , Other libpq Functions, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Unimplemented libpq Functions + +@deftypefn {Unimplemented Function} PGconn *PQsetdbLogin (char *pghost, char *pgport, char *pgoptions, char *pgtty, char *dbName, char *login, char *pwd) +Synchronous database connection. +@var{pghost} is the hostname of the PostgreSQL backend to connect to. +@var{pgport} is the TCP port number to use. +@var{pgoptions} specifies other backend options. +@var{pgtty} specifies the debugging tty to use. +@var{dbName} specifies the database name to use. +@var{login} specifies the database user name. +@var{pwd} specifies the database user's password. + +This routine is deprecated as of libpq-7.0, and its functionality can be +replaced by external Lisp code if needed. +@end deftypefn + +@deftypefn {Unimplemented Function} PGconn *PQsetdb (char *pghost, char *pgport, char *pgoptions, char *pgtty, char *dbName) +Synchronous database connection. +@var{pghost} is the hostname of the PostgreSQL backend to connect to. +@var{pgport} is the TCP port number to use. +@var{pgoptions} specifies other backend options. +@var{pgtty} specifies the debugging tty to use. +@var{dbName} specifies the database name to use. + +This routine was deprecated in libpq-6.5. +@end deftypefn + +@deftypefn {Unimplemented Function} int PQsocket (PGconn *conn) +Return socket file descriptor to a backend database process. +@var{conn} database connection object. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQprint (FILE *fout, PGresult *res, PGprintOpt *ps) +Print out the results of a query to a designated C stream. +@var{fout} C stream to print to +@var{res} the query result object to print +@var{ps} the print options structure. + +This routine is deprecated as of libpq-7.0 and cannot be sensibly exported +to XEmacs Lisp. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQdisplayTuples (PGresult *res, FILE *fp, int fillAlign, char *fieldSep, int printHeader, int quiet) +@var{res} query result object to print +@var{fp} C stream to print to +@var{fillAlign} pad the fields with spaces +@var{fieldSep} field separator +@var{printHeader} display headers? +@var{quiet} + +This routine was deprecated in libpq-6.5. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQprintTuples (PGresult *res, FILE *fout, int printAttName, int terseOutput, int width) +@var{res} query result object to print +@var{fout} C stream to print to +@var{printAttName} print attribute names +@var{terseOutput} delimiter bars +@var{width} width of column, if 0, use variable width + +This routine was deprecated in libpq-6.5. +@end deftypefn + +@deftypefn {Unimplemented Function} int PQmblen (char *s, int encoding) +Determine length of a multibyte encoded char at @code{*s}. +@var{s} encoded string +@var{encoding} type of encoding + +Compatibility note: This function was introduced in libpq-7.0. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQtrace (PGconn *conn, FILE *debug_port) +Enable tracing on @code{debug_port}. +@var{conn} database connection object. +@var{debug_port} C output stream to use. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQuntrace (PGconn *conn) +Disable tracing. +@var{conn} database connection object. +@end deftypefn + +@deftypefn {Unimplemented Function} char *PQoidStatus (PGconn *conn) +Return the object id as a string of the last tuple inserted. +@var{conn} database connection object. + +Compatibility note: This function is deprecated in libpq-7.0, however it +is used internally by the XEmacs binding code when linked against versions +prior to 7.0. +@end deftypefn + +@deftypefn {Unimplemented Function} PGresult *PQfn (PGconn *conn, int fnid, int *result_buf, int *result_len, int result_is_int, PQArgBlock *args, int nargs) +``Fast path'' interface --- not really recommended for application use +@var{conn} A database connection object. +@var{fnid} +@var{result_buf} +@var{result_len} +@var{result_is_int} +@var{args} +@var{nargs} +@end deftypefn + +The following set of very low level large object functions aren't +appropriate to be exported to Lisp. + +@deftypefn {Unimplemented Function} int pq-lo-open (PGconn *conn, int lobjid, int mode) +@var{conn} a database connection object. +@var{lobjid} a large object ID. +@var{mode} opening modes. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-close (PGconn *conn, int fd) +@var{conn} a database connection object. +@var{fd} a large object file descriptor +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-read (PGconn *conn, int fd, char *buf, int len) +@var{conn} a database connection object. +@var{fd} a large object file descriptor. +@var{buf} buffer to read into. +@var{len} size of buffer. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-write (PGconn *conn, int fd, char *buf, size_t len) +@var{conn} a database connection object. +@var{fd} a large object file descriptor. +@var{buf} buffer to write from. +@var{len} size of buffer. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-lseek (PGconn *conn, int fd, int offset, int whence) +@var{conn} a database connection object. +@var{fd} a large object file descriptor. +@var{offset} +@var{whence} +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-creat (PGconn *conn, int mode) +@var{conn} a database connection object. +@var{mode} opening modes. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-tell (PGconn *conn, int fd) +@var{conn} a database connection object. +@var{fd} a large object file descriptor. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-unlink (PGconn *conn, int lobjid) +@var{conn} a database connection object. +@var{lbojid} a large object ID. +@end deftypefn + +@node XEmacs PostgreSQL libpq Examples, , XEmacs PostgreSQL libpq API, PostgreSQL Support +@comment node-name, next, previous, up +@section XEmacs PostgreSQL libpq Examples + +This is an example of one method of establishing an asynchronous +connection. + +@example +(defun database-poller (P) + (message "%S before poll" (pq-pgconn P 'pq::status)) + (pq-connect-poll P) + (message "%S after poll" (pq-pgconn P 'pq::status)) + (if (eq (pq-pgconn P 'pq::status) 'pg::connection-ok) + (message "Done!") + (add-timeout .1 'database-poller P))) + @result{} database-poller +(progn + (setq P (pq-connect-start "")) + (add-timeout .1 'database-poller P)) + @result{} pg::connection-started before poll + @result{} pg::connection-made after poll + @result{} pg::connection-made before poll + @result{} pg::connection-awaiting-response after poll + @result{} pg::connection-awaiting-response before poll + @result{} pg::connection-auth-ok after poll + @result{} pg::connection-auth-ok before poll + @result{} pg::connection-setenv after poll + @result{} pg::connection-setenv before poll + @result{} pg::connection-ok after poll + @result{} Done! +P + @result{} # +@end example + +Here is an example of one method of doing an asynchronous reset. + +@example +(defun database-poller (P) + (let (PS) + (message "%S before poll" (pq-pgconn P 'pq::status)) + (setq PS (pq-reset-poll P)) + (message "%S after poll [%S]" (pq-pgconn P 'pq::status) PS) + (if (eq (pq-pgconn P 'pq::status) 'pg::connection-ok) + (message "Done!") + (add-timeout .1 'database-poller P)))) + @result{} database-poller +(progn + (pq-reset-start P) + (add-timeout .1 'database-poller P)) + @result{} pg::connection-started before poll + @result{} pg::connection-made after poll [pgres::polling-writing] + @result{} pg::connection-made before poll + @result{} pg::connection-awaiting-response after poll [pgres::polling-reading] + @result{} pg::connection-awaiting-response before poll + @result{} pg::connection-setenv after poll [pgres::polling-reading] + @result{} pg::connection-setenv before poll + @result{} pg::connection-ok after poll [pgres::polling-ok] + @result{} Done! +P + @result{} # +@end example + +And finally, an asynchronous query. + +@example +(defun database-poller (P) + (let (R) + (pq-consume-input P) + (if (pq-is-busy P) + (add-timeout .1 'database-poller P) + (setq R (pq-get-result P)) + (if R + (progn + (push R result-list) + (add-timeout .1 'database-poller P)))))) + @result{} database-poller +(when (pq-send-query P "SELECT * FROM xemacs_test;") + (setq result-list nil) + (add-timeout .1 'database-poller P)) + @result{} 885 +;; wait a moment +result-list + @result{} (#) +@end example + +Here is an example showing how multiple SQL statements in a single query +can have all their results collected. +@example +;; Using the same @code{database-poller} function from the previous example +(when (pq-send-query P "SELECT * FROM xemacs_test; +SELECT * FROM pg_database; +SELECT * FROM pg_user;") + (setq result-list nil) + (add-timeout .1 'database-poller P)) + @result{} 1782 +;; wait a moment +result-list + @result{} (# # #) +@end example + +Here is an example which illustrates collecting all data from a query, +including the field names. + +@example +(defun pg-util-query-results (results) + "Retrieve results of last SQL query into a list structure." + (let ((i (1- (pq-ntuples R))) + j l1 l2) + (while (>= i 0) + (setq j (1- (pq-nfields R))) + (setq l2 nil) + (while (>= j 0) + (push (pq-get-value R i j) l2) + (decf j)) + (push l2 l1) + (decf i)) + (setq j (1- (pq-nfields R))) + (setq l2 nil) + (while (>= j 0) + (push (pq-fname R j) l2) + (decf j)) + (push l2 l1) + l1)) + @result{} pg-util-query-results +(setq R (pq-exec P "SELECT * FROM xemacs_test ORDER BY field2 DESC;")) + @result{} # +(pg-util-query-results R) + @result{} (("f1" "field2") ("a" "97") ("b" "97") ("stuff" "42") ("a string" "12") ("foo" "10") ("string" "2") ("text" "1")) +@end example + +Here is an example of a query that uses a database cursor. + +@example +(let (data R) + (setq R (pq-exec P "BEGIN;")) + (setq R (pq-exec P "DECLARE k_cursor CURSOR FOR SELECT * FROM xemacs_test ORDER BY f1 DESC;")) + + (setq R (pq-exec P "FETCH k_cursor;")) + (while (eq (pq-ntuples R) 1) + (push (list (pq-get-value R 0 0) (pq-get-value R 0 1)) data) + (setq R (pq-exec P "FETCH k_cursor;"))) + (setq R (pq-exec P "END;")) + data) + @result{} (("a" "97") ("a string" "12") ("b" "97") ("foo" "10") ("string" "2") ("stuff" "42") ("text" "1")) +@end example + +Here's another example of cursors, this time with a Lisp macro to +implement a mapping function over a table. + +@example +(defmacro map-db (P table condition callout) + `(let (R) + (pq-exec ,P "BEGIN;") + (pq-exec ,P (concat "DECLARE k_cursor CURSOR FOR SELECT * FROM " + ,table + " " + ,condition + " ORDER BY f1 DESC;")) + (setq R (pq-exec P "FETCH k_cursor;")) + (while (eq (pq-ntuples R) 1) + (,callout (pq-get-value R 0 0) (pq-get-value R 0 1)) + (setq R (pq-exec P "FETCH k_cursor;"))) + (pq-exec P "END;"))) + @result{} map-db +(defun callback (arg1 arg2) + (message "arg1 = %s, arg2 = %s" arg1 arg2)) + @result{} callback +(map-db P "xemacs_test" "WHERE field2 > 10" callback) + @result{} arg1 = stuff, arg2 = 42 + @result{} arg1 = b, arg2 = 97 + @result{} arg1 = a string, arg2 = 12 + @result{} arg1 = a, arg2 = 97 + @result{} # +@end example diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/processes.texi --- a/man/lispref/processes.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/processes.texi Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the XEmacs Lisp Reference Manual. -@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/processes.info @node Processes, System Interface, Databases, Top @@ -92,7 +92,7 @@ argument, @var{args}. The @var{args} must all be strings, and they are supplied to @var{program} as separate command line arguments. Wildcard characters and other shell constructs are not allowed in these strings, -since they are passed directly to the specified program. +since they are passed directly to the specified program. @strong{Please note:} The argument @var{program} contains only the name of the program; it may not contain any command-line arguments. You @@ -106,7 +106,7 @@ specify overrides for it with @code{process-environment}. @xref{System Environment}. -@defvar exec-directory +@defvar exec-directory @pindex wakeup The value of this variable is the name of a directory (a string) that contains programs that come with XEmacs, that are intended for XEmacs @@ -296,8 +296,8 @@ @smallexample @group -(call-process-region - start end +(call-process-region + start end shell-file-name ; @r{Name of program.} nil ; @r{Do not delete region.} buffer ; @r{Send output to @code{buffer}.} @@ -704,25 +704,26 @@ section. XEmacs also sends signals automatically at certain times: killing a buffer sends a @code{SIGHUP} signal to all its associated processes; killing XEmacs sends a @code{SIGHUP} signal to all remaining -processes. (@code{SIGHUP} is a signal that usually indicates that the -user hung up the phone.) +processes. (@code{SIGHUP} is a signal that indicates that the +connection between the user and the process is broken, for example if a +connection via a telephone line is hung up.) Each of the signal-sending functions takes two optional arguments: -@var{process-name} and @var{current-group}. +@var{process} and @var{current-group}. - The argument @var{process-name} must be either a process, the name of -one, or @code{nil}. If it is @code{nil}, the process defaults to the -process associated with the current buffer. An error is signaled if -@var{process-name} does not identify a process. + The argument @var{process} must be either a process or a buffer, +the name of one, or @code{nil}. If it is @code{nil}, the process +defaults to the process associated with the current buffer. An error is +signaled if @var{process} does not identify a process. The argument @var{current-group} is a flag that makes a difference when you are running a job-control shell as an XEmacs subprocess. If it -is non-@code{nil}, then the signal is sent to the current process-group -of the terminal that XEmacs uses to communicate with the subprocess. If -the process is a job-control shell, this means the shell's current -subjob. If it is @code{nil}, the signal is sent to the process group of -the immediate subprocess of XEmacs. If the subprocess is a job-control -shell, this is the shell itself. +is non-@code{nil}, then the signal is sent to the current foreground +process group of the terminal that XEmacs uses to communicate with the +subprocess. If the process is a job-control shell, this means the +shell's current subjob. If it is @code{nil}, the signal is sent to the +process group of the immediate subprocess of XEmacs. If the subprocess +is a job-control shell, this is the shell itself. The flag @var{current-group} has no effect when a pipe is used to communicate with the subprocess, because the operating system does not @@ -730,30 +731,39 @@ job-control shells won't work when a pipe is used. See @code{process-connection-type} in @ref{Asynchronous Processes}. -@defun interrupt-process &optional process-name current-group -This function interrupts the process @var{process-name} by sending the -signal @code{SIGINT}. Outside of XEmacs, typing the ``interrupt -character'' (normally @kbd{C-c} on some systems, and @code{DEL} on -others) sends this signal. When the argument @var{current-group} is -non-@code{nil}, you can think of this function as ``typing @kbd{C-c}'' -on the terminal by which XEmacs talks to the subprocess. + Some of the functions below take a @var{signal} argument, which +identifies a signal to be sent. It must be either an integer or a +symbol which names the signal, like @code{SIGSEGV}. + +@defun process-send-signal signal &optional process current-group +This function sends the signal @var{signal} to the process @var{process}. +The following functions can be implemented in terms of +@code{process-send-signal}. @end defun -@defun kill-process &optional process-name current-group -This function kills the process @var{process-name} by sending the +@defun interrupt-process &optional process current-group +This function interrupts the process @var{process} by sending the signal +@code{SIGINT}. Outside of XEmacs, typing the ``interrupt character'' +(normally @kbd{C-c}) sends this signal. When the argument +@var{current-group} is non-@code{nil}, you can think of this function as +``typing @kbd{C-c}'' on the terminal by which XEmacs talks to the +subprocess. +@end defun + +@defun kill-process &optional process current-group +This function kills the process @var{process} by sending the signal @code{SIGKILL}. This signal kills the subprocess immediately, and cannot be handled by the subprocess. @end defun -@defun quit-process &optional process-name current-group +@defun quit-process &optional process current-group This function sends the signal @code{SIGQUIT} to the process -@var{process-name}. This signal is the one sent by the ``quit -character'' (usually @kbd{C-b} or @kbd{C-\}) when you are not inside -XEmacs. +@var{process}. This signal is the one sent by the ``quit +character'' (usually @kbd{C-\}) when you are not inside XEmacs. @end defun -@defun stop-process &optional process-name current-group -This function stops the process @var{process-name} by sending the +@defun stop-process &optional process current-group +This function stops the process @var{process} by sending the signal @code{SIGTSTP}. Use @code{continue-process} to resume its execution. @@ -763,17 +773,16 @@ on the terminal XEmacs uses to communicate with the subprocess. @end defun -@defun continue-process &optional process-name current-group +@defun continue-process &optional process current-group This function resumes execution of the process @var{process} by sending -it the signal @code{SIGCONT}. This presumes that @var{process-name} was +it the signal @code{SIGCONT}. This presumes that @var{process} was stopped previously. @end defun -@c Emacs 19 feature @defun signal-process pid signal -This function sends a signal to process @var{pid}, which need not be -a child of XEmacs. The argument @var{signal} specifies which signal -to send; it should be an integer. +This function sends a signal to the process with process id @var{pid}, +which need not be a child of XEmacs. The argument @var{signal} +specifies which signal to send. @end defun @node Output from Processes @@ -1096,7 +1105,7 @@ The string describing the event looks like one of the following: @itemize @bullet -@item +@item @code{"finished\n"}. @item diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/scrollbars.texi --- a/man/lispref/scrollbars.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/scrollbars.texi Mon Aug 13 11:35:02 2007 +0200 @@ -3,8 +3,8 @@ @c Copyright (C) 1995 Ben Wing. @c See the file lispref.texi for copying conditions. @setfilename ../../info/glyphs.info -@node Scrollbars, Drag and Drop, Toolbar, top -@chapter scrollbars +@node Scrollbars, Drag and Drop, Gutter, top +@chapter Scrollbars @cindex scrollbars Not yet documented. diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/searching.texi --- a/man/lispref/searching.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/searching.texi Mon Aug 13 11:35:02 2007 +0200 @@ -273,17 +273,21 @@ @dfn{non-greedy} quantifier, a regexp construct borrowed from Perl. @c Did perl get this from somewhere? What's the real history of *? ? -This construct very useful for when you want to match the text inside a -pair of delimiters. For instance, @samp{/\*.*?\*/} will match C -comments in a string. This could not be achieved without the use of -greedy quantifier. +This construct is very useful for when you want to match the text inside +a pair of delimiters. For instance, @samp{/\*.*?\*/} will match C +comments in a string. This could not easily be achieved without the use +of a non-greedy quantifier. This construct has not been available prior to XEmacs 20.4. It is not available in FSF Emacs. @item +? @cindex @samp{+?} in regexp -is the @samp{+} analog to @samp{*?}. +is the non-greedy version of @samp{+}. + +@item ?? +@cindex @samp{??} in regexp +is the non-greedy version of @samp{?}. @item \@{n,m\@} @c Note the spacing after the close brace is deliberate. @@ -293,6 +297,9 @@ more than @var{m} times. This syntax is supported by most Unix regexp utilities, and has been introduced to XEmacs for the version 20.3. +Unfortunately, the non-greedy version of this quantifier does not exist +currently, although it does in Perl. + @item [ @dots{} ] @cindex character set (in regexp) @cindex @samp{[} in regexp @@ -462,8 +469,9 @@ substring to be recorded for future reference. This is useful when you need a lot of grouping @samp{\( @dots{} \)} -constructs, but only want to remember one or two. Then you can use -not want to remember them for later use with @code{match-string}. +constructs, but only want to remember one or two -- or if you have +more than nine groupings and need to use backreferences to refer to +the groupings at the end. Using @samp{\(?: @dots{} \)} rather than @samp{\( @dots{} \)} when you don't need the captured substrings ought to speed up your programs some, @@ -472,7 +480,7 @@ must do. The actual performance gain to be observed has not been measured or quantified as of this writing. @c This is used to good advantage by the font-locking code, and by -@c `regexp-opt.el'. ... It will be. It's not yet, but will be. +@c `regexp-opt.el'. The shy grouping operator has been borrowed from Perl, and has not been available prior to XEmacs 20.3, nor is it available in FSF Emacs. diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/specifiers.texi --- a/man/lispref/specifiers.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/specifiers.texi Mon Aug 13 11:35:02 2007 +0200 @@ -703,7 +703,7 @@ particular device class or device type and/or to mark instantiators added by a particular package so that they can be later removed. -A specifier tag set consists of a list of zero of more specifier tags, +A specifier tag set consists of a list of zero or more specifier tags, each of which is a symbol that is recognized by XEmacs as a tag. (The valid device types and device classes are always tags, as are any tags defined by @code{define-specifier-tag}.) It is called a ``tag set'' (as @@ -934,11 +934,11 @@ @code{face-boolean}, or @code{toolbar}. For more information on particular types of specifiers, see the -functions @code{generic-specifier-p}, @code{integer-specifier-p}, -@code{natnum-specifier-p}, @code{boolean-specifier-p}, -@code{color-specifier-p}, @code{font-specifier-p}, -@code{image-specifier-p}, @code{face-boolean-specifier-p}, and -@code{toolbar-specifier-p}. +functions @code{make-generic-specifier}, @code{make-integer-specifier}, +@code{make-natnum-specifier}, @code{make-boolean-specifier}, +@code{make-color-specifier}, @code{make-font-specifier}, +@code{make-image-specifier}, @code{make-face-boolean-specifier}, and +@code{make-toolbar-specifier}. @end defun @defun make-specifier-and-init type spec-list &optional dont-canonicalize @@ -954,6 +954,59 @@ be in full form. See @code{canonicalize-spec-list}. @end defun +@defun make-integer-specifier spec-list + +Return a new @code{integer} specifier object with the given +specification list. @var{spec-list} can be a list of specifications +(each of which is a cons of a locale and a list of instantiators), a +single instantiator, or a list of instantiators. + +Valid instantiators for integer specifiers are integers. +@end defun + +@defun make-boolean-specifier spec-list + +Return a new @code{boolean} specifier object with the given +specification list. @var{spec-list} can be a list of specifications +(each of which is a cons of a locale and a list of instantiators), a +single instantiator, or a list of instantiators. + +Valid instantiators for boolean specifiers are @code{t} and @code{nil}. +@end defun + +@defun make-natnum-specifier spec-list + +Return a new @code{natnum} specifier object with the given specification +list. @var{spec-list} can be a list of specifications (each of which is +a cons of a locale and a list of instantiators), a single instantiator, +or a list of instantiators. + +Valid instantiators for natnum specifiers are non-negative integers. +@end defun + +@defun make-generic-specifier spec-list + +Return a new @code{generic} specifier object with the given +specification list. @var{spec-list} can be a list of specifications +(each of which is a cons of a locale and a list of instantiators), a +single instantiator, or a list of instantiators. + +Valid instantiators for generic specifiers are all Lisp values. They +are returned back unchanged when a specifier is instantiated. +@end defun + +@defun make-display-table-specifier spec-list + +Return a new @code{display-table} specifier object with the given spec +list. @var{spec-list} can be a list of specifications (each of which is +a cons of a locale and a list of instantiators), a single instantiator, +or a list of instantiators. + +Valid instantiators for display-table specifiers are described in detail +in the doc string for @code{current-display-table} (@pxref{Active +Display Table}). +@end defun + @node Specifier Validation Functions @section Functions for Checking the Validity of Specifier Components diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/strings.texi --- a/man/lispref/strings.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/strings.texi Mon Aug 13 11:35:02 2007 +0200 @@ -610,14 +610,14 @@ @cindex string properties @cindex properties of strings -Similar to symbols, extents, faces, and glyphs, you can attach +Just as with symbols, extents, faces, and glyphs, you can attach additional information to strings in the form of @dfn{string properties}. These differ from text properties, which are logically attached to particular characters in the string. To attach a property to a string, use @code{put}. To retrieve a property from a string, use @code{get}. You can also use @code{remprop} to remove -a property from a string and @code{object-props} to retrieve a list of +a property from a string and @code{object-plist} to retrieve a list of all the properties in a string. @node Formatting Strings diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/symbols.texi --- a/man/lispref/symbols.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/symbols.texi Mon Aug 13 11:35:02 2007 +0200 @@ -378,14 +378,14 @@ @cindex plist, symbol A @dfn{property list} (@dfn{plist} for short) is a list of paired -elements stored in the property list cell of a symbol. Each of the -pairs associates a property name (usually a symbol) with a property or -value. Property lists are generally used to record information about a -symbol, such as its documentation as a variable, the name of the file +elements, often stored in the property list cell of a symbol. Each of +the pairs associates a property name (usually a symbol) with a property +or value. Property lists are generally used to record information about +a symbol, such as its documentation as a variable, the name of the file where it was defined, or perhaps even the grammatical class of the symbol (representing a word) in a language-understanding system. - Many objects other than symbols can have property lists associated + Some objects which are not symbols also have property lists associated with them, and XEmacs provides a full complement of functions for working with property lists. @xref{Property Lists}. @@ -405,7 +405,7 @@ @menu * Plists and Alists:: Comparison of the advantages of property lists and association lists. -* Symbol Plists:: Functions to access symbols' property lists. +* Object Plists:: Functions to access objects' property lists. * Other Plists:: Accessing property lists stored elsewhere. @end menu @@ -441,13 +441,22 @@ are pushed on the front of the list and later discarded; this is not possible with a property list. -@node Symbol Plists -@subsection Property List Functions for Symbols +@node Object Plists +@subsection Property List Functions for Objects + +Once upon a time, only symbols had property lists. Now, several other +object types, including strings, extents, faces and glyphs also have +property lists. @defun symbol-plist symbol This function returns the property list of @var{symbol}. @end defun +@defun object-plist object +This function returns the property list of @var{object}. If +@var{object} is a symbol, this is identical to @code{symbol-plist}. +@end defun + @defun setplist symbol plist This function sets @var{symbol}'s property list to @var{plist}. Normally, @var{plist} should be a well-formed property list, but this is @@ -463,23 +472,24 @@ For symbols in special obarrays, which are not used for ordinary purposes, it may make sense to use the property list cell in a nonstandard fashion; in fact, the abbrev mechanism does so -(@pxref{Abbrevs}). +(@pxref{Abbrevs}). But generally, its use is discouraged. Use +@code{put} instead. @code{setplist} can only be used with symbols, not +other object types. @end defun -@defun get symbol property +@defun get object property &optional default This function finds the value of the property named @var{property} in -@var{symbol}'s property list. If there is no such property, @code{nil} -is returned. Thus, there is no distinction between a value of -@code{nil} and the absence of the property. +@var{object}'s property list. If there is no such property, +@code{default} (which itself defaults to @code{nil}) is returned. -The name @var{property} is compared with the existing property names -using @code{eq}, so any object is a legitimate property. +@var{property} is compared with the existing properties using @code{eq}, +so any object is a legitimate property. See @code{put} for an example. @end defun -@defun put symbol property value -This function puts @var{value} onto @var{symbol}'s property list under +@defun put object property value +This function puts @var{value} onto @var{object}'s property list under the property name @var{property}, replacing any previous property value. The @code{put} function returns @var{value}. @@ -490,13 +500,24 @@ @result{} (a buzzing little bug) (get 'fly 'verb) @result{} transitive -(symbol-plist 'fly) +(object-plist 'fly) @result{} (verb transitive noun (a buzzing little bug)) @end smallexample @end defun +@defun remprop object property +This function removes the entry for @var{property} from the property +list of @var{object}. It returns @code{t} if the property was +indeed found and removed, or @code{nil} if there was no such property. +(This function was probably omitted from Emacs originally because, +since @code{get} did not allow a @var{default}, it was very difficult +to distinguish between a missing property and a property whose value +was @code{nil}; thus, setting a property to @code{nil} was close +enough to @code{remprop} for most purposes.) +@end defun + @node Other Plists -@subsection Property Lists Outside Symbols +@subsection Property Lists Not Associated with Objects These functions are useful for manipulating property lists that are stored in places other than symbols: diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/toolbar.texi --- a/man/lispref/toolbar.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/toolbar.texi Mon Aug 13 11:35:02 2007 +0200 @@ -3,13 +3,15 @@ @c Copyright (C) 1995, 1996 Ben Wing. @c See the file lispref.texi for copying conditions. @setfilename ../../info/toolbar.info -@node Toolbar, Scrollbars, Dialog Boxes, top +@node Toolbar, Gutter, Dialog Boxes, top @chapter Toolbar @cindex toolbar @menu * Toolbar Intro:: An introduction. -* Toolbar Descriptor Format:: How to create a toolbar. +* Creating Toolbar:: How to create a toolbar. +* Toolbar Descriptor Format:: Accessing and modifying a toolbar's + properties. * Specifying the Toolbar:: Setting a toolbar's contents. * Other Toolbar Variables:: Controlling the size of toolbars. @end menu @@ -57,6 +59,27 @@ the user sets the default toolbar to the same position, it will just not be visible. +@node Creating Toolbar +@section Creating Toolbar + +@defun make-toolbar-specifier spec-list + +Return a new @code{toolbar} specifier object with the given +specification list. @var{spec-list} can be a list of specifications +(each of which is a cons of a locale and a list of instantiators), a +single instantiator, or a list of instantiators. @xref{Specifiers}, for +more information about specifiers. + +Toolbar specifiers are used to specify the format of a toolbar. The +values of the variables @code{default-toolbar}, @code{top-toolbar}, +@code{left-toolbar}, @code{right-toolbar}, and @code{bottom-toolbar} are +always toolbar specifiers. + +Valid toolbar instantiators are called "toolbar descriptors" +and are lists of vectors. See @code{default-toolbar} for a description +of the exact format. +@end defun + @node Toolbar Descriptor Format @section Toolbar Descriptor Format diff -r 72a7cfa4a488 -r abe6d1db359e man/lispref/windows.texi --- a/man/lispref/windows.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/lispref/windows.texi Mon Aug 13 11:35:02 2007 +0200 @@ -1041,7 +1041,7 @@ @defun window-point window This function returns the current position of point in @var{window}. -For a nonselected window, this is the value point would have (in that +For a non-selected window, this is the value point would have (in that window's buffer) if that window were selected. When @var{window} is the selected window and its buffer is also the diff -r 72a7cfa4a488 -r abe6d1db359e man/make-stds.texi --- a/man/make-stds.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/make-stds.texi Mon Aug 13 11:35:02 2007 +0200 @@ -507,7 +507,7 @@ @item srcdir The directory for the sources being compiled. The value of this variable is normally inserted by the @code{configure} shell script. -(If you are using Autconf, use @samp{srcdir = @@srcdir@@}.) +(If you are using Autoconf, use @samp{srcdir = @@srcdir@@}.) @end table For example: diff -r 72a7cfa4a488 -r abe6d1db359e man/new-users-guide/edit.texi --- a/man/new-users-guide/edit.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/new-users-guide/edit.texi Mon Aug 13 11:35:02 2007 +0200 @@ -137,7 +137,7 @@ Move the cursor forward one word (@code{forward-word}). @item M-b @findex backward-word -Move the cursor backword one word (@code{backward-word}). +Move the cursor backward one word (@code{backward-word}). @item M-< Move the cursor to the top of the buffer (@code{beginning-of-buffer}). @item M-> diff -r 72a7cfa4a488 -r abe6d1db359e man/new-users-guide/modes.texi --- a/man/new-users-guide/modes.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/new-users-guide/modes.texi Mon Aug 13 11:35:02 2007 +0200 @@ -228,7 +228,7 @@ @item line-number-mode @cindex line-number-mode After you enable this mode, the line number at which your cursor is -present will be displayed continously in the mode line. +present will be displayed continuously in the mode line. @item blink-paren @cindex blink-paren diff -r 72a7cfa4a488 -r abe6d1db359e man/new-users-guide/region.texi --- a/man/new-users-guide/region.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/new-users-guide/region.texi Mon Aug 13 11:35:02 2007 +0200 @@ -217,7 +217,7 @@ contents. This command will also prompt you for a buffer name. @item M-x insert-buffer Insert contents of specified buffer into current buffer at point. This -command will prompt you for a buffername which you want to be copied +command will prompt you for a buffer name which you want to be copied into the current buffer at the location of the cursor. @item M-x append-to-file This command will prompt you for a filename and append the region to diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs-faq.texi --- a/man/xemacs-faq.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs-faq.texi Mon Aug 13 11:35:02 2007 +0200 @@ -1,4 +1,4 @@ -\input texinfo.tex @c -*-texinfo-*- +\input texinfo.tex @c -*- mode: texinfo; coding: iso-2022-8 -*- @c %**start of header @setfilename ../info/xemacs-faq.info @settitle Frequently asked questions about XEmacs @@ -7,7 +7,7 @@ @finalout @titlepage @title XEmacs FAQ -@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/01/27 17:11:28 $ +@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/09/19 07:50:41 $ @sp 1 @author Tony Rossini @author Ben Wing @@ -32,23 +32,17 @@ This is the guide to the XEmacs Frequently Asked Questions list---a compendium of questions and answers pertaining to one of the finest -programs ever written. It is much more than just a Text Editor. - -This FAQ is freely redistributable. I take no liability for the -correctness and safety of any procedures or advice given here. This -FAQ 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. +programs ever written. XEmacs is much more than just a Text Editor. + +This FAQ is freely redistributable. This FAQ 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. If you have a Web browser, the official hypertext version is at @iftex @* @end iftex -@uref{http://www.xemacs.org/faq/xemacs-faq.html}. - -This version is somewhat nicer than the unofficial hypertext versions -that are archived at Utrecht, Oxford, Smart Pages, and other FAQ -archives. +@uref{http://www.xemacs.org/faq/xemacs-faq.html} @ifset CANONICAL @html @@ -104,7 +98,7 @@ * Q1.0.4:: Why Another Version of Emacs? * Q1.0.5:: Why Haven't XEmacs and GNU Emacs Merged? * Q1.0.6:: Where can I get help? -* Q1.0.7:: Where is the mailing list archived? +* Q1.0.7:: Where are the mailing lists archived? * Q1.0.8:: How do you pronounce XEmacs? * Q1.0.9:: What does XEmacs look like? * Q1.0.10:: Is there a port of XEmacs to Microsoft ('95 or NT)? @@ -124,12 +118,12 @@ * Q1.2.3:: Who contributed to the FAQ in the past? Internationalization: -* Q1.3.1:: What is the status of XEmacs v20? -* Q1.3.2:: What is the status of Asian-language support, aka @var{mule}? +* Q1.3.1:: What is the status of internationalization support aka MULE (including Asian language support? +* Q1.3.2:: How can I help with internationalization? * Q1.3.3:: How do I type non-ASCII characters? * Q1.3.4:: Can XEmacs messages come out in a different language? -* Q1.3.5:: Please explain the various input methods in MULE/XEmacs 20.0 -* Q1.3.6:: How do I portably code for MULE/XEmacs 20.0? +* Q1.3.5:: Please explain the various input methods in MULE/XEmacs +* Q1.3.6:: How do I portably code for MULE/XEmacs? * Q1.3.7:: How about Cyrillic Modes? Getting Started: @@ -351,7 +345,7 @@ * Q5.1.4:: What is the performance hit of @code{let}? * Q5.1.5:: What is the recommended use of @code{setq}? * Q5.1.6:: What is the typical misuse of @code{setq} ? -* Q5.1.7:: I like the the @code{do} form of cl, does it slow things down? +* Q5.1.7:: I like the @code{do} form of cl, does it slow things down? * Q5.1.8:: I like recursion, does it slow things down? * Q5.1.9:: How do I put a glyph as annotation in a buffer? * Q5.1.10:: @code{map-extents} won't traverse all of my extents! @@ -403,6 +397,9 @@ * Q6.3.2:: What are the differences between the various MS Windows emacsen? * Q6.3.3:: What is the porting team doing at the moment? +Troubleshooting: +* Q6.4.1:: XEmacs won't start on Windows. (NEW) + Current Events: * Q7.0.1:: What is new in 20.2? @@ -449,7 +446,7 @@ * Q1.0.4:: Why Another Version of Emacs? * Q1.0.5:: Why Haven't XEmacs and GNU Emacs Merged? * Q1.0.6:: Where can I get help? -* Q1.0.7:: Where is the mailing list archived? +* Q1.0.7:: Where are the mailing lists archived? * Q1.0.8:: How do you pronounce XEmacs? * Q1.0.9:: What does XEmacs look like? * Q1.0.10:: Is there a port of XEmacs to Microsoft ('95 or NT)? @@ -469,12 +466,12 @@ * Q1.2.3:: Who contributed to the FAQ in the past? Internationalization: -* Q1.3.1:: What is the status of XEmacs v20? -* Q1.3.2:: What is the status of Asian-language support, aka @var{mule}? +* Q1.3.1:: What is the status of internationalization support aka MULE (including Asian language support? +* Q1.3.2:: How can I help with internationalization? * Q1.3.3:: How do I type non-ASCII characters? * Q1.3.4:: Can XEmacs messages come out in a different language? -* Q1.3.5:: Please explain the various input methods in MULE/XEmacs 20.0 -* Q1.3.6:: How do I portably code for MULE/XEmacs 20.0? +* Q1.3.5:: Please explain the various input methods in MULE/XEmacs +* Q1.3.6:: How do I portably code for MULE/XEmacs? * Q1.3.7:: How about Cyrillic Modes? Getting Started: @@ -500,10 +497,10 @@ @node Q1.0.2, Q1.0.3, Q1.0.1, Introduction @unnumberedsubsec Q1.0.2: What is the current version of XEmacs? -XEmacs 21.1.8 is the current stable version of XEmacs. - -XEmacs 20.4 is a minor upgrade from 20.3, containing many bugfixes. It -was released in February 1998. +XEmacs versions 21.1.* are releases made from the current stable +sources. XEmacs versions 21.2.* are releases made from the development +sources. Check at @uref{http://www.xemacs.org} for the current minor +version. XEmacs 19.16 was the last release of v19, released in November, 1997, which was also the last version without international language support. @@ -628,7 +625,7 @@ @samp{unsubscribe} to be removed. @node Q1.0.7, Q1.0.8, Q1.0.6, Introduction -@unnumberedsubsec Q1.0.7: Where is the mailing list archived? +@unnumberedsubsec Q1.0.7: Where are the mailing lists archived? The archives can be found at @uref{http://www.xemacs.org/Lists/Archive} @@ -697,9 +694,8 @@ @c @uref{ftp://ftp.cs.cornell.edu/pub/parmet/, Emacs 18.59}. Yes, there is a port of XEmacs 19.14, tested on MacOS 7.6.1 and MacOS -8.5.1 by @uref{pjarvis@@ispchannel.com,Pitts Jarvis}. It's available -at @uref{http://my.ispchannel.com/~pjarvis/xemacs.html, -http://my.ispchannel.com/~pjarvis/xemacs.html}. +8.5.1 by @email{pjarvis@@ispchannel.com, Pitts Jarvis}. It's available +at @uref{http://my.ispchannel.com/~pjarvis/xemacs.html}. @node Q1.0.12, Q1.0.13, Q1.0.11, Introduction @unnumberedsubsec Q1.0.12: Is there a port of XEmacs to NextStep? @@ -720,8 +716,7 @@ TeX, you can generate your own manual from the XEmacs sources. HTML and Postscript versions of XEmacs manuals may be available from the -XEmacs web site in the future. - +XEmacs web site in the future. Send requests to @email{faq@@xemacs.org}. @node Q1.1.1, Q1.1.2, Q1.0.14, Introduction @unnumberedsec 1.1: Policies @@ -736,12 +731,11 @@ Please make sure that @samp{XEmacs FAQ} appears on the Subject: line. If you think you have a better way of answering a question, or think a question should be included, we'd like to hear about it. Questions and -answers included into the FAQ will be edited for spelling and grammar, +answers included into the FAQ will be edited for spelling and grammar and will be attributed. Answers appearing without attribution are -either from versions of the FAQ dated before May 1996, or are from one -of the four people listed at the top of this document. Answers quoted -from Usenet news articles will always be attributed, regardless of the -author. +either from versions of the FAQ dated before May 1996 or are from +previous FAQ maintainers. Answers quoted from Usenet news articles will +always be attributed, regardless of the author. @node Q1.1.2, Q1.1.3, Q1.1.1, Introduction @unnumberedsubsec Q1.1.2: How do I become a Beta Tester? @@ -911,80 +905,16 @@ @node Q1.3.1, Q1.3.2, Q1.2.3, Introduction @unnumberedsec 1.3: Internationalization -@unnumberedsubsec Q1.3.1: What is the status of XEmacs v20? - -XEmacs v20 is the version of XEmacs that includes MULE (Asian-language) -support. XEmacs 20.0 was released in February 1997, followed by XEmacs -20.2 in May, XEmacs 20.3 in November and XEmacs 20.4 in February 1998. When compiled without MULE -support, 20.4 is approximately as stable as 19.16, and probably faster -(due to additional optimization work.) - -As of XEmacs 20.3, version 20 is @emph{the} supported version of -XEmacs. This means that 19.16 will optionally receive stability fixes -(if any), but that all the real development work will be done on the v20 -tree. - -The incompatible changes in XEmacs 20 include the additional byte-codes, -new primitive data types (@code{character}, @code{char-table}, and -@code{range-table}). This means that the character-integer equivalence -inherent to all the previous Emacs and XEmacs releases no longer -applies. - -However, to avoid breaking old code, many functions that should normally -accept characters work with integers, and vice versa. For more -information, see the Lisp reference manual. Here is a relevant excerpt, -for your convenience. - -@quotation - In XEmacs version 19, and in all versions of FSF GNU Emacs, a -@dfn{character} in XEmacs Lisp is nothing more than an integer. -This is yet another holdover from XEmacs Lisp's derivation from -vintage-1980 Lisps; modern versions of Lisp consider this equivalence -a bad idea, and have separate character types. In XEmacs version 20, -the modern convention is followed, and characters are their own -primitive types. (This change was necessary in order for @sc{mule}, -i.e. Asian-language, support to be correctly implemented.) - - Even in XEmacs version 20, remnants of the equivalence between -characters and integers still exist; this is termed the @dfn{char-int -confoundance disease}. In particular, many functions such as @code{eq}, -@code{equal}, and @code{memq} have equivalent functions (@code{old-eq}, -@code{old-equal}, @code{old-memq}, etc.) that pretend like characters -are integers are the same. Byte code compiled under any version 19 -Emacs will have all such functions mapped to their @code{old-} equivalents -when the byte code is read into XEmacs 20. This is to preserve -compatibility---Emacs 19 converts all constant characters to the equivalent -integer during byte-compilation, and thus there is no other way to preserve -byte-code compatibility even if the code has specifically been written -with the distinction between characters and integers in mind. - - Every character has an equivalent integer, called the @dfn{character -code}. For example, the character @kbd{A} is represented as the -@w{integer 65}, following the standard @sc{ascii} representation of -characters. If XEmacs was not compiled with @sc{mule} support, the -range of this integer will always be 0 to 255---eight bits, or one -byte. (Integers outside this range are accepted but silently truncated; -however, you should most decidedly @emph{not} rely on this, because it -will not work under XEmacs with @sc{mule} support.) When @sc{mule} -support is present, the range of character codes is much -larger. (Currently, 19 bits are used.) - - FSF GNU Emacs uses kludgy character codes above 255 to represent -keyboard input of @sc{ascii} characters in combination with certain -modifiers. XEmacs does not use this (a more general mechanism is -used that does not distinguish between @sc{ascii} keys and other -keys), so you will never find character codes above 255 in a -non-@sc{mule} XEmacs. - - Individual characters are not often used in programs. It is far more -common to work with @emph{strings}, which are sequences composed of -characters. -@end quotation +@unnumberedsubsec Q1.3.1: What is the status of internationalization support aka MULE (including Asian language support? + +Both the stable and development versions of XEmacs include +internationalization support (aka MULE). MULE currently works on UNIX +and Linux systems; work for supporting MULE on Windows operating systems +is in progress. Binaries compiled without MULE support run faster than +MULE capable XEmacsen. @node Q1.3.2, Q1.3.3, Q1.3.1, Introduction -@unnumberedsubsec Q1.3.2: What is the status of Asian-language support, aka MULE? - -MULE support is now available for UNIX versions of XEmacs. +@unnumberedsubsec Q1.3.2: How can I help with internationalization? If you would like to help, you may want to join the @email{xemacs-mule@@xemacs.org} mailing list. Especially needed are @@ -1003,20 +933,20 @@ The message-catalog support has mostly been written but doesn't currently work. The first release of XEmacs 20 will @emph{not} support -it. However, menubar localization @emph{does} work, even in 19.14. To +it. However, menubar localization @emph{does} work. To enable it, add to your @file{Emacs} file entries like this: @example Emacs*XlwMenu.resourceLabels: True Emacs*XlwMenu.file.labelString: Fichier -Emacs*XlwMenu.openInOtherWindow.labelString: In anderem Fenster offnen +Emacs*XlwMenu.openInOtherWindow.labelString: In anderem Fenster oeffnen @end example The name of the resource is derived from the non-localized entry by removing punctuation and capitalizing as above. @node Q1.3.5, Q1.3.6, Q1.3.4, Introduction -@unnumberedsubsec Q1.3.5: Please explain the various input methods in MULE/XEmacs 20.0 +@unnumberedsubsec Q1.3.5: Please explain the various input methods in MULE/XEmacs @email{morioka@@jaist.ac.jp, MORIOKA Tomohiko} writes: @@ -1067,7 +997,7 @@ @end quotation @node Q1.3.6, Q1.3.7, Q1.3.5, Introduction -@unnumberedsubsec Q1.3.6: How do I portably code for MULE/XEmacs 20? +@unnumberedsubsec Q1.3.6: How do I portably code for MULE/XEmacs? @email{morioka@@jaist.ac.jp, MORIOKA Tomohiko} writes: @@ -1313,8 +1243,8 @@ @node Q2.0.1, Q2.0.2, Installation, Installation @unnumberedsec 2.0: Installation @unnumberedsubsec Q2.0.1: Running XEmacs without installing -The @file{INSTALL} file says that up to 108 MB of space is needed -temporarily during installation! How can I just try it out? + +How can I just try XEmacs without installing it? XEmacs will run in place without requiring installation and copying of the Lisp directories, and without having to specify a special build-time @@ -1335,98 +1265,13 @@ @node Q2.0.2, Q2.0.3, Q2.0.1, Installation @unnumberedsubsec Q2.0.2: XEmacs is too big -Although this entry has been written for XEmacs 19.13, most of it still -stands true. - -@email{steve@@xemacs.org, Steve Baur} writes: - -@quotation -The 45MB of space required by the installation directories can be +The space required by the installation directories can be reduced dramatically if desired. Gzip all the .el files. Remove all -the packages you'll never want to use (or even ones you do like the two -obsolete mailcrypts and Gnus 4 in 19.13). Remove the TexInfo manuals. +the packages you'll never want to use. Remove the TexInfo manuals. Remove the Info (and use just hardcopy versions of the manual). Remove most of the stuff in etc. Remove or gzip all the source code. Gzip or remove the C source code. Configure it so that copies are not made of -the support lisp. I'm not advocating any of these things, just pointing -out ways to reduce the disk requirements if desired. - -Now examine the space used by directory: - -@format -0 /usr/local/bin/xemacs -2048 /usr/local/bin/xemacs-19.13 - -1546 /usr/local/lib/xemacs-19.13/i486-miranova-sco3.2v4.2 -1158 /usr/local/lib/xemacs-19.13/i486-unknown-linux1.2.13 -@end format - -You need to keep these. XEmacs isn't stripped by default in -installation, you should consider stripping. That will save you about -5MB right there. - -@format -207 /usr/local/lib/xemacs-19.13/etc/w3 -122 /usr/local/lib/xemacs-19.13/etc/sounds -18 /usr/local/lib/xemacs-19.13/etc/sparcworks -159 /usr/local/lib/xemacs-19.13/etc/vm -6 /usr/local/lib/xemacs-19.13/etc/e -21 /usr/local/lib/xemacs-19.13/etc/eos -172 /usr/local/lib/xemacs-19.13/etc/toolbar -61 /usr/local/lib/xemacs-19.13/etc/ns -43 /usr/local/lib/xemacs-19.13/etc/gnus -@end format - -These are support directories for various packages. In general they -match a directory under ./xemacs-19.13/lib/xemacs-19.13/lisp/. If you -do not require the package, you may delete or gzip the support too. - -@format -1959 /usr/local/lib/xemacs-19.13/etc -175 /usr/local/lib/xemacs-19.13/lisp/bytecomp -340 /usr/local/lib/xemacs-19.13/lisp/calendar -342 /usr/local/lib/xemacs-19.13/lisp/comint -517 /usr/local/lib/xemacs-19.13/lisp/dired -42 /usr/local/lib/xemacs-19.13/lisp/electric -212 /usr/local/lib/xemacs-19.13/lisp/emulators -238 /usr/local/lib/xemacs-19.13/lisp/energize -289 /usr/local/lib/xemacs-19.13/lisp/gnus -457 /usr/local/lib/xemacs-19.13/lisp/ilisp -1439 /usr/local/lib/xemacs-19.13/lisp/modes -2276 /usr/local/lib/xemacs-19.13/lisp/packages -1040 /usr/local/lib/xemacs-19.13/lisp/prim -176 /usr/local/lib/xemacs-19.13/lisp/pcl-cvs -154 /usr/local/lib/xemacs-19.13/lisp/rmail -3 /usr/local/lib/xemacs-19.13/lisp/epoch -45 /usr/local/lib/xemacs-19.13/lisp/term -860 /usr/local/lib/xemacs-19.13/lisp/utils -851 /usr/local/lib/xemacs-19.13/lisp/vm -13 /usr/local/lib/xemacs-19.13/lisp/vms -157 /usr/local/lib/xemacs-19.13/lisp/x11 -19 /usr/local/lib/xemacs-19.13/lisp/tooltalk -14 /usr/local/lib/xemacs-19.13/lisp/sunpro -291 /usr/local/lib/xemacs-19.13/lisp/games -198 /usr/local/lib/xemacs-19.13/lisp/edebug -619 /usr/local/lib/xemacs-19.13/lisp/w3 -229 /usr/local/lib/xemacs-19.13/lisp/eos -55 /usr/local/lib/xemacs-19.13/lisp/iso -59 /usr/local/lib/xemacs-19.13/lisp/mailcrypt -187 /usr/local/lib/xemacs-19.13/lisp/eterm -356 /usr/local/lib/xemacs-19.13/lisp/ediff -408 /usr/local/lib/xemacs-19.13/lisp/hyperbole/kotl -1262 /usr/local/lib/xemacs-19.13/lisp/hyperbole -247 /usr/local/lib/xemacs-19.13/lisp/hm--html-menus -161 /usr/local/lib/xemacs-19.13/lisp/mh-e -299 /usr/local/lib/xemacs-19.13/lisp/viper -53 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-x -4 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/DocWindow.nib -3 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/InfoPanel.nib -3 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/TreeView.nib -11 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj -53 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx -466 /usr/local/lib/xemacs-19.13/lisp/oobr -14142 /usr/local/lib/xemacs-19.13/lisp -@end format +the support lisp. These are all Emacs Lisp source code and bytecompiled object code. You may safely gzip everything named *.el here. You may remove any package @@ -1434,81 +1279,24 @@ that you do not use}. You must be sure you do not use it though, so be conservative at first. -Possible candidates for deletion include w3 (newer versions exist, or -you may just use Lynx or Netscape for web browsing), games, hyperbole, -mh-e, hm--html-menus (better packages exist), vm, viper, oobr, gnus (new -versions exist), etc. Ask yourself, @emph{Do I ever want to use this -package?} If the answer is no, then it is a candidate for removal. +Possible candidates for deletion include w3, games, hyperbole, mh-e, +hm-html-menus, vm, viper, oobr, gnus, etc. Ask yourself, @emph{Do I +ever want to use this package?} If the answer is no, then it is a +candidate for removal. First, gzip all the .el files. Then go about package by package and start gzipping the .elc files. Then run XEmacs and do whatever it is you normally do. If nothing bad happens, then delete the directory. Be conservative about deleting directories, and it would be handy to have a -backup tape around in case you get too zealous. +backup around in case you get too zealous. @file{prim}, @file{modes}, @file{packages}, and @file{utils} are four directories you definitely do @strong{not} want to delete, although certain packages can be removed from them if you do not use them. -@example -1972 /usr/local/lib/xemacs-19.13/info -@end example - -These are online texinfo sources. You may either gzip them or remove -them. In either case, @kbd{C-h i} (info mode) will no longer work. - -@example -20778 /usr/local/lib/xemacs-19.13 -@end example - -The 20MB achieved is less than half of what the full distribution takes up, -@strong{and} can be achieved without deleting a single file. -@end quotation - -@email{boffi@@hp735.stru.polimi.it, Giacomo Boffi} provides this procedure: - -@quotation -Substitute @file{/usr/local/lib/} with the path where the xemacs tree is -rooted, then use this script: - -@example -#!/bin/sh - -r=/usr/local/lib/xemacs-19.13/lisp - -cd $r ; rm -f cmpr ; touch cmpr - -du -s . - -for d in * ; do - if test -d $d ; then - cd $d - for f in *.el ; do -# compress (remove) only (ONLY) the sources that have a -# corresponding compiled file --- do not (DO NOT) -# touch other sources - if test -f $@{f@}c ; then gzip -v9 $f >> $r/cmpr ; fi - done - cd .. - fi -done - -du -s . -@end example - -A step beyond would be substituting @samp{rm -f} for @samp{gzip -v9}, -but you have to be desperate for removing the sources (remember that -emacs can access compressed files transparently). - -Also, a good megabyte could easily be trimmed from the $r/../etc -directory, e.g., the termcap files, some O+NEWS, others that I don't -remember as well. -@end quotation - -@quotation -XEmacs 21.0 will unbundle the lisp hierarchy and allow the installer -to choose exactly how much support code gets installed. -@end quotation +Online texinfo sources in the @file{info} can either be compressed them +or remove them. In either case, @kbd{C-h i} (info mode) will no longer +work. @node Q2.0.3, Q2.0.4, Q2.0.2, Installation @unnumberedsubsec Q2.0.3: Compiling XEmacs with Netaudio. @@ -1565,9 +1353,8 @@ @unnumberedsubsec Q2.0.5: Do I need X11 to run XEmacs? No. The name @dfn{XEmacs} is unfortunate in the sense that it is -@strong{not} an X Window System-only version of Emacs. Starting with -19.14 XEmacs has full color support on a color-capable character -terminal. +@strong{not} an X Window System-only version of Emacs. XEmacs has +full color support on a color-capable character terminal. @node Q2.0.6, Q2.0.7, Q2.0.5, Installation @unnumberedsubsec Q2.0.6: I'm having strange crashes. What do I do? @@ -2489,7 +2276,6 @@ @node Q2.1.24, , Q2.1.23, Installation @unnumberedsubsec Q2.1.24: XEmacs won't start without network. (NEW) -Q2.1.23: Movemail on Linux does not work for XEmacs 19.15 and later. 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 @@ -3035,8 +2821,8 @@ @end quotation +@node Q3.3.1, Q3.3.2, Q3.2.6, Customization @unnumberedsec 3.3: The Modeline -@node Q3.3.1, Q3.3.2, Q3.2.6, Customization @unnumberedsubsec Q3.3.1: How can I make the modeline go away? @lisp @@ -4870,7 +4656,7 @@ * Q5.1.4:: What is the performance hit of @code{let}? * Q5.1.5:: What is the recommended use of @code{setq}? * Q5.1.6:: What is the typical misuse of @code{setq}? -* Q5.1.7:: I like the the @code{do} form of cl, does it slow things down? +* Q5.1.7:: I like the @code{do} form of cl, does it slow things down? * Q5.1.8:: I like recursion, does it slow things down? * Q5.1.9:: How do I put a glyph as annotation in a buffer? * Q5.1.10:: @code{map-extents} won't traverse all of my extents! @@ -5520,7 +5306,7 @@ @end lisp @node Q5.1.7, Q5.1.8, Q5.1.6, Miscellaneous -@unnumberedsubsec Q5.1.7: I like the the @code{do} form of cl, does it slow things down? +@unnumberedsubsec Q5.1.7: I like the @code{do} form of cl, does it slow things down? It shouldn't. Here is what Dave Gillespie has to say about cl.el performance: @@ -6103,6 +5889,9 @@ * Q6.3.2:: What are the differences between the various MS Windows emacsen? * Q6.3.3:: What is the porting team doing at the moment? +Troubleshooting: +* Q6.4.1:: XEmacs won't start on Windows. (NEW) + @end menu @node Q6.0.1, Q6.0.2, MS Windows, MS Windows @@ -6206,8 +5995,10 @@ @node Q6.1.2, Q6.1.3, Q6.1.1, MS Windows @unnumberedsubsec Q6.1.2: What compiler do I need to compile XEmacs? -You need Visual C++ 4.2 or 5.0, with the exception of the Cygwin port, -which uses Gcc. +You need Visual C++ 4.2, 5.0, or 6.0, with the exception of the Cygwin +port, which uses Gcc. There is also a MINGW32 port of XEmacs (using +Gcc, but using native libraries rather than the Cygwin libraries). #### +More information about this should be provided. @node Q6.1.3, Q6.1.4, Q6.1.2, MS Windows @@ -6237,8 +6028,8 @@ from; @item -CYGWIN32 needs to be set to tty for process support -work. e.g. CYGWIN32=tty; +CYGWIN needs to be set to tty for process support work. e.g. CYGWIN=tty; +(use CYGWIN32=tty under b19 and older.) @item picking up some other grep or other unix like tools can kill configure; @@ -6262,16 +6053,56 @@ @uref{http://sourceware.cygnus.com/cygwin/} You will need version b19 or later. - -You will also need the X libraries. There are libraries at +The latest current version is 1.1.1. +Other common versions you will see are b20.1. + +Another location, one of the mirror sites of the site just mentioned, +is usually a last faster: + +@uref{ftp://ftp.freesoftware.com/pub/sourceware/cygwin/} + +You can obtain the latest version (currently 1.1.1) from the +@samp{latest/} subdirectory of either of the above two just-mentioned +URL's. + +@strong{WARNING: The version of GCC supplied under @samp{latest/}, as of +June 6th, 2000, does not appear to work. It generates loads of spurious +preprocessor warnings and errors, which makes it impossible to compile +XEmacs with it.} + +You will also need the X libraries. You can get them on the XEmacs FTP +site at + +@uref{ftp://ftp.xemacs.org/pub/xemacs/aux/cygwin/} + +You will find b19 and b20 versions of the X libraries, plus b19 and b20 +versions of stuff that should go into @samp{/usr/local/}, donated by +Andy Piper. This includes pre-built versions of various graphics libraries, +such as PNG, JPEG, TIFF, and XPM. (Remember, GIF support is built-in to +XEmacs.) + +(X libraries for v1 and beyond of Cygwin can be found on the Cygwin site +itself -- look in the @samp{xfree/} subdirectory.) + +@emph{NOTE:} There are two versions of the XPM library provided in +Andy's packets. Once is for building with X support, and the other for +building without. The X version should work if you're building with +both X and Windows support. The two files are called @file{libXpm-X.a} +and @file{libXpm-noX.a} respectively, and you must symlink the +appropriate one to @file{libXpm.a}. @strong{CAREFUL:} By default, the +non-X version is symlinked in. If you then configure XEmacs with X, +you won't run into problems until you start compiling @file{events.c}, +at which point you'll get strange and decidedly non-obvious errors. + +Please see @uref{http://www.xemacs.freeserve.co.uk/} (Andy Piper's home +page) for more information. + +BTW There are also libraries at @iftex @* @end iftex @uref{http://dao.gsfc.nasa.gov/software/grads/win32/X11R6.3/}, but -these are not b19 compatible. You can get b19 X11R6.3 binaries, as -well as pre-built ncurses and graphic libraries, from: - -@uref{ftp://ftp.parallax.co.uk/pub/andyp/}. +these are not b19 compatible, and may in fact be native-compiled. @node Q6.2.1, Q6.2.2, Q6.1.6, MS Windows @@ -6433,11 +6264,38 @@ @end itemize -@node Q6.3.3, , Q6.3.2, MS Windows +@node Q6.3.3, Q6.4.1, Q6.3.2, MS Windows @unnumberedsubsec Q6.3.3: What is the porting team doing at the moment? The porting team is continuing work on the MS Windows-specific code. +@node Q6.4.1, ,Q6.3.3, MS Windows +@unnumberedsec 6.3: Troubleshooting +@unnumberedsubsec Q6.4.1 XEmacs won't start on Windows. (NEW) + +XEmacs relies on a process called "dumping" to generate a working +executable. Under MS-Windows this process effectively fixes the memory +addresses of information in the executable. When XEmacs starts up it tries +to reserve these memory addresses so that the dumping process can be +reversed - putting the information back at the correct addresses. +Unfortunately some .dlls (For instance the soundblaster driver) occupy +memory addresses that can conflict with those needed by the dumped XEmacs +executable. In this instance XEmacs will fail to start without any +explanation. Note that this is extremely machine specific. + +21.1.10 includes a fix for this that makes more intelligent guesses +about which memory addresses will be free, and this should cure the +problem for most people. Unfortunately, no binary is yet available for +this version. Check back periodically at + +@uref{ftp://ftp.xemacs.org/pub/xemacs/binaries/}. + +21.2 implements "portable dumping" which will eliminate the problem +altogether. You might have better luck with the 21.2 beta binary, +available at + +@uref{ftp://ftp.xemacs.org/pub/xemacs/beta/binaries/}. + @node Current Events, , MS Windows, Top @unnumbered 7 What the Future Holds diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/abbrevs.texi --- a/man/xemacs/abbrevs.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/abbrevs.texi Mon Aug 13 11:35:02 2007 +0200 @@ -257,9 +257,10 @@ minibuffer and reads the specified file, defining abbrevs according to its contents. @kbd{M-x quietly-read-abbrev-file} is the same but does not display a message in the echo area; it is actually useful primarily -in the @file{.emacs} file. If you give an empty argument to either of -these functions, the file name Emacs uses is the value of the variable -@code{abbrev-file-name}, which is by default @code{"~/.abbrev_defs"}. +in the init file. @xref{Init File}. If you give an empty argument to +either of these functions, the file name Emacs uses is the value of the +variable @code{abbrev-file-name}, which is by default +@code{"~/.abbrev_defs"}. @vindex save-abbrevs Emacs offers to save abbrevs automatically if you have changed any of diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/basic.texi --- a/man/xemacs/basic.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/basic.texi Mon Aug 13 11:35:02 2007 +0200 @@ -1,4 +1,6 @@ - +@c This is part of the XEmacs manual. +@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc. +@c See file xemacs.texi for copying conditions. @node Basic, Undo, Startup Paths, Top @chapter Basic Editing Commands @@ -7,8 +9,34 @@ We now give the basics of how to enter text, make corrections, and save the text in a file. If this material is new to you, you might learn it more easily by running the Emacs learn-by-doing tutorial. To -do this, type @kbd{Control-h t} (@code{help-with-tutorial}). +use the tutorial, run Emacs and type @kbd{Control-h t} +(@code{help-with-tutorial}). You can also use @b{Tutorials} item from +the @b{Help} menu. + +XEmacs comes with many translations of tutorial. If your XEmacs is with +MULE and you set up language environment correctly, XEmacs chooses right +tutorial when available (@pxref{Language Environments}). If you want +specific translation, give @kbd{C-h t} a prefix argument, like @kbd{C-u +C-h t}. + + To clear the screen and redisplay, type @kbd{C-l} (@code{recenter}). + +@menu +* Inserting Text:: Inserting text by simply typing it. +* Moving Point:: How to move the cursor to the place where you want to + change something. +* Erasing:: Deleting and killing text. +* Files: Basic Files. Visiting, creating, and saving files. +* Help: Basic Help. Asking what a character does. +* Blank Lines:: Commands to make or delete blank lines. +* Continuation Lines:: Lines too wide for the screen. +* Position Info:: What page, line, row, or column is point on? +* Arguments:: Numeric arguments for repeating a command. +@c * Repeating:: A short-cut for repeating the previous command. +@end menu + +@node Inserting Text, Moving Point, , Basic @section Inserting Text @cindex insertion @@ -16,74 +44,92 @@ @cindex cursor @cindex graphic characters To insert printing characters into the text you are editing, just type -them. This inserts the characters into the buffer at the cursor (that -is, at @dfn{point}; @pxref{Point}). The cursor moves forward. Any -characters after the cursor move forward too. If the text in the buffer -is @samp{FOOBAR}, with the cursor before the @samp{B}, and you type -@kbd{XX}, the result is @samp{FOOXXBAR}, with the cursor still before the -@samp{B}. +them. This inserts the characters you type into the buffer at the +cursor (that is, at @dfn{point}; @pxref{Point}). The cursor moves +forward, and any text after the cursor moves forward too. If the text +in the buffer is @samp{FOOBAR}, with the cursor before the @samp{B}, +then if you type @kbd{XX}, you get @samp{FOOXXBAR}, with the cursor +still before the @samp{B}. -@kindex DEL +@kindex BS @cindex deletion - To @dfn{delete} text you have just inserted, use @key{DEL}. -@key{DEL} deletes the character @var{before} the cursor (not the one -that the cursor is on top of or under; that is the character @var{after} -the cursor). The cursor and all characters after it move backwards. -Therefore, if you type a printing character and then type @key{DEL}, -they cancel out. + To @dfn{delete} text you have just inserted, use @key{BS}. @key{BS} +deletes the character @emph{before} the cursor (not the one that the +cursor is on top of or under; that is the character @var{after} the +cursor). The cursor and all characters after it move backwards. +Therefore, if you type a printing character and then type @key{BS}, they +cancel out. @kindex RET @cindex newline To end a line and start typing a new one, type @key{RET}. This inserts a newline character in the buffer. If point is in the middle of a line, @key{RET} splits the line. Typing @key{DEL} when the cursor is -at the beginning of a line rubs out the newline before the line, thus -joining the line with the preceding line. - - Emacs automatically splits lines when they become too long, if you -turn on a special mode called @dfn{Auto Fill} mode. @xref{Filling}, for -information on using Auto Fill mode. +at the beginning of a line deletes the preceding newline, thus joining +the line with the preceding line. -@findex delete-backward-char -@findex newline -@findex self-insert - Customization information: @key{DEL}, in most modes, runs the command -@code{delete-backward-char}; @key{RET} runs the command @code{newline}, -and self-inserting printing characters run the command -@code{self-insert}, which inserts whatever character was typed to invoke -it. Some major modes rebind @key{DEL} to other commands. + Emacs can split lines automatically when they become too long, if you +turn on a special minor mode called @dfn{Auto Fill} mode. +@xref{Filling}, for how to use Auto Fill mode. + + If you prefer to have text characters replace (overwrite) existing +text rather than shove it to the right, you can enable Overwrite mode, +a minor mode. @xref{Minor Modes}. @cindex quoting @kindex C-q @findex quoted-insert - Direct insertion works for printing characters and @key{SPC}, but -other characters act as editing commands and do not insert themselves. -If you need to insert a control character or a character whose code is -above 200 octal, you must @dfn{quote} it by typing the character -@kbd{control-q} (@code{quoted-insert}) first. There are two ways to use -@kbd{C-q}:@refill + Direct insertion works for printing characters and @key{SPC}, but other +characters act as editing commands and do not insert themselves. If you +need to insert a control character or a character whose code is above 200 +octal, you must @dfn{quote} it by typing the character @kbd{Control-q} +(@code{quoted-insert}) first. (This character's name is normally written +@kbd{C-q} for short.) There are two ways to use @kbd{C-q}: @itemize @bullet @item -@kbd{Control-q} followed by any non-graphic character (even @kbd{C-g}) +@kbd{C-q} followed by any non-graphic character (even @kbd{C-g}) inserts that character. + @item -@kbd{Control-q} followed by three octal digits inserts the character -with the specified character code. +@kbd{C-q} followed by a sequence of octal digits inserts the character +with the specified octal character code. You can use any number of +octal digits; any non-digit terminates the sequence. If the terminating +character is @key{RET}, it serves only to terminate the sequence; any +other non-digit is itself used as input after terminating the sequence. +(The use of octal sequences is disabled in ordinary non-binary Overwrite +mode, to give you a convenient way to insert a digit instead of +overwriting with it.) @end itemize @noindent A numeric argument to @kbd{C-q} specifies how many copies of the quoted character should be inserted (@pxref{Arguments}). - If you prefer to have text characters replace (overwrite) existing -text instead of moving it to the right, you can enable Overwrite mode, a -minor mode. @xref{Minor Modes}. +@findex backward-or-forward-delete-char +@findex newline +@findex self-insert + Customization information: @key{DEL}, in most modes, runs the command +@code{backward-or-forward-delete-char}; @key{RET} runs the command +@code{newline}, and self-inserting printing characters run the command +@code{self-insert}, which inserts whatever character was typed to invoke +it. Some major modes rebind @key{DEL} to other commands. +@node Moving Point, Erasing, Inserting Text, Basic @section Changing the Location of Point +@cindex arrow keys +@kindex LEFT +@kindex RIGHT +@kindex UP +@kindex DOWN +@cindex moving point +@cindex movement +@cindex cursor motion +@cindex moving the cursor To do more than insert characters, you have to know how to move point -(@pxref{Point}). Here are a few of the available commands. +(@pxref{Point}). The simplest way to do this is with arrow keys, or by +clicking the left mouse button where you want to move to. NOTE: Many of the following commands have two versions, one that uses the function keys (e.g. @key{LEFT} or @key{END}) and one that doesn't. @@ -149,7 +195,10 @@ Move backward one word (@code{backward-word}). @item C-n @itemx DOWN -Move down one line, vertically (@code{next-line}). This command attempts to keep the horizontal position unchanged, so if you start in the middle of one line, you end in the middle of the next. When on the last line of text, @kbd{C-n} creates a new line and moves onto it. +Move down one line, vertically (@code{next-line}). This command +attempts to keep the horizontal position unchanged, so if you start in +the middle of one line, you end in the middle of the next. When on the +last line of text, @kbd{C-n} creates a new line and moves onto it. @item C-p @itemx UP Move up one line, vertically (@code{previous-line}). @@ -163,14 +212,16 @@ Clear the frame and reprint everything (@code{recenter}). Text moves on the frame to bring point to the center of the window. @item M-r -Move point to left margin on the line halfway down the frame or -window (@code{move-to-window-line}). Text does not move on the -frame. A numeric argument says how many screen lines down from the -top of the window (zero for the top). A negative argument counts from -the bottom (@minus{}1 for the bottom). +Move point to left margin, vertically centered in the window +(@code{move-to-window-line}). Text does not move on the screen. + +A numeric argument says which screen line to place point on. It counts +screen lines down from the top of the window (zero for the top line). A +negative argument counts lines from the bottom (@minus{}1 for the bottom +line). @item C-t Transpose two characters, the ones before and after the cursor -@*(@code{transpose-chars}). +(@code{transpose-chars}). @item M-< @itemx C-HOME Move to the top of the buffer (@code{beginning-of-buffer}). With @@ -180,35 +231,46 @@ @itemx C-END Move to the end of the buffer (@code{end-of-buffer}). @item M-x goto-char -Read a number @var{n} and move the cursor to character number @var{n}. +Read a number @var{n} and move point to buffer position @var{n}. Position 1 is the beginning of the buffer. @item M-g -Read a number @var{n} and move cursor to line number @var{n} +Read a number @var{n} and move point to line number @var{n} (@code{goto-line}). Line 1 is the beginning of the buffer. -@item C-x C-n +@c @item C-x C-n +@item M-x set-goal-column @findex set-goal-column Use the current column of point as the @dfn{semi-permanent goal column} for @kbd{C-n} and @kbd{C-p} (@code{set-goal-column}). Henceforth, those commands always move to this column in each line moved into, or as close as possible given the contents of the line. This goal column remains in effect until canceled. -@item C-u C-x C-n +@c @item C-u C-x C-n +@item C-u M-x set-goal-column Cancel the goal column. Henceforth, @kbd{C-n} and @kbd{C-p} once again try to avoid changing the horizontal position, as usual. @end table @vindex track-eol If you set the variable @code{track-eol} to a non-@code{nil} value, -@kbd{C-n} and @kbd{C-p} move to the end of the line when at the end of -the starting line. By default, @code{track-eol} is @code{nil}. +then @kbd{C-n} and @kbd{C-p} when at the end of the starting line move +to the end of another line. Normally, @code{track-eol} is @code{nil}. +@xref{Variables}, for how to set variables such as @code{track-eol}. +@vindex next-line-add-newlines + Normally, @kbd{C-n} on the last line of a buffer appends a newline to +it. If the variable @code{next-line-add-newlines} is @code{nil}, then +@kbd{C-n} gets an error instead (like @kbd{C-p} on the first line). + +@node Erasing, Basic Files, Moving Point, Basic @section Erasing Text @table @kbd @item @key{DEL} -Delete the character before the cursor (@code{delete-backward-char}). +Delete the character before or after point +(@code{backward-or-forward-delete-char}). You can customize +this behavior by setting the variable @code{delete-key-deletes-forward}. @item C-d -Delete the character after the cursor (@code{delete-char}). +Delete the character after point (@code{delete-char}). @item C-k Kill to the end of the line (@code{kill-line}). @item M-d @@ -218,30 +280,34 @@ (@code{backward-kill-word}). @end table - In contrast to the @key{DEL} key, which deletes the character before -the cursor, @kbd{Control-d} deletes the character after the cursor, -causing the rest of the text on the line to shift left. If -@kbd{Control-d} is typed at the end of a line, that line and the next -line are joined. +@cindex killing characters and lines +@cindex deleting characters and lines +@cindex erasing characters and lines + You already know about the @key{DEL} key which deletes the character +before point (that is, before the cursor). Another key, @kbd{Control-d} +(@kbd{C-d} for short), deletes the character after point (that is, the +character that the cursor is on). This shifts the rest of the text on +the line to the left. If you type @kbd{C-d} at the end of a line, it +joins together that line and the next line. - To erase a larger amount of text, use @kbd{Control-k}, which kills a -line at a time. If you use @kbd{C-k} at the beginning or in the middle -of a line, it kills all the text up to the end of the line. If you use -@kbd{C-k} at the end of a line, it joins that line and the next -line. + To erase a larger amount of text, use the @kbd{C-k} key, which kills a +line at a time. If you type @kbd{C-k} at the beginning or middle of a +line, it kills all the text up to the end of the line. If you type +@kbd{C-k} at the end of a line, it joins that line and the next line. @xref{Killing}, for more flexible ways of killing text. +@node Basic Files, Basic Help, Erasing, Basic @section Files @cindex files - The commands above are sufficient for creating and altering text in an -Emacs buffer. More advanced Emacs commands just make things easier. But -to keep any text permanently you must put it in a @dfn{file}. Files are -named units of text which are stored by the operating system and which -you can retrieve by name. To look at or use the contents of a file in -any way, including editing the file with Emacs, you must specify the -file name. + The commands described above are sufficient for creating and altering +text in an Emacs buffer; the more advanced Emacs commands just make +things easier. But to keep any text permanently you must put it in a +@dfn{file}. Files are named units of text which are stored by the +operating system for you to retrieve later by name. To look at or use +the contents of a file in any way, including editing the file with +Emacs, you must specify the file name. Consider a file named @file{/usr/rms/foo.c}. To begin editing this file from Emacs, type: @@ -251,54 +317,51 @@ @end example @noindent -The file name is given as an @dfn{argument} to the command @kbd{C-x -C-f} (@code{find-file}). The command uses the @dfn{minibuffer} to -read the argument. You have to type @key{RET} to terminate the argument -(@pxref{Minibuffer}).@refill +Here the file name is given as an @dfn{argument} to the command @kbd{C-x +C-f} (@code{find-file}). That command uses the @dfn{minibuffer} to +read the argument, and you type @key{RET} to terminate the argument +(@pxref{Minibuffer}). You can also use the @b{Open...} menu item from the @b{File} menu, then type the name of the file to the prompt. - Emacs obeys the command by @dfn{visiting} the file: it creates a -buffer, copies the contents of the file into the buffer, and then -displays the buffer for you to edit. You can make changes in the -buffer, and then @dfn{save} the file by typing @kbd{C-x C-s} -(@code{save-buffer}) or choosing @b{Save Buffer} from the @b{File} menu. -This makes the changes permanent by copying the altered contents of the -buffer back into the file @file{/usr/rms/foo.c}. Until then, the -changes are only inside your Emacs buffer, and the file @file{foo.c} is -not changed.@refill + Emacs obeys the command by @dfn{visiting} the file: creating a buffer, +copying the contents of the file into the buffer, and then displaying +the buffer for you to edit. If you alter the text, you can @dfn{save} +the new text in the file by typing @kbd{C-x C-s} (@code{save-buffer}) or +choosing @b{Save Buffer} from the @b{File} menu. This makes the changes +permanent by copying the altered buffer contents back into the file +@file{/usr/rms/foo.c}. Until you save, the changes exist only inside +Emacs, and the file @file{foo.c} is unaltered. To create a file, visit the file with @kbd{C-x C-f} as if it already existed or choose @b{Open...} from the @b{File} menu and provide the -name for the new file in the minibuffer. Emacs will create an empty -buffer in which you can insert the text you want to put in the file. -When you save the buffer with @kbd{C-x C-s}, or by choosing @b{Save -Buffer} from the @b{File} menu, the file is created. +name for the new file. Emacs will create an empty buffer in which you +can insert the text you want to put in the file. When you save the +buffer with @kbd{C-x C-s}, or by choosing @b{Save Buffer} from the +@b{File} menu, the file is created. - To learn more about using files, @pxref{Files}. + To learn more about using files, @xref{Files}. +@node Basic Help, Blank Lines, Basic Files, Basic @section Help - If you forget what a key does, you can use the Help character -(@kbd{C-h}) to find out: Type @kbd{C-h k} followed by the key you want -to know about. For example, @kbd{C-h k C-n} tells you what @kbd{C-n} +@cindex getting help with keys + If you forget what a key does, you can find out with the Help +character, which is @kbd{C-h} (or @key{F1}, which is an alias for +@kbd{C-h}). Type @kbd{C-h k} followed by the key you want to know +about; for example, @kbd{C-h k C-n} tells you all about what @kbd{C-n} does. @kbd{C-h} is a prefix key; @kbd{C-h k} is just one of its subcommands (the command @code{describe-key}). The other subcommands of -@kbd{C-h} provide different kinds of help. Type @kbd{C-h} three times -to get a description of all the help facilities. @xref{Help}.@refill +@kbd{C-h} provide different kinds of help. Type @kbd{C-h} twice to get +a description of all the help facilities. @xref{Help}. -@menu -* Blank Lines:: Commands to make or delete blank lines. -* Continuation Lines:: Lines too wide for the frame. -* Position Info:: What page, line, row, or column is point on? -* Arguments:: Numeric arguments for repeating a command. -@end menu - -@node Blank Lines, Continuation Lines, Basic, Basic +@node Blank Lines, Continuation Lines, Basic Help, Basic @section Blank Lines - Here are special commands and techniques for entering and removing +@cindex inserting blank lines +@cindex deleting blank lines + Here are special commands and techniques for putting in and taking out blank lines. @c widecommands @@ -315,55 +378,65 @@ @cindex blank lines @findex open-line @findex delete-blank-lines - When you want to insert a new line of text before an existing line, -you just type the new line of text, followed by @key{RET}. If you -prefer to create a blank line first and then insert the desired text, -use the key @kbd{C-o} (@code{open-line}), which inserts a newline after -point but leaves point in front of the newline. Then type -the text into the new line. @kbd{C-o F O O} has the same effect as -@kbd{F O O @key{RET}}, except for the final location of point. + When you want to insert a new line of text before an existing line, you +can do it by typing the new line of text, followed by @key{RET}. +However, it may be easier to see what you are doing if you first make a +blank line and then insert the desired text into it. This is easy to do +using the key @kbd{C-o} (@code{open-line}), which inserts a newline +after point but leaves point in front of the newline. After @kbd{C-o}, +type the text for the new line. @kbd{C-o F O O} has the same effect as +@w{@kbd{F O O @key{RET}}}, except for the final location of point. - To create several blank lines, type @kbd{C-o} several times, or -give @kbd{C-o} an argument indicating how many blank lines to create. -@xref{Arguments}, for more information. + You can make several blank lines by typing @kbd{C-o} several times, or +by giving it a numeric argument to tell it how many blank lines to make. +@xref{Arguments}, for how. If you have a fill prefix, then @kbd{C-o} +command inserts the fill prefix on the new line, when you use it at the +beginning of a line. @xref{Fill Prefix}. - If you have many blank lines in a row and want to get rid of them, use -@kbd{C-x C-o} (@code{delete-blank-lines}). If point is on a blank -line which is adjacent to at least one other blank line, @kbd{C-x C-o} -deletes all but one of the blank lines. -If point is on a blank line with no other adjacent blank line, the -sole blank line is deleted. If point is on a non-blank -line, @kbd{C-x C-o} deletes any blank lines following that non-blank -line. + The easy way to get rid of extra blank lines is with the command +@kbd{C-x C-o} (@code{delete-blank-lines}). @kbd{C-x C-o} in a run of +several blank lines deletes all but one of them. @kbd{C-x C-o} on a +solitary blank line deletes that blank line. When point is on a +nonblank line, @kbd{C-x C-o} deletes any blank lines following that +nonblank line. @node Continuation Lines, Position Info, Blank Lines, Basic @section Continuation Lines @cindex continuation line - If you add too many characters to one line without breaking with a -@key{RET}, the line grows to occupy two (or more) screen lines, with a -curved arrow at the extreme right margin of all but the last line. The -curved arrow indicates that the following screen line is not really a -distinct line in the text, but just the @dfn{continuation} of a line too -long to fit the frame. You can use Auto Fill mode (@pxref{Filling}) -to have Emacs insert newlines automatically when a line gets too long. +@cindex wrapping +@cindex line wrapping + If you add too many characters to one line without breaking it with +@key{RET}, the line will grow to occupy two (or more) lines on the +screen, with a curved arrow at the extreme right margin of all but the +last of them. The curved arrow says that the following screen line is +not really a distinct line in the text, but just the @dfn{continuation} +of a line too long to fit the screen. Continuation is also called +@dfn{line wrapping}. + Sometimes it is nice to have Emacs insert newlines automatically when +a line gets too long. Continuation on the screen does not do that. Use +Auto Fill mode (@pxref{Filling}) if that's what you want. @vindex truncate-lines @cindex truncation Instead of continuation, long lines can be displayed by @dfn{truncation}. This means that all the characters that do not fit in the width of the frame or window do not appear at all. They remain in the buffer, -temporarily invisible. Three diagonal dots in the last column (instead of -the curved arrow inform you that truncation is in effect. +temporarily invisible. Right arrow in the last column (instead of the +curved arrow) inform you that truncation is in effect. - To turn off continuation for a particular buffer, set the -variable @code{truncate-lines} to non-@code{nil} in that buffer. -Truncation instead of continuation also happens whenever horizontal -scrolling is in use, and optionally whenever side-by-side windows are in -use (@pxref{Windows}). Altering the value of @code{truncate-lines} makes -it local to the current buffer; until that time, the default value is in -effect. The default is initially @code{nil}. @xref{Locals}.@refill + Truncation instead of continuation happens whenever horizontal +scrolling is in use, and optionally in all side-by-side windows +(@pxref{Windows}). You can enable truncation for a particular buffer by +setting the variable @code{truncate-lines} to non-@code{nil} in that +buffer. (@xref{Variables}.) Altering the value of +@code{truncate-lines} makes it local to the current buffer; until that +time, the default value is in effect. The default is initially +@code{nil}. @xref{Locals}. + + @xref{Display Vars}, for additional variables that affect how text is +displayed. @node Position Info, Arguments, Continuation Lines, Basic @section Cursor Position Information @@ -380,9 +453,12 @@ Print page number of point, and line number within page. @item M-x what-line Print line number of point in the buffer. +@item M-x line-number-mode +Toggle automatic display of current line number. @item M-= -Print number of lines and characters in the current region -(@code{count-lines-region}). +Print number of lines and characters in the current region +(@code{count-lines-region}). @xref{Mark}, for information about the +region. @item C-x = Print character code of character after point, character position of point, and column of point (@code{what-cursor-position}). @@ -396,6 +472,7 @@ @findex count-lines-region There are several commands for printing line numbers: + @itemize @bullet @item @kbd{M-x what-line} counts lines from the beginning of the file and @@ -407,26 +484,28 @@ counts lines within the page, printing both of them. @xref{Pages}, for the command @kbd{C-x l}, which counts the lines in the current page. @item -@kbd{M-=} (@code{count-lines-region}) prints the number of lines in -the region (@pxref{Mark}). +@kbd{M-=} (@code{count-lines-region}) prints the number of lines in the +region (@pxref{Mark}). @xref{Pages}, for the command @kbd{C-x l} which +counts the lines in the @end itemize @kindex C-x = @findex what-cursor-position - The command @kbd{C-x =} (@code{what-cursor-position}) provides -information about point and about the column the cursor is in. -It prints a line in the echo area that looks like this: + The command @kbd{C-x =} (@code{what-cursor-position}) can be used to find out +the column that the cursor is in, and other miscellaneous information about +point. It prints a line in the echo area that looks like this: @example -Char: x (0170) point=65986 of 563027(12%) column 44 +Char: c (0143, 99, 0x63) point=18862 of 24800(76%) column 53 @end example @noindent -(In fact, this is the output produced when point is before @samp{column 44} -in the example.) +(In fact, this is the output produced when point is before @samp{column +53} in the example.) - The two values after @samp{Char:} describe the character following point, -first by showing it and second by giving its octal character code. + The four values after @samp{Char:} describe the character that follows +point, first by showing it and then by giving its character code in +octal, decimal and hex. @samp{point=} is followed by the position of point expressed as a character count. The front of the buffer counts as position 1, one character later @@ -434,8 +513,8 @@ in the buffer. Afterward in parentheses comes the position expressed as a percentage of the total size. - @samp{column} is followed by the horizontal position of point, in columns -from the left edge of the window. + @samp{column} is followed by the horizontal position of point, in +columns from the left edge of the window. If the buffer has been narrowed, making some of the text at the beginning and the end temporarily invisible, @kbd{C-x =} prints @@ -443,7 +522,7 @@ might say: @smallexample -Char: x (0170) point=65986 of 563025(12%) <65102 - 68533> column 44 +Char: c (0143, 99, 0x63) point=19674 of 24575(80%) <19591 - 19703> column 69 @end smallexample @noindent @@ -463,12 +542,15 @@ @section Numeric Arguments @cindex numeric arguments - Any Emacs command can be given a @dfn{numeric argument}. Some commands -interpret the argument as a repetition count. For example, giving an -argument of ten to the key @kbd{C-f} (the command @code{forward-char}, move -forward one character) moves forward ten characters. With these commands, -no argument is equivalent to an argument of one. Negative arguments are -allowed. Often they tell a command to move or act backwards. + In mathematics and computer usage, the word @dfn{argument} means +``data provided to a function or operation.'' Any Emacs command can be +given a @dfn{numeric argument} (also called a @dfn{prefix argument}). +Some commands interpret the argument as a repetition count. For +example, giving an argument of ten to the key @kbd{C-f} (the command +@code{forward-char}, move forward one character) moves forward ten +characters. With these commands, no argument is equivalent to an +argument of one. Negative arguments are allowed. Often they tell a +command to move or act in the opposite direction. @kindex M-1 @kindex M-@t{-} @@ -482,18 +564,21 @@ M-5 C-n @end example @noindent -moves down five lines. The characters @kbd{Meta-1}, @kbd{Meta-2}, and -so on, as well as @kbd{Meta--}, do this because they are keys bound to -commands (@code{digit-argument} and @code{negative-argument}) that are -defined to contribute to an argument for the next command. +would move down five lines. The characters @kbd{Meta-1}, @kbd{Meta-2}, +and so on, as well as @kbd{Meta--}, do this because they are keys bound +to commands (@code{digit-argument} and @code{negative-argument}) that +are defined to contribute to an argument for the next command. Digits +and @kbd{-} modified with Control, or Control and Meta, also specify +numeric arguments. @kindex C-u @findex universal-argument Another way of specifying an argument is to use the @kbd{C-u} -(@code{universal-argument}) command followed by the digits of the argument. -With @kbd{C-u}, you can type the argument digits without holding -down shift keys. To type a negative argument, start with a minus sign. -Just a minus sign normally means @minus{}1. @kbd{C-u} works on all terminals. +(@code{universal-argument}) command followed by the digits of the +argument. With @kbd{C-u}, you can type the argument digits without +holding down modifier keys; @kbd{C-u} works on all terminals. To type a +negative argument, type a minus sign after @kbd{C-u}. Just a minus sign +without digits normally means @minus{}1. @kbd{C-u} followed by a character which is neither a digit nor a minus sign has the special meaning of ``multiply by four''. It multiplies the @@ -503,7 +588,7 @@ in the usual size frame. Other useful combinations are @kbd{C-u C-n}, @kbd{C-u C-u C-n} (move down a good fraction of a frame), @kbd{C-u C-u C-o} (make ``a lot'' of blank lines), and @kbd{C-u C-k} (kill four -lines).@refill +lines). Some commands care only about whether there is an argument and not about its value. For example, the command @kbd{M-q} (@code{fill-paragraph}) with @@ -519,32 +604,47 @@ the end of the line, it kills the newline itself. Thus, two @kbd{C-k} commands with no arguments can kill a non-blank line, just like @kbd{C-k} with an argument of one. (@xref{Killing}, for more information on -@kbd{C-k}.)@refill +@kbd{C-k}.) A few commands treat a plain @kbd{C-u} differently from an ordinary argument. A few others may treat an argument of just a minus sign -differently from an argument of @minus{}1. These unusual cases will be -described when they come up; they are always to make the individual -command more convenient to use. +differently from an argument of @minus{}1. These unusual cases are +described when they come up; they are always for reasons of convenience +of use of the individual command. -@c section Autoarg Mode + You can use a numeric argument to insert multiple copies of a +character. This is straightforward unless the character is a digit; for +example, @kbd{C-u 6 4 a} inserts 64 copies of the character @samp{a}. +But this does not work for inserting digits; @kbd{C-u 6 4 1} specifies +an argument of 641, rather than inserting anything. To separate the +digit to insert from the argument, type another @kbd{C-u}; for example, +@kbd{C-u 6 4 C-u 1} does insert 64 copies of the character @samp{1}. + + We use the term ``prefix argument'' as well as ``numeric argument'' to +emphasize that you type the argument before the command, and to +distinguish these arguments from minibuffer arguments that come after +the command. + @ignore -@cindex autoarg mode - Users of ASCII keyboards may prefer to use Autoarg mode. Autoarg mode -means that you don't need to type @kbd{C-u} to specify a numeric argument. -Instead, you type just the digits. Digits followed by an ordinary -inserting character are themselves inserted, but digits followed by an -Escape or Control character serve as an argument to it and are not -inserted. A minus sign can also be part of an argument, but only at the -beginning. If you type a minus sign following some digits, both the digits -and the minus sign are inserted. +@node Repeating +@section Repeating a Command +@cindex repeating a command + +@kindex C-x z +@findex repeat + The command @kbd{C-x z} (@code{repeat}) provides another way to repeat +an Emacs command many times. This command repeats the previous Emacs +command, whatever that was. Repeating a command uses the same arguments +that were used before; it does not read new arguments each time. - To use Autoarg mode, set the variable Autoarg Mode nonzero. -@xref{Variables}. + To repeat the command more than once, type additional @kbd{z}'s: each +@kbd{z} repeats the command one more time. Repetition ends when you +type a character other than @kbd{z}, or press a mouse button. - Autoargument digits echo at the bottom of the frame; the first -nondigit causes them to be inserted or uses them as an argument. To -insert some digits and nothing else, you must follow them with a Space -and then rub it out. @kbd{C-g} cancels the digits, while Delete inserts -them all and then rubs out the last. + For example, suppose you type @kbd{C-u 2 0 C-d} to delete 20 +characters. You can repeat that command (including its argument) three +additional times, to delete a total of 80 characters, by typing @kbd{C-x +z z z}. The first @kbd{C-x z} repeats the command once, and each +subsequent @kbd{z} repeats it once again. + @end ignore diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/buffers.texi --- a/man/xemacs/buffers.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/buffers.texi Mon Aug 13 11:35:02 2007 +0200 @@ -248,7 +248,7 @@ @item C-d Like @kbd{d} but move up afterwards instead of down. @item s -Request to save the buffer. An @samp{S} befor the buffer name on a line +Request to save the buffer. An @samp{S} before the buffer name on a line indicates the request. Requested saves actually take place when you use the @kbd{x} command. You can request both saving and deletion for the same buffer. diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/building.texi --- a/man/xemacs/building.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/building.texi Mon Aug 13 11:35:02 2007 +0200 @@ -480,7 +480,7 @@ you can switch buffers, visit files, and perform any other editing operations. However, the debugger is a recursive editing level (@pxref{Recursive Edit}); it is a good idea to return to the backtrace -buffer and explictly exit the debugger when you don't want to use it any +buffer and explicitly exit the debugger when you don't want to use it any more. Exiting the debugger kills the backtrace buffer. @cindex current stack frame diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/calendar.texi --- a/man/xemacs/calendar.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/calendar.texi Mon Aug 13 11:35:02 2007 +0200 @@ -571,10 +571,10 @@ for how daylight savings time is determined. As a user, you might find it convenient to set the calendar location -variables for your usual physical location in your @file{.emacs} file. -And when you install Emacs on a machine, you can create a -@file{default.el} file which sets them properly for the typical location -of most users of that machine. @xref{Init File}. +variables for your usual physical location in your init file. And when +you install Emacs on a machine, you can create a @file{default.el} file +which sets them properly for the typical location of most users of that +machine. @xref{Init File}. @node Lunar Phases, Other Calendars, Sunrise/Sunset, Calendar/Diary @subsection Phases of the Moon @@ -1051,10 +1051,10 @@ few days as well; the variable @code{number-of-diary-entries} specifies how many days to include (@pxref{Customization}). - If you put @code{(diary)} in your @file{.emacs} file, this + If you put @code{(diary)} in your init file, this automatically displays a window with the day's diary entries, when you -enter Emacs. The mode line of the displayed window shows the date and -any holidays that fall on that date. +enter Emacs. @xref{Init File}. The mode line of the displayed window +shows the date and any holidays that fall on that date. @findex diary-mail-entries @vindex diary-mail-days @@ -1403,7 +1403,7 @@ @code{t}, calling up the calendar automatically displays the diary entries for the current date as well. The diary dates appear only if the current date is visible. If you add both of the following lines to -your @file{.emacs} file:@refill +your init file:@refill @example (setq view-diary-entries-initially t) @@ -1411,7 +1411,8 @@ @end example @noindent -this displays both the calendar and diary windows whenever you start Emacs. +this displays both the calendar and diary windows whenever you start +Emacs. @xref{Init File}. @vindex view-calendar-holidays-initially Similarly, if you set the variable @@ -1585,12 +1586,14 @@ For example, suppose you want to add Bastille Day, celebrated in France on July 14. You can do this by adding the following line -to your @file{.emacs} file: +to your init file: @smallexample (setq other-holidays '((holiday-fixed 7 14 "Bastille Day"))) @end smallexample +@xref{Init File}. + @noindent The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the fourteenth day of the seventh month (July). @@ -2061,13 +2064,15 @@ @cindex sorting diary entries If you use the fancy diary display, you can use the normal hook @code{list-diary-entries-hook} to sort each day's diary entries by their -time of day. Add this line to your @file{.emacs} file: +time of day. Add this line to your init file: @findex sort-diary-entries @example (add-hook 'list-diary-entries-hook 'sort-diary-entries t) @end example +@xref{Init File}. + @noindent For each day, this sorts diary entries that begin with a recognizable time of day according to their times. Diary entries without times come diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/cmdargs.texi --- a/man/xemacs/cmdargs.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/cmdargs.texi Mon Aug 13 11:35:02 2007 +0200 @@ -139,7 +139,7 @@ @item -no-init-file @itemx -q -Do not load your Emacs init file @file{~/.emacs}. +Do not load your Emacs init file. @xref{Init File}. @item -no-site-file Do not load the site-specific init file @file{lisp/site-start.el}. @@ -156,7 +156,8 @@ This is equivalent to @samp{-q -no-site-file -no-early-packages}. @item -user-init-file @var{file} -Load @var{file} as your Emacs init file instead of @file{~/.emacs}. +Load @var{file} as your Emacs init file instead of +@file{~/.xemacs/init.el}/@file{~/.emacs}. @item -user-init-directory @var{directory} Use @var{directory} as the location of your early package hierarchies @@ -164,9 +165,10 @@ @item -user @var{user} @itemx -u @var{user} -Equivalent to -@samp{-user-init-file ~@var{user}/.emacs -user-init-directory ~@var{user}/.xemacs}. - +Equivalent to @samp{-user-init-file ~@var{user}/.xemacs/init.el +-user-init-directory ~@var{user}/.xemacs}, or @samp{-user-init-file +~@var{user}/.emacs -user-init-directory ~@var{user}/.xemacs}. whichever +init file comes first. @xref{Init File}. @end table diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/custom.texi --- a/man/xemacs/custom.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/custom.texi Mon Aug 13 11:35:02 2007 +0200 @@ -7,12 +7,12 @@ behavior of Emacs in minor ways. All kinds of customization affect only the particular Emacs job that you -do them in. They are completely lost when you kill the Emacs job, and have -no effect on other Emacs jobs you may run at the same time or later. The -only way an Emacs job can affect anything outside of it is by writing a -file; in particular, the only way to make a customization `permanent' is to -put something in your @file{.emacs} file or other appropriate file to do the -customization in each session. @xref{Init File}. +do them in. They are completely lost when you kill the Emacs job, and +have no effect on other Emacs jobs you may run at the same time or +later. The only way an Emacs job can affect anything outside of it is +by writing a file; in particular, the only way to make a customization +`permanent' is to put something in your init file or other appropriate +file to do the customization in each session. @xref{Init File}. @menu * Minor Modes:: Each minor mode is one feature you can turn on @@ -26,10 +26,11 @@ By changing them, you can "redefine keys". * Syntax:: The syntax table controls how words and expressions are parsed. -* Init File:: How to write common customizations in the @file{.emacs} - file. -* Audible Bell:: Changing how Emacs sounds the bell. -* Faces:: Changing the fonts and colors of a region of text. +* Init File:: How to write common customizations in the init file. +* Audible Bell:: Changing how Emacs sounds the bell. +* Faces:: Changing the fonts and colors of a region of text. +* Frame Components:: Controlling the presence and positions of the + menubar, toolbars, and gutters. * X Resources:: X resources controlling various aspects of the behavior of XEmacs. @end menu @@ -385,10 +386,10 @@ @cindex saving option value Setting the option changes its value in the current Emacs session; @dfn{saving} the value changes it for future sessions as well. This -works by writing code into your @file{~/.emacs} file so as to set the -option variable again each time you start Emacs. To save the option, -invoke @samp{[State]} and select the @samp{Save for Future Sessions} -operation. +works by writing code into your init file so as to set the option +variable again each time you start Emacs. @xref{Init File}. To save +the option, invoke @samp{[State]} and select the @samp{Save for Future +Sessions} operation. You can also restore the option to its standard value by invoking @samp{[State]} and selecting the @samp{Reset} operation. There are @@ -748,7 +749,7 @@ list. That is inappropriate. Whether you use Auto Fill mode or not is a matter of personal taste, not a matter of the contents of particular files. If you want to use Auto Fill, set up major mode hooks with your -@file{.emacs} file to turn it on (when appropriate) for you alone +init file to turn it on (when appropriate) for you alone (@pxref{Init File}). Don't try to use a local variable list that would impose your taste on everyone working with the file. @@ -910,7 +911,7 @@ code to do this, because @code{insert-kbd-macro} writes the Lisp code for you. Then save the file. You can load the file with @code{load-file} (@pxref{Lisp Libraries}). If the file you save in is your initialization file -@file{~/.emacs} (@pxref{Init File}), then the macro will be defined each +(@pxref{Init File}), then the macro will be defined each time you run Emacs. If you give @code{insert-kbd-macro} a prefix argument, it creates @@ -1153,7 +1154,7 @@ @findex define-key @findex substitute-key-definition The most general way to modify a keymap is the function -@code{define-key}, used in Lisp code (such as your @file{.emacs} file). +@code{define-key}, used in Lisp code (such as your init file). @code{define-key} takes three arguments: the keymap, the key to modify in it, and the new definition. @xref{Init File}, for an example. @code{substitute-key-definition} is used similarly; it takes three @@ -1325,13 +1326,15 @@ The direct mechanism for disabling a command is to have a non-@code{nil} @code{disabled} property on the Lisp symbol for the command. These -properties are normally set by the user's @file{.emacs} file with +properties are normally set by the user's init file with Lisp expressions such as: @example (put 'delete-region 'disabled t) @end example +@xref{Init File}. + If the value of the @code{disabled} property is a string, that string is included in the message printed when the command is used: @@ -1342,9 +1345,9 @@ @findex disable-command @findex enable-command - You can disable a command either by editing the @file{.emacs} file + You can disable a command either by editing the init file directly or with the command @kbd{M-x disable-command}, which edits the -@file{.emacs} file for you. @xref{Init File}. +init file for you. @xref{Init File}. When you attempt to invoke a disabled command interactively in Emacs, a window is displayed containing the command's name, its @@ -1353,7 +1356,7 @@ enable it and execute, or cancel it. If you decide to enable the command, you are asked whether to do this permanently or just for the current session. Enabling permanently works by automatically editing -your @file{.emacs} file. You can use @kbd{M-x enable-command} at any +your init file. You can use @kbd{M-x enable-command} at any time to enable any command permanently. Whether a command is disabled is independent of what key is used to @@ -1530,22 +1533,23 @@ and some English to explain that string if necessary. @node Init File -@section The Init File, .emacs +@section The Init File @cindex init file @cindex Emacs initialization file @cindex key rebinding, permanent @cindex rebinding keys, permanently - When you start Emacs, it normally loads the file @file{.emacs} in your -home directory. This file, if it exists, should contain Lisp code. It -is called your initialization file or @dfn{init file}. Use the command -line switch @samp{-q} to tell Emacs whether to load an -init file (@pxref{Entering Emacs}). Use the command line switch -@samp{-user-init-file} (@pxref{Command Switches}) to tell Emacs to load -a different file instead of @file{~/.emacs}. - -When the @file{.emacs} file is read, the variable @code{user-init-file} -says which init file was loaded. + When you start Emacs, it normally loads either @file{.xemacs/init.el} +or the file @file{.emacs} (whichever comes first) in your home directory. +This file, if it exists, should contain Lisp code. It is called your +initialization file or @dfn{init file}. Use the command line switch +@samp{-q} to tell Emacs whether to load an init file (@pxref{Entering +Emacs}). Use the command line switch @samp{-user-init-file} +(@pxref{Command Switches}) to tell Emacs to load a different file +instead of @file{~/.xemacs/init.el}/@file{~/.emacs}. + +When the init file is read, the variable @code{user-init-file} says +which init file was loaded. At some sites there is a @dfn{default init file}, which is the library named @file{default.el}, found via the standard search path for @@ -1555,10 +1559,8 @@ first; if it sets @code{inhibit-default-init} non-@code{nil}, then @file{default} is not loaded. - If you have a large amount of code in your @file{.emacs} file, you -should move it into another file named @file{@var{something}.el}, -byte-compile it (@pxref{Lisp Libraries}), and load that file from your -@file{.emacs} file using @code{load}. + If you have a large amount of code in your init file, you should +byte-compile it to @file{~/.xemacs/init.elc} or @file{~/.emacs.elc}. @menu * Init Syntax:: Syntax of constants in Emacs Lisp. @@ -1569,7 +1571,7 @@ @node Init Syntax @subsection Init File Syntax - The @file{.emacs} file contains one or more Lisp function call + The init file contains one or more Lisp function call expressions. Each consists of a function name followed by arguments, all surrounded by parentheses. For example, @code{(setq fill-column 60)} represents a call to the function @code{setq} which is @@ -1577,7 +1579,7 @@ The second argument to @code{setq} is an expression for the new value of the variable. This can be a constant, a variable, or a function call -expression. In @file{.emacs}, constants are used most of the time. +expression. In the init file, constants are used most of the time. They can be: @table @asis @@ -1811,16 +1813,16 @@ @vindex term-file-prefix The library's name is constructed by concatenating the value of the -variable @code{term-file-prefix} and the terminal type. Your @file{.emacs} +variable @code{term-file-prefix} and the terminal type. Your init file can prevent the loading of the terminal-specific library by setting -@code{term-file-prefix} to @code{nil}. +@code{term-file-prefix} to @code{nil}. @xref{Init File}. @vindex term-setup-hook The value of the variable @code{term-setup-hook}, if not @code{nil}, is called as a function of no arguments at the end of Emacs initialization, -after both your @file{.emacs} file and any terminal-specific library have -been read. You can set the value in the @file{.emacs} file to override -part of any of the terminal-specific libraries and to define +after both your init file and any terminal-specific library have been +read. @xref{Init File}. You can set the value in the init file to +override part of any of the terminal-specific libraries and to define initializations for terminals that do not have a library.@refill @node Audible Bell @@ -2052,6 +2054,16 @@ @var{frame} argument is provided, the face is changed only in that frame; otherwise, it is changed in all frames. +@node Frame Components +@section Frame Components + +You can control the presence and position of most frame components, such +as the menubar, toolbars, and gutters. + +This section is not written yet. Try the Lisp Reference Manual: +@ref{Menubar,,,lispref,}, @ref{Toolbar Intro,,,lispref,}, and +@ref{Gutter Intro,,,lispref,}. + @node X Resources @section X Resources @cindex X resources @@ -2477,17 +2489,31 @@ @subsection Menubar Resources As the menubar is implemented as a widget which is not a part of XEmacs -proper, it does not use the fac" mechanism for specifying fonts and +proper, it does not use the face mechanism for specifying fonts and colors: It uses whatever resources are appropriate to the type of widget which is used to implement it. -If Emacs was compiled to use only the Motif-lookalike menu widgets, then one -way to specify the font of the menubar would be +If Emacs was compiled to use only the Lucid Motif-lookalike menu widgets, +then one way to specify the font of the menubar would be @example Emacs*menubar*font: *-courier-medium-r-*-*-*-120-*-*-*-*-*-* @end example +If both the Lucid Motif-lookalike menu widgets and X Font Sets are +configured to allow multilingual menubars, then one uses + +@example +*menubar*FontSet: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-*, \ + -*-*-*-*-*-*-*-120-*-jisx0208.1983-0 +@end example + +That would specify fonts for a Japanese menubar. Specifying only one +XLFD is acceptable; specifying more than one for a given registry +(language) is also allowed. When X Font Sets are configured, some .font +resources (eg, menubars) are ignored in favor of the corresponding +.fontSet resources. + If the Motif library is being used, then one would have to use @example diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/entering.texi --- a/man/xemacs/entering.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/entering.texi Mon Aug 13 11:35:02 2007 +0200 @@ -1,53 +1,91 @@ - +@c This is part of the XEmacs manual. +@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995 Free Software Foundation, Inc. +@c See file xemacs.texi for copying conditions. @node Entering Emacs, Exiting, Pull-down Menus, Top @chapter Entering and Exiting Emacs -@cindex entering Emacs @cindex entering XEmacs +@cindex starting XEmacs + + The usual way to invoke XEmacs is to type @kbd{xemacs @key{RET}} at +the shell. XEmacs clears the screen and then displays an initial +advisory message and copyright notice. You can begin typing XEmacs +commands immediately afterward. - The usual way to invoke Emacs is to type @kbd{emacs @key{RET}} at the -shell (for XEmacs, type @kbd{xemacs @key{RET}}). Emacs clears the -screen and then displays an initial advisory message and copyright -notice. You can begin typing Emacs commands immediately afterward. + Some operating systems insist on discarding all type-ahead when XEmacs +starts up; they give XEmacs no way to prevent this. Therefore, it is +advisable to wait until XEmacs clears the screen before typing your first +editing command. - Some operating systems insist on discarding all type-ahead when Emacs -starts up; they give Emacs no way to prevent this. Therefore, it is -wise to wait until Emacs clears the screen before typing the first -editing command. + If you run XEmacs from a shell window under the X Window System, run it +in the background with @samp{xemacs&}. This way, XEmacs does not tie up +the shell window, so you can use that to run other shell commands while +XEmacs operates its own X windows. You can begin typing XEmacs commands +as soon as you direct your keyboard input to the XEmacs frame. @vindex initial-major-mode Before Emacs reads the first command, you have not had a chance to -give a command to specify a file to edit. Since Emacs must always have a -current buffer for editing, it presents a buffer, by default, a buffer named -@samp{*scratch*}. The buffer is in Lisp Interaction -mode; you can use it to type Lisp expressions and evaluate them, or you -can ignore that capability and simply doodle. You can specify a -different major mode for this buffer by setting the variable -@code{initial-major-mode} in your init file. @xref{Init File}. +give a command to specify a file to edit. Since Emacs must always have +a current buffer for editing, it presents a buffer, by default, a buffer +named @samp{*scratch*}. The buffer is in Lisp Interaction mode; you can +use it to type Lisp expressions and evaluate them, or you can ignore +that capability and simply doodle. (You can specify a different major +mode for this buffer by setting the variable @code{initial-major-mode} +in your init file. @xref{Init File}.) + + It is possible to specify files to be visited, Lisp files to be +loaded, and functions to be called, by giving Emacs arguments in the +shell command line. @xref{Command Switches}. But we don't recommend +doing this. The feature exists mainly for compatibility with other +editors. - It is possible to give Emacs arguments in the shell command line to -specify files to visit, Lisp files to load, and functions to call. + Many other editors are designed to be started afresh each time you +want to edit. You edit one file and then exit the editor. The next +time you want to edit either another file or the same one, you must run +the editor again. With these editors, it makes sense to use a +command-line argument to say which file to edit. + + But starting a new Emacs each time you want to edit a different file +does not make sense. For one thing, this would be annoyingly slow. For +another, this would fail to take advantage of Emacs's ability to visit +more than one file in a single editing session. And it would lose the +other accumulated context, such as registers, undo history, and the mark +ring. + + The recommended way to use XEmacs is to start it only once, just +after you log in, and do all your editing in the same Emacs session. +Each time you want to edit a different file, you visit it with the +existing Emacs, which eventually comes to have many files in it ready +for editing. Usually you do not kill the Emacs until you are about to +log out. @xref{Files}, for more information on visiting more than one +file. @node Exiting, Command Switches, Entering Emacs, Top @section Exiting Emacs @cindex exiting @cindex killing Emacs @cindex suspending +@cindex leaving Emacs +@cindex quitting Emacs @cindex shrinking XEmacs frame There are two commands for exiting Emacs because there are two kinds of exiting: @dfn{suspending} Emacs and @dfn{killing} Emacs. -@dfn{Suspending} means stopping Emacs temporarily and returning control -to its superior (usually the shell), allowing you to resume editing -later in the same Emacs job, with the same files, same kill ring, same -undo history, and so on. This is the usual way to exit. @dfn{Killing} -Emacs means destroying the Emacs job. You can run Emacs again later, -but you will get a fresh Emacs; there is no way to resume the same -editing session after it has been killed. + + @dfn{Suspending} means stopping Emacs temporarily and returning +control to its parent process (usually a shell), allowing you to resume +editing later in the same Emacs job, with the same buffers, same kill +ring, same undo history, and so on. This is the usual way to exit. + + @dfn{Killing} Emacs means destroying the Emacs job. You can run Emacs +again later, but you will get a fresh Emacs; there is no way to resume +the same editing session after it has been killed. @table @kbd @item C-z -Suspend Emacs (@code{suspend-emacs}). If used under the X window system, -shrink the X window containing the Emacs frame to an icon (see below). +Suspend Emacs or iconify a frame +(@code{suspend-emacs-or-iconify-frame}). If used under the X window +system, shrink the X window containing the Emacs frame to an icon (see +below). @item C-x C-c Kill Emacs (@code{save-buffers-kill-emacs}). @end table @@ -56,45 +94,68 @@ the X window containing the Emacs frame to an icon. The Emacs process is stopped temporarily, and control is returned to the window manager. If more than one frame is associated with the Emacs process, only the -frame from which you used @kbd{C-z} is retained. The X windows -containing the other Emacs frames are closed. +frame from which you used @kbd{C-z} is iconified. To activate the "suspended" Emacs, use the appropriate window manager mouse gestures. Usually left-clicking on the icon reactivates and reopens the X window containing the Emacs frame, but the window manager you use determines what exactly happens. To actually kill the Emacs -process, use @kbd{C-x C-c} or the @b{Exit Emacs} item on the @b{File} +process, use @kbd{C-x C-c} or the @b{Exit XEmacs} item on the @b{File} menu. @kindex C-z @findex suspend-emacs - On systems that do not permit programs to be suspended, @kbd{C-z} runs -an inferior shell that communicates directly with the terminal, and -Emacs waits until you exit the subshell. On these systems, the only way -to return to the shell from which Emacs was started (to log out, for -example) is to kill Emacs. @kbd{C-d} or @code{exit} are typical -commands to exit a subshell. + To suspend Emacs, type @kbd{C-z} (@code{suspend-emacs}). This takes +you back to the shell from which you invoked Emacs. You can resume +Emacs with the shell command @samp{%xemacs} in most common shells. + + On systems that do not support suspending programs, @kbd{C-z} starts +an inferior shell that communicates directly with the terminal. +Emacs waits until you exit the subshell. (The way to do that is +probably with @kbd{C-d} or @samp{exit}, but it depends on which shell +you use.) The only way on these systems to get back to the shell from +which Emacs was run (to log out, for example) is to kill Emacs. + + Suspending also fails if you run Emacs under a shell that doesn't +support suspending programs, even if the system itself does support it. +In such a case, you can set the variable @code{cannot-suspend} to a +non-@code{nil} value to force @kbd{C-z} to start an inferior shell. +(One might also describe Emacs's parent shell as ``inferior'' for +failing to support job control properly, but that is a matter of taste.) + + When Emacs communicates directly with an X server and creates its own +dedicated X windows, @kbd{C-z} has a different meaning. Suspending an +applications that uses its own X windows is not meaningful or useful. +Instead, @kbd{C-z} runs the command @code{iconify-or-deiconify-frame}, +which temporarily closes up the selected Emacs frame. +The way to get back to a shell window is with the window manager. @kindex C-x C-c @findex save-buffers-kill-emacs To kill Emacs, type @kbd{C-x C-c} (@code{save-buffers-kill-emacs}). A -two-character key is used for this to make it harder to type. In -XEmacs, selecting the @b{Exit Emacs} option of the @b{File} menu is an -alternate way of issuing the command. +two-character key is used for this to make it harder to type. Selecting +the @b{Exit XEmacs} option of the @b{File} menu is an alternate way of +issuing the command. Unless a numeric argument is used, this command first offers to save any -modified buffers. If you do not save all buffers, you are asked for -reconfirmation with @kbd{yes} before killing Emacs, since any changes -not saved will be lost. If any subprocesses are still running, @kbd{C-x -C-c} asks you to confirm killing them, since killing Emacs kills the -subprocesses simultaneously. +modified file-visiting buffers. If you do not save all buffers, you are +asked for reconfirmation with @kbd{yes} before killing Emacs, since any +changes not saved will be lost forever. If any subprocesses are still +running, @kbd{C-x C-c} asks you to confirm killing them, since killing +Emacs will kill the subprocesses immediately. - In most programs running on Unix, certain characters may instantly -suspend or kill the program. (In Berkeley Unix these characters are -normally @kbd{C-z} and @kbd{C-c}.) @i{This Unix feature is turned off -while you are in Emacs.} The meanings of @kbd{C-z} and @kbd{C-x C-c} as -keys in Emacs were inspired by the standard Berkeley Unix meanings of -@kbd{C-z} and @kbd{C-c}, but that is their only relationship with Unix. -You could customize these keys to do anything (@pxref{Keymaps}). + There is no way to restart an Emacs session once you have killed it. +You can, however, arrange for Emacs to record certain session +information, such as which files are visited, when you kill it, so that +the next time you restart Emacs it will try to visit the same files and +so on. +@c @xref{Saving Emacs Sessions}. -@c ??? What about system V here? + The operating system usually listens for certain special characters +whose meaning is to kill or suspend the program you are running. +@b{This operating system feature is turned off while you are in Emacs.} +The meanings of @kbd{C-z} and @kbd{C-x C-c} as keys in Emacs were +inspired by the use of @kbd{C-z} and @kbd{C-c} on several operating +systems as the characters for stopping or killing a program, but that is +their only relationship with the operating system. You can customize +these keys to run any commands of your choice (@pxref{Keymaps}). diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/files.texi --- a/man/xemacs/files.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/files.texi Mon Aug 13 11:35:02 2007 +0200 @@ -477,8 +477,8 @@ that newly made backup is included in the count in @code{kept-new-versions}. By default, both variables are 2. -@vindex trim-versions-without-asking - If @code{trim-versions-without-asking} is non-@code{nil}, excess +@vindex delete-old-versions + If @code{delete-old-versions} is non-@code{nil}, excess middle versions are deleted without notification. If it is @code{nil}, the default, you are asked whether the excess middle versions should really be deleted. diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/frame.texi --- a/man/xemacs/frame.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/frame.texi Mon Aug 13 11:35:02 2007 +0200 @@ -41,9 +41,21 @@ window}(@pxref{Echo Area}). It is used by XEmacs to exchange information with the user. There is only one echo area per XEmacs frame. @item -If you are running XEmacs under the X Window System, a +If you are running XEmacs under a graphical windowing system, a menu bar at the top of the frame makes shortcuts to several of the commands available (@pxref{Pull-down Menus}). +@item +If you are running XEmacs under a graphical windowing system, a +toolbar at the top of the frame, just under the menu bar if it exists, +provides ``one-touch'' shortcuts to several commands. (Not yet +documented.) +@item +If you are running XEmacs under a graphical windowing system, a +gutter at the top (under the toolbar) and/or bottom of the frame +provides advanced GUI facilities like tab controls for rapid switching +among related windows and progress bars for time-consuming operations +like downloads across the Internet. Gutters are an experimental feature +introduced in XEmacs version 21.2. (Not yet documented.) @end itemize You can subdivide the XEmacs frame into multiple text windows, and use diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/glossary.texi --- a/man/xemacs/glossary.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/glossary.texi Mon Aug 13 11:35:02 2007 +0200 @@ -261,7 +261,7 @@ keyboards lacking a @key{META} key. Unlike the @key{META} key (which, like the @key{SHIFT} key, is held down while another character is typed), the @key{ESC} key is pressed and released, and applies to the -next character typed. +next character typed. @item Fill Prefix The fill prefix is a string that Emacs enters at the beginning @@ -278,7 +278,7 @@ each corresponding to a top-level X window and each looking like the screen on a TTY. Each frame contains one or more non-overlapping Emacs windows (possibly with associated scrollbars, under X), an -echo area, and (under X) possibly a menubar. +echo area, and (under X) possibly a menubar, toolbar, and/or gutter. @item Global Global means `independent of the current environment; in effect @@ -568,7 +568,7 @@ @item Read-only Buffer A read-only buffer is one whose text you are not allowed to change. Normally Emacs makes buffers read-only when they contain text which -has a special significance to Emacs, such asDired buffers. +has a special significance to Emacs, such as Dired buffers. Visiting a file that is write-protected also makes a read-only buffer. @xref{Buffers}. @@ -621,7 +621,7 @@ @item Scrolling Scrolling means shifting the text in the Emacs window to make a -different part ot the buffer visible. @xref{Display,Scrolling}. +different part of the buffer visible. @xref{Display,Scrolling}. @item Searching Searching means moving point to the next occurrence of a specified @@ -682,7 +682,7 @@ A termscript file contains a record of all characters Emacs sent to the terminal. It is used for tracking down bugs in Emacs redisplay. Emacs does not make a termscript file unless explicitly instructed to do -so. +so. @xref{Bugs}. @item Text @@ -749,7 +749,7 @@ @xref{Windows}, for commands to control the use of windows. Note that if you are running Emacs under X, terminology can be confusing: Each Emacs frame occupies a separate X window and can, in turn, be divided into -different subwindows. +different subwindows. @item Word Abbrev Synonymous with `abbrev'. diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/gnu.texi --- a/man/xemacs/gnu.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/gnu.texi Mon Aug 13 11:35:02 2007 +0200 @@ -191,7 +191,7 @@ With Unix, the price of sources puts this out of consideration for most businesses. With GNU this will be easy. It is still possible for there to be no available competent person, but this problem cannot be blamed on -distibution arrangements. GNU does not eliminate all the world's problems, +distribution arrangements. GNU does not eliminate all the world's problems, only some of them. Meanwhile, the users who know nothing about computers need handholding: diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/help.texi --- a/man/xemacs/help.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/help.texi Mon Aug 13 11:35:02 2007 +0200 @@ -1,20 +1,28 @@ @node Help, Mark, M-x, Top @chapter Help +@kindex Help @cindex help @cindex self-documentation +@findex help-command +@kindex C-h +@kindex F1 - Emacs provides extensive help features which revolve around a single + XEmacs provides extensive help features accessible through a single character, @kbd{C-h}. @kbd{C-h} is a prefix key that is used only for -documentation-printing commands. The characters you can type after +documentation-printing commands. The characters that you can type after @kbd{C-h} are called @dfn{help options}. One help option is @kbd{C-h}; -you use it to ask for help about using @kbd{C-h}. +that is how you ask for help about using @kbd{C-h}. To cancel, type +@kbd{C-g}. The function key @key{F1} is equivalent to @kbd{C-h}. - @kbd{C-h C-h} prints a list of the possible help options, and then asks -you to type the desired option. It prompts with the string: +@kindex C-h C-h +@findex help-for-help + @kbd{C-h C-h} (@code{help-for-help}) displays a list of the possible +help options, and then asks you to type the desired option. It prompts +with the string: @smallexample -A, B, C, F, I, K, L, M, N, S, T, V, W, C-c, C-d, C-n, C-w or C-h for more help: +A B C F I K L M N P S T V W C-c C-d C-f C-i C-k C-n C-w; ? for more help: @end smallexample @noindent @@ -23,66 +31,109 @@ Typing a third @kbd{C-h} displays a description of what the options mean; Emacs still waits for you to type an option. To cancel, type @kbd{C-g}. + Most help buffers use a special major mode, Help mode, which lets you +scroll conveniently with @key{SPC} and @key{DEL} or @key{BS}. + +@menu +* Help Summary:: Brief list of all Help commands. +* Key Help:: Asking what a key does in XEmacs. +* Name Help:: Asking about a command, variable or function name. +* Apropos:: Asking what pertains to a given topic. +* Library Keywords:: Finding Lisp libraries by keywords (topics). +* Help Mode:: Special features of Help mode and Help buffers. +* Misc Help:: Other help commands. +@end menu + +@iftex +@node Help Summary, Help Summary, Help, Help +@end iftex +@ifinfo +@node Help Summary, Key Help, Help, Help +@section Help Summary +@end ifinfo + Here is a summary of the defined help commands. @table @kbd -@item C-h a @var{string} @key{RET} -Display a list of commands whose names contain @var{string} -(@code{command-@*apropos}).@refill +@item C-h a @var{regexp} @key{RET} +Display a list of functions and variables whose names match @var{regexp} +(@code{hyper-apropos}). +@item C-h A @var{regexp} +Show all commands whose names contain matches for @var{regexp} +(@code{command-apropos}). @item C-h b -Display a table of all key bindings currently in effect, with local bindings of -the current major mode first, followed by all global bindings -(@code{describe-bindings}). +Display a table of all key bindings currently in effect, with local +bindings of the current major mode first, followed by all global +bindings (@code{describe-bindings}). @item C-h c @var{key} -Print the name of the command that @var{key} runs (@code{describe-key-@*briefly}). -@kbd{c} is for `character'. For more extensive information on @var{key}, -use @kbd{C-h k}. -@item C-h f @var{function} @key{RET} +Print the name of the command that @var{key} runs +(@code{describe-key-briefly}). Here @kbd{c} stands for `character'. For more +extensive information on @var{key}, use @kbd{C-h k}. +@item C-h d @var{function} @key{RET} +@itemx C-h f @var{function} @key{RET} Display documentation on the Lisp function named @var{function} -(@code{describe-function}). Note that commands are Lisp functions, so +(@code{describe-function}). Since commands are Lisp functions, a command name may be used. @item C-h i Run Info, the program for browsing documentation files (@code{info}). -The complete Emacs manual is available online in Info. +The complete XEmacs manual is available online in Info. @item C-h k @var{key} -Display name and documentation of the command @var{key} runs (@code{describe-key}). +Display the name and documentation of the command that @var{key} runs +(@code{describe-key}). @item C-h l Display a description of the last 100 characters you typed (@code{view-lossage}). @item C-h m Display documentation of the current major mode (@code{describe-mode}). @item C-h n -Display documentation of Emacs changes, most recent first +@itemx C-h C-n +Display documentation of XEmacs changes, most recent first (@code{view-emacs-news}). @item C-h p +Find packages by topic keyword (@code{finder-by-keyword}). +@item C-h C-p Display a table of all mouse bindings currently in effect now, with -local bindings of the current major mode first, followed by all global bindings -(@code{describe-pointer}). +local bindings of the current major mode first, followed by all global +bindings (@code{describe-pointer}). @item C-h s Display current contents of the syntax table, plus an explanation of -what they mean (@code{describe-syntax}). +what they mean (@code{describe-syntax}). @xref{Syntax}. @item C-h t -Display the Emacs tutorial (@code{help-with-tutorial}). +Enter the XEmacs interactive tutorial (@code{help-with-tutorial}). @item C-h v @var{var} @key{RET} Display the documentation of the Lisp variable @var{var} -(@code{describe-@*variable}). +(@code{describe-variable}). @item C-h w @var{command} @key{RET} Print which keys run the command named @var{command} (@code{where-is}). -@item M-x apropos @var{regexp} -Show all symbols whose names contain matches for @var{regexp}. +@item C-h B @key{RET} +Display info on how to deal with Beta versions of XEmacs +(@code{describe-beta}). +@item C-h C @var{group} @key{RET} +Select customization buffer for @var{group} (@code{customize}). +@item C-h F @key{RET} +View the local copy of the XEmacs FAQ (@code{xemacs-local-faq}). +@item C-h C-i @var{file} @key{RET} +Read Info file @var{file} with Info browser (@code{Info-query}). +@item C-h C-c @var{command} @key{RET} +Look up an Emacs command @var{command} in the Emacs manual in the Info +system (@code{Info-goto-emacs-command-node}). +@item C-h C-f @var{function} @key{RET} +Look up an Emacs Lisp function @var{function} in the Elisp manual in the +Info system (@code{Info-elisp-ref}). @end table +@node Key Help, Name Help, Help Summary, Help @section Documentation for a Key @kindex C-h c @findex describe-key-briefly The most basic @kbd{C-h} options are @kbd{C-h c} -(@code{describe-key-briefly}) and @kbd{C-h k}@*(@code{describe-key}). -@kbd{C-h c @var{key}} prints the name of the command that @var{key} is -bound to in the echo area. For example, @kbd{C-h c C-f} prints +(@code{describe-key-briefly}) and @w{@kbd{C-h k}} (@code{describe-key}). +@kbd{C-h c @var{key}} prints in the echo area the name of the command +that @var{key} is bound to. For example, @kbd{C-h c C-f} prints @samp{forward-char}. Since command names are chosen to describe what -the command does, using this option is a good way to get a somewhat cryptic -description of what @var{key} does.@refill +the commands do, this is a good way to get a very brief description of +what @var{key} does. @kindex C-h k @findex describe-key @@ -93,6 +144,10 @@ selection. This information does not usually fit into the echo area, so a window is used for the display. + @kbd{C-h c} and @kbd{C-h k} work for any sort of key sequences, +including function keys and mouse events. + +@node Name Help, Apropos, Key Help, Help @section Help by Command or Variable Name @kindex C-h f @@ -116,117 +171,238 @@ @code{describe-function} shows its arglist if the @var{function} is not an autoload function. - @kbd{C-h f} is also useful for Lisp functions you are planning to -use in a Lisp program. For example, if you have just written the code -@code{(make-vector len)} and want to make sure you are using -@code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}. Because -@kbd{C-h f} allows all function names, not just command names, you may find -that some of your favorite abbreviations that work in @kbd{M-x} don't work -in @kbd{C-h f}. An abbreviation may be unique among command names, yet fail -to be unique when other function names are allowed. + @kbd{C-h f} is also useful for Lisp functions that you are planning to +use in a Lisp program. For example, if you have just written the +expression @code{(make-vector len)} and want to make sure you are using +@code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}. +Because @kbd{C-h f} allows all function names, not just command names, +you may find that some of your favorite abbreviations that work in +@kbd{M-x} don't work in @kbd{C-h f}. An abbreviation may be unique +among command names, yet fail to be unique when other function names are +allowed. - -If you type @key{RET}, leaving the minibuffer empty, @kbd{C-h f} by -default describes the function called by the innermost Lisp expression -in the buffer around point, @i{provided} that that is a valid, defined Lisp -function name. For example, if point is located following the text + The function name for @kbd{C-h f} to describe has a default which is +used if you type @key{RET} leaving the minibuffer empty. The default is +the function called by the innermost Lisp expression in the buffer +around point, @emph{provided} that is a valid, defined Lisp function +name. For example, if point is located following the text @samp{(make-vector (car x)}, the innermost list containing point is the -one starting with @samp{(make-vector}, so the default is to describe -the function @code{make-vector}. +one that starts with @samp{(make-vector}, so the default is to describe the +function @code{make-vector}. @kbd{C-h f} is often useful just to verify that you have the right -spelling for the function name. If @kbd{C-h f} mentions a default in the -prompt, you have typed the name of a defined Lisp function. If that is -what you wanted to know, just type @kbd{C-g} to cancel the @kbd{C-h f} -command and continue editing. +spelling for the function name. If @kbd{C-h f} mentions a name from the +buffer as the default, that name must be defined as a Lisp function. If +that is all you want to know, just type @kbd{C-g} to cancel the @kbd{C-h +f} command, then go on editing. @kindex C-h w @findex where-is - @kbd{C-h w @var{command} @key{RET}} (@code{where-s}) tells you what + @kbd{C-h w @var{command} @key{RET}} (@code{where-is}) tells you what keys are bound to @var{command}. It prints a list of the keys in the -echo area. Alternatively, it informs you that a command is not bound to -any keys, which implies that you must use @kbd{M-x} to call the -command.@refill +echo area. Alternatively, it informs you that a command is not bound to +any keys, which implies that you must use @kbd{M-x} to call the +command. @kindex C-h v @findex describe-variable @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but describes Lisp variables instead of Lisp functions. Its default is the Lisp symbol around or before point, if that is the name of a known Lisp -variable. @xref{Variables}.@refill +variable. @xref{Variables}. +@node Apropos, Library Keywords, Name Help, Help @section Apropos -@kindex C-h a +@kindex C-h A @findex command-apropos -@cindex apropos +@cindex apropos @table @kbd -@item C-h a +@item C-h A Show only symbols that are names of commands -(@code{command-apropos}).@refill +(@code{command-apropos}). @item M-x apropos @var{regexp} -Show all symbols whose names comtain matches for @var{regexp}. +Show all symbols whose names contain matches for @var{regexp}. @end table - It is possible to ask a question like, ``What are the commands for -working with files?'' To do this, type @kbd{C-h a file @key{RET}}, -which displays a list of all command names that contain @samp{file}, -such as @code{copy-file}, @code{find-file}, and so on. With each -command name a brief description of its use and information on the keys -you can use to invoke it is displayed. For example, you would be -informed that you can invoke @code{find-file} by typing @kbd{C-x C-f}. -The @kbd{a} in @kbd{C-h a} stands for `Apropos'; @kbd{C-h a} runs the -Lisp function @code{command-apropos}.@refill + A more sophisticated sort of question to ask is, ``What are the +commands for working with files?'' To ask this question, type @kbd{C-h +a file @key{RET}}, which displays a list of all command names that +contain @samp{file}, including @code{copy-file}, @code{find-file}, and +so on. With each command name appears a brief description of how to use +the command, and what keys you can currently invoke it with. For +example, it would say that you can invoke @code{find-file} by typing +@kbd{C-x C-f}. The @kbd{A} in @kbd{C-h A} stands for `Apropos'; +@kbd{C-h A} runs the command @code{command-apropos}. This command +normally checks only commands (interactive functions); if you specify a +prefix argument, it checks noninteractive functions as well. - Because @kbd{C-h a} looks only for functions whose names contain the + Because @kbd{C-h A} looks only for functions whose names contain the string you specify, you must use ingenuity in choosing the string. If you are looking for commands for killing backwards and @kbd{C-h a -kill-backwards @key{RET}} doesn't reveal any commands, don't give up. -Try just @kbd{kill}, or just @kbd{backwards}, or just @kbd{back}. Be -persistent. Pretend you are playing Adventure. Also note that you can -use a regular expression as the argument (@pxref{Regexps}). +kill-backwards @key{RET}} doesn't reveal any, don't give up. Try just +@kbd{kill}, or just @kbd{backwards}, or just @kbd{back}. Be persistent. +Pretend you are playing Adventure. Also note that you can use a regular +expression as the argument, for more flexibility (@pxref{Regexps}). Here is a set of arguments to give to @kbd{C-h a} that covers many -classes of Emacs commands, since there are strong conventions for naming -standard Emacs commands. By giving you a feeling for the naming -conventions, this set of arguments can also help you develop a -technique for picking @code{apropos} strings. +classes of XEmacs commands, since there are strong conventions for +naming the standard XEmacs commands. By giving you a feel for the +naming conventions, this set should also serve to aid you in developing +a technique for picking @code{apropos} strings. @quotation char, line, word, sentence, paragraph, region, page, sexp, list, defun, -buffer, frame, window, file, dir, register, mode, -beginning, end, forward, backward, next, previous, up, down, search, goto, -kill, delete, mark, insert, yank, fill, indent, case, -change, set, what, list, find, view, describe. +rect, buffer, frame, window, face, file, dir, register, mode, beginning, +end, forward, backward, next, previous, up, down, search, goto, kill, +delete, mark, insert, yank, fill, indent, case, change, set, what, list, +find, view, describe, default. @end quotation @findex apropos To list all Lisp symbols that contain a match for a regexp, not just the ones that are defined as commands, use the command @kbd{M-x apropos} -instead of @kbd{C-h a}. +instead of @kbd{C-h A}. This command does not check key bindings by +default; specify a numeric argument if you want it to check them. + +@findex apropos-documentation + The @code{apropos-documentation} command is like @code{apropos} except +that it searches documentation strings for matches for the specified +regular expression. + +@findex apropos-value + The @code{apropos-value} command is like @code{apropos} except that it +searches symbols' values for matches for the specified regular +expression. This command does not check function definitions or +property lists by default; specify a numeric argument if you want it to +check them. + +@vindex apropos-do-all + If the variable @code{apropos-do-all} is non-@code{nil}, the commands +above all behave as if they had been given a prefix argument. + + If you want more information about a function definition, variable or +symbol property listed in the Apropos buffer, you can click on it with +@kbd{Mouse-2} or move there and type @key{RET}. + +@node Library Keywords, Help Mode, Apropos, Help +@section Keyword Search for Lisp Libraries + +@kindex C-h p +@findex finder-by-keyword +The @kbd{C-h p} command lets you search the standard Emacs Lisp +libraries by topic keywords. Here is a partial list of keywords you can +use: +@display +abbrev abbreviation handling, typing shortcuts, macros +bib code related to the `bib' bibliography processor +c C, C++, and Objective-C language support +calendar calendar and time management support +comm communications, networking, remote access to files +data support for editing files of data +docs support for Emacs documentation +dumped files preloaded into Emacs +emulations emulations of other editors +extensions Emacs Lisp language extensions +faces support for multiple fonts +frames support for Emacs frames and window systems +games games, jokes and amusements +hardware support for interfacing with exotic hardware +help support for on-line help systems +hypermedia support for links between text or other media types +i18n internationalization and alternate character-set support +internal code for Emacs internals, build process, defaults +languages specialized modes for editing programming languages +lisp Lisp support, including Emacs Lisp +local code local to your site +maint maintenance aids for the Emacs development group +mail modes for electronic-mail handling +matching various sorts of searching and matching +mouse mouse support +mule multi-language extensions +news support for netnews reading and posting +oop support for object-oriented programming +outlines support for hierarchical outlining +processes process, subshell, compilation, and job control support +terminals support for terminal types +tex code related to the TeX formatter +tools programming tools +unix front-ends/assistants for, or emulators of, UNIX features +vms support code for vms +wp word processing +@end display + +@node Help Mode, Misc Help, Library Keywords, Help +@section Help Mode Commands + + Help buffers provide the commands of View mode (@pxref{Misc File +Ops}), plus a few special commands of their own. + +@table @kbd +@item @key{SPC} +Scroll forward. +@item @key{DEL} +@itemx @key{BS} +Scroll backward. +@c @item @key{RET} +@c Follow a cross reference at point. +@c @item @key{TAB} +@c Move point forward to the next cross reference. +@c @item S-@key{TAB} +@c Move point back to the previous cross reference. +@c @item Mouse-2 +@c Follow a cross reference that you click on. +@end table + + When a command name (@pxref{M-x,, Running Commands by Name}) or +variable name (@pxref{Variables}) appears in the documentation, it +normally appears inside paired single-quotes. + +@node Misc Help, , Help Mode, Help @section Other Help Commands @kindex C-h i @findex info +@cindex Info +@cindex manuals, on-line +@cindex on-line manuals @kbd{C-h i} (@code{info}) runs the Info program, which is used for -browsing through structured documentation files. The entire Emacs manual +browsing through structured documentation files. The entire XEmacs manual is available within Info. Eventually all the documentation of the GNU system will be available. Type @kbd{h} after entering Info to run a tutorial on using Info. + If you specify a numeric argument, @kbd{C-h i} prompts for the name of +a documentation file. This way, you can browse a file which doesn't +have an entry in the top-level Info menu. It is also handy when you +need to get to the documentation quickly, and you know the exact name of +the file. + +@kindex C-h C-f +@kindex C-h C-k +@findex Info-elisp-ref +@findex Info-goto-emacs-command-node + There are two special help commands for accessing XEmacs documentation +through Info. @kbd{C-h C-f @var{function} @key{RET}} enters Info and +goes straight to the documentation of the XEmacs function +@var{function}. @kbd{C-h C-k @var{key}} enters Info and goes straight +to the documentation of the key @var{key}. These two keys run the +commands @code{Info-elisp-ref} and +@code{Info-goto-emacs-key-command-node}. + @kindex C-h l @findex view-lossage If something surprising happens, and you are not sure what commands you typed, use @kbd{C-h l} (@code{view-lossage}). @kbd{C-h l} prints the last -100 command characters you typed. If you see commands you don't -know, use @kbd{C-h c} to find out what they do. +100 command characters you typed in. If you see commands that you don't +know, you can use @kbd{C-h c} to find out what they do. @kindex C-h m @findex describe-mode - Emacs has several major modes. Each mode redefines a few keys and + XEmacs has several major modes. Each mode redefines a few keys and makes a few other changes in how editing works. @kbd{C-h m} (@code{describe-mode}) prints documentation on the current major mode, which normally describes all the commands that are changed in this mode. @@ -234,13 +410,21 @@ @kindex C-h b @findex describe-bindings @kbd{C-h b} (@code{describe-bindings}) and @kbd{C-h s} -(@code{describe-syntax}) present information about the current Emacs +(@code{describe-syntax}) present information about the current XEmacs mode that is not covered by @kbd{C-h m}. @kbd{C-h b} displays a list of -all key bindings currently in effect, with the local bindings of the current -major mode first, followed by the global bindings (@pxref{Key +all the key bindings currently in effect, with the local bindings of the +current major mode first, followed by the global bindings (@pxref{Key Bindings}). @kbd{C-h s} displays the contents of the syntax table with -explanations of each character's syntax (@pxref{Syntax}).@refill +explanations of each character's syntax (@pxref{Syntax}). + You can get a similar list for a particular prefix key by typing +@kbd{C-h} after the prefix key. (There are a few prefix keys for which +this does not work---those that provide their own bindings for +@kbd{C-h}. One of these is @key{ESC}, because @kbd{@key{ESC} C-h} is +actually @kbd{C-M-h}, which marks a defun.) + +@kindex C-h F +@findex xemacs-local-faq @kindex C-h n @findex view-emacs-news @kindex C-h t @@ -252,14 +436,16 @@ @kindex C-h C-w @findex describe-no-warranty The other @kbd{C-h} options display various files of useful -information. @kbd{C-h C-w} (@code{describe-no-warranty}) displays -details on the complete absence of warranty for XEmacs. @kbd{C-h n} -(@code{view-emacs-news}) displays the file @file{emacs/etc/NEWS}, which -contains documentation on Emacs changes arranged chronologically. -@kbd{C-h t} (@code{help-with-tutorial}) displays the learn-by-doing -Emacs tutorial. @kbd{C-h C-c} (@code{describe-copying}) displays the file -@file{emacs/etc/COPYING}, which tells you the conditions you must obey -in distributing copies of Emacs. @kbd{C-h C-d} +information. @kbd{C-h C-w} (@code{describe-no-warranty}) displays the +full details on the complete absence of warranty for XEmacs. @kbd{C-h +n} (@code{view-emacs-news}) displays the file @file{xemacs/etc/NEWS}, +which contains documentation on XEmacs changes arranged chronologically. +@kbd{C-h F} (@code{xemacs-local-faq}) displays local version of the +XEmacs frequently-answered-questions-list. @kbd{C-h t} +(@code{help-with-tutorial}) displays the learn-by-doing XEmacs +tutorial. @kbd{C-h C-c} (@code{describe-copying}) displays the file +@file{xemacs/etc/COPYING}, which tells you the conditions you must obey +in distributing copies of XEmacs. @kbd{C-h C-d} (@code{describe-distribution}) displays another file named -@file{emacs/etc/DISTRIB}, which tells you how you can order a copy of -the latest version of Emacs.@refill +@file{xemacs/etc/DISTRIB}, which tells you how you can order a copy of +the latest version of XEmacs. diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/keystrokes.texi --- a/man/xemacs/keystrokes.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/keystrokes.texi Mon Aug 13 11:35:02 2007 +0200 @@ -143,7 +143,7 @@ Release the middle mouse button, while pressing @key{CTRL} and @key{META}. @end table -@cindex shift modifer +@cindex shift modifier Note: As you define keystrokes, you can use the @kbd{shift} key only as a modifier with characters that do not have a second keysym on the same key, such as @kbd{backspace} and @kbd{tab}. It is an error to @@ -163,7 +163,7 @@ schematic representation of a complete key sequence is as follows: @example - [(modifier .. modifer keysym) ... (modifier .. modifier keysym)] + [(modifier .. modifier keysym) ... (modifier .. modifier keysym)] @end example Here are some examples of complete key sequences: diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/menus.texi --- a/man/xemacs/menus.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/menus.texi Mon Aug 13 11:35:02 2007 +0200 @@ -345,19 +345,19 @@ alternate binding before the command executes. @item Syntax Highlighting -You can customize your @code{.emacs} file to include the font-lock -mode so that when you select this item, the comments will be -displayed in one face, strings in another, reserved words in another, -and so on. When @b{Fonts} is selected, different parts of the program -will appear in different Fonts. When @b{Colors} is selected, then the -program will be displayed in different colors. Selecting @b{None} -causes the program to appear in just one Font and Color. Selecting -@b{Less} resets the Fonts and Colors to a fast, minimal set of -decorations. Selecting @b{More} resets the Fonts and Colors to a larger -set of decorations. For example, if @b{Less} is selected (which is the -default setting) then you might have all comments in green color. -Whereas, if @b{More} is selected then a function name in the comments -themselves might appear in a different Color or Font.@refill +You can customize your init file to include the font-lock mode so that +when you select this item, the comments will be displayed in one face, +strings in another, reserved words in another, and so on. @xref{Init +File}. When @b{Fonts} is selected, different parts of the program will +appear in different Fonts. When @b{Colors} is selected, then the program +will be displayed in different colors. Selecting @b{None} causes the +program to appear in just one Font and Color. Selecting @b{Less} resets +the Fonts and Colors to a fast, minimal set of decorations. Selecting +@b{More} resets the Fonts and Colors to a larger set of decorations. For +example, if @b{Less} is selected (which is the default setting) then you +might have all comments in green color. Whereas, if @b{More} is +selected then a function name in the comments themselves might appear in +a different Color or Font.@refill @item Paren Highlighting After selecting @b{Blink} from this item, if you place the cursor @@ -390,7 +390,7 @@ @item Save Options Selecting this item will save the current settings of your Options -menu to your @code{.emacs} file. +menu to your init file. @xref{Init File}. @end table @node Buffers Menu diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/mini.texi --- a/man/xemacs/mini.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/mini.texi Mon Aug 13 11:35:02 2007 +0200 @@ -135,7 +135,10 @@ however. You cannot switch buffers in it---the minibuffer and its window are permanently attached. Also, you cannot split or kill the minibuffer window. But you can make it taller in the normal fashion with -@kbd{C-x ^}. +@kbd{C-x ^}. If you enable Resize-Minibuffer mode, then the +minibuffer window expands vertically as necessary to hold the text that +you put in the minibuffer. Use @kbd{M-x resize-minibuffer-mode} to +enable or disable this minor mode (@pxref{Minor Modes}). @kindex C-M-v If while in the minibuffer you issue a command that displays help text @@ -227,7 +230,7 @@ @samp{c-}---so no more characters are added; instead, @key{TAB} displays a list of all possible completions in another window. - If you go on to type @kbd{f @key{TAB}}, this @key{TAB} sees + If you go on to type @kbd{-f @key{TAB}}, this @key{TAB} sees @samp{auto-f}. The only command name starting this way is @code{auto-fill-mode}, so completion fills in the rest of that. You now have @samp{auto-fill-mode} in the minibuffer after typing just @kbd{au @@ -285,6 +288,15 @@ You normally use this command while point is in the minibuffer; but you must click in the list of completions, not in the minibuffer itself. +@findex switch-to-completions +@item @key{PRIOR} +@itemx M-v +Typing @key{PRIOR} or @kbd{M-v}, while in the minibuffer, selects the +window showing the completion list buffer +(@code{switch-to-completions}). This paves the way for using the +commands below. (Selecting that window in the usual ways has the same +effect, but this way is more convenient.) + @findex choose-completion @item @key{RET} Typing @key{RET} @emph{in the completion list buffer} chooses the @@ -375,6 +387,12 @@ not valid completions, an extra @key{RET} must be typed to confirm the response. This is helpful for catching typos. +@cindex Icomplete mode + Icomplete mode presents a constantly-updated display that tells you +what completions are available for the text you've entered so far. The +command to enable or disable this minor mode is @kbd{M-x +icomplete-mode}. + @node Minibuffer History, Repetition, Completion, Minibuffer @section Minibuffer History @cindex minibuffer history @@ -479,11 +497,11 @@ @item C-x @key{ESC} @key{ESC} Re-execute a recent minibuffer command (@code{repeat-complex-command}). @item M-p -Within @kbd{C-x @key{ESC}}, move to previous recorded command +Within @kbd{C-x @key{ESC} @key{ESC}}, move to previous recorded command (@code{previous-history-element}). @item M-n -Within @kbd{C-x @key{ESC}}, move to the next (more recent) recorded -command (@code{next-history-element}). +Within @kbd{C-x @key{ESC} @key{ESC}}, move to the next (more recent) +recorded command (@code{next-history-element}). @item M-x list-command-history Display the entire command history, showing all the commands @kbd{C-x @key{ESC} @key{ESC}} can repeat, most recent first. diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/misc.texi --- a/man/xemacs/misc.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/misc.texi Mon Aug 13 11:35:02 2007 +0200 @@ -192,7 +192,7 @@ specify a directory, the directories in the list @code{exec-path} are searched; this list is initialized based on the @code{PATH} environment variable when you start XEmacs. You can override either or both of these -default initializations in your @file{.emacs} file.@refill +default initializations in your init file. @xref{Init File}.@refill When you use @kbd{M-!} and @kbd{M-|}, XEmacs has to wait until the shell command completes. You can quit with @kbd{C-g}; that terminates @@ -740,7 +740,7 @@ (viper-mode) @end example -in your @file{.emacs} file. +in your init file. @xref{Init File}. Viper comes with a separate manual that is provided standard with the XEmacs distribution. diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/mule.texi --- a/man/xemacs/mule.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/mule.texi Mon Aug 13 11:35:02 2007 +0200 @@ -19,7 +19,7 @@ Simplified Chinese script (for mainland of China), Traditional Chinese script (for Taiwan and Hong-Kong), Greek script, Hebrew script, IPA symbols, Japanese scripts (Hiragana, Katakana and Kanji), Korean scripts -(Hangul and Hanja) and Cyrillic script (for Beylorussian, Bulgarian, +(Hangul and Hanja) and Cyrillic script (for Byelorussian, Bulgarian, Russian, Serbian and Ukrainian). These features have been merged from the modified version of Emacs known as MULE (for ``MULti-lingual Enhancement to GNU Emacs''). diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/new.texi --- a/man/xemacs/new.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/new.texi Mon Aug 13 11:35:02 2007 +0200 @@ -13,21 +13,23 @@ XEmacs has a new vi emulation mode called evi mode. To start evi mode in Emacs, type the command @kbd{M-x evi}. If you want Emacs to automatically put you in evi-mode all the time, include this -line in your @file{.emacs} file: +line in your init file: @example (setq term-setup-hook 'evi) @end example @xref{evi Mode} for a brief discussion. +@xref{Init File}. @end ignore @item XEmacs has a new vi emulation mode called ``viper'' mode. To start viper mode in XEmacs, type the command @kbd{M-x viper-mode}. If you want XEmacs to automatically put you in viper-mode all the time, include -this line in your @file{.emacs} file: +this line in your init file: @example (viper-mode) @end example +@xref{Init File}. @item Earlier versions of Emacs only allowed keybindings to ASCII character @@ -267,7 +269,9 @@ )) @end example -Of particular interest for use in @file{.emacs} files are: +Alternatively, use @file{.xemacs/init.el} for an init file. @xref{Init File}. + +Of particular interest for use in files are: @itemize @bullet @findex add-menu diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/packages.texi --- a/man/xemacs/packages.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/packages.texi Mon Aug 13 11:35:02 2007 +0200 @@ -134,13 +134,15 @@ already have some or all of the packages on a local disk, such as a CDROM. If you want to install from a local disk, you must first tell XEmacs where to find the package binaries. This is done by adding a line -like the following to your @file{.emacs} file: +like the following to your init file: @example (setq package-get-remote (cons (list nil "/my/path/to/package/binaries") package-get-remote)) @end example +@xref{Init File}. + Here, you'd change @file{/my/path/to/package/binaries} to be the path to your local package binaries. Next, restart XEmacs, and you're ready to go (advanced users can just re-evaluate the sexp). diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/programs.texi --- a/man/xemacs/programs.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/programs.texi Mon Aug 13 11:35:02 2007 +0200 @@ -45,7 +45,7 @@ There are editing commands to operate on them. * Grinding:: Adjusting indentation to show the nesting. * Matching:: Insertion of a close-delimiter flashes matching open. -* Comments:: Inserting, illing and aligning comments. +* Comments:: Inserting, filling and aligning comments. * Balanced Editing:: Inserting two matching parentheses at once, etc. * Lisp Completion:: Completion on symbol names in Lisp code. * Documentation:: Getting documentation of functions you plan to call. diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/search.texi --- a/man/xemacs/search.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/search.texi Mon Aug 13 11:35:02 2007 +0200 @@ -77,7 +77,7 @@ within searches (@kbd{C-q}, @kbd{C-w}, @kbd{C-r}, @kbd{C-s}, or @kbd{C-y}). Sometimes you search for @samp{FOO} and find it, but were actually -looking for a different occurance of it. To move to the next occurrence +looking for a different occurrence of it. To move to the next occurrence of the search string, type another @kbd{C-s}. Do this as often as necessary. If you overshoot, you can cancel some @kbd{C-s} characters with @key{DEL}. @@ -330,12 +330,30 @@ @cindex regexp A @dfn{regular expression} (@dfn{regexp}, for short) is a pattern that -denotes a set of strings, possibly an infinite set. Searching for matches +denotes a (possibly infinite) set of strings. Searching for matches for a regexp is a powerful operation that editors on Unix systems have -traditionally offered. In XEmacs, you can search for the next match for -a regexp either incrementally or not. +traditionally offered. + + To gain a thorough understanding of regular expressions and how to use +them to best advantage, we recommend that you study @cite{Mastering +Regular Expressions, by Jeffrey E.F. Friedl, O'Reilly and Associates, +1997}. (It's known as the "Hip Owls" book, because of the picture on its +cover.) You might also read the manuals to @ref{(gawk)Top}, +@ref{(ed)Top}, @cite{sed}, @cite{grep}, @ref{(perl)Top}, +@ref{(regex)Top}, @ref{(rx)Top}, @cite{pcre}, and @ref{(flex)Top}, which +also make good use of regular expressions. + + The XEmacs regular expression syntax most closely resembles that of +@cite{ed}, or @cite{grep}, the GNU versions of which all utilize the GNU +@cite{regex} library. XEmacs' version of @cite{regex} has recently been +extended with some Perl--like capabilities, described in the next +section. + + In XEmacs, you can search for the next match for a regexp either +incrementally or not. @kindex M-C-s +@kindex M-C-r @findex isearch-forward-regexp @findex isearch-backward-regexp Incremental search for a regexp is done by typing @kbd{M-C-s} @@ -344,7 +362,7 @@ regexp rather than looking for an exact match against the text in the buffer. Each time you add text to the search string, you make the regexp longer, and the new regexp is searched for. A reverse regexp search command -@code{isearch-backward-regexp} also exists, but no key runs it. +@code{isearch-backward-regexp} also exists, bound to @kbd{M-C-r}. All of the control characters that do special things within an ordinary incremental search have the same functionality in incremental regexp search. @@ -358,151 +376,227 @@ @code{re-search-forward} and @code{re-search-backward}. You can invoke them with @kbd{M-x} or bind them to keys. You can also call @code{re-search-forward} by way of incremental regexp search with -@kbd{M-C-s @key{RET}}. +@kbd{M-C-s @key{RET}}; similarly for @code{re-search-backward} with +@kbd{M-C-r @key{RET}}. @node Regexps, Search Case, Regexp Search, Search @section Syntax of Regular Expressions -Regular expressions have a syntax in which a few characters are special -constructs and the rest are @dfn{ordinary}. An ordinary character is a -simple regular expression which matches that character and nothing else. -The special characters are @samp{$}, @samp{^}, @samp{.}, @samp{*}, -@samp{+}, @samp{?}, @samp{[}, @samp{]} and @samp{\}; no new special -characters will be defined. Any other character appearing in a regular -expression is ordinary, unless a @samp{\} precedes it.@refill + Regular expressions have a syntax in which a few characters are +special constructs and the rest are @dfn{ordinary}. An ordinary +character is a simple regular expression that matches that character and +nothing else. The special characters are @samp{.}, @samp{*}, @samp{+}, +@samp{?}, @samp{[}, @samp{]}, @samp{^}, @samp{$}, and @samp{\}; no new +special characters will be defined in the future. Any other character +appearing in a regular expression is ordinary, unless a @samp{\} +precedes it. For example, @samp{f} is not a special character, so it is ordinary, and -therefore @samp{f} is a regular expression that matches the string @samp{f} -and no other string. (It does @i{not} match the string @samp{ff}.) Likewise, -@samp{o} is a regular expression that matches only @samp{o}.@refill +therefore @samp{f} is a regular expression that matches the string +@samp{f} and no other string. (It does @emph{not} match the string +@samp{ff}.) Likewise, @samp{o} is a regular expression that matches +only @samp{o}.@refill Any two regular expressions @var{a} and @var{b} can be concatenated. The -result is a regular expression which matches a string if @var{a} matches +result is a regular expression that matches a string if @var{a} matches some amount of the beginning of that string and @var{b} matches the rest of the string.@refill -As a simple example, you can concatenate the regular expressions @samp{f} +As a simple example, we can concatenate the regular expressions @samp{f} and @samp{o} to get the regular expression @samp{fo}, which matches only -the string @samp{fo}. To do something nontrivial, you -need to use one of the following special characters: +the string @samp{fo}. Still trivial. To do something more powerful, you +need to use one of the special characters. Here is a list of them: +@need 1200 @table @kbd @item .@: @r{(Period)} +@cindex @samp{.} in regexp is a special character that matches any single character except a newline. -Using concatenation, you can make regular expressions like @samp{a.b}, which -matches any three-character string which begins with @samp{a} and ends with +Using concatenation, we can make regular expressions like @samp{a.b}, which +matches any three-character string that begins with @samp{a} and ends with @samp{b}.@refill @item * -is not a construct by itself; it is a suffix, which means the -preceding regular expression is to be repeated as many times as +@cindex @samp{*} in regexp +is not a construct by itself; it is a quantifying suffix operator that +means to repeat the preceding regular expression as many times as possible. In @samp{fo*}, the @samp{*} applies to the @samp{o}, so @samp{fo*} matches one @samp{f} followed by any number of @samp{o}s. The case of zero @samp{o}s is allowed: @samp{fo*} does match @samp{f}.@refill -@samp{*} always applies to the @i{smallest} possible preceding +@samp{*} always applies to the @emph{smallest} possible preceding expression. Thus, @samp{fo*} has a repeating @samp{o}, not a repeating @samp{fo}.@refill -The matcher processes a @samp{*} construct by immediately matching -as many repetitions as it can find. Then it continues with the rest -of the pattern. If that fails, backtracking occurs, discarding some -of the matches of the @samp{*}-modified construct in case that makes -it possible to match the rest of the pattern. For example, matching -@samp{ca*ar} against the string @samp{caaar}, the @samp{a*} first -tries to match all three @samp{a}s; but the rest of the pattern is -@samp{ar} and there is only @samp{r} left to match, so this try fails. -The next alternative is for @samp{a*} to match only two @samp{a}s. -With this choice, the rest of the regexp matches successfully.@refill +The matcher processes a @samp{*} construct by matching, immediately, as +many repetitions as can be found; it is "greedy". Then it continues +with the rest of the pattern. If that fails, backtracking occurs, +discarding some of the matches of the @samp{*}-modified construct in +case that makes it possible to match the rest of the pattern. For +example, in matching @samp{ca*ar} against the string @samp{caaar}, the +@samp{a*} first tries to match all three @samp{a}s; but the rest of the +pattern is @samp{ar} and there is only @samp{r} left to match, so this +try fails. The next alternative is for @samp{a*} to match only two +@samp{a}s. With this choice, the rest of the regexp matches +successfully.@refill + +Nested repetition operators can be extremely slow if they specify +backtracking loops. For example, it could take hours for the regular +expression @samp{\(x+y*\)*a} to match the sequence +@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}. The slowness is because +Emacs must try each imaginable way of grouping the 35 @samp{x}'s before +concluding that none of them can work. To make sure your regular +expressions run fast, check nested repetitions carefully. @item + -is a suffix character similar to @samp{*} except that it requires that -the preceding expression be matched at least once. For example, -@samp{ca+r} will match the strings @samp{car} and @samp{caaaar} -but not the string @samp{cr}, whereas @samp{ca*r} would match all -three strings.@refill +@cindex @samp{+} in regexp +is a quantifying suffix operator similar to @samp{*} except that the +preceding expression must match at least once. It is also "greedy". +So, for example, @samp{ca+r} matches the strings @samp{car} and +@samp{caaaar} but not the string @samp{cr}, whereas @samp{ca*r} matches +all three strings. @item ? -is a suffix character similar to @samp{*} except that it can match the -preceding expression either once or not at all. For example, -@samp{ca?r} will match @samp{car} or @samp{cr}; nothing else. +@cindex @samp{?} in regexp +is a quantifying suffix operator similar to @samp{*}, except that the +preceding expression can match either once or not at all. For example, +@samp{ca?r} matches @samp{car} or @samp{cr}, but does not match anything +else. + +@item *? +@cindex @samp{*?} in regexp +works just like @samp{*}, except that rather than matching the longest +match, it matches the shortest match. @samp{*?} is known as a +@dfn{non-greedy} quantifier, a regexp construct borrowed from Perl. +@c Did perl get this from somewhere? What's the real history of *? ? + +This construct is very useful for when you want to match the text inside +a pair of delimiters. For instance, @samp{/\*.*?\*/} will match C +comments in a string. This could not easily be achieved without the use +of a non-greedy quantifier. + +This construct has not been available prior to XEmacs 20.4. It is not +available in FSF Emacs. + +@item +? +@cindex @samp{+?} in regexp +is the non-greedy version of @samp{+}. + +@item ?? +@cindex @samp{??} in regexp +is the non-greedy version of @samp{?}. + +@item \@{n,m\@} +@c Note the spacing after the close brace is deliberate. +@cindex @samp{\@{n,m\@} }in regexp +serves as an interval quantifier, analogous to @samp{*} or @samp{+}, but +specifies that the expression must match at least @var{n} times, but no +more than @var{m} times. This syntax is supported by most Unix regexp +utilities, and has been introduced to XEmacs for the version 20.3. + +Unfortunately, the non-greedy version of this quantifier does not exist +currently, although it does in Perl. @item [ @dots{} ] +@cindex character set (in regexp) +@cindex @samp{[} in regexp +@cindex @samp{]} in regexp @samp{[} begins a @dfn{character set}, which is terminated by a -@samp{]}. In the simplest case, the characters between the two form -the set. Thus, @samp{[ad]} matches either one @samp{a} or one -@samp{d}, and @samp{[ad]*} matches any string composed of just -@samp{a}s and @samp{d}s (including the empty string), from which it -follows that @samp{c[ad]*r} matches @samp{cr}, @samp{car}, @samp{cdr}, +@samp{]}. In the simplest case, the characters between the two brackets +form the set. Thus, @samp{[ad]} matches either one @samp{a} or one +@samp{d}, and @samp{[ad]*} matches any string composed of just @samp{a}s +and @samp{d}s (including the empty string), from which it follows that +@samp{c[ad]*r} matches @samp{cr}, @samp{car}, @samp{cdr}, @samp{caddaar}, etc.@refill -You can include character ranges in a character set by writing two +The usual regular expression special characters are not special inside a +character set. A completely different set of special characters exists +inside character sets: @samp{]}, @samp{-} and @samp{^}.@refill + +@samp{-} is used for ranges of characters. To write a range, write two characters with a @samp{-} between them. Thus, @samp{[a-z]} matches any -lower-case letter. Ranges may be intermixed freely with individual -characters, as in @samp{[a-z$%.]}, which matches any lower-case letter -or @samp{$}, @samp{%}, or period. -@refill +lower case letter. Ranges may be intermixed freely with individual +characters, as in @samp{[a-z$%.]}, which matches any lower case letter +or @samp{$}, @samp{%}, or a period.@refill -Note that inside a character set the usual special characters are not -special any more. A completely different set of special characters -exists inside character sets: @samp{]}, @samp{-}, and @samp{^}.@refill +To include a @samp{]} in a character set, make it the first character. +For example, @samp{[]a]} matches @samp{]} or @samp{a}. To include a +@samp{-}, write @samp{-} as the first character in the set, or put it +immediately after a range. (You can replace one individual character +@var{c} with the range @samp{@var{c}-@var{c}} to make a place to put the +@samp{-}.) There is no way to write a set containing just @samp{-} and +@samp{]}. -To include a @samp{]} in a character set, you must make it the first -character. For example, @samp{[]a]} matches @samp{]} or @samp{a}. To -include a @samp{-}, write @samp{---}, which is a range containing only -@samp{-}. To include @samp{^}, make it other than the first character -in the set.@refill +To include @samp{^} in a set, put it anywhere but at the beginning of +the set. @item [^ @dots{} ] +@cindex @samp{^} in regexp @samp{[^} begins a @dfn{complement character set}, which matches any character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} -matches all characters @i{except} letters and digits.@refill +matches all characters @emph{except} letters and digits.@refill @samp{^} is not special in a character set unless it is the first character. The character following the @samp{^} is treated as if it -were first (@samp{-} and @samp{]} are not special there). +were first (thus, @samp{-} and @samp{]} are not special there). Note that a complement character set can match a newline, unless newline is mentioned as one of the characters not to match. @item ^ -is a special character that matches the empty string, but only if at -the beginning of a line in the text being matched. Otherwise, it fails -to match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs -at the beginning of a line. +@cindex @samp{^} in regexp +@cindex beginning of line in regexp +is a special character that matches the empty string, but only at the +beginning of a line in the text being matched. Otherwise it fails to +match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at +the beginning of a line. + +When matching a string instead of a buffer, @samp{^} matches at the +beginning of the string or after a newline character @samp{\n}. @item $ +@cindex @samp{$} in regexp is similar to @samp{^} but matches only at the end of a line. Thus, -@samp{xx*$} matches a string of one @samp{x} or more at the end of a line. +@samp{x+$} matches a string of one @samp{x} or more at the end of a line. + +When matching a string instead of a buffer, @samp{$} matches at the end +of the string or before a newline character @samp{\n}. @item \ -does two things: it quotes the special characters (including +@cindex @samp{\} in regexp +has two functions: it quotes the special characters (including @samp{\}), and it introduces additional special constructs. Because @samp{\} quotes special characters, @samp{\$} is a regular expression that matches only @samp{$}, and @samp{\[} is a regular -expression that matches only @samp{[}, and so on.@refill +expression that matches only @samp{[}, and so on. + +@c Removed a paragraph here in lispref about doubling backslashes inside +@c of Lisp strings. + @end table -Note: for historical compatibility, special characters are treated as -ordinary ones if they are in contexts where their special meanings make no -sense. For example, @samp{*foo} treats @samp{*} as ordinary since there is -no preceding expression on which the @samp{*} can act. It is poor practice -to depend on this behavior; better to quote the special character anyway, -regardless of where is appears.@refill +@strong{Please note:} For historical compatibility, special characters +are treated as ordinary ones if they are in contexts where their special +meanings make no sense. For example, @samp{*foo} treats @samp{*} as +ordinary since there is no preceding expression on which the @samp{*} +can act. It is poor practice to depend on this behavior; quote the +special character anyway, regardless of where it appears.@refill -Usually, @samp{\} followed by any character matches only +For the most part, @samp{\} followed by any character matches only that character. However, there are several exceptions: characters -which, when preceded by @samp{\}, are special constructs. Such +that, when preceded by @samp{\}, are special constructs. Such characters are always ordinary when encountered on their own. Here -is a table of @samp{\} constructs. +is a table of @samp{\} constructs: @table @kbd @item \| +@cindex @samp{|} in regexp +@cindex regexp alternative specifies an alternative. Two regular expressions @var{a} and @var{b} with @samp{\|} in -between form an expression that matches anything @var{a} or +between form an expression that matches anything that either @var{a} or @var{b} matches.@refill Thus, @samp{foo\|bar} matches either @samp{foo} or @samp{bar} @@ -515,6 +609,9 @@ Full backtracking capability exists to handle multiple uses of @samp{\|}. @item \( @dots{} \) +@cindex @samp{(} in regexp +@cindex @samp{)} in regexp +@cindex regexp grouping is a grouping construct that serves three purposes: @enumerate @@ -523,78 +620,126 @@ Thus, @samp{\(foo\|bar\)x} matches either @samp{foox} or @samp{barx}. @item -To enclose a complicated expression for the postfix @samp{*} to operate on. -Thus, @samp{ba\(na\)*} matches @samp{bananana}, etc., with any (zero or -more) number of @samp{na} strings.@refill +To enclose an expression for a suffix operator such as @samp{*} to act +on. Thus, @samp{ba\(na\)*} matches @samp{bananana}, etc., with any +(zero or more) number of @samp{na} strings.@refill @item -To mark a matched substring for future reference. - +To record a matched substring for future reference. @end enumerate This last application is not a consequence of the idea of a -parenthetical grouping; it is a separate feature which happens to be +parenthetical grouping; it is a separate feature that happens to be assigned as a second meaning to the same @samp{\( @dots{} \)} construct -because in practice there is no conflict between the two meanings. -Here is an explanation: +because there is no conflict in practice between the two meanings. +Here is an explanation of this feature: @item \@var{digit} -after the end of a @samp{\( @dots{} \)} construct, the matcher remembers the -beginning and end of the text matched by that construct. Then, later on -in the regular expression, you can use @samp{\} followed by @var{digit} -to mean ``match the same text matched the @var{digit}'th time by the -@samp{\( @dots{} \)} construct.''@refill +matches the same text that matched the @var{digit}th occurrence of a +@samp{\( @dots{} \)} construct. -The strings matching the first nine @samp{\( @dots{} \)} constructs appearing -in a regular expression are assigned numbers 1 through 9 in order that the -open-parentheses appear in the regular expression. @samp{\1} through -@samp{\9} may be used to refer to the text matched by the corresponding -@samp{\( @dots{} \)} construct. +In other words, after the end of a @samp{\( @dots{} \)} construct. the +matcher remembers the beginning and end of the text matched by that +construct. Then, later on in the regular expression, you can use +@samp{\} followed by @var{digit} to match that same text, whatever it +may have been. + +The strings matching the first nine @samp{\( @dots{} \)} constructs +appearing in a regular expression are assigned numbers 1 through 9 in +the order that the open parentheses appear in the regular expression. +So you can use @samp{\1} through @samp{\9} to refer to the text matched +by the corresponding @samp{\( @dots{} \)} constructs. For example, @samp{\(.*\)\1} matches any newline-free string that is composed of two identical halves. The @samp{\(.*\)} matches the first half, which may be anything, but the @samp{\1} that follows must match the same exact text. +@item \(?: @dots{} \) +@cindex @samp{\(?:} in regexp +@cindex regexp grouping +is called a @dfn{shy} grouping operator, and it is used just like +@samp{\( @dots{} \)}, except that it does not cause the matched +substring to be recorded for future reference. + +This is useful when you need a lot of grouping @samp{\( @dots{} \)} +constructs, but only want to remember one or two -- or if you have +more than nine groupings and need to use backreferences to refer to +the groupings at the end. + +Using @samp{\(?: @dots{} \)} rather than @samp{\( @dots{} \)} when you +don't need the captured substrings ought to speed up your programs some, +since it shortens the code path followed by the regular expression +engine, as well as the amount of memory allocation and string copying it +must do. The actual performance gain to be observed has not been +measured or quantified as of this writing. +@c This is used to good advantage by the font-locking code, and by +@c `regexp-opt.el'. + +The shy grouping operator has been borrowed from Perl, and has not been +available prior to XEmacs 20.3, nor is it available in FSF Emacs. + +@item \w +@cindex @samp{\w} in regexp +matches any word-constituent character. The editor syntax table +determines which characters these are. @xref{Syntax}. + +@item \W +@cindex @samp{\W} in regexp +matches any character that is not a word constituent. + +@item \s@var{code} +@cindex @samp{\s} in regexp +matches any character whose syntax is @var{code}. Here @var{code} is a +character that represents a syntax code: thus, @samp{w} for word +constituent, @samp{-} for whitespace, @samp{(} for open parenthesis, +etc. @xref{Syntax}, for a list of syntax codes and the characters that +stand for them. + +@item \S@var{code} +@cindex @samp{\S} in regexp +matches any character whose syntax is not @var{code}. +@end table + + The following regular expression constructs match the empty string---that is, +they don't use up any characters---but whether they match depends on the +context. + +@table @kbd @item \` -matches the empty string, provided it is at the beginning -of the buffer. +@cindex @samp{\`} in regexp +matches the empty string, but only at the beginning +of the buffer or string being matched against. @item \' -matches the empty string, provided it is at the end of -the buffer. +@cindex @samp{\'} in regexp +matches the empty string, but only at the end of +the buffer or string being matched against. + +@item \= +@cindex @samp{\=} in regexp +matches the empty string, but only at point. +(This construct is not defined when matching against a string.) @item \b -matches the empty string, provided it is at the beginning or +@cindex @samp{\b} in regexp +matches the empty string, but only at the beginning or end of a word. Thus, @samp{\bfoo\b} matches any occurrence of @samp{foo} as a separate word. @samp{\bballs?\b} matches @samp{ball} or @samp{balls} as a separate word.@refill @item \B -matches the empty string, provided it is @i{not} at the beginning or +@cindex @samp{\B} in regexp +matches the empty string, but @emph{not} at the beginning or end of a word. @item \< -matches the empty string, provided it is at the beginning of a word. +@cindex @samp{\<} in regexp +matches the empty string, but only at the beginning of a word. @item \> -matches the empty string, provided it is at the end of a word. - -@item \w -matches any word-constituent character. The editor syntax table -determines which characters these are. - -@item \W -matches any character that is not a word-constituent. - -@item \s@var{code} -matches any character whose syntax is @var{code}. @var{code} is a -character which represents a syntax code: thus, @samp{w} for word -constituent, @samp{-} for whitespace, @samp{(} for open-parenthesis, -etc. @xref{Syntax}.@refill - -@item \S@var{code} -matches any character whose syntax is not @var{code}. +@cindex @samp{\>} in regexp +matches the empty string, but only at the end of a word. @end table Here is a complicated regexp used by Emacs to recognize the end of a diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/sending.texi --- a/man/xemacs/sending.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/sending.texi Mon Aug 13 11:35:02 2007 +0200 @@ -235,9 +235,9 @@ command @code{M-x merge-mail-aliases}. The @code{rebuild-mail-aliases} command is similar, but deletes existing aliases first. -@vindex mail-alias-seperator-string +@vindex mail-alias-separator-string If you want multiple addresses separated by a string other than @samp{,} -(a comma), then set the variable @code{mail-alias-seperator-string} to +(a comma), then set the variable @code{mail-alias-separator-string} to it. This has to be a comma bracketed by whitespace if you want any kind of reasonable behavior. diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/startup.texi --- a/man/xemacs/startup.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/startup.texi Mon Aug 13 11:35:02 2007 +0200 @@ -39,7 +39,7 @@ @cindex root of a hierarchy Whenever this section refers to a directory using the shorthand @code{}, it means that XEmacs searches for it under all -hierarchies under all hierarchies XEmacs was able to scrounge up. In a +hierarchies XEmacs was able to scrounge up. In a running XEmacs, the hierarchy roots are stored in the variable @code{emacs-roots}. @vindex emacs-roots @@ -63,8 +63,9 @@ very front, late ones somewhere in the middle, and last hierarchies are (you guessed it) last. -By default, XEmacs expects an early package hierarchy in the a -subdirectory @file{.xemacs} of the user's home directory. +By default, XEmacs expects an early package hierarchy in the +subdirectory @file{.xemacs/xemacs-packages} of the user's home +directory. Moreover, XEmacs expects late hierarchies in the subdirectories @file{site-packages}, @file{mule-packages}, and @file{xemacs-packages} @@ -77,19 +78,19 @@ By default, XEmacs does not have a pre-configured last package hierarchy. Last hierarchies are primarily for using package hierarchies of outdated versions of XEmacs as a fallback option. For example, it is -possible to run XEmacs 21.0 with the 20.4 package hierarchy as a last +possible to run XEmacs 21 with the 20.4 package hierarchy as a last hierarchy. It is possible to specify at configure-time the location of the various package hierarchies with the @code{--package-path} option to configure. @cindex package path The early, late, and last components of the package path are separated -by double instead of single colons. If three components are present, -they are locate the early, late, and last package hierarchies +by double instead of single colons. If all three components are +present, they locate the early, late, and last package hierarchies respectively. If two components are present, they locate the early and -late hierarchies. If only one component is present, it locates the late -hierarchy. At run time, the package path may also be specified via the -@code{EMACSPACKAGEPATH} environment variable. +late hierarchies. If only one component is present, it locates the +late hierarchy. At run time, the package path may also be specified via +the @code{EMACSPACKAGEPATH} environment variable. An XEmacs package is laid out just like a normal installed XEmacs lisp directory. It may have @file{lisp}, @file{etc}, @file{info}, and @@ -158,16 +159,6 @@ @vindex INFOPATH to @code{Info-directory-list}. -@item lock-directory -@itemx superlock-file -@vindex lock-directory -@vindex superlock-file -Are the site-specific locations of the lock directory and the superlock -file, respectively. The @code{lock-directory} variable may also be -initialized from the @code{EMACSLOCKDIR} -@vindex EMACSLOCKDIR -environment variable. - @item exec-directory @vindex exec-directory Is the directory of architecture-dependent files that come with XEmacs, diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/trouble.texi --- a/man/xemacs/trouble.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/trouble.texi Mon Aug 13 11:35:02 2007 +0200 @@ -332,12 +332,13 @@ it happen again, you can report at least that. Check whether any programs you have loaded into the Lisp world, including -your @file{.emacs} file, set any variables that may affect the functioning -of Emacs. Also, see whether the problem happens in a freshly started Emacs -without loading your @file{.emacs} file (start Emacs with the @code{-q} switch -to prevent loading the init file). If the problem does @var{not} occur -then, it is essential that we know the contents of any programs that you -must load into the Lisp world in order to cause the problem to occur. +your init file, set any variables that may affect the functioning of +Emacs. @xref{Init File}. Also, see whether the problem happens in a +freshly started Emacs without loading your init file (start Emacs with +the @code{-q} switch to prevent loading the init file). If the problem +does @var{not} occur then, it is essential that we know the contents of +any programs that you must load into the Lisp world in order to cause +the problem to occur. If the problem does depend on an init file or other Lisp programs that are not part of the standard Emacs system, then you should make sure it is @@ -378,15 +379,15 @@ (open-termscript "~/termscript") @end example -@noindent -using @kbd{Meta-@key{ESC}} or from the @samp{*scratch*} buffer just -after starting Emacs. From then on, all output from Emacs to the terminal -will be written in the specified termscript file as well, until the Emacs -process is killed. If the problem happens when Emacs starts up, put this -expression into your @file{.emacs} file so that the termscript file will -be open when Emacs displays the screen for the first time. Be warned: -it is often difficult, and sometimes impossible, to fix a terminal-dependent -bug without access to a terminal of the type that stimulates the bug.@refill +@noindent using @kbd{Meta-@key{ESC}} or from the @samp{*scratch*} buffer +just after starting Emacs. From then on, all output from Emacs to the +terminal will be written in the specified termscript file as well, until +the Emacs process is killed. If the problem happens when Emacs starts +up, put this expression into your init file so that the termscript file +will be open when Emacs displays the screen for the first time. +@xref{Init File}. Be warned: it is often difficult, and sometimes +impossible, to fix a terminal-dependent bug without access to a terminal +of the type that stimulates the bug.@refill The newsgroup @samp{comp.emacs.xemacs} may be used for bug reports, other discussions and requests for assistance. diff -r 72a7cfa4a488 -r abe6d1db359e man/xemacs/xemacs.texi --- a/man/xemacs/xemacs.texi Mon Aug 13 11:33:40 2007 +0200 +++ b/man/xemacs/xemacs.texi Mon Aug 13 11:35:02 2007 +0200 @@ -271,9 +271,13 @@ Registers -* RegPos:: Saving positions in registers. -* RegText:: Saving text in registers. -* RegRect:: Saving rectangles in registers. +* Position: RegPos. Saving positions in registers. +* Text: RegText. Saving text in registers. +* Rectangle: RegRect. Saving rectangles in registers. +* Configurations: RegConfig. Saving window configurations in registers. +* Files: RegFiles. File names in registers. +* Numbers: RegNumbers. Numbers in registers. +* Bookmarks:: Bookmarks are like registers, but persistent. Controlling the Display @@ -547,8 +551,7 @@ By changing them, you can "redefine keys". * Syntax:: The syntax table controls how words and expressions are parsed. -* Init File:: How to write common customizations in the @file{.emacs} - file. +* Init File:: How to write common customizations in the init file. * Audible Bell:: Changing how XEmacs sounds the bell. * Faces:: Changing the fonts and colors of a region of text. * X Resources:: X resources controlling various aspects of the @@ -582,7 +585,7 @@ * Entry: Syntax Entry. What the syntax table records for each character. * Change: Syntax Change. How to change the information. -The Init File, @file{~/.emacs} +The Init File * Init Syntax:: Syntax of constants in Emacs Lisp. * Init Examples:: How to do some things with an init file. diff -r 72a7cfa4a488 -r abe6d1db359e modules/base64/Makefile --- a/modules/base64/Makefile Mon Aug 13 11:33:40 2007 +0200 +++ b/modules/base64/Makefile Mon Aug 13 11:35:02 2007 +0200 @@ -1,5 +1,4 @@ # -# Sample makefile for a simple Emacs module. # This is slightly more complicated than would normally be the case, # as this makefile has been tailored to work in the Emacs source tree. # For samples of how to compile modules outside of the source tree @@ -8,6 +7,8 @@ # 'installed'. # +SHELL=/bin/sh +RM=rm -f CC=../../lib-src/ellcc CFLAGS=-I. -I../../src LD=$(CC) --mode=link @@ -28,7 +29,7 @@ distclean: clean clean: - rm -f $(MODNAME).ell $(OBJS) base64_i.o base64_i.c + $(RM) $(MODNAME).ell $(OBJS) base64_i.o base64_i.c $(MODNAME).ell: $(OBJS) base64_i.o $(LD) --mod-output=$@ $(OBJS) base64_i.o diff -r 72a7cfa4a488 -r abe6d1db359e modules/ldap/Makefile --- a/modules/ldap/Makefile Mon Aug 13 11:33:40 2007 +0200 +++ b/modules/ldap/Makefile Mon Aug 13 11:35:02 2007 +0200 @@ -1,5 +1,4 @@ # -# Sample makefile for a simple Emacs module. # This is slightly more complicated than would normally be the case, # as this makefile has been tailored to work in the Emacs source tree. # For samples of how to compile modules outside of the source tree @@ -8,6 +7,8 @@ # 'installed'. # +SHELL=/bin/sh +RM=rm -f CC=../../lib-src/ellcc CFLAGS=-I. -I../../src LD=$(CC) --mode=link @@ -28,7 +29,7 @@ distclean: clean clean: - rm -f $(MODNAME).ell $(OBJS) eldap_i.o eldap_i.c + $(RM) $(MODNAME).ell $(OBJS) eldap_i.o eldap_i.c $(MODNAME).ell: $(OBJS) eldap_i.o $(LD) --mod-output=$@ $(OBJS) eldap_i.o diff -r 72a7cfa4a488 -r abe6d1db359e modules/sample/Makefile --- a/modules/sample/Makefile Mon Aug 13 11:33:40 2007 +0200 +++ b/modules/sample/Makefile Mon Aug 13 11:35:02 2007 +0200 @@ -8,6 +8,8 @@ # 'installed'. # +SHELL=/bin/sh +RM=rm -f CC=../../lib-src/ellcc CFLAGS=-I. -I../../src LD=$(CC) --mode=link @@ -28,7 +30,7 @@ distclean: clean clean: - rm -f $(MODNAME).ell $(OBJS) sample_i.o sample_i.c + $(RM) $(MODNAME).ell $(OBJS) sample_i.o sample_i.c $(MODNAME).ell: $(OBJS) sample_i.o $(LD) --mod-output=$@ $(OBJS) sample_i.o diff -r 72a7cfa4a488 -r abe6d1db359e modules/sample/sample.c --- a/modules/sample/sample.c Mon Aug 13 11:33:40 2007 +0200 +++ b/modules/sample/sample.c Mon Aug 13 11:35:02 2007 +0200 @@ -31,9 +31,9 @@ /* * Each dynamically loaded Emacs module is given a name at compile * time. This is a short name, and must be a valid part of a C - * identifier. This name is used to contruct the name of several + * identifier. This name is used to construct the name of several * functions which must appear in the module source code. - * The first such function, modules_of_XXXX, should load in any dependant + * The first such function, modules_of_XXXX, should load in any dependent * modules. This function is optional, and the module will still load if * it is not present in the module. * @@ -60,8 +60,8 @@ { /* * This function isn't actually required as we will not be loading - * in any dependant modules, but if we were, we would do something like: - * emodules_load ("dependant.ell", "sample2", "1.0.0"); + * in any dependent modules, but if we were, we would do something like: + * emodules_load ("dependent.ell", "sample2", "1.0.0"); */ } diff -r 72a7cfa4a488 -r abe6d1db359e modules/zlib/Makefile --- a/modules/zlib/Makefile Mon Aug 13 11:33:40 2007 +0200 +++ b/modules/zlib/Makefile Mon Aug 13 11:35:02 2007 +0200 @@ -8,6 +8,8 @@ # 'installed'. # +SHELL=/bin/sh +RM=rm -f CC=../../lib-src/ellcc CFLAGS=-I. -I../../src LD=$(CC) --mode=link @@ -28,7 +30,7 @@ distclean: clean clean: - rm -f $(MODNAME).ell $(OBJS) zlib_i.o zlib_i.c + $(RM) $(MODNAME).ell $(OBJS) zlib_i.o zlib_i.c $(MODNAME).ell: $(OBJS) zlib_i.o $(LD) --mod-output=$@ $(OBJS) zlib_i.o diff -r 72a7cfa4a488 -r abe6d1db359e nt/.cvsignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/.cvsignore Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,4 @@ +config.inc +xemacs.ncb +xemacs.opt +xemacs.plg diff -r 72a7cfa4a488 -r abe6d1db359e nt/ChangeLog --- a/nt/ChangeLog Mon Aug 13 11:33:40 2007 +0200 +++ b/nt/ChangeLog Mon Aug 13 11:35:02 2007 +0200 @@ -1,3 +1,287 @@ +2000-10-04 Martin Buchholz + + * XEmacs 21.2.36 is released. + +2000-09-30 Martin Buchholz + + * config.h (HAVE_STRCASECMP): Remove. + +2000-09-07 Jonathan Harris + + * xemacs.mak: + Make src\depend parsing recognise "#if defined" instead of "#ifdef". + Use matching single quotes to keep 4dos shell happy. + +2000-08-07 Ben Wing + + * xemacs.mak: add getloadavg.c. + +2000-07-30 Ben Wing + + * README (NOTE): + Improve X documentation. + Document nascent Mule support. + Document current MS Windows contributors. + +2000-07-15 Ben Wing + + * xemacs.mak: + added new file win32.c. + took out unused alloca.c. + * xemacs.mak (update-elc-2): added new target for rebuilding the + remaining .elcs after dumped. its dependency is added for target + all. + * xemacs.mak (update-auto-and-custom): + cleaned up ; now it byte-compiles custom-load.el. + * xemacs.mak (mostlyclean): + * xemacs.mak (clean): + * xemacs.mak (nicenclean): + * xemacs.mak (distclean): + * xemacs.mak (realclean): + * xemacs.mak (versionclean): + Redid all the clean targets, to be similar to what's in the + standard Makefile. + +2000-07-18 Kirill 'Big K' Katsnelson + + * xemacs.mak ($(PROGNAME)): Do check error code from temacs during + dumping. + +2000-07-19 Martin Buchholz + + * XEmacs 21.2.35 is released. + +2000-07-14 IKEYAMA Tomonori + + * config.h: Import C++ compilation stuff from src/config.h. + +2000-07-05 Craig Lanning + + * xemacs.rc: Uppercase the id's so that windres will work. + +2000-07-05 Kirill 'Big K' Katsnelson + + * xemacs.mak (TEMACS_LIBS): Added comdlg32.lib + +2000-06-12 Ben Wing + + * config.h (ENCAPSULATE_STAT): + Always encapsulate stat/fstat. Also suggested by Mike Alexander + . + +2000-06-10 Ben Wing + + * config.h: + * config.h (HAVE_GETPAGESIZE): + * config.h (HAVE_GETTIMEOFDAY): + corrections to go along with removed nt/inc. + removed HAVE_FEP. + + * config.inc.samp: + correct graphics lib paths to agree with binaries provided in + ftp aux dir. + + * xemacs.mak (DEPEND): + * xemacs.mak (DEFINES): + * xemacs.mak (LIB_SRC_DEFINES): + * xemacs.mak (minitar): + * xemacs.mak (TEMACS_LFLAGS): + * xemacs.mak (tags): + * xemacs.mak (all): + * xemacs.mak (install): + WINDOWSNT -> WIN32_NATIVE. + Don't build run*.exe. + comments about required ^^. + Added setargv.obj to the list of linked entities, + causing automatic wildcarding of filenames given on the + command line. (As usual, enclose in double quotes to avoid + this.) + +2000-06-07 Ben Wing + + * runemacs.c: Removed. No longer necessary. + + * Makefile.cygwin: Removed. + + * inc\*: Removed. At long-fucking-last! + +2000-05-28 Martin Buchholz + + * XEmacs 21.2.34 is released. + +2000-05-12 Craig Lanning + + * inc\sys\socket.h: Don't define timeval as ws_timeval for mingw32 + +2000-05-01 Martin Buchholz + + * XEmacs 21.2.33 is released. + +2000-04-27 Ben Wing + + * xemacs.mak: combine auto-autoloads.el and custom.el update into + one call to xemacs. + +2000-04-26 Ben Wing + + * xemacs.mak: put in support for QUICK_BUILD. + + * config.inc.samp: put in an entry for QUICK_BUILD. + +2000-04-23 Ben Wing + + * xemacs.mak: Modified section that dumps .exe to not dump + when nothing has changed. It does this by relying on a flag + set by update-elcs. + + Also in building of auto-autoloads.el, we no longer unconditionally + remove the old one. That was pointless and made the whole build + procedure a lot longer -- the autoload code is smart enough to + update itself automatically from an out-of-date autoload file. + +2000-04-04 Kirill 'Big K' Katsnelson + + * xemacs.mak: Build the i utility and use it to pipe windowed + [xt]emacs output to the build console. + +2000-03-25 Didier Verna + + * config.h: handle the renaming of `foo_h_path' to `foo_h_file'. + +2000-03-22 Mike Alexander + + * xemacs.mak (PROGRAM_DEFINES): Define EMACS_VERSION and + EMACS_PROGNAME + (DEPEND): Don't try to create $(OUTDIR) if it already exists + ($(SRC)\dump-id.c): Make it + (DOC_SRC11): Add dumper.c if portable dumping + (dump-xemacs): Make portable dumping work again and create + dump-id.c and compile it whenever we do a portable dump. + (depend): Change $(SRCDIR) to $(SRC) + +2000-03-22 Jonathan Harris + + * .cvsignore: New file, ignores user's config.inc and files + containing the user's DevStudio workspace info. + + * config.h.samp: Added DEPEND option. Renamed HAVE_MSW and HAVE_X to + HAVE_MS_WINDOWS and HAVE_X_WINDOWS. + + * README: Documented DEPEND option. Other small changes. + + * Todo: Removed - was hopelessly out of date. + + * config.h.samp: + * xemacs.mak: Added DEPEND option to control use of dependency + information generated by make-src-depend. Requires Perl. Defaults + to disabled. Renamed HAVE_MSW and HAVE_X to HAVE_MS_WINDOWS and + HAVE_X_WINDOWS as a side-effect. + Handles '&' in XEmacs codenames by replacing with 'and'. + + * xemacs.dsp: + Correct Output_Dir so that DevStudio finds the xemacs executable + by default. + +2000-03-20 Ben Wing + + * README: Substantial rewrite. + * xemacs.mak: Pdump fix. (not working yet, though) + +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-15 Mike Alexander + + * xemacs.mak: Fix for generation of $(XEMACS)\Installation. + +2000-03-14 Adrian Aichner + + * xemacs.mak (LIB_SRC_TOOLS): LIB_SRC_TOOLS depend on + XEMACS_INCLUDES when we USE_PORTABLE_DUMPER. + +2000-03-13 Ben Wing + + * xemacs.mak (TEMACS_ENTRYPOINT): + Fix for portable dumper. + +2000-03-12 Ben Wing + + * xemacs.mak (*): + * config.inc: New. + + a) Added a file called config.inc which makes it easier to set + build options for MS Windows. (Previously, the only way to do this + was through command line options to nmake.) + + b) Cleaned the file up a bit. + + c) Changed xemacs to be a windows application and not a console + application, now that runemacs.exe is no longer necessary. + + d) Added support for building the tags file. + + * xemacs.dsw: New. + * xemacs.dsp: New. + For compiling, editing, and debugging XEmacs using the VC++ 5.0 + GUI. They may well work under other versions of VC++, but I don't + have access to them to test them. + +2000-03-11 Andy Piper + + * PROBLEMS: Doc fix from Reini Urban . + +2000-02-27 Mike Alexander + + * xemacs.rc: Include the portable dump data if INCLUDE_DUMP is defined + + * xemacs.mak: Add the portable dump data to the EXE as a resource + +2000-03-07 Jonathan Harris + + * xemacs.mak (TEMACS_LIBS): Add ole32.lib and uuid.lib. + (installation): Always regenerate installation report. + +2000-02-25 Craig Lanning + + * inc\sys\time.h: MinGW defines struct timeval in . + +2000-02-24 Martin Buchholz + + * config.h (INLINE_HEADER): Define properly (?) for Windows. + +2000-02-23 Martin Buchholz + + * XEmacs 21.2.31 is released. + +2000-02-22 Martin Buchholz + + * config.h (gc_checking_assert): New. + +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-21 Jonathan Harris + + * README: Tidy up. + Document need for makeinfo program or texinfo package. + + * Xmd.patch: New file, previously in README. + +2000-02-17 Martin Buchholz + + * config.h: Delete unused HAVE_LINUX_VERSION_H. + +2000-02-16 Martin Buchholz + + * XEmacs 21.2.29 is released. + +2000-02-06 Mike Alexander + + * xemacs.mak (install): Copy xemacs.dmp if using the portable + dumper. + 2000-02-07 Martin Buchholz * XEmacs 21.2.28 is released. @@ -96,7 +380,7 @@ * xemacs.mak (SRCDIR): Make path to xemacs absolute to facilitate building info in man subdirs. Echo all cd commands, - not just some of them. + not just some of them. (makeinfo-test): Test for availability of `texinfo' package to build info. Recommend use of external `makeinfo' program for @@ -179,12 +463,12 @@ 1999-06-05 Norbert Koch * xemacs.mak (mule): remove dependencies from mule-coding.c - + 1999-06-11 XEmacs Build Bot * XEmacs 21.2.16 is released -1999-05-14 Adrian Aichner <adrian@xemacs.org> +1999-05-14 Adrian Aichner * xemacs.mak (GUNG_HO): Explicitly default to 0. Fix some comment typos. @@ -198,7 +482,7 @@ 1999-05-31 Andy Piper * xemacs.mak: add select & select-x targets. - + 1999-05-14 XEmacs Build Bot * XEmacs 21.2.14 is released @@ -229,9 +513,9 @@ report" did. 1999-04-29 Andy Piper - + * sys/file.h: conditionalise definition of X_OK. - + 1999-03-12 XEmacs Build Bot * XEmacs 21.2.13 is released @@ -320,7 +604,7 @@ 1998-12-13 Jonathan Harris * xemacs.mak: - Replaced PACKAGEPATH variable with PACKAGE_PREFIX. + Replaced PACKAGEPATH variable with PACKAGE_PREFIX. configure-package-path is initialised to contain subdirectories of PACKAGE_PREFIX. The install target makes a skeleton package tree under PACKAGE_PREFIX. @@ -359,7 +643,7 @@ 1998-12-07 Martin Buchholz * xemacs.mak (TEMACS_OBJS): - (DOC_SRC4): + (DOC_SRC4): - Remove pure.c, pure.obj 1998-11-04 Adrian Aichner @@ -434,7 +718,7 @@ * xemacs.mak: change "copy" to "xcopy" in install target -1998-08-04 Jeff Sparkes +1998-08-04 Jeff Sparkes * xemacs.mak: Link in PNG, TIFF and JPEG in native build. @@ -542,9 +826,9 @@ 1998-05-20 Kirill M. Katsnelson - * xemacs.mak: Unified -nologo compiler switch handling and lib-src + * xemacs.mak: Unified -nologo compiler switch handling and lib-src programs build (only make-docfile currently, adding other tools - soon). + soon). 1998-05-23 Kirill M. Katsnelson @@ -618,7 +902,7 @@ 1998-04-10 Kirill M. Katsnelson * config.h: Do not USE_ASSERTION when DEBUG_XEMACS is not - defined. + defined. * xemacs.mak: Added new file process-nt.c @@ -672,7 +956,7 @@ 1998-03-19 Kirill M. Katsnelson - * xemacs.mak: HAVE_FILE_CODING removed: it is no longer an option, + * xemacs.mak: HAVE_FILE_CODING removed: it is no longer an option, since file I/O depends on it, and defined unconditioanlly in src/s/windowsnt.h. Added -nologo switch to different tools here and there. @@ -737,7 +1021,7 @@ * config.h: removed #define HAVE_UNIXOID_EVENT_LOOP Thu December 04 1997 jhar@tardis.ed.ac.uk - + * xemacs.mak: Define DEBUG_XEMACS when compiling with debug. Tue November 29 12:29:33 1997 davidh @@ -755,14 +1039,14 @@ - Rewrote timeout code, eliminating "!NILP(rest)" bug. - Special processing for 'Ctrl-@' keystroke. - Support for some new keysyms. - + Mon December 01 1997 jhar * xemacs.mak: - Add PACKAGE_PATH and EMACS_BETA_VERSION defines. - Automatically copy changed include files from \nt to \src. - Corrected some DOC_SRC* lists. - + Tue November 18 21:45:06 1997 davidh * xemacs.mak updated to remove dependency on startup.elc @@ -771,7 +1055,7 @@ Thu September 25 23:06:44 1997 davidh * xemacs.mak updated to make the build as simple as typing - nmake -f xemacs.mak. Also support for native gui included + nmake -f xemacs.mak. Also support for native gui included which should mean the w32 directory is no longer required. * config.h synced with config.h.in from 20.3-b2 @@ -781,7 +1065,7 @@ Thu September 25 23:06:44 1997 davidh * August Hill provided a patch to xemacs.mak to greatly simplify - the build - the DOC file gets created correctly. + the build - the DOC file gets created correctly. Tue September 22 23:06:44 1997 davidh @@ -807,7 +1091,7 @@ * nt/TODO created. * nt/X11.patch created to help with the X build. - + * August Hill provided: a patch to fix the _WRETCODE undefined symbol, a patch to fix a problem with dired @@ -820,7 +1104,7 @@ use the macro, I decided this would be easiest. * Modified src/fileio.c to only open files in O_BINARY. This - causes files to be opened and written without automatically + causes files to be opened and written without automatically writing ^M 's to the end of each line. MULE ought to sort this in theory, but I am less than convinced. @@ -861,7 +1145,7 @@ Thu Mar 13 00:19:25 1997 marcpa (marcpa at MARCPA) - * At end of compilation, there are some unresolved symbols: + * At end of compilation, there are some unresolved symbols: link.exe @C:\TEMP\nma00115. sysdep.obj : error LNK2001: unresolved external symbol _vfork @@ -888,12 +1172,11 @@ @@ -150,8 +150,9 @@ typedef CARD16 BITS16; typedef CARD8 BYTE; - + +#ifndef WIN32 typedef CARD8 BOOL; - +#endif * cpp.exe not used: cl.exe from VC++4.2 seems to handle everything - properly. - + properly. diff -r 72a7cfa4a488 -r abe6d1db359e nt/Makefile.cygwin --- a/nt/Makefile.cygwin Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -MSW_LIBS =-luser32 -lgdi32 -lcomdlg32 -LDFLAGS =-Wl,--subsystem,windows -CFLAGS =-g - -bindir =/usr/local/bin - -INSTALL = /usr/local/src/xemacs-21.0-b42/lib-src/installexe.sh /d/cygnus/h-i386-cygwin32/bin/install -c -INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 - -runemacs.exe: runemacs.o - $(CC) $(LDFLAGS) runemacs.o $(MSW_LIBS) -o $@ - -install: runemacs.exe - $(INSTALL_PROGRAM) runemacs.exe $(bindir) diff -r 72a7cfa4a488 -r abe6d1db359e nt/PROBLEMS --- a/nt/PROBLEMS Mon Aug 13 11:33:40 2007 +0200 +++ b/nt/PROBLEMS Mon Aug 13 11:35:02 2007 +0200 @@ -87,9 +87,9 @@ Function XEmacs binding -------- -------------- Undo C-_ - Cut C-Insert - Copy C-Insert - Paste Sh-Del + Cut Sh-Del + Copy C-Insert + Paste Sh-Insert You can rebind keys to make XEmacs more Windows-compatible; for example, to bind C-z to undo: @@ -99,11 +99,11 @@ Rebindind C-x and C-c is trickier because by default these are prefix keys in XEmacs. See the "Key Bindings" node in the XEmacs manual. -** Behaviour of selected regions +** Behavior of selected regions Selected regions behave differently in XEmacs from typical Windows programs. The pc-select package provides various functions to enable -the standard Windows behaviour for selected regions (eg mark via +the standard Windows behavior for selected regions (eg mark via shift-arrow, self-inserting deletes region, etc). ** Limitations on the use of the AltGr key. diff -r 72a7cfa4a488 -r abe6d1db359e nt/README --- a/nt/README Mon Aug 13 11:33:40 2007 +0200 +++ b/nt/README Mon Aug 13 11:35:02 2007 +0200 @@ -1,45 +1,130 @@ - Building and Installing XEmacs on Windows NT +Building and Installing XEmacs on Windows 95/98/NT/2000 -*- mode:outline -*- David Hobley - Marc Paquette - Jonathan Harris + Marc Paquette + Jonathan Harris + Ben Wing -The port was made much easier by the groundbreaking work of Geoff Voelker -and others who worked on the GNU Emacs port to NT. Their version is available -from http://www.cs.washington.edu/homes/voelker/ntemacs.html +This is a port of XEmacs to Windows 95/98/NT/2000. If you are looking for a +port of GNU Emacs, see http://www.cs.washington.edu/homes/voelker/ntemacs.html. +NT 3.51 or later is required for building on Windows NT. Note that the +developers typically use NT 4.0 and Windows 2000, and there may possibly be +problems under Windows 95/98 and NT 3.51. If so, please report them to +xemacs-nt@xemacs.org; we are committed to maintaining compatibility with all +systems listed. -To get it working you will need: +* Required tools and sources +============================ + +1. You will need Visual C++ V4.0 or later to compile everything. Personally + we have tested V4.0, V4.2, V5.0 and v6.0. -1. You will need Visual C++ V4.0 or later to compile everything. Personally we - have tested V4.0, V4.2 and V5.0. - Note that Visual C++ assumes a couple of environment variables INCLUDE and - LIB to be set which specify the location of the includes and libraries. - Your PATH environment variable also needs to include the DevStudio vc\bin - and sharedide\bin directories. - Visual C++ V5.0 installs a batch file called vcvars32.bat in + Note that Visual C++ assumes that the environment variables INCLUDE and + LIB are set to specify the location of the includes and libraries. + Your PATH environment variable also needs to include the DevStudio + vc\bin and sharedide\bin directories. + + Visual C++ V5.0 and later install a batch file called vcvars32.bat in c:\Program Files\DevStudio\VC\bin\ (or wherever you installed it) that you can run before building to set up all of these environment variables. + Alternatively, you can choose at setup time to have these + environment variables automatically set up in the registry, which + is generally a good idea. -2. Grab the latest XEmacs source from ftp.xemacs.org if necessary. All Win32 - support is in the nt\ subdirectory. You'll also need the xemacs-base - package from the binary-packages subdirectory and you'll probably also - want at least the edit-utils, text-modes, fsf-compat, cc-mode, - prog-modes and xemacs-devel packages. - Unpack the packages into, say, "c:\Program Files\XEmacs\xemacs-packages". + +2. Grab the latest XEmacs source from + + ftp://ftp.xemacs.org/pub/xemacs/ + + or one of its mirrors listed at http://www.xemacs.org/Download/index.html. + + (NOTE: If you are behind a firewall and have problems with FTP access, + the URL http://ftp.xemacs.org/pub/xemacs/ works just as well.) + + You'll also need the packages. You probably want to get the unified + packages bundle from + + ftp://ftp.xemacs.org/pub/xemacs/packages/xemacs-sumo.tar.gz + + If you are building with international support, you also need + + ftp://ftp.xemacs.org/pub/xemacs/packages/xemacs-mule-sumo.tar.gz + + Although we don't recommend it, you can also retrieve just the packages + you really need if you have an extremely slow net connection or are very + short on disk space. You can find the various packages in + ftp://ftp.xemacs.org/pub/xemacs/packages/. You will need the xemacs-base + package (and mule-base, if building with international support). You'll + also need the texinfo package unless you have a copy of makeinfo.exe on + your machine. If you want to download additional or updated packages + from within XEmacs you'll need the efs, dired and vm packages. You'll + probably also want at least the edit-utils, text-modes, fsf-compat, + cc-mode, prog-modes and xemacs-devel packages. + + Unpack the packages into "x:\your\choice\XEmacs\xemacs-packages", + for example "c:\Program Files\XEmacs\xemacs-packages". + +3. At this point you can choose to build for X and/or for Win32 native GUI. + If you only want to build for the Win32 native GUI then skip the next + section. + + +** Extra tools and sources required for X -3. At this point you can select X or Win32 native GUI support. +NOTE: XEmacs has not been tested with X support under the native +Windows build for a long, long time! It may not even compile any +more. If you are interested in X support, you're better off compiling +the Cygwin version of XEmacs, which can handle both Win32 native and X +frames (in the same binary, in fact, but not at the same time), and is +actively tested with X support. + +If you want support for X you will also need: + +1. An X server. XEmacs has been tested and runs well under MI/X, + available from: http://www.microimages.com/mix/. (International aka + "Mule" support even works under this X server!) Unfortunately, this is + not free, but is trialware; you have to pay $25 if you want to use it + for more than 15 days. XEmacs also runs (barely) under the free XWin + server that comes as part of the Cygwin XFree86 package, available at + + ftp://sources.redhat.com/pub/cygwin/xfree/ + + or numerous mirrors, such as + + ftp://ftp.freesoftware.com/pub/sourceware/cygwin/xfree/ -If you want to build for native GUI: + There are numerous other X servers available in the same package or at + the same location, but unfortunately most of them behave even worse + than XWin. If you have any luck with any of these, *PLEASE* email + the maintainers at xemacs-nt@xemacs.org, and we'll add the info here. + +2. Source for the MIT X11R6.3 libraries, available from ftp.x.org. + +3. You'll need to compile the MIT libraries without multi-thread support. + To do this, there is an example Win32.cf and site.def provided which set + the relevant flags. You will also need to apply the patch in nt/X11.patch + in the xc/lib/X11 directory which will fix the DLL definition file. -1. If you want XPM image and toolbar support grab the latest version of the - xpm sources (xpm-3.4k.tar.gz at time of writing) and unpack them somewhere. + Once compiled and installed, you will need to apply the patch in + nt/Xmd.patch. This is messy and better solutions would be appreciated. + +4. Goto step 2 under 'Optional libraries' below. + + +* Optional libraries +==================== + +1. You really want the XPM library. Grab the latest version of the + xpm sources (xpm-3.4k.tar.gz at time of writing) from + ftp://ftp.xemacs.org/pub/xemacs/aux/ and unpack them somewhere. Copy nt\xpm.mak from the xemacs sources to the lib subdirectory of the xpm sources, cd to that directory and build xpm with 'nmake -f xpm.mak'. 2. You probably also want PNG image support. Grab the latest versions of zlib - and libpng (zlib-1.1.3 and libpng-1.0.2 at time of writing), unpack them - somewhere and read the respective READMEs for details on how to build them. - The following build procedure works for zlib-1.1.3 and libpng-1.0.2: + and libpng (zlib-1.1.3 and libpng-1.0.2 at time of writing) from + ftp://ftp.xemacs.org/pub/xemacs/aux/, unpack them somewhere and read + the respective READMEs for details on how to build them. The following + build procedure works for zlib-1.1.3 and libpng-1.0.2: cd to the zlib directory, type 'copy msdos\makefile.w32 Makefile' and then type 'nmake'. @@ -48,117 +133,186 @@ and type 'nmake -f scripts\makefile.w32'. 3. If you want TIFF support, grap the latest version of libtiff (tiff-v3.4 - at time of writing) and unpack it somewhere. Copy nt\tiff.mak from the - xemacs sources to the contrib\winnt subdirectory of the tiff sources, - cd to that directory and build libtiff with 'nmake -f tiff.mak'. Note: - tiff.mak has only been verified to work under WinNT, not Win95 or 98. - However, the lastest distribution of libtiff includes a - contrib\win95\makefile.w95; that might work. + at time of writing) from ftp://ftp.xemacs.org/pub/xemacs/aux/ and unpack + it somewhere. Copy nt\tiff.mak from the xemacs sources to the + contrib\winnt subdirectory of the tiff sources, cd to that directory and + build libtiff with 'nmake -f tiff.mak'. Note: tiff.mak has only been + verified to work under WinNT, not Win95 or 98. However, the lastest + distribution of libtiff includes a contrib\win95\makefile.w95; that might + work. 4. If you want JPEG support grab the latest version of jpegsrc (jpeg-6b at - time of writing) and read the README for details on how to build it. - -5. If you want X-Face support, grab compface distribution and unpack it - somewhere. Copy nt\compface.mak from xemacs sources to the compface - directory. cd to that directory and build libcompface with - 'nmake -f compface.mak'. - -6. cd to the nt subdirectory of the xemacs distribution and build xemacs: - `nmake install -f xemacs.mak`, but read on before hitting Enter. - -7. If you're building with XPM support, add this to the nmake command line: - HAVE_XPM=1 XPM_DIR="x:\location\of\your\xpm\sources" - and similarly for JPEG and TIFF support. - - If you're building with PNG support, add this to the nmake command line: - HAVE_PNG=1 PNG_DIR="x:\location\of\your\png\sources" - ZLIB_DIR="x:\location\of\your\zlib\sources" - - If you want to build with GIF support, add this to the nmake command line: - HAVE_GIF=1 - - If you're building with X-Face support, add this to the nmake command line: - HAVE_XFACE=1 COMPFACE_DIR="x:\location\of\your\compface\sources" + time of writing) from ftp://ftp.xemacs.org/pub/xemacs/aux/ and read the + README for details on how to build it. -8. By default, XEmacs will expect to find its packages in the subdirectories - "site-packages", "mule-packages" and "xemacs-packages" under the package - prefix directory "c:\Program Files\XEmacs". If you want it to look for - these subdirectories elsewhere, add this to the nmake command line: - PACKAGE_PREFIX="x:\your\package\directory" - If you change your mind and want to alter the package prefix directory - after you've built XEmacs, delete the file .\obj\emacs.obj and rebuild with - the new PACKAGE_PREFIX. - -9. By default, XEmacs will be installed in directories under the directory - "c:\Program Files\XEmacs\XEmacs-21.0". If you want to install it elsewhere, - add this to the nmake command line: - INSTALL_DIR="x:\your\installation\directory" - -10. Now you can press Enter. nmake will build temacs, the DOC file, update the - elc's, dump xemacs and install the relevant files in the directories under - the installation directory. Unless you set INSTALL_DIR above, the file that - you should run to start XEmacs will be installed as - "c:\Program Files\XEmacs\XEmacs-21.0\i386-pc-win32\runemacs.exe". You may - want to create a shortcut to that file from your Desktop or Start Menu. - -11. The build process always creates debugging and "Source Browser" information - in the source tree for use with MS DevStudio. If you actually want to debug - XEmacs you should run XEmacs from the source directory instead of from the - installation directory. You should probably also build a debug version of - XEmacs; to do this start with a clean source tree and add DEBUG_XEMACS=1 to - the nmake command line. You probably don't want to install your debug build - so you should tell nmake to build the 'all' target instead of the 'install' - target. - - To make use of the debugging and "Source Browser" information, create a new - "console" project in MS DevStudio and, under Project/Settings, set: - Debug: executable name = full path of src\xemacs.exe - Link: output file name = full path of src\temacs.exe - Browse Info: browse info file name = full path of src\temacs.bsc - Remember to close the Source Browser file in DevStudio before rebuilding. +5. If you want X-Face support, grab the compface distribution from + ftp://ftp.xemacs.org/pub/xemacs/aux/ and unpack it somewhere. + Copy nt\compface.mak from xemacs sources to the compface directory. + cd to that directory and build libcompface with 'nmake -f compface.mak'. -If you want support for X you will need: +* Building +========== + +1. cd to the nt subdirectory of the xemacs distribution and copy the file + config.inc.samp to config.inc. Make any necessary modifications. This + file controls the options that XEmacs is built with: + + -- If you want international (aka "Mule") support, modify the appropriate + line in config.inc as follows: + + HAVE_MULE=1 -1. An X server. MI/X is available on the Internet for free; It is - available from: http://www.microimages.com/www/html/freestuf/mixdlfrm.htm + NOTE: This support is still quite raw under the Win32 native GUI, + but works well if you compile the Cygwin version with X support + and disable native Win32 support (--with-msw=no). + + -- If you're building with XPM support, modify the appropriate lines in + config.inc as follows: + + HAVE_XPM=1 + XPM_DIR="x:\location\of\your\xpm\sources" + + and similarly for JPEG and TIFF support. -2. The MIT X11R6.3 libraries available from: ftp.x.org + -- If you're building with PNG support, modify the appropriate lines in + config.inc as follows: + + HAVE_PNG=1 + PNG_DIR="x:\location\of\your\png\sources" + ZLIB_DIR="x:\location\of\your\zlib\sources" + + -- If you're building with GIF support, modify the appropriate lines in + config.inc as follows: + + HAVE_GIF=1 -3. You'll need to compile the MIT libraries without multi-thread support. - To do this, there is an example Win32.cf and site.def provided which - set the relevant flags. You will also need to apply the patch in - nt/X11.patch in the xc/lib/X11 directory which will fix the DLL definition - file. Once compiled and installed, you will need to apply the following - patch to Xmd.h. This is messy and better solutions would be appreciated. + -- If you're building with X-Face support, modify the appropriate lines in + config.inc as follows: + + HAVE_XFACE=1 + COMPFACE_DIR="x:\location\of\your\compface\sources" + + -- If you're building for X, modify the appropriate lines in config.inc + as follows: + + HAVE_X_WINDOWS=1 + X11_DIR=x:\root\directory\of\your\X11\installation + + -- By default, XEmacs will expect to find its packages in the + subdirectories "site-packages", "mule-packages" and "xemacs-packages" + under the directory "c:\Program Files\XEmacs". If you want it to look + for these subdirectories elsewhere, modify the appropriate lines in + config.inc as follows: -4. Goto 2 under 'native GUI' above and add this to the nmake command line: - HAVE_X=1 X11_DIR=x:\root\directory\of\your\X11\installation + PACKAGE_PREFIX="x:\your\package\directory" + + Make sure that the directory pointed to by PACKAGE_PREFIX contains + the xemacs-packages directory into which you installed the packages. + + -- XEmacs can build its info files more quickly if you have a copy of the + makeinfo program. If you have a copy, modify the appropriate lines in + config.inc as follows: + + MAKEINFO="x:\location\of\makeinfo.exe" + + If you don't have a copy of makeinfo then you'll need to have installed + the XEmacs texinfo package. + +2. If you want to install XEmacs when you build it, modify the appropriate + lines in config.inc as follows (you can also run XEmacs from its build + directory): + + INSTALL_DIR="x:\your\installation\directory" ---- Xmd.h~ Thu Jun 08 23:20:40 1995 -+++ Xmd.h Sun Mar 16 13:09:10 1997 -@@ -150,8 +150,9 @@ - typedef CARD16 BITS16; - typedef CARD8 BYTE; - -+#ifndef WIN32 - typedef CARD8 BOOL; -- -+#endif - -Known Problems: -Please look at the TODO list for the current list of problems and people -working on them. + (By default, XEmacs will be installed in directories under the directory + "c:\Program Files\XEmacs\XEmacs-21.2".) + +3. If you want to build xemacs on the command line, use + `nmake install -f xemacs.mak', or just `nmake -f xemacs.mak' if you want + to run XEmacs from its build directory. nmake will build temacs, the DOC + file, update the elc's, dump xemacs and (optionally) install the relevant + files in the directories under the installation directory. + + If you chose to install XEmacs, the file that you should run to start + XEmacs will be installed (by default) as + "c:\Program Files\XEmacs\XEmacs-21.2\i586-pc-win32\xemacs.exe". + + To run from the build directory, run the file "nt\xemacs.exe" off of the + root of the build directory. + + You may want to create a shortcut to the file from your Desktop or + Start Menu. + +4. To build using MS Developer Studio, you can use the workspace file + `nt/xemacs.dsw'. This was prepared for Visual C++ 6.0. If you are using + Visual C++ 5.0, you can use the workspace file `nt/xemacs-vc50.dsw'. If + you have a different version and neither file works, just open up + `nt/xemacs.mak' from within MS Developer Studio and it will offer to wrap + this Makefile in a workspace file, from which you can build. Assuming + you want to run from the build directory (which you will want to do if + you are planning on doing any development work on XEmacs), use the + following settings in Project/Settings...: + + Under the General tab: + + Build command line: NMAKE /f xemacs.mak + Output file name: ..\src\xemacs.exe + Browse info file name: ..\src\temacs.bsc + + Under the Debug tab: -Any other problems you need clarified, please email us and we will endeavour -to provide any assistance we can: + Executable for debug session: ..\src\xemacs.exe + + + If you want to install XEmacs when it's built, change the build command + line to "NMAKE install /f xemacs.mak". (You will have to make the same + change even if you use the provided workspace nt/xemacs.dsw.) + + +* Debugging under MS Developer Studio +===================================== + +The build process always creates debugging and "Source Browser" information +in the source tree for use with DevStudio. However that information is not +very useful unless you build a debug version of XEmacs: + +1. Set DEBUG_XEMACS=1 and DEPEND=1 in config.inc and rebuild. + +2. See instructions above for obtaining a workspace file for use with + 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. + +4. 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. + + +* Known Problems +================ + +Please look at the PROBLEMS file for known problems. Any other problems you +need clarified, please email us and we will endeavour to provide any +assistance we can: The XEmacs NT Mailing List: xemacs-nt@xemacs.org Subscribe address: xemacs-nt-request@xemacs.org -David Hobley -Marc Paquette -August Hill -Jonathan Harris +Ben Wing (current primary MS Windows maintainer; author of the MS Windows + Mule code and some of the dialog box code) +Andy Piper (MS Windows contributor; author of the Cygwin support and the + MS Windows glyph and widget code) +Jonathan Harris (MS Windows contributor; author of the MS Windows redisplay + and underlying GUI code) +Kirill Katsnelson (MS Windows contributor; author of the MS Windows process + and printing code and some of the dialog box code; + general guru on obscure MS Windows programming topics) +David Hobley (early MS Windows contributor) +Marc Paquette (early MS Windows contributor) +August Hill (early MS Windows contributor) and others. diff -r 72a7cfa4a488 -r abe6d1db359e nt/Todo --- a/nt/Todo Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -# List of problems with XEmacs. If anyone wants to work on these, please -# mail me and I'll update the table below. - -# Core NT issues - 1. Subprocess support is completely broken. - 2. Networking support is completely broken. This is due to the fact that - the model relies on the subprocess support also working. - 4. No binary release. We know a binary release would be A Good Thing. - However we want to make things stable before producing one so we don't - have to field too many problems. Sorry. - 5. Support for dired is perhaps not quite there. We need to port ls-lisp.el - from FSF Emacs. - 6. Currently the backup files do not get the same permissions as the file - being edited. August Hill is looking at this one. - 7. Verify that CRLF issues are dealt with correctly. Marc Paquette is - looking at this. - 8. Use the registry to store the root directory(ies) of lisp packages; that - is the path name, not the elisp files. - -# X issues - 1. Redrawing on my (davidh) system seems fairly broken - I don't know if - this is the XEmacs redraw functionality, my X server or just something - strange with X under NT. Has anyone else experiences with this ? - -# Native GUI issues - 0. The entire event model. - 1. Calling mouse_[enter|leave]_frame_hook - 2. Can't change bold, italic or bold-italic face fonts - 3. Bogus delay when setting default- or initial-frame-plist - 4. Short timeouts don't seem to be very accurate - 5. Scrollbar dragging. Redisplay isn't called while dragging. - Also can't retrieve 32 bit tracking position with GetScrollInfo() - 6. Menubar - 7. Palette handling - 8. Middle mouse button emulation - 9. Drag'n'drop - 10. Images - -Old Issues. - - 1. For some reason, HOME is a required environment variable. - diff -r 72a7cfa4a488 -r abe6d1db359e nt/Xmd.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/Xmd.patch Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,10 @@ +--- Xmd.h~ Thu Jun 08 23:20:40 1995 ++++ Xmd.h Sun Mar 16 13:09:10 1997 +@@ -150,8 +150,9 @@ + typedef CARD16 BITS16; + typedef CARD8 BYTE; + ++#ifndef WIN32 + typedef CARD8 BOOL; +- ++#endif diff -r 72a7cfa4a488 -r abe6d1db359e nt/config.h --- a/nt/config.h Mon Aug 13 11:33:40 2007 +0200 +++ b/nt/config.h Mon Aug 13 11:35:02 2007 +0200 @@ -21,7 +21,7 @@ /* Synched up with: FSF 19.30 (more or less). */ /* No code in XEmacs #includes config.h twice, but some of the code - intended to work with other packages as well (like gmalloc.c) + intended to work with other packages as well (like gmalloc.c) think they can include it as many times as they like. */ #ifndef _SRC_CONFIG_H_ #define _SRC_CONFIG_H_ @@ -154,11 +154,10 @@ #undef HAVE_UTIME_H #undef HAVE_SYS_WAIT_H #undef HAVE_LIBGEN_H -#undef HAVE_LINUX_VERSION_H #undef WORDS_BIGENDIAN #undef TIME_WITH_SYS_TIME -#define HAVE_SYS_TIME_H +#undef HAVE_SYS_TIME_H #define HAVE_LOCALE_H #ifdef HAVE_X_WINDOWS #define HAVE_X11_LOCALE_H @@ -231,7 +230,10 @@ #undef HAVE_FREXP #undef HAVE_FTIME #undef HAVE_GETHOSTNAME -#undef HAVE_GETPAGESIZE + +#define HAVE_GETPAGESIZE +#define getpagesize() 4096 + #define HAVE_GETTIMEOFDAY #define HAVE_GETWD #undef HAVE_LOGB @@ -255,7 +257,6 @@ #undef HAVE_SIGHOLD #undef HAVE_SIGPROCMASK #undef HAVE_SIGSETJMP -#undef HAVE_STRCASECMP #define HAVE_STRERROR #undef HAVE_TZSET #undef HAVE_UTIMES @@ -287,7 +288,7 @@ /* Define HAVE_BERKELEY_DB if you want to use the BerkDB libraries */ #undef HAVE_BERKELEY_DB /* Full #include file path for Berkeley DB's db.h */ -#undef DB_H_PATH +#undef DB_H_FILE #if defined (HAVE_DBM) || defined (HAVE_BERKELEY_DB) # define HAVE_DATABASE @@ -296,8 +297,8 @@ /* Define HAVE_NCURSES if -lncurses is present. */ #undef HAVE_NCURSES /* Full #include file paths for ncurses' curses.h and term.h. */ -#undef CURSES_H_PATH -#undef TERM_H_PATH +#undef CURSES_H_FILE +#undef TERM_H_FILE #define LOWTAGS @@ -343,6 +344,11 @@ #define bufpos_checking_assert(assertion) #endif +#ifdef ERROR_CHECK_GC +#define gc_checking_assert(assertion) assert (assertion) +#else +#define gc_checking_assert(assertion) +#endif /* Define MEMORY_USAGE_STATS if you want extra code compiled in to determine where XEmacs's memory is going. */ @@ -420,8 +426,6 @@ compiling-running-crashing. */ #undef NO_DOC_FILE -#define CONST const - /* If not defined, use unions instead of ints. A few systems (DEC Alpha) seem to require this, probably because something with the int definitions isn't right with 64-bit systems. @@ -484,7 +488,7 @@ #undef SUNPRO /* Sun SparcStations, SGI machines, and HP9000s700s have support for playing - different sound files as beeps. If you are on a SparcStation but do not + different sound files as beeps. If you are on a SparcStation but do not have the sound option installed for some reason, then undefine HAVE_NATIVE_SOUND. (It's usually found in /usr/demo/SOUND/ on SunOS 4 and Solaris systems; on Solaris, you may need to install the "SUNWaudmo" @@ -494,7 +498,7 @@ /* If you wish to compile with support for the Network Audio System system define HAVE_NAS_SOUND. - NAS_NO_ERROR_JUMP means that the NAS libraries don't inlcude some + NAS_NO_ERROR_JUMP means that the NAS libraries don't include some error handling changes. */ #undef HAVE_NAS_SOUND @@ -534,7 +538,7 @@ uses, mbstowcs() and wcstombs(), are unusable when programs are statically linked (as XEmacs must be) because the static version of libc.a contains the *dynamic* versions of these functions. These - functions don't seem to be called when XEmacs is running, so it's + functions don't seem to be called when XEmacs is running, so it's enough to define stubs for them. This appears to be fixed in SunOS 4.1.2. @@ -557,10 +561,8 @@ #define ENCAPSULATE_OPEN #define ENCAPSULATE_FOPEN #define ENCAPSULATE_MKDIR - -#if defined (WIN32) && defined (USE_IME) -#define HAVE_FEP -#endif +#define ENCAPSULATE_STAT +#define ENCAPSULATE_FSTAT #if defined (HAVE_SOCKS) && !defined (DO_NOT_SOCKSIFY) #define accept Raccept @@ -581,11 +583,13 @@ /* MSVC version >= 2.x without /Za supports __inline */ #if (_MSC_VER < 900) || defined(__STDC__) -# define INLINE static +# define inline #else -# define INLINE __inline +# define inline __inline #endif +#define INLINE_HEADER inline static + /* MSVC warnings no-no crap. When adding one to this section, 1. Think twice 2. Insert textual description of the warning. @@ -597,6 +601,21 @@ #endif /* compiler understands #pragma warning*/ +#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 +# define not c_not + +# define EXTERN_C extern "C" +# else /* C code */ +# define EXTERN_C extern +# endif +#endif /* C or C++ */ + #define enum_field(enumeration_type) unsigned int /* We want to avoid saving the signal mask if possible, because diff -r 72a7cfa4a488 -r abe6d1db359e nt/config.inc.samp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/config.inc.samp Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,78 @@ +# -*- mode: makefile -*- + +############################################################################ + +INSTALL_DIR=c:\Program Files\XEmacs\XEmacs-$(XEMACS_VERSION_STRING) + +PACKAGE_PREFIX=c:\Program Files\XEmacs + +############################################################################ + +# Multilingual support (not currently working). +HAVE_MULE=0 + +# Native MS Windows support. +HAVE_MS_WINDOWS=1 + +# X Windows support. +HAVE_X_WINDOWS=0 +X11_DIR= + +############################################################################ + +# Set this to enable XPM support (virtually mandatory), and specify +# the directory containing xpm. +HAVE_XPM=1 +XPM_DIR=c:\src\xpm-3.4k + +# Set this to enable GIF support. +HAVE_GIF=1 + +# Set this to enable PNG support (virtually mandatory), and specify +# the directories containing png and zlib. +HAVE_PNG=1 +PNG_DIR=c:\src\libpng-1.0.5 +ZLIB_DIR=c:\src\zlib-1.1.3 + +# Set this to enable TIFF support, and specify the directory containing tiff. +HAVE_TIFF=0 +TIFF_DIR= + +# Set this to enable JPEG support, and specify the directory containing jpeg. +HAVE_JPEG=1 +JPEG_DIR=c:\src\jpeg-6b + +# Set this to enable XFace support, and specify the directory containing +# compface. +HAVE_XFACE=0 +COMPFACE_DIR= + +############################################################################ + +# 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=f:\src\texinfo-4.0\makeinfo\makeinfo.exe + +############################################################################ + +# Set this to enable some debug code that doesn't slow things down. +DEBUG_XEMACS=1 + +# Set this to speed up building, for development purposes. +QUICK_BUILD=0 + +# Set this to see exactly which compilation commands are being run (not +# generally recommended). +VERBOSECC=0 + +# Set this to get nmake to use dependency info (requires Perl to be installed) +DEPEND=0 + +############################################################################ + +# Some technical options. + +USE_MINIMAL_TAGBITS=0 +USE_INDEXED_LRECORD_IMPLEMENTATION=0 +USE_PORTABLE_DUMPER=0 +GUNG_HO=0 diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/arpa/inet.h --- a/nt/inc/arpa/inet.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -/* null version of - has everything */ diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/netdb.h --- a/nt/inc/netdb.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -/* null version of - has everything */ diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/netinet/in.h --- a/nt/inc/netinet/in.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -/* null version of - has everything */ diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/pwd.h --- a/nt/inc/pwd.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -#ifndef _PWD_H_ -#define _PWD_H_ -/* - * pwd.h doesn't exist on NT, so we put together our own. - */ - -struct passwd { - char *pw_name; - char *pw_passwd; - int pw_uid; - int pw_gid; - int pw_quota; - char *pw_gecos; - char *pw_dir; - char *pw_shell; -}; - -#endif /* _PWD_H_ */ diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/sys/dir.h --- a/nt/inc/sys/dir.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* 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: FSF 19.30. */ - -/* - -- definitions for 4.2BSD-compatible directory access - - last edit: 09-Jul-1983 D A Gwyn -*/ - -#ifdef VMS -#ifndef FAB$C_BID -#include -#endif -#ifndef NAM$C_BID -#include -#endif -#ifndef RMS$_SUC -#include -#endif -#include "vms-dir.h" -#endif /* VMS */ - -#define DIRBLKSIZ 512 /* size of directory block */ -#ifdef VMS -#define MAXNAMLEN (DIR$S_NAME + 7) /* 80 plus room for version #. */ -#define MAXFULLSPEC NAM$C_MAXRSS /* Maximum full spec */ -#else -#ifdef WINDOWSNT -#define MAXNAMLEN 255 -#else /* not WINDOWSNT */ -#define MAXNAMLEN 15 /* maximum filename length */ -#endif /* not WINDOWSNT */ -#endif /* VMS */ - /* NOTE: MAXNAMLEN must be one less than a multiple of 4 */ - -struct direct /* data from readdir() */ - { - long d_ino; /* inode number of entry */ - unsigned short d_reclen; /* length of this record */ - unsigned short d_namlen; /* length of string in d_name */ - char d_name[MAXNAMLEN+1]; /* name of file */ - }; - -typedef struct - { - int dd_fd; /* file descriptor */ - int dd_loc; /* offset in block */ - int dd_size; /* amount of valid data */ - char dd_buf[DIRBLKSIZ]; /* directory block */ - } DIR; /* stream data from opendir() */ - -DIR *opendir (CONST char *filename); -void closedir (DIR *dirp); -struct direct *readdir (DIR *dirp); -struct direct *readdirver (DIR *dirp); -long telldir (DIR *dirp); -void seekdir (DIR *dirp, long loc); - -#define rewinddir( dirp ) seekdir( dirp, 0L ) diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/sys/file.h --- a/nt/inc/sys/file.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -/* - * sys\file.h doesn't exist on NT - only needed for these constants - */ - -#define F_OK 0 -#ifdef X_OK -#undef X_OK -#endif -#define X_OK 1 -#define W_OK 2 -#define R_OK 4 diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/sys/ioctl.h --- a/nt/inc/sys/ioctl.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -/* - * sys\ioctl.h doesn't exist on NT...rather than including it conditionally - * in many of the source files, we just extend the include path so that the - * compiler will pick this up empty header instead. - */ diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/sys/param.h --- a/nt/inc/sys/param.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#ifndef _PARAM_H_ -#define _PARAM_H_ - -/* - * sys\param.h doesn't exist on NT, so we'll make one. - */ - -#define NBPG 4096 - -#endif /* _PARAM_H_ */ diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/sys/socket.h --- a/nt/inc/sys/socket.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* Workable version of based on winsock.h */ - -#ifndef _SOCKET_H_ -#define _SOCKET_H_ - -/* defeat the multiple include protection */ -#ifdef _WINSOCKAPI_ -#undef _WINSOCKAPI_ -#endif - -#if 0 /* What's wrong with winsock.h version ? - kkm */ -/* avoid clashing with our version of FD_SET if already defined */ -#ifdef FD_SET -#undef FD_SET -#undef FD_CLR -#undef FD_ISSET -#undef FD_ZERO -#endif - -/* allow us to provide our own version of fd_set */ -#define fd_set ws_fd_set -#endif /* 0 */ - -/* avoid duplicate definition of timeval */ -#ifdef HAVE_TIMEVAL -#define timeval ws_timeval -#endif - -#include - -#if 0 /* What's wrong with winsock.h version ? - kkm */ -/* revert to our version of FD_SET */ -#undef FD_SET -#undef FD_CLR -#undef FD_ISSET -#undef FD_ZERO -#undef fd_set -#include "nt.h" -#endif /* 0 */ - -#ifdef HAVE_TIMEVAL -#undef timeval -#endif - -/* map winsock error codes to standard names */ -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEINPROGRESS -#define EALREADY WSAEALREADY -#define ENOTSOCK WSAENOTSOCK -#define EDESTADDRREQ WSAEDESTADDRREQ -#define EMSGSIZE WSAEMSGSIZE -#define EPROTOTYPE WSAEPROTOTYPE -#define ENOPROTOOPT WSAENOPROTOOPT -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -#define EOPNOTSUPP WSAEOPNOTSUPP -#define EPFNOSUPPORT WSAEPFNOSUPPORT -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#define EADDRINUSE WSAEADDRINUSE -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL -#define ENETDOWN WSAENETDOWN -#define ENETUNREACH WSAENETUNREACH -#define ENETRESET WSAENETRESET -#define ECONNABORTED WSAECONNABORTED -#define ECONNRESET WSAECONNRESET -#define ENOBUFS WSAENOBUFS -#define EISCONN WSAEISCONN -#define ENOTCONN WSAENOTCONN -#define ESHUTDOWN WSAESHUTDOWN -#define ETOOMANYREFS WSAETOOMANYREFS -#define ETIMEDOUT WSAETIMEDOUT -#define ECONNREFUSED WSAECONNREFUSED -#define ELOOP WSAELOOP -/* #define ENAMETOOLONG WSAENAMETOOLONG */ -#define EHOSTDOWN WSAEHOSTDOWN -#define EHOSTUNREACH WSAEHOSTUNREACH -/* #define ENOTEMPTY WSAENOTEMPTY */ -#define EPROCLIM WSAEPROCLIM -#define EUSERS WSAEUSERS -#define EDQUOT WSAEDQUOT -#define ESTALE WSAESTALE -#define EREMOTE WSAEREMOTE - -#endif /* _SOCKET_H_ */ - -/* end of socket.h */ diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/sys/time.h --- a/nt/inc/sys/time.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* - * sys/time.h doesn't exist on NT - */ - -#include - -struct timeval - { - long tv_sec; /* seconds */ - long tv_usec; /* microseconds */ - }; - -struct timezone - { - int tz_minuteswest; /* minutes west of Greenwich */ - int tz_dsttime; /* type of dst correction */ - }; - -#ifndef HAVE_X_WINDOWS -/* X11R6 on NT provides the single parameter version of this command */ -void gettimeofday (struct timeval *, struct timezone *); -#endif - -/* end of sys/time.h */ diff -r 72a7cfa4a488 -r abe6d1db359e nt/inc/unistd.h --- a/nt/inc/unistd.h Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -/* Fake unistd.h: config.h already provides most of the relevant things. */ diff -r 72a7cfa4a488 -r abe6d1db359e nt/runemacs.c --- a/nt/runemacs.c Mon Aug 13 11:33:40 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ -/* - Simple program to start Emacs with its console window hidden. - - This program is provided purely for convenience, since most users will - use Emacs in windowing (GUI) mode, and will not want to have an extra - console window lying around. */ - -/* - You may want to define this if you want to be able to install updated - emacs binaries even when other users are using the current version. - The problem with some file servers (notably Novell) is that an open - file cannot be overwritten, deleted, or even renamed. So if someone - is running emacs.exe already, you cannot install a newer version. - By defining CHOOSE_NEWEST_EXE, you can name your new emacs.exe - something else which matches "emacs*.exe", and runemacs will - automatically select the newest emacs executeable in the bin directory. - (So you'll probably be able to delete the old version some hours/days - later). -*/ - -/* #define CHOOSE_NEWEST_EXE */ - -#define WIN32 - -#include -#include -#include - -#if defined(__CYGWIN32__) -#include -#include -#endif - -int WINAPI -WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) -{ - STARTUPINFO start; - SECURITY_ATTRIBUTES sec_attrs; - SECURITY_DESCRIPTOR sec_desc; - PROCESS_INFORMATION child; - int wait_for_child = FALSE; - DWORD ret_code = 0; - char *new_cmdline; - char *basename; - char *p; - char modname[MAX_PATH]; - - if (!GetModuleFileName (NULL, modname, MAX_PATH)) - goto error; - if ((p = strrchr (modname, '\\')) == NULL) - goto error; - - basename = alloca(strlen(p) + 1); - strcpy (basename, p + 1); - - *p = 0; - - new_cmdline = alloca (MAX_PATH + strlen (cmdline) + 1); - strcpy (new_cmdline, modname); - -#ifdef CHOOSE_NEWEST_EXE - { - /* Silly hack to allow new versions to be installed on - server even when current version is in use. */ - - char * best_name = alloca (MAX_PATH + 1); - FILETIME best_time = {0,0}; - WIN32_FIND_DATA wfd; - HANDLE fh; - p = new_cmdline + strlen (new_cmdline); - strcpy (p, "\\xemacs*.exe "); - fh = FindFirstFile (new_cmdline, &wfd); - if (fh == INVALID_HANDLE_VALUE) - goto error; - do - { - if (wfd.ftLastWriteTime.dwHighDateTime > best_time.dwHighDateTime - || (wfd.ftLastWriteTime.dwHighDateTime == best_time.dwHighDateTime - && wfd.ftLastWriteTime.dwLowDateTime > best_time.dwLowDateTime)) - { - best_time = wfd.ftLastWriteTime; - strcpy (best_name, wfd.cFileName); - } - } - while (FindNextFile (fh, &wfd)); - FindClose (fh); - *p++ = '\\'; - strcpy (p, best_name); - strcat (p, " "); - } -#else -#if defined(__CYGWIN32__) - { - struct stat stbuf; - char sym_link_name[MAX_PATH+1], real_name[MAX_PATH+1]; - - strcpy(sym_link_name, new_cmdline); - if (strcmp(basename, "rungnuclient.exe") == 0) - strcat(new_cmdline, "\\gnuclient.exe "); - else if (strcmp(basename, "runemacs.exe") == 0) - { - strcat(sym_link_name, "\\xemacs"); - - if (lstat(sym_link_name, &stbuf) == 0) - { - if ((stbuf.st_mode & S_IFLNK) == S_IFLNK) - { - if (readlink(sym_link_name, real_name, sizeof(real_name)) == -1) - { - MessageBox (NULL, "Error reading symbolic link for xemacs", - "Error", MB_ICONSTOP); - return 1; - } - else - { - strcat(new_cmdline, "\\"); - strcat(new_cmdline, real_name); - strcat(new_cmdline, " "); - } - } - else - strcat(new_cmdline, "\\xemacs "); - } - else - { - MessageBox (NULL, "can't locate XEmacs executable", - "Error", MB_ICONSTOP); - return 1; - } - } - } -#else - if (strcmp(basename, "rungnuclient.exe") == 0) - strcat (new_cmdline, "\\gnuclient.exe "); - else - strcat (new_cmdline, "\\xemacs.exe "); -#endif -#endif - - /* Append original arguments if any; first look for -wait as first - argument, and apply that ourselves. */ - if (strncmp (cmdline, "-wait", 5) == 0) - { - wait_for_child = TRUE; - cmdline += 5; - } - strcat (new_cmdline, cmdline); - - /* Set emacs_dir variable if runemacs was in "%emacs_dir%\bin". */ - if ((p = strrchr (modname, '\\')) && stricmp (p, "\\bin") == 0) - { - *p = 0; - for (p = modname; *p; p++) - if (*p == '\\') *p = '/'; - SetEnvironmentVariable ("emacs_dir", modname); - } - - memset (&start, 0, sizeof (start)); - start.cb = sizeof (start); - start.dwFlags = STARTF_USESHOWWINDOW; - start.wShowWindow = SW_HIDE; - - sec_attrs.nLength = sizeof (sec_attrs); - sec_attrs.lpSecurityDescriptor = NULL; - sec_attrs.bInheritHandle = FALSE; - - if (CreateProcess (NULL, new_cmdline, &sec_attrs, NULL, TRUE, 0, - NULL, NULL, &start, &child)) - { - if (wait_for_child) - { - WaitForSingleObject (child.hProcess, INFINITE); - GetExitCodeProcess (child.hProcess, &ret_code); - } - CloseHandle (child.hThread); - CloseHandle (child.hProcess); - } - else - goto error; - return (int) ret_code; - -error: - MessageBox (NULL, "Could not start XEmacs or gnuclient.", "Error", MB_ICONSTOP); - return 1; -} diff -r 72a7cfa4a488 -r abe6d1db359e nt/xemacs-vc50.dsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/xemacs-vc50.dsp Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,1392 @@ +# Microsoft Developer Studio Project File - Name="xemacs" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=xemacs - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "xemacs.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "xemacs.mak" CFG="xemacs - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "xemacs - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "xemacs - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "xemacs - Win32 Release" + +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Cmd_Line "NMAKE /f xemacs.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "xemacs.exe" +# PROP BASE Bsc_Name "xemacs.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\src" +# PROP Intermediate_Dir "obj" +# PROP Cmd_Line "NMAKE /f xemacs.mak" +# PROP Rebuild_Opt "/a" +# PROP Target_File "xemacs.exe" +# PROP Bsc_Name "xemacs.bsc" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "xemacs - Win32 Debug" + +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Cmd_Line "NMAKE /f xemacs.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "xemacs.exe" +# PROP BASE Bsc_Name "xemacs.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\src" +# PROP Intermediate_Dir "obj" +# PROP Cmd_Line "NMAKE /f xemacs.mak" +# PROP Rebuild_Opt "/a" +# PROP Target_File "..\src\xemacs.exe" +# PROP Bsc_Name "..\src\temacs.bsc" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "xemacs - Win32 Release" +# Name "xemacs - Win32 Debug" + +!IF "$(CFG)" == "xemacs - Win32 Release" + +!ELSEIF "$(CFG)" == "xemacs - Win32 Debug" + +!ENDIF + +# Begin Source File + +SOURCE=..\src\abbrev.c +# End Source File +# Begin Source File + +SOURCE=..\src\alloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\alloca.c +# End Source File +# Begin Source File + +SOURCE=..\src\backtrace.h +# End Source File +# Begin Source File + +SOURCE="..\src\balloon-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\balloon_help.c +# End Source File +# Begin Source File + +SOURCE=..\src\balloon_help.h +# End Source File +# Begin Source File + +SOURCE=..\src\bitmaps.h +# End Source File +# Begin Source File + +SOURCE=..\src\blocktype.c +# End Source File +# Begin Source File + +SOURCE=..\src\blocktype.h +# End Source File +# Begin Source File + +SOURCE="..\src\broken-sun.h" +# End Source File +# Begin Source File + +SOURCE=..\src\buffer.c +# End Source File +# Begin Source File + +SOURCE=..\src\buffer.h +# End Source File +# Begin Source File + +SOURCE=..\src\bufslots.h +# End Source File +# Begin Source File + +SOURCE=..\src\bytecode.c +# End Source File +# Begin Source File + +SOURCE=..\src\bytecode.h +# End Source File +# Begin Source File + +SOURCE=..\src\callint.c +# End Source File +# Begin Source File + +SOURCE=..\src\callproc.c +# End Source File +# Begin Source File + +SOURCE=..\src\casefiddle.c +# End Source File +# Begin Source File + +SOURCE=..\src\casetab.c +# End Source File +# Begin Source File + +SOURCE=..\src\chartab.c +# End Source File +# Begin Source File + +SOURCE=..\src\chartab.h +# End Source File +# Begin Source File + +SOURCE=..\src\cm.c +# End Source File +# Begin Source File + +SOURCE=..\src\cm.h +# End Source File +# Begin Source File + +SOURCE=..\src\cmdloop.c +# End Source File +# Begin Source File + +SOURCE=..\src\cmds.c +# End Source File +# Begin Source File + +SOURCE=..\src\commands.h +# End Source File +# Begin Source File + +SOURCE=..\src\config.h +# End Source File +# Begin Source File + +SOURCE=..\src\conslots.h +# End Source File +# Begin Source File + +SOURCE="..\src\console-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\console-stream.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-stream.h" +# End Source File +# Begin Source File + +SOURCE="..\src\console-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-tty.h" +# End Source File +# Begin Source File + +SOURCE="..\src\console-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\console.c +# End Source File +# Begin Source File + +SOURCE=..\src\console.h +# End Source File +# Begin Source File + +SOURCE=..\src\data.c +# End Source File +# Begin Source File + +SOURCE=..\src\database.c +# End Source File +# Begin Source File + +SOURCE=..\src\database.h +# End Source File +# Begin Source File + +SOURCE=..\src\debug.c +# End Source File +# Begin Source File + +SOURCE=..\src\debug.h +# End Source File +# Begin Source File + +SOURCE="..\src\device-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\device-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\device-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\device.c +# End Source File +# Begin Source File + +SOURCE=..\src\device.h +# End Source File +# Begin Source File + +SOURCE=..\src\dgif_lib.c +# End Source File +# Begin Source File + +SOURCE="..\src\dialog-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\dialog-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\dialog.c +# End Source File +# Begin Source File + +SOURCE="..\src\dired-msw.c" +# End Source File +# Begin Source File + +SOURCE=..\src\dired.c +# End Source File +# Begin Source File + +SOURCE=..\src\doc.c +# End Source File +# Begin Source File + +SOURCE=..\src\doprnt.c +# End Source File +# Begin Source File + +SOURCE=..\src\dragdrop.c +# End Source File +# Begin Source File + +SOURCE=..\src\dragdrop.h +# End Source File +# Begin Source File + +SOURCE=..\src\dynarr.c +# End Source File +# Begin Source File + +SOURCE=..\src\ecrt0.c +# End Source File +# Begin Source File + +SOURCE=..\src\editfns.c +# End Source File +# Begin Source File + +SOURCE=..\src\eldap.c +# End Source File +# Begin Source File + +SOURCE=..\src\eldap.h +# End Source File +# Begin Source File + +SOURCE=..\src\elhash.c +# End Source File +# Begin Source File + +SOURCE=..\src\elhash.h +# End Source File +# Begin Source File + +SOURCE=..\src\Emacs.ad.h +# End Source File +# Begin Source File + +SOURCE=..\src\emacs.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsFrame.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsFrame.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsFrameP.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsManager.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsManager.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsManagerP.h +# End Source File +# Begin Source File + +SOURCE="..\src\EmacsShell-sub.c" +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsShell.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsShell.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsShellP.h +# End Source File +# Begin Source File + +SOURCE=..\src\emodules.c +# End Source File +# Begin Source File + +SOURCE=..\src\emodules.h +# End Source File +# Begin Source File + +SOURCE=..\src\esd.c +# End Source File +# Begin Source File + +SOURCE=..\src\eval.c +# End Source File +# Begin Source File + +SOURCE="..\src\event-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-stream.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-unixoid.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-Xt.c" +# End Source File +# Begin Source File + +SOURCE="..\src\events-mod.h" +# End Source File +# Begin Source File + +SOURCE=..\src\events.c +# End Source File +# Begin Source File + +SOURCE=..\src\events.h +# End Source File +# Begin Source File + +SOURCE=..\src\extents.c +# End Source File +# Begin Source File + +SOURCE=..\src\extents.h +# End Source File +# Begin Source File + +SOURCE="..\src\ExternalClient-Xlib.c" +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalClient.c +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalClient.h +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalClientP.h +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalShell.c +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalShell.h +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalShellP.h +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xlib.c" +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xlib.h" +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xt.c" +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xt.h" +# End Source File +# Begin Source File + +SOURCE=..\src\faces.c +# End Source File +# Begin Source File + +SOURCE=..\src\faces.h +# End Source File +# Begin Source File + +SOURCE="..\src\file-coding.c" +# End Source File +# Begin Source File + +SOURCE="..\src\file-coding.h" +# End Source File +# Begin Source File + +SOURCE=..\src\fileio.c +# End Source File +# Begin Source File + +SOURCE=..\src\filelock.c +# End Source File +# Begin Source File + +SOURCE=..\src\filemode.c +# End Source File +# Begin Source File + +SOURCE=..\src\floatfns.c +# End Source File +# Begin Source File + +SOURCE=..\src\fns.c +# End Source File +# Begin Source File + +SOURCE="..\src\font-lock.c" +# End Source File +# Begin Source File + +SOURCE="..\src\frame-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\frame-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\frame-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\frame.c +# End Source File +# Begin Source File + +SOURCE=..\src\frame.h +# End Source File +# Begin Source File + +SOURCE=..\src\frameslots.h +# End Source File +# Begin Source File + +SOURCE="..\src\free-hook.c" +# End Source File +# Begin Source File + +SOURCE=..\src\general.c +# End Source File +# Begin Source File + +SOURCE=..\src\getloadavg.c +# End Source File +# Begin Source File + +SOURCE=..\src\getpagesize.h +# End Source File +# Begin Source File + +SOURCE=..\src\gif_io.c +# End Source File +# Begin Source File + +SOURCE=..\src\gifrlib.h +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-eimage.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-widget.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\glyphs.c +# End Source File +# Begin Source File + +SOURCE=..\src\glyphs.h +# End Source File +# Begin Source File + +SOURCE=..\src\gmalloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\gpmevent.c +# End Source File +# Begin Source File + +SOURCE=..\src\gpmevent.h +# End Source File +# Begin Source File + +SOURCE="..\src\gui-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\gui-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\gui-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\gui.c +# End Source File +# Begin Source File + +SOURCE=..\src\gui.h +# End Source File +# Begin Source File + +SOURCE=..\src\gutter.c +# End Source File +# Begin Source File + +SOURCE=..\src\gutter.h +# End Source File +# Begin Source File + +SOURCE=..\src\hash.c +# End Source File +# Begin Source File + +SOURCE=..\src\hash.h +# End Source File +# Begin Source File + +SOURCE=..\src\hftctl.c +# End Source File +# Begin Source File + +SOURCE=..\src\hpplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\imgproc.c +# End Source File +# Begin Source File + +SOURCE=..\src\imgproc.h +# End Source File +# Begin Source File + +SOURCE=..\src\indent.c +# End Source File +# Begin Source File + +SOURCE=..\src\inline.c +# End Source File +# Begin Source File + +SOURCE="..\src\input-method-motif.c" +# End Source File +# Begin Source File + +SOURCE="..\src\input-method-xfs.c" +# End Source File +# Begin Source File + +SOURCE="..\src\input-method-xlib.c" +# End Source File +# Begin Source File + +SOURCE=..\src\insdel.c +# End Source File +# Begin Source File + +SOURCE=..\src\insdel.h +# End Source File +# Begin Source File + +SOURCE=..\src\intl.c +# End Source File +# Begin Source File + +SOURCE="..\src\iso-wide.h" +# End Source File +# Begin Source File + +SOURCE=..\src\keymap.c +# End Source File +# Begin Source File + +SOURCE=..\src\keymap.h +# End Source File +# Begin Source File + +SOURCE=..\src\lastfile.c +# End Source File +# Begin Source File + +SOURCE=..\src\libsst.c +# End Source File +# Begin Source File + +SOURCE=..\src\libsst.h +# End Source File +# Begin Source File + +SOURCE=..\src\libst.h +# End Source File +# Begin Source File + +SOURCE="..\src\line-number.c" +# End Source File +# Begin Source File + +SOURCE="..\src\line-number.h" +# End Source File +# Begin Source File + +SOURCE=..\src\linuxplay.c +# End Source File +# Begin Source File + +SOURCE="..\src\lisp-disunion.h" +# End Source File +# Begin Source File + +SOURCE="..\src\lisp-union.h" +# End Source File +# Begin Source File + +SOURCE=..\src\lisp.h +# End Source File +# Begin Source File + +SOURCE=..\src\lread.c +# End Source File +# Begin Source File + +SOURCE=..\src\lrecord.h +# End Source File +# Begin Source File + +SOURCE=..\src\lstream.c +# End Source File +# Begin Source File + +SOURCE=..\src\lstream.h +# End Source File +# Begin Source File + +SOURCE=..\src\macros.c +# End Source File +# Begin Source File + +SOURCE=..\src\macros.h +# End Source File +# Begin Source File + +SOURCE=..\src\malloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\marker.c +# End Source File +# Begin Source File + +SOURCE=..\src\md5.c +# End Source File +# Begin Source File + +SOURCE="..\src\mem-limits.h" +# End Source File +# Begin Source File + +SOURCE="..\src\menubar-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\menubar-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\menubar-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\menubar.c +# End Source File +# Begin Source File + +SOURCE=..\src\menubar.h +# End Source File +# Begin Source File + +SOURCE=..\src\minibuf.c +# End Source File +# Begin Source File + +SOURCE=..\src\miscplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\miscplay.h +# End Source File +# Begin Source File + +SOURCE="..\src\mule-canna.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-ccl.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-ccl.h" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-charset.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-charset.h" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-mcpath.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-mcpath.h" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-wnnfns.c" +# End Source File +# Begin Source File + +SOURCE=..\src\mule.c +# End Source File +# Begin Source File + +SOURCE=..\src\nas.c +# End Source File +# Begin Source File + +SOURCE=..\src\ndir.h +# End Source File +# Begin Source File + +SOURCE=..\src\nt.c +# End Source File +# Begin Source File + +SOURCE=..\src\nt.h +# End Source File +# Begin Source File + +SOURCE=..\src\ntheap.c +# End Source File +# Begin Source File + +SOURCE=..\src\ntheap.h +# End Source File +# Begin Source File + +SOURCE=..\src\ntplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\ntproc.c +# End Source File +# Begin Source File + +SOURCE="..\src\objects-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-tty.h" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\objects.c +# End Source File +# Begin Source File + +SOURCE=..\src\objects.h +# End Source File +# Begin Source File + +SOURCE="..\src\offix-cursors.h" +# End Source File +# Begin Source File + +SOURCE="..\src\offix-types.h" +# End Source File +# Begin Source File + +SOURCE=..\src\offix.c +# End Source File +# Begin Source File + +SOURCE=..\src\offix.h +# End Source File +# Begin Source File + +SOURCE=..\src\opaque.c +# End Source File +# Begin Source File + +SOURCE=..\src\opaque.h +# End Source File +# Begin Source File + +SOURCE=..\src\paths.h +# End Source File +# Begin Source File + +SOURCE="..\src\pre-crt0.c" +# End Source File +# Begin Source File + +SOURCE=..\src\print.c +# End Source File +# Begin Source File + +SOURCE="..\src\process-nt.c" +# End Source File +# Begin Source File + +SOURCE="..\src\process-unix.c" +# End Source File +# Begin Source File + +SOURCE=..\src\process.c +# End Source File +# Begin Source File + +SOURCE=..\src\process.h +# End Source File +# Begin Source File + +SOURCE=..\src\procimpl.h +# End Source File +# Begin Source File + +SOURCE=..\src\profile.c +# End Source File +# Begin Source File + +SOURCE=..\src\ralloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\rangetab.c +# End Source File +# Begin Source File + +SOURCE=..\src\rangetab.h +# End Source File +# Begin Source File + +SOURCE=..\src\realpath.c +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-output.c" +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\redisplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\redisplay.h +# End Source File +# Begin Source File + +SOURCE=..\src\regex.c +# End Source File +# Begin Source File + +SOURCE=..\src\regex.h +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\scrollbar.c +# End Source File +# Begin Source File + +SOURCE=..\src\scrollbar.h +# End Source File +# Begin Source File + +SOURCE=..\src\search.c +# End Source File +# Begin Source File + +SOURCE="..\src\select-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\select-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\select.c +# End Source File +# Begin Source File + +SOURCE=..\src\select.h +# End Source File +# Begin Source File + +SOURCE=..\src\sgiplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\sheap.c +# End Source File +# Begin Source File + +SOURCE=..\src\signal.c +# End Source File +# Begin Source File + +SOURCE=..\src\sound.c +# End Source File +# Begin Source File + +SOURCE=..\src\specifier.c +# End Source File +# Begin Source File + +SOURCE=..\src\specifier.h +# End Source File +# Begin Source File + +SOURCE=..\src\strcat.c +# End Source File +# Begin Source File + +SOURCE=..\src\strcmp.c +# End Source File +# Begin Source File + +SOURCE=..\src\strcpy.c +# End Source File +# Begin Source File + +SOURCE=..\src\strftime.c +# End Source File +# Begin Source File + +SOURCE="..\src\sunOS-fix.c" +# End Source File +# Begin Source File + +SOURCE=..\src\sunplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\sunpro.c +# End Source File +# Begin Source File + +SOURCE=..\src\symbols.c +# End Source File +# Begin Source File + +SOURCE=..\src\symeval.h +# End Source File +# Begin Source File + +SOURCE=..\src\symsinit.h +# End Source File +# Begin Source File + +SOURCE=..\src\syntax.c +# End Source File +# Begin Source File + +SOURCE=..\src\syntax.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysdep.c +# End Source File +# Begin Source File + +SOURCE=..\src\sysdep.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysdir.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysdll.c +# End Source File +# Begin Source File + +SOURCE=..\src\sysdll.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysfile.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysfloat.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysproc.h +# End Source File +# Begin Source File + +SOURCE=..\src\syspwd.h +# End Source File +# Begin Source File + +SOURCE=..\src\syssignal.h +# End Source File +# Begin Source File + +SOURCE=..\src\systime.h +# End Source File +# Begin Source File + +SOURCE=..\src\systty.h +# End Source File +# Begin Source File + +SOURCE=..\src\syswait.h +# End Source File +# Begin Source File + +SOURCE=..\src\termcap.c +# End Source File +# Begin Source File + +SOURCE=..\src\terminfo.c +# End Source File +# Begin Source File + +SOURCE="..\src\toolbar-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\toolbar-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\toolbar.c +# End Source File +# Begin Source File + +SOURCE=..\src\toolbar.h +# End Source File +# Begin Source File + +SOURCE=..\src\tooltalk.c +# End Source File +# Begin Source File + +SOURCE=..\src\tooltalk.h +# End Source File +# Begin Source File + +SOURCE=..\src\tparam.c +# End Source File +# Begin Source File + +SOURCE=..\src\undo.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexaix.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexalpha.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexapollo.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexconvex.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexcw.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexec.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexelf.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexelfsgi.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexencap.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexenix.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexfreebsd.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexfx2800.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexhp9k3.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexhp9k800.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexmips.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexnext.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexnt.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexsni.c +# End Source File +# Begin Source File + +SOURCE="..\src\unexsol2-6.c" +# End Source File +# Begin Source File + +SOURCE=..\src\unexsol2.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexsunos4.c +# End Source File +# Begin Source File + +SOURCE=..\src\universe.h +# End Source File +# Begin Source File + +SOURCE="..\src\vm-limit.c" +# End Source File +# Begin Source File + +SOURCE=..\src\widget.c +# End Source File +# Begin Source File + +SOURCE=..\src\window.c +# End Source File +# Begin Source File + +SOURCE=..\src\window.h +# End Source File +# Begin Source File + +SOURCE=..\src\winslots.h +# End Source File +# Begin Source File + +SOURCE=.\xemacs.mak +# End Source File +# Begin Source File + +SOURCE=..\src\xgccache.c +# End Source File +# Begin Source File + +SOURCE=..\src\xgccache.h +# End Source File +# Begin Source File + +SOURCE=..\src\xintrinsic.h +# End Source File +# Begin Source File + +SOURCE=..\src\xintrinsicp.h +# End Source File +# Begin Source File + +SOURCE=..\src\xmmanagerp.h +# End Source File +# Begin Source File + +SOURCE=..\src\xmprimitivep.h +# End Source File +# Begin Source File + +SOURCE=..\src\xmu.c +# End Source File +# Begin Source File + +SOURCE=..\src\xmu.h +# End Source File +# End Target +# End Project diff -r 72a7cfa4a488 -r abe6d1db359e nt/xemacs-vc50.dsw --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/xemacs-vc50.dsw Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "xemacs"=".\xemacs-vc50.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff -r 72a7cfa4a488 -r abe6d1db359e nt/xemacs.dsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/xemacs.dsp Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,1393 @@ +# Microsoft Developer Studio Project File - Name="xemacs" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=xemacs - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "xemacs.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "xemacs.mak" CFG="xemacs - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "xemacs - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "xemacs - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "xemacs - Win32 Release" + +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Cmd_Line "NMAKE /f xemacs.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "xemacs.exe" +# PROP BASE Bsc_Name "xemacs.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\src" +# PROP Intermediate_Dir "obj" +# PROP Cmd_Line "NMAKE /f xemacs.mak" +# PROP Rebuild_Opt "/a" +# PROP Target_File "xemacs.exe" +# PROP Bsc_Name "xemacs.bsc" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "xemacs - Win32 Debug" + +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Cmd_Line "NMAKE /f xemacs.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "xemacs.exe" +# PROP BASE Bsc_Name "xemacs.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\src" +# PROP Intermediate_Dir "obj" +# PROP Cmd_Line "NMAKE /f xemacs.mak" +# PROP Rebuild_Opt "/a" +# PROP Target_File "..\src\xemacs.exe" +# PROP Bsc_Name "..\src\temacs.bsc" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "xemacs - Win32 Release" +# Name "xemacs - Win32 Debug" + +!IF "$(CFG)" == "xemacs - Win32 Release" + +!ELSEIF "$(CFG)" == "xemacs - Win32 Debug" + +!ENDIF + +# Begin Source File + +SOURCE=..\src\abbrev.c +# End Source File +# Begin Source File + +SOURCE=..\src\alloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\alloca.c +# End Source File +# Begin Source File + +SOURCE=..\src\backtrace.h +# End Source File +# Begin Source File + +SOURCE="..\src\balloon-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\balloon_help.c +# End Source File +# Begin Source File + +SOURCE=..\src\balloon_help.h +# End Source File +# Begin Source File + +SOURCE=..\src\bitmaps.h +# End Source File +# Begin Source File + +SOURCE=..\src\blocktype.c +# End Source File +# Begin Source File + +SOURCE=..\src\blocktype.h +# End Source File +# Begin Source File + +SOURCE="..\src\broken-sun.h" +# End Source File +# Begin Source File + +SOURCE=..\src\buffer.c +# End Source File +# Begin Source File + +SOURCE=..\src\buffer.h +# End Source File +# Begin Source File + +SOURCE=..\src\bufslots.h +# End Source File +# Begin Source File + +SOURCE=..\src\bytecode.c +# End Source File +# Begin Source File + +SOURCE=..\src\bytecode.h +# End Source File +# Begin Source File + +SOURCE=..\src\callint.c +# End Source File +# Begin Source File + +SOURCE=..\src\callproc.c +# End Source File +# Begin Source File + +SOURCE=..\src\casefiddle.c +# End Source File +# Begin Source File + +SOURCE=..\src\casetab.c +# End Source File +# Begin Source File + +SOURCE=..\src\chartab.c +# End Source File +# Begin Source File + +SOURCE=..\src\chartab.h +# End Source File +# Begin Source File + +SOURCE=..\src\cm.c +# End Source File +# Begin Source File + +SOURCE=..\src\cm.h +# End Source File +# Begin Source File + +SOURCE=..\src\cmdloop.c +# End Source File +# Begin Source File + +SOURCE=..\src\cmds.c +# End Source File +# Begin Source File + +SOURCE=..\src\commands.h +# End Source File +# Begin Source File + +SOURCE=..\src\config.h +# End Source File +# Begin Source File + +SOURCE=..\src\conslots.h +# End Source File +# Begin Source File + +SOURCE="..\src\console-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\console-stream.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-stream.h" +# End Source File +# Begin Source File + +SOURCE="..\src\console-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-tty.h" +# End Source File +# Begin Source File + +SOURCE="..\src\console-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\console.c +# End Source File +# Begin Source File + +SOURCE=..\src\console.h +# End Source File +# Begin Source File + +SOURCE=..\src\data.c +# End Source File +# Begin Source File + +SOURCE=..\src\database.c +# End Source File +# Begin Source File + +SOURCE=..\src\database.h +# End Source File +# Begin Source File + +SOURCE=..\src\debug.c +# End Source File +# Begin Source File + +SOURCE=..\src\debug.h +# End Source File +# Begin Source File + +SOURCE="..\src\device-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\device-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\device-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\device.c +# End Source File +# Begin Source File + +SOURCE=..\src\device.h +# End Source File +# Begin Source File + +SOURCE=..\src\dgif_lib.c +# End Source File +# Begin Source File + +SOURCE="..\src\dialog-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\dialog-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\dialog.c +# End Source File +# Begin Source File + +SOURCE="..\src\dired-msw.c" +# End Source File +# Begin Source File + +SOURCE=..\src\dired.c +# End Source File +# Begin Source File + +SOURCE=..\src\doc.c +# End Source File +# Begin Source File + +SOURCE=..\src\doprnt.c +# End Source File +# Begin Source File + +SOURCE=..\src\dragdrop.c +# End Source File +# Begin Source File + +SOURCE=..\src\dragdrop.h +# End Source File +# Begin Source File + +SOURCE=..\src\dynarr.c +# End Source File +# Begin Source File + +SOURCE=..\src\ecrt0.c +# End Source File +# Begin Source File + +SOURCE=..\src\editfns.c +# End Source File +# Begin Source File + +SOURCE=..\src\eldap.c +# End Source File +# Begin Source File + +SOURCE=..\src\eldap.h +# End Source File +# Begin Source File + +SOURCE=..\src\elhash.c +# End Source File +# Begin Source File + +SOURCE=..\src\elhash.h +# End Source File +# Begin Source File + +SOURCE=..\src\Emacs.ad.h +# End Source File +# Begin Source File + +SOURCE=..\src\emacs.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsFrame.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsFrame.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsFrameP.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsManager.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsManager.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsManagerP.h +# End Source File +# Begin Source File + +SOURCE="..\src\EmacsShell-sub.c" +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsShell.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsShell.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsShellP.h +# End Source File +# Begin Source File + +SOURCE=..\src\emodules.c +# End Source File +# Begin Source File + +SOURCE=..\src\emodules.h +# End Source File +# Begin Source File + +SOURCE=..\src\esd.c +# End Source File +# Begin Source File + +SOURCE=..\src\eval.c +# End Source File +# Begin Source File + +SOURCE="..\src\event-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-stream.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-unixoid.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-Xt.c" +# End Source File +# Begin Source File + +SOURCE="..\src\events-mod.h" +# End Source File +# Begin Source File + +SOURCE=..\src\events.c +# End Source File +# Begin Source File + +SOURCE=..\src\events.h +# End Source File +# Begin Source File + +SOURCE=..\src\extents.c +# End Source File +# Begin Source File + +SOURCE=..\src\extents.h +# End Source File +# Begin Source File + +SOURCE="..\src\ExternalClient-Xlib.c" +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalClient.c +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalClient.h +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalClientP.h +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalShell.c +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalShell.h +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalShellP.h +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xlib.c" +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xlib.h" +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xt.c" +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xt.h" +# End Source File +# Begin Source File + +SOURCE=..\src\faces.c +# End Source File +# Begin Source File + +SOURCE=..\src\faces.h +# End Source File +# Begin Source File + +SOURCE="..\src\file-coding.c" +# End Source File +# Begin Source File + +SOURCE="..\src\file-coding.h" +# End Source File +# Begin Source File + +SOURCE=..\src\fileio.c +# End Source File +# Begin Source File + +SOURCE=..\src\filelock.c +# End Source File +# Begin Source File + +SOURCE=..\src\filemode.c +# End Source File +# Begin Source File + +SOURCE=..\src\floatfns.c +# End Source File +# Begin Source File + +SOURCE=..\src\fns.c +# End Source File +# Begin Source File + +SOURCE="..\src\font-lock.c" +# End Source File +# Begin Source File + +SOURCE="..\src\frame-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\frame-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\frame-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\frame.c +# End Source File +# Begin Source File + +SOURCE=..\src\frame.h +# End Source File +# Begin Source File + +SOURCE=..\src\frameslots.h +# End Source File +# Begin Source File + +SOURCE="..\src\free-hook.c" +# End Source File +# Begin Source File + +SOURCE=..\src\general.c +# End Source File +# Begin Source File + +SOURCE=..\src\getloadavg.c +# End Source File +# Begin Source File + +SOURCE=..\src\getpagesize.h +# End Source File +# Begin Source File + +SOURCE=..\src\gif_io.c +# End Source File +# Begin Source File + +SOURCE=..\src\gifrlib.h +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-eimage.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-widget.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\glyphs.c +# End Source File +# Begin Source File + +SOURCE=..\src\glyphs.h +# End Source File +# Begin Source File + +SOURCE=..\src\gmalloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\gpmevent.c +# End Source File +# Begin Source File + +SOURCE=..\src\gpmevent.h +# End Source File +# Begin Source File + +SOURCE="..\src\gui-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\gui-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\gui-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\gui.c +# End Source File +# Begin Source File + +SOURCE=..\src\gui.h +# End Source File +# Begin Source File + +SOURCE=..\src\gutter.c +# End Source File +# Begin Source File + +SOURCE=..\src\gutter.h +# End Source File +# Begin Source File + +SOURCE=..\src\hash.c +# End Source File +# Begin Source File + +SOURCE=..\src\hash.h +# End Source File +# Begin Source File + +SOURCE=..\src\hftctl.c +# End Source File +# Begin Source File + +SOURCE=..\src\hpplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\imgproc.c +# End Source File +# Begin Source File + +SOURCE=..\src\imgproc.h +# End Source File +# Begin Source File + +SOURCE=..\src\indent.c +# End Source File +# Begin Source File + +SOURCE=..\src\inline.c +# End Source File +# Begin Source File + +SOURCE="..\src\input-method-motif.c" +# End Source File +# Begin Source File + +SOURCE="..\src\input-method-xfs.c" +# End Source File +# Begin Source File + +SOURCE="..\src\input-method-xlib.c" +# End Source File +# Begin Source File + +SOURCE=..\src\insdel.c +# End Source File +# Begin Source File + +SOURCE=..\src\insdel.h +# End Source File +# Begin Source File + +SOURCE=..\src\intl.c +# End Source File +# Begin Source File + +SOURCE="..\src\iso-wide.h" +# End Source File +# Begin Source File + +SOURCE=..\src\keymap.c +# End Source File +# Begin Source File + +SOURCE=..\src\keymap.h +# End Source File +# Begin Source File + +SOURCE=..\src\lastfile.c +# End Source File +# Begin Source File + +SOURCE=..\src\libsst.c +# End Source File +# Begin Source File + +SOURCE=..\src\libsst.h +# End Source File +# Begin Source File + +SOURCE=..\src\libst.h +# End Source File +# Begin Source File + +SOURCE="..\src\line-number.c" +# End Source File +# Begin Source File + +SOURCE="..\src\line-number.h" +# End Source File +# Begin Source File + +SOURCE=..\src\linuxplay.c +# End Source File +# Begin Source File + +SOURCE="..\src\lisp-disunion.h" +# End Source File +# Begin Source File + +SOURCE="..\src\lisp-union.h" +# End Source File +# Begin Source File + +SOURCE=..\src\lisp.h +# End Source File +# Begin Source File + +SOURCE=..\src\lread.c +# End Source File +# Begin Source File + +SOURCE=..\src\lrecord.h +# End Source File +# Begin Source File + +SOURCE=..\src\lstream.c +# End Source File +# Begin Source File + +SOURCE=..\src\lstream.h +# End Source File +# Begin Source File + +SOURCE=..\src\macros.c +# End Source File +# Begin Source File + +SOURCE=..\src\macros.h +# End Source File +# Begin Source File + +SOURCE=..\src\malloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\marker.c +# End Source File +# Begin Source File + +SOURCE=..\src\md5.c +# End Source File +# Begin Source File + +SOURCE="..\src\mem-limits.h" +# End Source File +# Begin Source File + +SOURCE="..\src\menubar-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\menubar-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\menubar-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\menubar.c +# End Source File +# Begin Source File + +SOURCE=..\src\menubar.h +# End Source File +# Begin Source File + +SOURCE=..\src\minibuf.c +# End Source File +# Begin Source File + +SOURCE=..\src\miscplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\miscplay.h +# End Source File +# Begin Source File + +SOURCE="..\src\mule-canna.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-ccl.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-ccl.h" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-charset.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-charset.h" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-mcpath.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-mcpath.h" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-wnnfns.c" +# End Source File +# Begin Source File + +SOURCE=..\src\mule.c +# End Source File +# Begin Source File + +SOURCE=..\src\nas.c +# End Source File +# Begin Source File + +SOURCE=..\src\ndir.h +# End Source File +# Begin Source File + +SOURCE=..\src\nt.c +# End Source File +# Begin Source File + +SOURCE=..\src\nt.h +# End Source File +# Begin Source File + +SOURCE=..\src\ntheap.c +# End Source File +# Begin Source File + +SOURCE=..\src\ntheap.h +# End Source File +# Begin Source File + +SOURCE=..\src\ntplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\ntproc.c +# End Source File +# Begin Source File + +SOURCE="..\src\objects-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-tty.h" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\objects.c +# End Source File +# Begin Source File + +SOURCE=..\src\objects.h +# End Source File +# Begin Source File + +SOURCE="..\src\offix-cursors.h" +# End Source File +# Begin Source File + +SOURCE="..\src\offix-types.h" +# End Source File +# Begin Source File + +SOURCE=..\src\offix.c +# End Source File +# Begin Source File + +SOURCE=..\src\offix.h +# End Source File +# Begin Source File + +SOURCE=..\src\opaque.c +# End Source File +# Begin Source File + +SOURCE=..\src\opaque.h +# End Source File +# Begin Source File + +SOURCE=..\src\paths.h +# End Source File +# Begin Source File + +SOURCE="..\src\pre-crt0.c" +# End Source File +# Begin Source File + +SOURCE=..\src\print.c +# End Source File +# Begin Source File + +SOURCE="..\src\process-nt.c" +# End Source File +# Begin Source File + +SOURCE="..\src\process-unix.c" +# End Source File +# Begin Source File + +SOURCE=..\src\process.c +# End Source File +# Begin Source File + +SOURCE=..\src\process.h +# End Source File +# Begin Source File + +SOURCE=..\src\procimpl.h +# End Source File +# Begin Source File + +SOURCE=..\src\profile.c +# End Source File +# Begin Source File + +SOURCE=..\src\ralloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\rangetab.c +# End Source File +# Begin Source File + +SOURCE=..\src\rangetab.h +# End Source File +# Begin Source File + +SOURCE=..\src\realpath.c +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-output.c" +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\redisplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\redisplay.h +# End Source File +# Begin Source File + +SOURCE=..\src\regex.c +# End Source File +# Begin Source File + +SOURCE=..\src\regex.h +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\scrollbar.c +# End Source File +# Begin Source File + +SOURCE=..\src\scrollbar.h +# End Source File +# Begin Source File + +SOURCE=..\src\search.c +# End Source File +# Begin Source File + +SOURCE="..\src\select-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\select-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\select.c +# End Source File +# Begin Source File + +SOURCE=..\src\select.h +# End Source File +# Begin Source File + +SOURCE=..\src\sgiplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\sheap.c +# End Source File +# Begin Source File + +SOURCE=..\src\signal.c +# End Source File +# Begin Source File + +SOURCE=..\src\sound.c +# End Source File +# Begin Source File + +SOURCE=..\src\specifier.c +# End Source File +# Begin Source File + +SOURCE=..\src\specifier.h +# End Source File +# Begin Source File + +SOURCE=..\src\strcat.c +# End Source File +# Begin Source File + +SOURCE=..\src\strcmp.c +# End Source File +# Begin Source File + +SOURCE=..\src\strcpy.c +# End Source File +# Begin Source File + +SOURCE=..\src\strftime.c +# End Source File +# Begin Source File + +SOURCE="..\src\sunOS-fix.c" +# End Source File +# Begin Source File + +SOURCE=..\src\sunplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\sunpro.c +# End Source File +# Begin Source File + +SOURCE=..\src\symbols.c +# End Source File +# Begin Source File + +SOURCE=..\src\symeval.h +# End Source File +# Begin Source File + +SOURCE=..\src\symsinit.h +# End Source File +# Begin Source File + +SOURCE=..\src\syntax.c +# End Source File +# Begin Source File + +SOURCE=..\src\syntax.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysdep.c +# End Source File +# Begin Source File + +SOURCE=..\src\sysdep.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysdir.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysdll.c +# End Source File +# Begin Source File + +SOURCE=..\src\sysdll.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysfile.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysfloat.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysproc.h +# End Source File +# Begin Source File + +SOURCE=..\src\syspwd.h +# End Source File +# Begin Source File + +SOURCE=..\src\syssignal.h +# End Source File +# Begin Source File + +SOURCE=..\src\systime.h +# End Source File +# Begin Source File + +SOURCE=..\src\systty.h +# End Source File +# Begin Source File + +SOURCE=..\src\syswait.h +# End Source File +# Begin Source File + +SOURCE=..\src\termcap.c +# End Source File +# Begin Source File + +SOURCE=..\src\terminfo.c +# End Source File +# Begin Source File + +SOURCE="..\src\toolbar-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\toolbar-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\toolbar.c +# End Source File +# Begin Source File + +SOURCE=..\src\toolbar.h +# End Source File +# Begin Source File + +SOURCE=..\src\tooltalk.c +# End Source File +# Begin Source File + +SOURCE=..\src\tooltalk.h +# End Source File +# Begin Source File + +SOURCE=..\src\tparam.c +# End Source File +# Begin Source File + +SOURCE=..\src\undo.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexaix.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexalpha.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexapollo.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexconvex.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexcw.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexec.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexelf.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexelfsgi.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexencap.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexenix.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexfreebsd.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexfx2800.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexhp9k3.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexhp9k800.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexmips.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexnext.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexnt.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexsni.c +# End Source File +# Begin Source File + +SOURCE="..\src\unexsol2-6.c" +# End Source File +# Begin Source File + +SOURCE=..\src\unexsol2.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexsunos4.c +# End Source File +# Begin Source File + +SOURCE=..\src\universe.h +# End Source File +# Begin Source File + +SOURCE="..\src\vm-limit.c" +# End Source File +# Begin Source File + +SOURCE=..\src\widget.c +# End Source File +# Begin Source File + +SOURCE=..\src\window.c +# End Source File +# Begin Source File + +SOURCE=..\src\window.h +# End Source File +# Begin Source File + +SOURCE=..\src\winslots.h +# End Source File +# Begin Source File + +SOURCE=.\xemacs.mak +# End Source File +# Begin Source File + +SOURCE=..\src\xgccache.c +# End Source File +# Begin Source File + +SOURCE=..\src\xgccache.h +# End Source File +# Begin Source File + +SOURCE=..\src\xintrinsic.h +# End Source File +# Begin Source File + +SOURCE=..\src\xintrinsicp.h +# End Source File +# Begin Source File + +SOURCE=..\src\xmmanagerp.h +# End Source File +# Begin Source File + +SOURCE=..\src\xmprimitivep.h +# End Source File +# Begin Source File + +SOURCE=..\src\xmu.c +# End Source File +# Begin Source File + +SOURCE=..\src\xmu.h +# End Source File +# End Target +# End Project diff -r 72a7cfa4a488 -r abe6d1db359e nt/xemacs.dsw --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/xemacs.dsw Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "xemacs"=.\xemacs.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff -r 72a7cfa4a488 -r abe6d1db359e nt/xemacs.mak --- a/nt/xemacs.mak Mon Aug 13 11:33:40 2007 +0200 +++ b/nt/xemacs.mak Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,6 @@ # Makefile for Microsoft NMAKE # Copyright (C) 1995 Board of Trustees, University of Illinois. -# Copyright (C) 1995, 1996 Ben Wing. +# Copyright (C) 1995, 1996, 2000 Ben Wing. # Copyright (C) 1995 Sun Microsystems, Inc. # Copyright (C) 1998 Free Software Foundation, Inc. # @@ -24,18 +24,28 @@ # Synched up with: Not in FSF. # +default: all + XEMACS=.. LISP=$(XEMACS)\lisp +LIB_SRC=$(XEMACS)\lib-src MODULES=$(XEMACS)\modules NT=$(XEMACS)\nt OUTDIR=$(NT)\obj +SRC=$(XEMACS)\src +LWLIB_SRCDIR=$(XEMACS)\lwlib +MAKEDIRSTRING=$(MAKEDIR:\=\\) +XEMACSDIRSTRING=$(MAKEDIRSTRING:\\nt=) + # Define a variable for the 'del' command to use DEL=-del # Program name and version -!include "..\version.sh" +!include "$(XEMACS)\version.sh" + +!include "config.inc" !if !defined(INFODOCK) INFODOCK=0 @@ -46,6 +56,8 @@ PROGRAM_DEFINES=-DINFODOCK \ -DPATH_VERSION=\"$(INFODOCK_VERSION_STRING)\" \ -DPATH_PROGNAME=\"infodock\" \ + -DEMACS_PROGNAME=\"infodock\" \ + -DEMACS_VERSION=\"$(INFODOCK_VERSION_STRING)\" \ -DINFODOCK_MAJOR_VERSION=$(infodock_major_version) \ -DINFODOCK_MINOR_VERSION=$(infodock_minor_version) \ -DINFODOCK_BUILD_VERSION=$(infodock_build_version) @@ -57,7 +69,9 @@ !endif PROGRAM_DEFINES= \ -DPATH_VERSION=\"$(XEMACS_VERSION_STRING)\" \ - -DPATH_PROGNAME=\"xemacs\" + -DPATH_PROGNAME=\"xemacs\" \ + -DEMACS_VERSION=\"$(XEMACS_VERSION_STRING)\" \ + -DEMACS_PROGNAME=\"xemacs\" !endif # @@ -84,11 +98,11 @@ ! endif !endif PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)" -!if !defined(HAVE_MSW) -HAVE_MSW=1 +!if !defined(HAVE_MS_WINDOWS) +HAVE_MS_WINDOWS=1 !endif -!if !defined(HAVE_X) -HAVE_X=0 +!if !defined(HAVE_X_WINDOWS) +HAVE_X_WINDOWS=0 !endif !if !defined(HAVE_XPM) HAVE_XPM=0 @@ -126,6 +140,9 @@ !if !defined(DEBUG_XEMACS) DEBUG_XEMACS=0 !endif +!if !defined(QUICK_BUILD) +QUICK_BUILD=0 +!endif !if !defined(USE_UNION_TYPE) USE_UNION_TYPE=0 !endif @@ -194,67 +211,67 @@ !message [[[Developer note: If you want to fix it, read Q112297 first]]] #### CONFIG_ERROR=1 !endif -!if !$(HAVE_MSW) && !$(HAVE_X) -!message Please specify at least one HAVE_MSW=1 and/or HAVE_X=1 +!if !$(HAVE_MS_WINDOWS) && !$(HAVE_X_WINDOWS) +!message Please specify at least one HAVE_MS_WINDOWS=1 and/or HAVE_X_WINDOWS=1 CONFIG_ERROR=1 !endif -!if $(HAVE_X) && !defined(X11_DIR) +!if $(HAVE_X_WINDOWS) && !defined(X11_DIR) !message Please specify root directory for your X11 installation: X11_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_X) && defined(X11_DIR) && !exist("$(X11_DIR)\LIB\X11.LIB") +!if $(HAVE_X_WINDOWS) && defined(X11_DIR) && !exist("$(X11_DIR)\LIB\X11.LIB") !message Specified X11 directory does not contain "$(X11_DIR)\LIB\X11.LIB" CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_XPM) && !defined(XPM_DIR) +!if $(HAVE_MS_WINDOWS) && $(HAVE_XPM) && !defined(XPM_DIR) !message Please specify root directory for your XPM installation: XPM_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_XPM) && defined(XPM_DIR) && !exist("$(XPM_DIR)\lib\Xpm.lib") +!if $(HAVE_MS_WINDOWS) && $(HAVE_XPM) && defined(XPM_DIR) && !exist("$(XPM_DIR)\lib\Xpm.lib") !message Specified XPM directory does not contain "$(XPM_DIR)\lib\Xpm.lib" CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_PNG) && !defined(PNG_DIR) +!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && !defined(PNG_DIR) !message Please specify root directory for your PNG installation: PNG_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_PNG) && defined(PNG_DIR) && !exist("$(PNG_DIR)\libpng.lib") +!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && defined(PNG_DIR) && !exist("$(PNG_DIR)\libpng.lib") !message Specified PNG directory does not contain "$(PNG_DIR)\libpng.lib" CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_PNG) && !defined(ZLIB_DIR) +!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && !defined(ZLIB_DIR) !message Please specify root directory for your ZLIB installation: ZLIB_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_PNG) && defined(ZLIB_DIR) && !exist("$(ZLIB_DIR)\zlib.lib") +!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && defined(ZLIB_DIR) && !exist("$(ZLIB_DIR)\zlib.lib") !message Specified ZLIB directory does not contain "$(ZLIB_DIR)\zlib.lib" CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_TIFF) && !defined(TIFF_DIR) +!if $(HAVE_MS_WINDOWS) && $(HAVE_TIFF) && !defined(TIFF_DIR) !message Please specify root directory for your TIFF installation: TIFF_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_TIFF) && !exist("$(TIFF_DIR)\libtiff\libtiff.lib") +!if $(HAVE_MS_WINDOWS) && $(HAVE_TIFF) && !exist("$(TIFF_DIR)\libtiff\libtiff.lib") !message Specified TIFF directory does not contain "$(TIFF_DIR)\libtiff\libtiff.lib" CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_JPEG) && !defined(JPEG_DIR) +!if $(HAVE_MS_WINDOWS) && $(HAVE_JPEG) && !defined(JPEG_DIR) !message Please specify root directory for your JPEG installation: JPEG_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_JPEG) && !exist("$(JPEG_DIR)\libjpeg.lib") +!if $(HAVE_MS_WINDOWS) && $(HAVE_JPEG) && !exist("$(JPEG_DIR)\libjpeg.lib") !message Specified JPEG directory does not contain "$(JPEG_DIR)\libjpeg.lib" CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_XFACE) && !defined(COMPFACE_DIR) +!if $(HAVE_MS_WINDOWS) && $(HAVE_XFACE) && !defined(COMPFACE_DIR) !message Please specify root directory for your COMPFACE installation: COMPFACE_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_XFACE) && !exist("$(COMPFACE_DIR)\libcompface.lib") +!if $(HAVE_MS_WINDOWS) && $(HAVE_XFACE) && !exist("$(COMPFACE_DIR)\libcompface.lib") !message Specified COMPFACE directory does not contain "$(COMPFACE_DIR)\libcompface.lib" CONFIG_ERROR=1 !endif -!if $(HAVE_MSW) && $(HAVE_TOOLBARS) && !$(HAVE_XPM) +!if $(HAVE_MS_WINDOWS) && $(HAVE_TOOLBARS) && !$(HAVE_XPM) !message Toolbars require XPM support CONFIG_ERROR=1 !endif @@ -271,6 +288,30 @@ !endif # +# Whether to use dependency information generated by make-src-depend +# +!if !defined(DEPEND) +DEPEND=0 +!endif +!if $(DEPEND) +! if [if not exist $(OUTDIR)\nul mkdir "$(OUTDIR)"] +! endif +# generate an nmake-readable version of depend +# #### here, it doesn't seem to matter if we double ^'s! +# results are the same with all single ^ and all double ^^! +# see comment below. +! if [perl -p -e "s/^\x23if defined(.+)/!if defined$$1/; s/^\x23e/!e/;" \ + -e "s/([\s=^])([\w\d\.\-^]+\.[ch^])/$$1$(SRC:\=\\)\\$$2/g;" \ + -e "s/^(.+)\.o:(.+)/$(OUTDIR:\=\\)\\$$1.obj:$$2 $(NT:\=\\)\\config.inc/;" \ + < $(SRC)\depend > $(OUTDIR)\depend.tmp] +! endif +! include "$(OUTDIR)\depend.tmp" +!else +! if [echo WARNING: Compiling without dependency information.] +! endif +!endif + +# # Compiler command echo control. Define VERBOSECC=1 to get verbose compilation. # !if !defined(VERBOSECC) @@ -303,19 +344,19 @@ CFLAGS=-nologo -W3 $(OPT) $(C_LIBFLAG) -!if $(HAVE_X) +!if $(HAVE_X_WINDOWS) X_DEFINES=-DHAVE_X_WINDOWS X_INCLUDES=-I$(X11_DIR)\include X_LIBS=-libpath:$(X11_DIR)\lib Xaw.lib Xmu.lib Xt.lib SM.lib ICE.lib Xext.lib X11.lib !endif -!if $(HAVE_MSW) +!if $(HAVE_MS_WINDOWS) MSW_DEFINES=-DHAVE_MS_WINDOWS -DHAVE_SCROLLBARS -DHAVE_MENUBARS MSW_INCLUDES= MSW_LIBS= !if $(HAVE_MSW_C_DIRED) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_MSW_C_DIRED -MSW_C_DIRED_SRC=$(XEMACS)\src\dired-msw.c +MSW_C_DIRED_SRC=$(SRC)\dired-msw.c MSW_C_DIRED_OBJ=$(OUTDIR)\dired-msw.obj !endif !if $(HAVE_XPM) @@ -325,7 +366,7 @@ !endif !if $(HAVE_GIF) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_GIF -MSW_GIF_SRC=$(XEMACS)\src\dgif_lib.c $(XEMACS)\src\gif_io.c +MSW_GIF_SRC=$(SRC)\dgif_lib.c $(SRC)\gif_io.c MSW_GIF_OBJ=$(OUTDIR)\dgif_lib.obj $(OUTDIR)\gif_io.obj !endif !if $(HAVE_PNG) @@ -350,13 +391,13 @@ !endif !if $(HAVE_TOOLBARS) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_TOOLBARS -MSW_TOOLBAR_SRC=$(XEMACS)\src\toolbar.c $(XEMACS)\src\toolbar-msw.c +MSW_TOOLBAR_SRC=$(SRC)\toolbar.c $(SRC)\toolbar-msw.c MSW_TOOLBAR_OBJ=$(OUTDIR)\toolbar.obj $(OUTDIR)\toolbar-msw.obj MSW_LIBS=$(MSW_LIBS) comctl32.lib !endif !if $(HAVE_DIALOGS) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_DIALOGS -MSW_DIALOG_SRC=$(XEMACS)\src\dialog.c $(XEMACS)\src\dialog-msw.c +MSW_DIALOG_SRC=$(SRC)\dialog.c $(SRC)\dialog-msw.c MSW_DIALOG_OBJ=$(OUTDIR)\dialog.obj $(OUTDIR)\dialog-msw.obj !endif !if $(HAVE_WIDGETS) @@ -376,6 +417,10 @@ DEBUG_FLAGS=-debug:full !endif +!if $(QUICK_BUILD) +QUICK_DEFINES=-DQUICK_BUILD +!endif + !if $(USE_MINIMAL_TAGBITS) TAGBITS_DEFINES=-DUSE_MINIMAL_TAGBITS !endif @@ -408,41 +453,38 @@ # Generic variables -INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(XEMACS)\nt\inc -I$(XEMACS)\src -I$(XEMACS)\lwlib +INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(NT)\inc -I$(SRC) -I$(LWLIB_SRCDIR) DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) \ $(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) \ - $(DUMPER_DEFINES) $(MALLOC_DEFINES) \ - -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs \ + $(DUMPER_DEFINES) $(MALLOC_DEFINES) $(QUICK_DEFINES) \ + -DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs \ -DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES) #------------------------------------------------------------------------------ -default: $(OUTDIR)\nul all - $(OUTDIR)\nul: -@mkdir $(OUTDIR) XEMACS_INCLUDES=\ - $(XEMACS)\src\config.h \ - $(XEMACS)\src\Emacs.ad.h \ - $(XEMACS)\src\paths.h + $(SRC)\config.h \ + $(SRC)\Emacs.ad.h \ + $(SRC)\paths.h -$(XEMACS)\src\config.h: config.h - copy config.h $(XEMACS)\src +$(SRC)\config.h: config.h + copy config.h $(SRC) -$(XEMACS)\src\Emacs.ad.h: Emacs.ad.h - copy Emacs.ad.h $(XEMACS)\src +$(SRC)\Emacs.ad.h: Emacs.ad.h + copy Emacs.ad.h $(SRC) -$(XEMACS)\src\paths.h: paths.h - copy paths.h $(XEMACS)\src +$(SRC)\paths.h: paths.h + copy paths.h $(SRC) #------------------------------------------------------------------------------ # lib-src programs -LIB_SRC = $(XEMACS)\lib-src -LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32 -DWINDOWSNT +LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32_NATIVE # # Creating config.values to be used by config.el @@ -471,7 +513,7 @@ # Inferred rule {$(LIB_SRC)}.c{$(LIB_SRC)}.exe : cd $(LIB_SRC) - $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** -link -incremental:no + $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** -link -incremental:no setargv.obj cd $(NT) # Individual dependencies @@ -485,33 +527,37 @@ nmake -nologo -f minitar.mak ZLIB="$(ZLIB_DIR)" NT="$(NT)" LIB_SRC="$(LIB_SRC)" LIB_SRC_TOOLS = \ - $(LIB_SRC)/make-docfile.exe \ + $(LIB_SRC)/etags.exe \ $(LIB_SRC)/hexl.exe \ - $(LIB_SRC)/movemail.exe \ + $(LIB_SRC)/i.exe \ + $(LIB_SRC)/make-docfile.exe \ $(LIB_SRC)/mmencode.exe \ + $(LIB_SRC)/movemail.exe \ $(LIB_SRC)/sorted-doc.exe \ - $(LIB_SRC)/wakeup.exe \ - $(LIB_SRC)/etags.exe + $(LIB_SRC)/wakeup.exe !if $(USE_MINITAR) LIB_SRC_TOOLS = \ $(LIB_SRC_TOOLS) \ $(LIB_SRC)/minitar.exe !endif +!if $(USE_PORTABLE_DUMPER) +LIB_SRC_TOOLS = \ + $(XEMACS_INCLUDES) \ + $(LIB_SRC)/make-dump-id.exe \ + $(LIB_SRC_TOOLS) +!endif # Shorthand target minitar: $(LIB_SRC)/minitar.exe #------------------------------------------------------------------------------ -# runxemacs proglet - -RUNEMACS = $(XEMACS)\src\runxemacs.exe +# dump-id.c file that contains the dump id -$(RUNEMACS): $(LIB_SRC)\run.c $(LIB_SRC)\run.res - $(CCV) -I$(LIB_SRC) $(CFLAGS) -Fe$@ -Fo$(LIB_SRC) -Fd$(LIB_SRC)\ $** kernel32.lib user32.lib -link -incremental:no - -$(LIB_SRC)\run.res: $(LIB_SRC)\run.rc - rc -I$(LIB_SRC) -Fo$@ $** +$(SRC)\dump-id.c : $(LIB_SRC)/make-dump-id.exe + cd $(SRC) + $(LIB_SRC)\make-dump-id.exe + cd $(NT) #------------------------------------------------------------------------------ @@ -520,7 +566,7 @@ !if !$(USE_SYSTEM_MALLOC) || !$(USE_PORTABLE_DUMPER) LASTFILE=$(OUTDIR)\lastfile.lib -LASTFILE_SRC=$(XEMACS)\src +LASTFILE_SRC=$(SRC) LASTFILE_FLAGS=$(CFLAGS) $(INCLUDES) -Fo$@ -Fd$* -c LASTFILE_OBJS= \ $(OUTDIR)\lastfile.obj @@ -535,12 +581,11 @@ #------------------------------------------------------------------------------ -!if $(HAVE_X) +!if $(HAVE_X_WINDOWS) # LWLIB Library LWLIB=$(OUTDIR)\lwlib.lib -LWLIB_SRC=$(XEMACS)\lwlib LWLIB_FLAGS=$(CFLAGS) $(INCLUDES) $(DEFINES) \ -DNEED_ATHENA -DNEED_LUCID \ -D_WINDOWS -DMENUBARS_LUCID -DSCROLLBARS_LUCID -DDIALOGS_ATHENA \ @@ -557,25 +602,25 @@ $(LWLIB): $(LWLIB_OBJS) link.exe -lib -nologo -out:$@ $(LWLIB_OBJS) -$(OUTDIR)\lwlib-config.obj: $(LWLIB_SRC)\lwlib-config.c +$(OUTDIR)\lwlib-config.obj: $(LWLIB_SRCDIR)\lwlib-config.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\lwlib-utils.obj: $(LWLIB_SRC)\lwlib-utils.c +$(OUTDIR)\lwlib-utils.obj: $(LWLIB_SRCDIR)\lwlib-utils.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\lwlib-Xaw.obj: $(LWLIB_SRC)\lwlib-Xaw.c +$(OUTDIR)\lwlib-Xaw.obj: $(LWLIB_SRCDIR)\lwlib-Xaw.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\lwlib-Xlw.obj: $(LWLIB_SRC)\lwlib-Xlw.c +$(OUTDIR)\lwlib-Xlw.obj: $(LWLIB_SRCDIR)\lwlib-Xlw.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\lwlib.obj: $(LWLIB_SRC)\lwlib.c +$(OUTDIR)\lwlib.obj: $(LWLIB_SRCDIR)\lwlib.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\xlwmenu.obj: $(LWLIB_SRC)\xlwmenu.c +$(OUTDIR)\xlwmenu.obj: $(LWLIB_SRCDIR)\xlwmenu.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\xlwscrollbar.obj: $(LWLIB_SRC)\xlwscrollbar.c +$(OUTDIR)\xlwscrollbar.obj: $(LWLIB_SRCDIR)\xlwscrollbar.c $(CCV) $(LWLIB_FLAGS) $** !endif @@ -583,135 +628,136 @@ DOC=$(LIB_SRC)\DOC DOC_SRC1=\ - $(XEMACS)\src\abbrev.c \ - $(XEMACS)\src\alloc.c \ - $(XEMACS)\src\alloca.c \ - $(XEMACS)\src\blocktype.c \ - $(XEMACS)\src\buffer.c \ - $(XEMACS)\src\bytecode.c \ - $(XEMACS)\src\callint.c \ - $(XEMACS)\src\callproc.c \ - $(XEMACS)\src\casefiddle.c \ - $(XEMACS)\src\casetab.c \ - $(XEMACS)\src\chartab.c \ - $(XEMACS)\src\cmdloop.c \ - $(XEMACS)\src\cmds.c \ - $(XEMACS)\src\console-stream.c \ - $(XEMACS)\src\console.c \ - $(XEMACS)\src\data.c \ - $(XEMACS)\src\device.c + $(SRC)\abbrev.c \ + $(SRC)\alloc.c \ + $(SRC)\blocktype.c \ + $(SRC)\buffer.c \ + $(SRC)\bytecode.c \ + $(SRC)\callint.c \ + $(SRC)\callproc.c \ + $(SRC)\casefiddle.c \ + $(SRC)\casetab.c \ + $(SRC)\chartab.c \ + $(SRC)\cmdloop.c \ + $(SRC)\cmds.c \ + $(SRC)\console-stream.c \ + $(SRC)\console.c \ + $(SRC)\data.c \ + $(SRC)\device.c DOC_SRC2=\ - $(XEMACS)\src\dired.c \ - $(XEMACS)\src\doc.c \ - $(XEMACS)\src\doprnt.c \ - $(XEMACS)\src\dragdrop.c \ - $(XEMACS)\src\dynarr.c \ - $(XEMACS)\src\editfns.c \ - $(XEMACS)\src\elhash.c \ - $(XEMACS)\src\emacs.c \ - $(XEMACS)\src\eval.c \ - $(XEMACS)\src\event-stream.c \ - $(XEMACS)\src\events.c \ - $(XEMACS)\src\extents.c \ - $(XEMACS)\src\faces.c \ - $(XEMACS)\src\file-coding.c \ - $(XEMACS)\src\fileio.c \ - $(XEMACS)\src\filemode.c \ - $(XEMACS)\src\floatfns.c \ - $(XEMACS)\src\fns.c + $(SRC)\dired.c \ + $(SRC)\doc.c \ + $(SRC)\doprnt.c \ + $(SRC)\dragdrop.c \ + $(SRC)\dynarr.c \ + $(SRC)\editfns.c \ + $(SRC)\elhash.c \ + $(SRC)\emacs.c \ + $(SRC)\eval.c \ + $(SRC)\event-stream.c \ + $(SRC)\events.c \ + $(SRC)\extents.c \ + $(SRC)\faces.c \ + $(SRC)\file-coding.c \ + $(SRC)\fileio.c \ + $(SRC)\filemode.c \ + $(SRC)\floatfns.c \ + $(SRC)\fns.c DOC_SRC3=\ - $(XEMACS)\src\font-lock.c \ - $(XEMACS)\src\frame.c \ - $(XEMACS)\src\general.c \ - $(XEMACS)\src\glyphs.c \ - $(XEMACS)\src\glyphs-eimage.c \ - $(XEMACS)\src\glyphs-widget.c \ - $(XEMACS)\src\gui.c \ - $(XEMACS)\src\gutter.c \ - $(XEMACS)\src\hash.c \ - $(XEMACS)\src\imgproc.c \ - $(XEMACS)\src\indent.c \ - $(XEMACS)\src\insdel.c \ - $(XEMACS)\src\intl.c \ - $(XEMACS)\src\keymap.c \ - $(XEMACS)\src\line-number.c \ - $(XEMACS)\src\lread.c \ - $(XEMACS)\src\lstream.c \ - $(XEMACS)\src\macros.c \ - $(XEMACS)\src\marker.c + $(SRC)\font-lock.c \ + $(SRC)\frame.c \ + $(SRC)\general.c \ + $(SRC)\getloadavg.c \ + $(SRC)\glyphs.c \ + $(SRC)\glyphs-eimage.c \ + $(SRC)\glyphs-widget.c \ + $(SRC)\gui.c \ + $(SRC)\gutter.c \ + $(SRC)\hash.c \ + $(SRC)\imgproc.c \ + $(SRC)\indent.c \ + $(SRC)\insdel.c \ + $(SRC)\intl.c \ + $(SRC)\keymap.c \ + $(SRC)\line-number.c \ + $(SRC)\lread.c \ + $(SRC)\lstream.c \ + $(SRC)\macros.c \ + $(SRC)\marker.c DOC_SRC4=\ - $(XEMACS)\src\md5.c \ - $(XEMACS)\src\menubar.c \ - $(XEMACS)\src\minibuf.c \ - $(XEMACS)\src\nt.c \ - $(XEMACS)\src\ntplay.c \ - $(XEMACS)\src\ntproc.c \ - $(XEMACS)\src\objects.c \ - $(XEMACS)\src\opaque.c \ - $(XEMACS)\src\print.c \ - $(XEMACS)\src\process.c \ - $(XEMACS)\src\process-nt.c \ - $(XEMACS)\src\profile.c \ - $(XEMACS)\src\rangetab.c \ - $(XEMACS)\src\realpath.c \ - $(XEMACS)\src\redisplay-output.c \ - $(XEMACS)\src\redisplay.c \ - $(XEMACS)\src\regex.c \ - $(XEMACS)\src\scrollbar.c \ - $(XEMACS)\src\search.c \ - $(XEMACS)\src\select.c \ - $(XEMACS)\src\signal.c \ - $(XEMACS)\src\sound.c + $(SRC)\md5.c \ + $(SRC)\menubar.c \ + $(SRC)\minibuf.c \ + $(SRC)\nt.c \ + $(SRC)\ntplay.c \ + $(SRC)\ntproc.c \ + $(SRC)\objects.c \ + $(SRC)\opaque.c \ + $(SRC)\print.c \ + $(SRC)\process.c \ + $(SRC)\process-nt.c \ + $(SRC)\profile.c \ + $(SRC)\rangetab.c \ + $(SRC)\realpath.c \ + $(SRC)\redisplay-output.c \ + $(SRC)\redisplay.c \ + $(SRC)\regex.c \ + $(SRC)\scrollbar.c \ + $(SRC)\search.c \ + $(SRC)\select.c \ + $(SRC)\signal.c \ + $(SRC)\sound.c DOC_SRC5=\ - $(XEMACS)\src\specifier.c \ - $(XEMACS)\src\strftime.c \ - $(XEMACS)\src\symbols.c \ - $(XEMACS)\src\syntax.c \ - $(XEMACS)\src\sysdep.c \ - $(XEMACS)\src\termcap.c \ - $(XEMACS)\src\tparam.c \ - $(XEMACS)\src\undo.c \ - $(XEMACS)\src\window.c \ - $(XEMACS)\src\widget.c + $(SRC)\specifier.c \ + $(SRC)\strftime.c \ + $(SRC)\symbols.c \ + $(SRC)\syntax.c \ + $(SRC)\sysdep.c \ + $(SRC)\termcap.c \ + $(SRC)\tparam.c \ + $(SRC)\undo.c \ + $(SRC)\window.c \ + $(SRC)\win32.c \ + $(SRC)\widget.c -!if $(HAVE_X) +!if $(HAVE_X_WINDOWS) DOC_SRC6=\ - $(XEMACS)\src\balloon_help.c \ - $(XEMACS)\src\console-x.c \ - $(XEMACS)\src\device-x.c \ - $(XEMACS)\src\dialog-x.c \ - $(XEMACS)\src\EmacsFrame.c \ - $(XEMACS)\src\EmacsManager.c \ - $(XEMACS)\src\EmacsShell-sub.c\ - $(XEMACS)\src\EmacsShell.c \ - $(XEMACS)\src\event-Xt.c \ - $(XEMACS)\src\frame-x.c \ - $(XEMACS)\src\glyphs-x.c \ - $(XEMACS)\src\gui-x.c \ - $(XEMACS)\src\menubar.c \ - $(XEMACS)\src\menubar-x.c \ - $(XEMACS)\src\objects-x.c \ - $(XEMACS)\src\redisplay-x.c \ - $(XEMACS)\src\scrollbar-x.c \ - $(XEMACS)\src\balloon-x.c \ - $(XEMACS)\src\xgccache.c \ - $(XEMACS)\src\xmu.c \ - $(XEMACS)\src\select-x.c + $(SRC)\balloon_help.c \ + $(SRC)\console-x.c \ + $(SRC)\device-x.c \ + $(SRC)\dialog-x.c \ + $(SRC)\EmacsFrame.c \ + $(SRC)\EmacsManager.c \ + $(SRC)\EmacsShell-sub.c\ + $(SRC)\EmacsShell.c \ + $(SRC)\event-Xt.c \ + $(SRC)\frame-x.c \ + $(SRC)\glyphs-x.c \ + $(SRC)\gui-x.c \ + $(SRC)\menubar.c \ + $(SRC)\menubar-x.c \ + $(SRC)\objects-x.c \ + $(SRC)\redisplay-x.c \ + $(SRC)\scrollbar-x.c \ + $(SRC)\balloon-x.c \ + $(SRC)\xgccache.c \ + $(SRC)\xmu.c \ + $(SRC)\select-x.c !endif -!if $(HAVE_MSW) +!if $(HAVE_MS_WINDOWS) DOC_SRC7=\ - $(XEMACS)\src\console-msw.c \ - $(XEMACS)\src\device-msw.c \ - $(XEMACS)\src\event-msw.c \ - $(XEMACS)\src\frame-msw.c \ - $(XEMACS)\src\glyphs-msw.c \ - $(XEMACS)\src\gui-msw.c \ - $(XEMACS)\src\menubar-msw.c \ - $(XEMACS)\src\objects-msw.c \ - $(XEMACS)\src\redisplay-msw.c \ - $(XEMACS)\src\scrollbar-msw.c \ - $(XEMACS)\src\select-msw.c \ + $(SRC)\console-msw.c \ + $(SRC)\device-msw.c \ + $(SRC)\event-msw.c \ + $(SRC)\frame-msw.c \ + $(SRC)\glyphs-msw.c \ + $(SRC)\gui-msw.c \ + $(SRC)\menubar-msw.c \ + $(SRC)\objects-msw.c \ + $(SRC)\redisplay-msw.c \ + $(SRC)\scrollbar-msw.c \ + $(SRC)\select-msw.c \ $(MSW_C_DIRED_SRC) \ $(MSW_TOOLBAR_SRC) \ $(MSW_DIALOG_SRC) \ @@ -720,31 +766,34 @@ !if $(HAVE_MULE) DOC_SRC8=\ - $(XEMACS)\src\mule.c \ - $(XEMACS)\src\mule-charset.c \ - $(XEMACS)\src\mule-ccl.c -! if $(HAVE_X) - DOC_SRC8=$(DOC_SRC8) $(XEMACS)\src\input-method-xlib.c + $(SRC)\mule.c \ + $(SRC)\mule-charset.c \ + $(SRC)\mule-ccl.c +! if $(HAVE_X_WINDOWS) + DOC_SRC8=$(DOC_SRC8) $(SRC)\input-method-xlib.c ! endif !endif !if $(DEBUG_XEMACS) DOC_SRC9=\ - $(XEMACS)\src\debug.c \ - $(XEMACS)\src\tests.c + $(SRC)\debug.c \ + $(SRC)\tests.c !endif !if !$(USE_SYSTEM_MALLOC) DOC_SRC10=\ - $(XEMACS)\src\free-hook.c \ - $(XEMACS)\src\gmalloc.c \ - $(XEMACS)\src\ntheap.c \ - $(XEMACS)\src\vm-limit.c + $(SRC)\free-hook.c \ + $(SRC)\gmalloc.c \ + $(SRC)\ntheap.c \ + $(SRC)\vm-limit.c !endif !if !$(USE_PORTABLE_DUMPER) DOC_SRC11=\ - $(XEMACS)\src\unexnt.c + $(SRC)\unexnt.c +!else +DOC_SRC11=\ + $(SRC)\dumper.c !endif #------------------------------------------------------------------------------ @@ -757,30 +806,32 @@ !ENDIF !if !$(USE_PORTABLE_DUMPER) -TEMACS_ENTRYPOINT=-entry:_start +TEMACS_ENTRYPOINT=-entry:_start +!else +TEMACS_ENTRYPOINT=-entry:mainCRTStartup !endif -TEMACS_DIR=$(XEMACS)\src +TEMACS_DIR=$(SRC) TEMACS=$(TEMACS_DIR)\temacs.exe TEMACS_BROWSE=$(TEMACS_DIR)\temacs.bsc -TEMACS_SRC=$(XEMACS)\src +TEMACS_SRC=$(SRC) TEMACS_LIBS=$(LASTFILE) $(LWLIB) $(X_LIBS) $(MSW_LIBS) \ - oldnames.lib kernel32.lib user32.lib gdi32.lib advapi32.lib \ - shell32.lib wsock32.lib winmm.lib winspool.lib $(LIBC_LIB) + oldnames.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib \ + shell32.lib wsock32.lib winmm.lib winspool.lib ole32.lib uuid.lib $(LIBC_LIB) TEMACS_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS) -base:0x1000000\ - -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:console\ + -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:windows\ -pdb:$(TEMACS_DIR)\temacs.pdb -map:$(TEMACS_DIR)\temacs.map \ - -heap:0x00100000 -out:$@ -nodefaultlib + -heap:0x00100000 -nodefaultlib -incremental:no setargv.obj TEMACS_CPP_FLAGS=-c \ $(CFLAGS) $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \ -DEMACS_MAJOR_VERSION=$(emacs_major_version) \ -DEMACS_MINOR_VERSION=$(emacs_minor_version) \ $(EMACS_BETA_VERSION) \ - -DXEMACS_CODENAME=\"$(xemacs_codename)\" \ + -DXEMACS_CODENAME=\"$(xemacs_codename:&=and)\" \ -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \ -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\" -!if $(HAVE_X) +!if $(HAVE_X_WINDOWS) TEMACS_X_OBJS=\ $(OUTDIR)\balloon-x.obj \ $(OUTDIR)\balloon_help.obj \ @@ -805,7 +856,7 @@ $(OUTDIR)\select-x.obj !endif -!if $(HAVE_MSW) +!if $(HAVE_MS_WINDOWS) TEMACS_MSW_OBJS=\ $(OUTDIR)\console-msw.obj \ $(OUTDIR)\device-msw.obj \ @@ -829,7 +880,7 @@ $(OUTDIR)\mule.obj \ $(OUTDIR)\mule-charset.obj \ $(OUTDIR)\mule-ccl.obj -! if $(HAVE_X) +! if $(HAVE_X_WINDOWS) TEMACS_MULE_OBJS=\ $(TEMACS_MULE_OBJS) $(OUTDIR)\input-method-xlib.obj ! endif @@ -852,6 +903,9 @@ !if !$(USE_PORTABLE_DUMPER) TEMACS_DUMP_OBJS=\ $(OUTDIR)\unexnt.obj +!else +TEMACS_DUMP_OBJS=\ + $(OUTDIR)\dumper.obj !endif TEMACS_OBJS= \ @@ -864,7 +918,6 @@ $(TEMACS_DUMP_OBJS)\ $(OUTDIR)\abbrev.obj \ $(OUTDIR)\alloc.obj \ - $(OUTDIR)\alloca.obj \ $(OUTDIR)\blocktype.obj \ $(OUTDIR)\buffer.obj \ $(OUTDIR)\bytecode.obj \ @@ -900,6 +953,7 @@ $(OUTDIR)\font-lock.obj \ $(OUTDIR)\frame.obj \ $(OUTDIR)\general.obj \ + $(OUTDIR)\getloadavg.obj \ $(OUTDIR)\glyphs.obj \ $(OUTDIR)\glyphs-eimage.obj \ $(OUTDIR)\glyphs-widget.obj \ @@ -947,7 +1001,7 @@ $(OUTDIR)\undo.obj \ $(OUTDIR)\widget.obj \ $(OUTDIR)\window.obj \ - $(OUTDIR)\xemacs.res + $(OUTDIR)\win32.obj # Rules @@ -963,6 +1017,8 @@ $(CCV) $(TEMACS_CPP_FLAGS) $< -Fo$@ !endif +$(OUTDIR)\emacs.obj: $(XEMACS)\version.sh + $(OUTDIR)\TopLevelEmacsShell.obj: $(TEMACS_SRC)\EmacsShell-sub.c $(CCV) $(TEMACS_CPP_FLAGS) -DDEFINE_TOP_LEVEL_EMACS_SHELL $** -Fo$@ @@ -977,28 +1033,38 @@ #$(TEMACS_SRC)\paths.h: $(TEMACS_SRC)\paths.h.in # !"cd $(TEMACS_SRC); cp paths.h.in paths.h" -$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS) +$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS) $(OUTDIR)\xemacs.res !if $(DEBUG_XEMACS) @dir /b/s $(OUTDIR)\*.sbr > bscmake.tmp bscmake -nologo -o$(TEMACS_BROWSE) @bscmake.tmp @$(DEL) bscmake.tmp !endif !if $(USE_PORTABLE_DUMPER) - @if exist $(TEMACS_DIR)\xemacs.dmp del $(TEMACS_DIR)\xemacs.dmp -!endif + @if exist $(SRC)\dump-id.c del $(SRC)\dump-id.c +# make a new dump id file. There is probably a better way to do this, but this works + @if exist $(OUTDIR)\dump-id.obj del $(OUTDIR)\dump-id.obj + nmake -nologo -f xemacs.mak OUTDIR=$(OUTDIR) $(OUTDIR)\dump-id.obj link.exe @<< - $(TEMACS_LFLAGS) $(TEMACS_OBJS) $(TEMACS_LIBS) + $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj << +!else + link.exe @<< + $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) +<< +!endif $(OUTDIR)\xemacs.res: xemacs.rc rc -Fo$@ xemacs.rc + +PROGNAME=$(SRC)\xemacs.exe +TEMACS_BATCH="$(LIB_SRC)\i" "$(TEMACS)" -batch +XEMACS_BATCH="$(LIB_SRC)\i" "$(PROGNAME)" -vanilla -batch + # Section handling automated tests starts here -SRCDIR=$(MAKEDIR)\..\src -PROGNAME=$(SRCDIR)\xemacs.exe blddir=$(MAKEDIR:\=\\)\\.. -temacs_loadup=$(TEMACS) -batch -l $(SRCDIR)/../lisp/loadup.el +temacs_loadup=$(TEMACS_BATCH) -l $(LISP)/loadup.el dump_temacs = $(temacs_loadup) dump run_temacs = $(temacs_loadup) run-temacs ## We have automated tests!! @@ -1008,21 +1074,42 @@ # .PHONY: check check-temacs check: - cd $(SRCDIR) + cd $(SRC) $(PROGNAME) $(batch_test_emacs) check-temacs: - cd $(SRCDIR) + cd $(SRC) set EMACSBOOTSTRAPLOADPATH=$(LISP) set EMACSBOOTSTRAPMODULEPATH=$(MODULES) $(run_temacs) $(batch_test_emacs) # Section handling automated tests ends here +# Section handling tags starts here + +tagslisp=lisp + +tags: + @echo If you don't have a copy of etags around, then do 'make lib-src' first. + @echo To make use of the tags file, put the following in your .emacs: + @echo (setq tag-table-alist + @echo '(("$(XEMACSDIRSTRING)\\" . "$(XEMACSDIRSTRING)\\"))) + cd $(XEMACS) + $(DEL) TAGS + set PATH=lib-src;%PATH% +# we need to double ^, but only before backslash! Doubling it elsewhere +# causes problems. I don't understand this -- CMD.EXE uses ^ as a quoting +# convention of sorts, but appears to leave it alone inside of double quotes, +# even before \. Could this be nmake interference? + etags -a -r "/[ ]*DEF\(VAR\|INE\)_[A-Z_]+[ ]*([ ]*\"\([^^\"]+\)\"/\2/" src\*.c src\*.h lwlib\*.c lwlib\*.h lib-src\*.c lib-src\*.h + etags -a -l none -r "/^(def\(var\|un\|alias\|const\|macro\|subst\|struct\|face\|group\|custom\|ine-\(function\|compiler-macro\|[a-z-]+alias\)\)[ ]+'?\([^ ]+\)/\3/" $(tagslisp)\*.el + +# Section handling tags ends here + # Section handling info starts here !if !defined(MAKEINFO) -MAKEINFO=$(PROGNAME) -vanilla -batch -l texinfmt -f batch-texinfo-format +MAKEINFO=$(XEMACS_BATCH) -l texinfmt -f batch-texinfo-format !endif MANDIR = $(XEMACS)\man @@ -1203,13 +1290,13 @@ @<$(TEMACS_DIR)\NEEDTODUMP # This rule dumps xemacs and then possibly spawns sub-make if PURESPACE # requirements have changed. -dump-xemacs: temacs + +$(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP @echo >$(TEMACS_DIR)\SATISFIED cd $(TEMACS_DIR) set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH) set EMACSBOOTSTRAPMODULEPATH=$(MODULES) - -1 $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\loadup.el dump + $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\loadup.el dump !if $(USE_PORTABLE_DUMPER) - copy temacs.exe xemacs.exe + rc -d INCLUDE_DUMP -Fo $(OUTDIR)\xemacs.res $(NT)\xemacs.rc + link.exe @<< + $(TEMACS_LFLAGS) -out:xemacs.exe $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj +<< +# Make the resource section read/write since almost all of it is the dump +# data which needs to be writable. This avoids having to copy it. + editbin -nologo -section:.rsrc,rw xemacs.exe + del $(TEMACS_DIR)\xemacs.dmp !endif cd $(NT) @if not exist $(TEMACS_DIR)\SATISFIED nmake -nologo -f xemacs.mak $@ #------------------------------------------------------------------------------ # use this rule to build the complete system -all: $(XEMACS)\Installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \ - $(LIB_SRC_TOOLS) $(RUNEMACS) $(TEMACS) update-elc $(DOC) dump-xemacs \ - $(LISP)/auto-autoloads.el $(LISP)/custom-load.el info +all: installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \ + $(LIB_SRC_TOOLS) $(TEMACS) update-elc $(DOC) $(PROGNAME) \ + update-elc-2 update-auto-and-custom info temacs: $(LASTFILE) $(TEMACS) @@ -1282,8 +1381,7 @@ @xcopy /q $(LIB_SRC)\*.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)\" @copy $(LIB_SRC)\DOC "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" @copy $(CONFIG_VALUES) "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" - @copy $(XEMACS)\src\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" - @copy $(RUNEMACS) "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" + @copy $(SRC)\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" @xcopy /e /q $(XEMACS)\etc "$(INSTALL_DIR)\etc\" @xcopy /e /q $(XEMACS)\info "$(INSTALL_DIR)\info\" @xcopy /e /q $(XEMACS)\lisp "$(INSTALL_DIR)\lisp\" @@ -1296,55 +1394,51 @@ @$(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder" @$(DEL) PlaceHolder -distclean: - $(DEL) *.bak - $(DEL) *.orig - $(DEL) *.rej - $(DEL) *.tmp +mostlyclean: $(DEL) $(XEMACS)\Installation - cd $(OUTDIR) - $(DEL) *.lib - $(DEL) *.obj - $(DEL) *.pdb - $(DEL) *.res - $(DEL) *.sbr - cd $(XEMACS)\$(TEMACS_DIR) - $(DEL) config.h - $(DEL) paths.h - $(DEL) Emacs.ad.h - $(DEL) *.bak - $(DEL) *.orig - $(DEL) *.rej - $(DEL) *.exe - $(DEL) *.map - $(DEL) *.bsc - $(DEL) *.pdb - cd $(LIB_SRC) - $(DEL) DOC - $(DEL) *.bak - $(DEL) *.orig - $(DEL) *.rej - $(DEL) *.exe - $(DEL) *.obj - $(DEL) *.pdb - $(DEL) *.res - $(DEL) $(CONFIG_VALUES) - cd $(LISP) - $(DEL) /s /q *.bak *.elc *.orig *.rej - cd $(INFODIR) - $(DEL) *.info* + $(DEL) $(OUTDIR)\*.lib $(OUTDIR)\*.obj $(OUTDIR)\*.pdb + $(DEL) $(OUTDIR)\*.res $(OUTDIR)\*.sbr + $(DEL) $(SRC)\*.exe $(SRC)\*.map $(SRC)\*.bsc $(SRC)\*.pdb + $(DEL) $(LIB_SRC)\*.exe $(LIB_SRC)\*.obj $(LIB_SRC)\*.pdb + $(DEL) $(LIB_SRC)\*.res + +clean: mostlyclean versionclean + $(DEL) $(XEMACS)\TAGS + +nicenclean: clean + $(DEL) $(NT)\*.bak $(NT)\*.orig $(NT)\*.rej $(NT)\*.tmp + $(DEL) $(LIB_SRC)\*.bak $(LIB_SRC)\*.orig $(LIB_SRC)\*.rej + $(DEL) $(LIB_SRC)\*.tmp + $(DEL) $(SRC)\*.bak $(SRC)\*.orig $(SRC)\*.rej $(SRC)\*.tmp + $(DEL) /s $(LISP)\*.bak $(LISP)\*.orig $(LISP)\*.rej $(LISP)\*.tmp + +## This is used in making a distribution. +## Do not use it on development directories! +distclean: nicenclean + $(DEL) $(SRC)\config.h $(SRC)\paths.h $(SRC)\Emacs.ad.h + $(DEL) $(LIB_SRC)\$(CONFIG_VALUES) + $(DEL) $(INFODIR)\*.info* + $(DEL) /s /q $(LISP)\*.elc + +realclean: distclean + +versionclean: + $(DEL) $(SRC)\xemacs.exe $(LIB_SRC)\DOC + +#not sure about those wildcards. DOS wildcards are stupid compared to Unix, +#and could end up deleting *everything* instead of just backup files or +#whatever. +#extraclean: realclean +# $(DEL) *~ *.*~ #* m\*~ m\#* s\*~ s\#* depend: - cd $(SRCDIR) + cd $(SRC) perl ./make-src-depend > depend.tmp perl -MFile::Compare -e "compare('depend.tmp', 'depend') && rename('depend.tmp', 'depend') or unlink('depend.tmp')" -installation:: - @if exist $(XEMACS)\Installation del $(XEMACS)\Installation +$(XEMACS)\Installation:: installation -installation:: $(XEMACS)\Installation - -$(XEMACS)\Installation: +installation:: @type > $(XEMACS)\Installation << !if defined(OS) OS: $(OS) @@ -1361,10 +1455,10 @@ !if $(INFODOCK) Building InfoDock. !endif -!if $(HAVE_MSW) +!if $(HAVE_MS_WINDOWS) Compiling in support for Microsoft Windows native GUI. !endif -!if $(HAVE_X) +!if $(HAVE_X_WINDOWS) Compiling in support for X-Windows. !endif !if $(HAVE_MULE) @@ -1444,26 +1538,31 @@ !if $(DEBUG_XEMACS) Compiling in extra debug checks. XEmacs will be slow! !endif +!if $(QUICK_BUILD) + Disabling non-essential build actions. Use with care! +!endif <type] imp=$[(void*)(`alloc.c`lrecord_implementations_table[$lheader->type])] else + lheader="((struct lrecord_header *) -1)" + lrecord_type=-1 imp="0xdeadbeef" fi # printvar obj val type imp @@ -144,10 +144,6 @@ decode_object "$*" if test $type = $Lisp_Type_Int; then echo "int" elif test $type = $Lisp_Type_Char; then echo "char" - elif test $type = $Lisp_Type_Symbol; then echo "symbol" - elif test $type = $Lisp_Type_String; then echo "string" - elif test $type = $Lisp_Type_Vector; then echo "vector" - elif test $type = $Lisp_Type_Cons; then echo "cons" elif test $type = null_pointer; then echo "null_pointer" else echo "record type with name: $[((struct lrecord_implementation *)$imp)->name]" @@ -220,14 +216,11 @@ run -batch -l ../lisp/loadup.el dump } -function pstruct { - xstruct="((struct $1 *) $val)" - print $xstruct - print *$xstruct -} - -function lrecord_type_p { - if eval test -z \"\$lrecord_$1\" && test $imp = $[(void*)(&lrecord_$1)]; then return 0; else return 1; fi +function pstruct { # pstruct foo.c struct-name + module "$1" > /dev/null + type_ptr="((struct $2 *) $val)" + print $type_ptr + print *$type_ptr } document pobj << 'end' @@ -245,104 +238,110 @@ else print -f"Char: %d" $val fi - elif test $type = $Lisp_Type_String || lrecord_type_p string; then - pstruct Lisp_String - elif test $type = $Lisp_Type_Cons || lrecord_type_p cons; then - pstruct Lisp_Cons - elif test $type = $Lisp_Type_Symbol || lrecord_type_p symbol; then - pstruct Lisp_Symbol - echo "Symbol name: $[(char *)($xstruct->name->data)]" - elif test $type = $Lisp_Type_Vector || lrecord_type_p vector; then - pstruct Lisp_Vector - echo "Vector of length $[$xstruct->size]" - elif lrecord_type_p bit_vector; then - pstruct Lisp_Bit_Vector - elif lrecord_type_p buffer; then - pstruct buffer - elif lrecord_type_p char_table; then - pstruct Lisp_Char_Table - elif lrecord_type_p char_table_entry; then - pstruct Lisp_Char_Table_Entry - elif lrecord_type_p charset; then - pstruct Lisp_Charset - elif lrecord_type_p coding_system; then - pstruct Lisp_Coding_System - elif lrecord_type_p color_instance; then - pstruct Lisp_Color_Instance - elif lrecord_type_p command_builder; then - pstruct command_builder - elif lrecord_type_p compiled_function; then - pstruct Lisp_Compiled_Function - elif lrecord_type_p console; then - pstruct console - elif lrecord_type_p database; then - pstruct Lisp_Database - elif lrecord_type_p device; then - pstruct device - elif lrecord_type_p event; then - pstruct Lisp_Event - elif lrecord_type_p extent; then - pstruct extent - elif lrecord_type_p extent_auxiliary; then - pstruct extent_auxiliary - elif lrecord_type_p extent_info; then - pstruct extent_info - elif lrecord_type_p face; then - pstruct Lisp_Face - elif lrecord_type_p float; then - pstruct Lisp_Float - elif lrecord_type_p font_instance; then - pstruct Lisp_Font_Instance - elif lrecord_type_p frame; then - pstruct frame - elif lrecord_type_p glyph; then - pstruct Lisp_Glyph - elif lrecord_type_p hash_table; then - pstruct Lisp_Hash_Table - elif lrecord_type_p image_instance; then - pstruct Lisp_Image_Instance - elif lrecord_type_p keymap; then - pstruct Lisp_Keymap - elif lrecord_type_p lcrecord_list; then - pstruct lcrecord_list - elif lrecord_type_p lstream; then - pstruct lstream - elif lrecord_type_p marker; then - pstruct Lisp_Marker - elif lrecord_type_p opaque; then - pstruct Lisp_Opaque - elif lrecord_type_p opaque_ptr; then - pstruct Lisp_Opaque_Ptr - elif lrecord_type_p popup_data; then - pstruct popup_data - elif lrecord_type_p process; then - pstruct Lisp_Process - elif lrecord_type_p range_table; then - pstruct Lisp_Range_Table - elif lrecord_type_p specifier; then - pstruct Lisp_Specifier - elif lrecord_type_p subr; then - pstruct Lisp_Subr - elif lrecord_type_p symbol_value_buffer_local; then - pstruct symbol_value_buffer_local - elif lrecord_type_p symbol_value_forward; then - pstruct symbol_value_forward - elif lrecord_type_p symbol_value_lisp_magic; then - pstruct symbol_value_lisp_magic - elif lrecord_type_p symbol_value_varalias; then - pstruct symbol_value_varalias - elif lrecord_type_p toolbar_button; then - pstruct toolbar_button - elif lrecord_type_p tooltalk_message; then - pstruct Lisp_Tooltalk_Message - elif lrecord_type_p tooltalk_pattern; then - pstruct Lisp_Tooltalk_Pattern - elif lrecord_type_p weak_list; then - pstruct weak_list - elif lrecord_type_p window; then - pstruct window - elif lrecord_type_p window_configuration; then - pstruct window_config + elif test $lrecord_type = lrecord_type_string; then + pstruct alloc.c Lisp_String + elif test $lrecord_type = lrecord_type_cons; then + pstruct alloc.c Lisp_Cons + elif test $lrecord_type = lrecord_type_symbol; then + pstruct symbols.c Lisp_Symbol + echo "Symbol name: $[(char *)($type_ptr->name->data)]" + elif test $lrecord_type = lrecord_type_vector; then + pstruct alloc.c Lisp_Vector + echo "Vector of length $[$type_ptr->size]" + elif test $lrecord_type = lrecord_type_bit_vector; then + pstruct fns.c Lisp_Bit_Vector + elif test $lrecord_type = lrecord_type_buffer; then + pstruct buffer.c buffer + elif test $lrecord_type = lrecord_type_char_table; then + pstruct chartab.c Lisp_Char_Table + elif test $lrecord_type = lrecord_type_char_table_entry; then + pstruct chartab.c Lisp_Char_Table_Entry + elif test $lrecord_type = lrecord_type_charset; then + pstruct mule-charset.c Lisp_Charset + elif test $lrecord_type = lrecord_type_coding_system; then + pstruct file-coding.c Lisp_Coding_System + elif test $lrecord_type = lrecord_type_color_instance; then + pstruct objects.c Lisp_Color_Instance + elif test $lrecord_type = lrecord_type_command_builder; then + pstruct event-stream.c command_builder + elif test $lrecord_type = lrecord_type_compiled_function; then + pstruct bytecode.c Lisp_Compiled_Function + elif test $lrecord_type = lrecord_type_console; then + pstruct console.c console + elif test $lrecord_type = lrecord_type_database; then + pstruct database.c Lisp_Database + elif test $lrecord_type = lrecord_type_device; then + pstruct device.c device + elif test $lrecord_type = lrecord_type_event; then + pstruct events.c Lisp_Event + elif test $lrecord_type = lrecord_type_extent; then + pstruct extents.c extent + elif test $lrecord_type = lrecord_type_extent_auxiliary; then + pstruct extents.c extent_auxiliary + elif test $lrecord_type = lrecord_type_extent_info; then + pstruct extents.c extent_info + elif test $lrecord_type = lrecord_type_face; then + pstruct faces.c Lisp_Face + elif test $lrecord_type = lrecord_type_float; then + pstruct floatfns.c Lisp_Float + elif test $lrecord_type = lrecord_type_font_instance; then + pstruct objects.c Lisp_Font_Instance + elif test $lrecord_type = lrecord_type_frame; then + pstruct frame.c frame + elif test $lrecord_type = lrecord_type_glyph; then + pstruct glyph.c Lisp_Glyph + elif test $lrecord_type = lrecord_type_gui_item; then + pstruct gui.c Lisp_Gui_Item + elif test $lrecord_type = lrecord_type_hash_table; then + pstruct elhash.c Lisp_Hash_Table + elif test $lrecord_type = lrecord_type_image_instance; then + pstruct glyphs.c Lisp_Image_Instance + elif test $lrecord_type = lrecord_type_keymap; then + pstruct keymap.c Lisp_Keymap + elif test $lrecord_type = lrecord_type_lcrecord_list; then + pstruct alloc.c lcrecord_list + elif test $lrecord_type = lrecord_type_ldap; then + pstruct ldap.c Lisp_LDAP + elif test $lrecord_type = lrecord_type_lstream; then + pstruct lstream.c lstream + elif test $lrecord_type = lrecord_type_marker; then + pstruct marker.c Lisp_Marker + elif test $lrecord_type = lrecord_type_opaque; then + pstruct opaque.c Lisp_Opaque + elif test $lrecord_type = lrecord_type_opaque_ptr; then + pstruct opaque.c Lisp_Opaque_Ptr + elif test $lrecord_type = lrecord_type_popup_data; then + pstruct gui-x.c popup_data + elif test $lrecord_type = lrecord_type_process; then + pstruct process.c Lisp_Process + elif test $lrecord_type = lrecord_type_range_table; then + pstruct rangetab.c Lisp_Range_Table + elif test $lrecord_type = lrecord_type_specifier; then + pstruct specifier.c Lisp_Specifier + elif test $lrecord_type = lrecord_type_subr; then + pstruct eval.c Lisp_Subr + elif test $lrecord_type = lrecord_type_symbol_value_buffer_local; then + pstruct symbols.c symbol_value_buffer_local + elif test $lrecord_type = lrecord_type_symbol_value_forward; then + pstruct symbols.c symbol_value_forward + elif test $lrecord_type = lrecord_type_symbol_value_lisp_magic; then + pstruct symbols.c symbol_value_lisp_magic + elif test $lrecord_type = lrecord_type_symbol_value_varalias; then + pstruct symbols.c symbol_value_varalias + elif test $lrecord_type = lrecord_type_timeout; then + pstruct event-stream.c Lisp_Timeout + elif test $lrecord_type = lrecord_type_toolbar_button; then + pstruct toolbar.c toolbar_button + elif test $lrecord_type = lrecord_type_tooltalk_message; then + pstruct tooltalk.c Lisp_Tooltalk_Message + elif test $lrecord_type = lrecord_type_tooltalk_pattern; then + pstruct tooltalk.c Lisp_Tooltalk_Pattern + elif test $lrecord_type = lrecord_type_weak_list; then + pstruct data.c weak_list + elif test $lrecord_type = lrecord_type_window; then + pstruct window.c window + elif test $lrecord_type = lrecord_type_window_configuration; then + pstruct window.c window_config elif test "$type" = "null_pointer"; then echo "Lisp Object is a null pointer!!" else @@ -351,14 +350,8 @@ fi } -function pproc { - print *(`process.c`struct Lisp_Process*)$1 ; - ldp "(`process.c`struct Lisp_Process*)$1->name" ; - ldp "(`process.c`struct Lisp_Process*)$1->command" ; -} - dbxenv suppress_startup_message 4.0 -dbxenv mt_watchpoints on +# dbxenv mt_watchpoints on function dp_core { print ((struct x_frame *)(((struct frame*)(Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget->core diff -r 72a7cfa4a488 -r abe6d1db359e src/.gdbinit --- a/src/.gdbinit Mon Aug 13 11:33:40 2007 +0200 +++ b/src/.gdbinit Mon Aug 13 11:35:02 2007 +0200 @@ -48,12 +48,14 @@ set print union off set print pretty off +set $Lisp_Type_Int = -2 + define decode_object set $obj = (unsigned long) $arg0 if $obj & 1 # It's an int set $val = $obj >> 1 - set $type = Lisp_Type_Int + set $type = $Lisp_Type_Int else set $type = $obj & dbg_typemask if $type == Lisp_Type_Char @@ -65,9 +67,12 @@ end if $type == Lisp_Type_Record - set $lheader = (struct lrecord_header *) $val - set $imp = lrecord_implementations_table[$lheader->type] + set $lheader = ((struct lrecord_header *) $val) + set $lrecord_type = ($lheader->type) + set $imp = lrecord_implementations_table[$lrecord_type] else + set $lrecord_type = -1 + set $lheader = -1 set $imp = -1 end end @@ -85,30 +90,13 @@ define xtype decode_object $arg0 - if $type == Lisp_Type_Int + if $type == $Lisp_Type_Int echo int\n else if $type == Lisp_Type_Char echo char\n else - if $type == Lisp_Type_Symbol - echo symbol\n - else - if $type == Lisp_Type_String - echo string\n - else - if $type == Lisp_Type_Vector - echo vector\n - else - if $type == Lisp_Type_Cons - echo cons\n - else printf "record type: %s\n", $imp->name - # barf - end - end - end - end end end end @@ -240,15 +228,21 @@ # GDB's command language makes you want to ... -define pstruct - set $xstruct = (struct $arg0 *) $val - print $xstruct - print *$xstruct +define ptype + set $type_ptr = ($arg0 *) $val + print $type_ptr + print *$type_ptr +end + +define pstructtype + set $type_ptr = (struct $arg0 *) $val + print $type_ptr + print *$type_ptr end define pobj decode_object $arg0 - if $type == Lisp_Type_Int + if $type == $Lisp_Type_Int printf "Integer: %d\n", $val else if $type == Lisp_Type_Char @@ -258,152 +252,161 @@ printf "Char: %d\n", $val end else - if $type == Lisp_Type_String || $imp == &lrecord_string - pstruct Lisp_String + if $lrecord_type == lrecord_type_string + ptype Lisp_String else - if $type == Lisp_Type_Cons || $imp == &lrecord_cons - pstruct Lisp_Cons + if $lrecord_type == lrecord_type_cons + ptype Lisp_Cons else - if $type == Lisp_Type_Symbol || $imp == &lrecord_symbol - pstruct Lisp_Symbol - printf "Symbol name: %s\n", $xstruct->name->data + if $lrecord_type == lrecord_type_symbol + ptype Lisp_Symbol + printf "Symbol name: %s\n", $type_ptr->name->data else - if $type == Lisp_Type_Vector || $imp == &lrecord_vector - pstruct Lisp_Vector - printf "Vector of length %d\n", $xstruct->size - #print *($xstruct->data) @ $xstruct->size + if $lrecord_type == lrecord_type_vector + ptype Lisp_Vector + printf "Vector of length %d\n", $type_ptr->size + #print *($type_ptr->data) @ $type_ptr->size else - if $imp == &lrecord_bit_vector - pstruct Lisp_Bit_Vector + if $lrecord_type == lrecord_type_bit_vector + ptype Lisp_Bit_Vector else - if $imp == &lrecord_buffer - pstruct buffer + if $lrecord_type == lrecord_type_buffer + pstructtype buffer else - if $imp == &lrecord_char_table - pstruct Lisp_Char_Table + if $lrecord_type == lrecord_type_char_table + ptype Lisp_Char_Table else - if $imp == &lrecord_char_table_entry - pstruct Lisp_Char_Table_Entry + if $lrecord_type == lrecord_type_char_table_entry + ptype Lisp_Char_Table_Entry else - if $imp == &lrecord_charset - pstruct Lisp_Charset + if $lrecord_type == lrecord_type_charset + ptype Lisp_Charset + else + if $lrecord_type == lrecord_type_coding_system + ptype Lisp_Coding_System else - if $imp == &lrecord_coding_system - pstruct Lisp_Coding_System + if $lrecord_type == lrecord_type_color_instance + ptype Lisp_Color_Instance else - if $imp == &lrecord_color_instance - pstruct Lisp_Color_Instance + if $lrecord_type == lrecord_type_command_builder + ptype command_builder else - if $imp == &lrecord_command_builder - pstruct command_builder + if $lrecord_type == lrecord_type_compiled_function + ptype Lisp_Compiled_Function else - if $imp == &lrecord_compiled_function - pstruct Lisp_Compiled_Function + if $lrecord_type == lrecord_type_console + pstructtype console else - if $imp == &lrecord_console - pstruct console + if $lrecord_type == lrecord_type_database + ptype Lisp_Database else - if $imp == &lrecord_database - pstruct Lisp_Database + if $lrecord_type == lrecord_type_device + pstructtype device else - if $imp == &lrecord_device - pstruct device + if $lrecord_type == lrecord_type_event + ptype Lisp_Event else - if $imp == &lrecord_event - pstruct Lisp_Event + if $lrecord_type == lrecord_type_extent + pstructtype extent else - if $imp == &lrecord_extent - pstruct extent + if $lrecord_type == lrecord_type_extent_auxiliary + pstructtype extent_auxiliary else - if $imp == &lrecord_extent_auxiliary - pstruct extent_auxiliary + if $lrecord_type == lrecord_type_extent_info + pstructtype extent_info else - if $imp == &lrecord_extent_info - pstruct extent_info + if $lrecord_type == lrecord_type_face + ptype Lisp_Face else - if $imp == &lrecord_face - pstruct Lisp_Face + if $lrecord_type == lrecord_type_float + ptype Lisp_Float + else + if $lrecord_type == lrecord_type_font_instance + ptype Lisp_Font_Instance else - if $imp == &lrecord_float - pstruct Lisp_Float + if $lrecord_type == lrecord_type_frame + pstructtype frame else - if $imp == &lrecord_font_instance - pstruct Lisp_Font_Instance + if $lrecord_type == lrecord_type_glyph + ptype Lisp_Glyph else - if $imp == &lrecord_frame - pstruct frame + if $lrecord_type == lrecord_type_gui_item + ptype Lisp_Gui_Item else - if $imp == &lrecord_glyph - pstruct Lisp_Glyph + if $lrecord_type == lrecord_type_hash_table + ptype Lisp_Hash_Table else - if $imp == &lrecord_hash_table - pstruct Lisp_Hash_Table + if $lrecord_type == lrecord_type_image_instance + ptype Lisp_Image_Instance else - if $imp == &lrecord_image_instance - pstruct Lisp_Image_Instance + if $lrecord_type == lrecord_type_keymap + ptype Lisp_Keymap else - if $imp == &lrecord_keymap - pstruct Lisp_Keymap + if $lrecord_type == lrecord_type_lcrecord_list + pstructtype lcrecord_list else - if $imp == &lrecord_lcrecord_list - pstruct lcrecord_list + if $lrecord_type == lrecord_type_ldap + ptype Lisp_LDAP else - if $imp == &lrecord_lstream - pstruct lstream + if $lrecord_type == lrecord_type_lstream + pstructtype lstream else - if $imp == &lrecord_marker - pstruct Lisp_Marker + if $lrecord_type == lrecord_type_marker + ptype Lisp_Marker else - if $imp == &lrecord_opaque - pstruct Lisp_Opaque + if $lrecord_type == lrecord_type_opaque + ptype Lisp_Opaque else - if $imp == &lrecord_opaque_ptr - pstruct Lisp_Opaque_Ptr + if $lrecord_type == lrecord_type_opaque_ptr + ptype Lisp_Opaque_Ptr + else + if $lrecord_type == lrecord_type_popup_data + ptype popup_data else - if $imp == &lrecord_popup_data - pstruct popup_data + if $lrecord_type == lrecord_type_process + ptype Lisp_Process else - if $imp == &lrecord_process - pstruct Lisp_Process + if $lrecord_type == lrecord_type_range_table + ptype Lisp_Range_Table else - if $imp == &lrecord_range_table - pstruct Lisp_Range_Table + if $lrecord_type == lrecord_type_specifier + ptype Lisp_Specifier else - if $imp == &lrecord_specifier - pstruct Lisp_Specifier + if $lrecord_type == lrecord_type_subr + ptype Lisp_Subr else - if $imp == &lrecord_subr - pstruct Lisp_Subr + if $lrecord_type == lrecord_type_symbol_value_buffer_local + pstructtype symbol_value_buffer_local else - if $imp == &lrecord_symbol_value_buffer_local - pstruct symbol_value_buffer_local + if $lrecord_type == lrecord_type_symbol_value_forward + pstructtype symbol_value_forward else - if $imp == &lrecord_symbol_value_forward - pstruct symbol_value_forward + if $lrecord_type == lrecord_type_symbol_value_lisp_magic + pstructtype symbol_value_lisp_magic else - if $imp == &lrecord_symbol_value_lisp_magic - pstruct symbol_value_lisp_magic + if $lrecord_type == lrecord_type_symbol_value_varalias + pstructtype symbol_value_varalias else - if $imp == &lrecord_symbol_value_varalias - pstruct symbol_value_varalias + if $lrecord_type == lrecord_type_timeout + ptype Lisp_Timeout else - if $imp == &lrecord_toolbar_button - pstruct toolbar_button + if $lrecord_type == lrecord_type_toolbar_button + pstructtype toolbar_button else - if $imp == &lrecord_tooltalk_message - pstruct Lisp_Tooltalk_Message + if $lrecord_type == lrecord_type_tooltalk_message + ptype Lisp_Tooltalk_Message else - if $imp == &lrecord_tooltalk_pattern - pstruct Lisp_Tooltalk_Pattern + if $lrecord_type == lrecord_type_tooltalk_pattern + ptype Lisp_Tooltalk_Pattern else - if $imp == &lrecord_weak_list - pstruct weak_list + if $lrecord_type == lrecord_type_weak_list + pstructtype weak_list else - if $imp == &lrecord_window - pstruct window + if $lrecord_type == lrecord_type_window + pstructtype window else - if $imp == &lrecord_window_configuration - pstruct window_config + if $lrecord_type == lrecord_type_window_configuration + pstructtype window_config else echo Unknown Lisp Object type\n print $arg0 @@ -423,6 +426,8 @@ end end end + end + end # Repeat after me... gdb sux, gdb sux, gdb sux... end end @@ -460,6 +465,7 @@ end end end + end end document pobj diff -r 72a7cfa4a488 -r abe6d1db359e src/ChangeLog --- a/src/ChangeLog Mon Aug 13 11:33:40 2007 +0200 +++ b/src/ChangeLog Mon Aug 13 11:35:02 2007 +0200 @@ -1,3 +1,6022 @@ +2000-10-04 Martin Buchholz + + * XEmacs 21.2.36 is released. + +2000-08-31 Daiki Ueno + + * lread.c (locate_file): Check the path element is non-nil. + +2000-10-02 Martin Buchholz + + * lisp.h: Warning suppression for SCO compilers. + + * redisplay-tty.c (reset_tty_modes): Fix crash. + E.g. from xemacs running on X: (delete-device (make-device 'tty nil)) + +2000-09-27 Martin Buchholz + + Big signal/process handling overhaul. Bugs fixed: + M-x shell, type `sleep 10000', M-x comint-interrupt-subjob and + M-x comint-kill-subjob should work for both values nil and t of + process-connection-type. It was broken on most platforms. + Testing on Irix and Cygwin still needed. Other plaforms tested. + * sysdep.c: Move #include of stropts.h into sysproc.h. Use pid_t. + * process-unix.c: Signal/Process handling overhaul. + (pty_name): make 64 bytes, as `expect' does, for paranoia. + (allocate_pty): Use all available modern methods of allocating + ptys, falling back to old style BSD allocation as a last resort. + Use allegedly more secure Unix98 pty allocation by default. + (allocate_pty_the_old_fashioned_way): New. the last resort. + (unix_create_process): Push ptem, ldterm, ttcompat where + available. Autoconfiscate. + (try_to_initialize_subtty): New. + (unix_kill_child_process): Proper signal handling for ptys on most + platforms, using special knowledge of AIX, BSD, etc... + (unix_create_process): Always disconnect_controlling_terminal() for + subprocesses, whether using ptys or not. + * process.h: Remove old getpt-dependent PTY code. + * process.c (Fprocess_send_signal): New, obvious generic function. + (decode_signal): New. + (Finterrupt_process): + (Fkill_process): + (Fquit_process): + (Fstop_process): + (Fcontinue_process): + (Fsignal_process): Use decode_signal. + (process_send_signal): + Many docstring corrections. + Allow any signal to be sent to a process object. + * config.h.in: Add symbols for big signal/process overhaul. + * syssignal.h (EMACS_KILLPG): Use HAVE_KILLPG. Use `pid', not `gid'. + * sysproc.h: Include process-related headers, where available: + sys/stropts.h sys/strtio.h pty.h libutil.h + * s/irix4-0.h: + * s/irix5-0.h: + * s/cygwin32.h: + * s/gnu.h: + * s/linux.h: + * s/hpux.h: + * s/aix3-1.h: + Remove old S&M pty stuff. + * console-tty.c (tty_init_console): Use pid_t, not int, for pids. + * systty.h: Simplify cpp hackery, improve comments. + Favor BSD ioctl(TIOCGPGRP) over Posix tcgetpgrp(). + + * editfns.c (Fformat_time_string): + Be a little more paranoid with the return value of ctime. + + * fileio.c (check_executable): + (check_writable): + Use symbolic constants X_OK, W_OK. + + * console-x.c (split_up_display_spec): Fix a warning. + +2000-10-02 Martin Buchholz + + * gui-x.c (add_accel_and_to_external): strlen ==> XSTRING_LENGTH + * ntproc.c (sys_spawnve): make_string ==> build_string + Small clarity improvements. + +2000-09-30 Martin Buchholz + + * events.c (WRONG_EVENT_TYPE_FOR_PROPERTY): Warning removal. + + * s/windowsnt.h (HAVE_STRCASECMP): Remove. + + * config.h.in (HAVE_STRCASECMP): Remove. + +2000-09-29 Martin Buchholz + + * redisplay-output.c (redisplay_output_pixmap): + Cleaner and possibly more 64-bit correct code. + +2000-09-28 Stephen J. Turnbull + + * dumper.c (pdump_load_finish): move restoration of + `noninteractive1' to emacs.c (main_1). + * emacs.c (main_1): protect LISP-visible command-line flags + from pdump_load(). + +2000-09-26 Stephen J. Turnbull + + * Makefile.in.in (versionclean): Use EXE_TARGET and + DUMP_TARGET instead of literal program names. + +2000-09-20 Martin Buchholz + + * Makefile.in.in: Recent purify's require absolute paths for cache-dir. + +2000-09-19 Martin Buchholz + + * *: Spelling mega-patch + +2000-09-19 Martin Buchholz + + * fns.c (bad_bad_turtle): + Delete "Eek!" comment, since we fixed the bug to which it refers. + +2000-09-16 Martin Buchholz + + * alloca.c: Replace REGISTER with register. + +2000-09-16 Daiki Ueno + + * file-coding.c (ucs_to_char): Use countof. + +2000-09-16 Martin Buchholz + + * file-coding.c: (ucs_to_char): + (complex_vars_of_file_coding): + Use countof instead of sizeof. + Use CHECK_NATNUM instead of CHECK_INT. + + * sysdep.c (strcasecmp): Remove. + * device-x.c (ascii_strcasecmp): New. + * device-x.c (Fx_get_resource): Use ascii_strcasecmp. + Avoid using non-standard non-portable strcasecmp. + +2000-09-16 Martin Buchholz + + * Makefile.in.in (mostlyclean): remove reference to prefix-args. + * font-lock.c: remove reference to emacsfns.h. + * search.c: small doc improvement. + * event-Xt.c: correct file names in comments. + * console-x.h Correct file names in comments. + * frame.c: Correct file names in comments. + * event-stream.c: remove Energize from comments. + +2000-09-15 Martin Buchholz + + * symeval.h (DEFERROR_STANDARD): + (DEFERROR): + (DEFSYMBOL): + (DEFSYMBOL_NO_DUMP): + (DEFSYMBOL_MULTIWORD_PREDICATE): + (DEFSYMBOL_MULTIWORD_PREDICATE_NO_DUMP): + (DEFKEYWORD): + The construct &##name is not sensible C. + Fixes compilation errors with Unixware native compiler. + +2000-09-14 Martin Buchholz + + * frame.c (device_matches_console_spec): no longer takes a `frame' arg + (next_frame_internal): Removed. We now just have next_frame. + (next_frame): + Write a simpler and cleaner one-pass algorithm. + Remove called_from_delete_device arg and #ifdefed-out code. + (previous_frame): + Renamed from prev_frame. Update callers. + Cleaned up to have an analogous implementation to next_frame. + (other_visible_frames_internal): Remove the + called_from_delete_device bogus arg, and hence, remove this + function. Just use other_visible_frames(). + + * window.c (Fnext_window): + Prettify docstring. + Since next_frame() is guaranteed to return a frame, remove check + for nil inserted in previous patch. + (Fprevious_window): + Prettify docstring. + Make code look more like Fnext_window. + (window_loop): + Respect the `console' arg when iterating through windows. + Fixes bug: (get-buffer-window buffer t device) not respecting + the `device' arg. + This function needs more work, as others have pointed out. + + * frame.h: Rename prev_frame to previous_frame. + device_matches_console_spec no longer takes a `frame' arg. + + * s/gnu.h: + * s/linux.h: + * s/hpux.h: + Use EMACS_BLOCK_SIGNAL instead of sigblock. + From "Golubev I. N." . + + * make-src-depend: Fix typo. + +2000-09-13 Martin Buchholz + + * window.c (Fnext_window): + next_frame() might return nil, not a frame. + Fixes this crash: + (gdb) run -eval '(progn (make-device (quote x) "polgar:0") (next-window (minibuffer-window) t (quote visible) (second (device-list))))' + + * frame.c (next_frame_internal): + We've passed a frame if we've passed its device. + Fixes this crash: + (gdb) run -eval '(progn (make-frame nil (make-device (quote x) "polgar:0")) (next-window (minibuffer-window) t (quote visible) (second (device-list))))' +Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245, RECORD_TYPEP (obj, lrecord_type_frame) + +2000-09-11 Jonathan Harris + + * menubar-msw.c (mswindows_translate_menu_or_dialog_item): + Allow option to suppress accelerators in menu/dialog items. + (populate_or_checksum_helper): Pass dialog title through above. + +2000-09-10 Jonathan Harris + + * event-msw.c (mswindows_key_to_emacs_keysym): + Add "pause" key, fix "menu" key. + +2000-09-09 Martin Buchholz + + * eval.c (reinit_vars_of_eval): + Increase max_lisp_eval_depth to 1000, + required for thai-xtis.el to byte-compile under some circumstances. + +2000-09-04 Martin Buchholz + + * event-Xt.c (x_to_emacs_keysym): Increase size of `buffer' to 513. + From Kenichi Handa. + +2000-09-01 Martin Buchholz + + * make-src-depend: Make the generated Makefiles smaller. + + * s/hpux.h (SETUP_SLAVE_PTY): + Provide a %d in the format string for the errno argument. + + * editfns.c (Ftemp_directory): + Warning fix. + Avoid buffer overrun on very long file name. + + * input-method-xlib.c (XIM_init_device): + 6th parameter of XRegisterIMInstantiateCallback has different + pointer types on different OSes, so simply cast to (void *). + + * unexhp9k800.c: Warning fixes. Fiddly changes. + + * sysdll.c (dll_open): + shl_load will hang hard if passed a NULL filename. + Simply return NULL for compatibility with dlopen. + * sysdll.c: Conform to XEmacs coding standards. + + * sysdep.c (get_pty_max_bytes): + Support pty input lines longer than 512 bytes on HP-UX 10.20. + +2000-08-31 Martin Buchholz + + * tooltalk.c: Add #include + +2000-08-12 Alexandre Oliva + + * s/hpux.h: Don't use undefined function sigunblock(). + +2000-08-31 Martin Buchholz + + * config.h.in: Add HAVE_BALLOON_HELP. + * emacs.c: Use HAVE_BALLOON_HELP. + * Makefile.in.in (x_objs): + Make Balloon Help conditional on finding shape.h. + +2000-08-23 Yoshiki Hayashi + + * syntax.c (regex_emacs_buffer_p): New variable. + * syntax.h (regex_emacs_buffer_p): extern. + * search.c (looking_at_1): + (string_match_1): + (fast_string_match): + (search_buffer): Set regex_emacs_buffer_p. + * regex.c (re_match_2_internal): Reference regex_emacs_buffer_p + when before_dot, at_dot, after_dot. + +2000-08-23 Andy Piper + + * gui-x.c (popup_selection_callback): Only set action_occurred + when we really have an image instance. + * gui-msw.c (mswindows_handle_gui_wm_command): ditto. + +2000-08-23 Andy Piper + + * gui-msw.c (mswindows_handle_gui_wm_command): set + action_occurred. + * gui-x.c (popup_selection_callback): ditto. + + * glyphs.h (IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED): new accessor. + (XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED): ditto. + (struct Lisp_Image_Instance): add action_occurred flag. + + * glyphs.c (redisplay_subwindow): use action_occurred flag. + (image_instance_changed): ditto. + (reset_frame_subwindow_instance_cache): only unmap windows - do + not remove them from the cache also. + + * glyphs-widget.c (tab_control_update): better debug. + (progress_gauge_update): ditto. + (layout_update): ditto. + (layout_instantiate): ditto. + (tab_control_order_only_changed): cope with null pending items. + + * glyphs-msw.c (mswindows_tab_control_redisplay): add better + debug. Force selection of an item when an action occurred. Cope + with null pending_items. + (mswindows_progress_gauge_redisplay): better debug. + * glyphs-x.c (x_tab_control_redisplay): ditto. + + * redisplay.c (redisplay_frame): reset the frame cache if the + frame is garbaged. + + * window.c (Fset_window_configuration): potentially re-enable + frame cache reset. + (window_unmap_subwindows): need to finalize instances here since + it is only used in mark_window_as_deleted. + +2000-08-22 Stephen J. Turnbull + + * nas.c (SndOpenDataForReading): + nas.c (WaveOpenDataForReading): + nas.c (readChunk): {BIG,LITTLE}_ENDIAN -> NAS_{BIG,LITTLE}_ENDIAN. + Somehow escaped from the 2000-08-14 patch. + +2000-08-14 Stephen J. Turnbull + + * nas.c: Preprocessor trickery to use NAS_LITTLE_ENDIAN instead + of LITTLE_ENDIAN (conflicts with glibc, at least) in NAS <= 1.2p5. + +2000-08-21 Andy Piper + + * glyphs-x.c (x_map_subwindow): Minor optimization - only map the + window if it is not already displayed. + + * glyphs-msw.c (mswindows_map_subwindow): only map the window if + it is not already displayed. + + * window.c (Fset_window_configuration): don't reset the frame + cache. + + * glyphs.c (unmap_subwindow_instance_cache_mapper): only remove + instances from the frame cache if we are actually finalizing them. + (reset_frame_subwindow_instance_cache): reset frame cache only + after unmapping everything. + (map_subwindow): set displayed flag after mapping. + +2000-08-21 Martin Buchholz + + * data.c (indirect_function): + Rename ERRORP to non-misleading VOID_FUNCTION_ERRORP. + + * eval.c (function_argcount): + Use original function when signaling errors. + +2000-08-18 Andy Piper + + * frame.c (delete_frame_internal): use new + free_frame_subwindow_instances name. + + * glyphs-msw.c (mswindows_tab_control_instantiate): verify index. + (add_tab_item): make return type correct. + (mswindows_tab_control_instantiate): assert index of tab. + (mswindows_tab_control_redisplay): Re-code to use + gui_item_equal_sans_selected and gui_item_list_find_selected. + + * glyphs-widget.c (tab_control_update): Correct comment. + + * window.c (window_unmap_subwindows): use new + unmap_subwindow_instance_cache_mapper. + (window_unmap_subwindows_cache_mapper): deleted. + (Fset_window_configuration): comparisons should now be with + EQ. Preserve the subwindow instance cache across configuration + changes. + (allocate_window): ditto. + (make_dummy_parent): ditto. + + * glyphs.c (free_frame_subwindow_instances): rename from + free_frame_subwindow_instance_cache. finalize all instances rather + than just those in the display cache. + (finalize_all_subwindow_instances): walk windows unmapping and + finalizing subwindows. + (unmap_subwindow_instance_cache_mapper): moved from + window.c. Allow finalization as well as unmapping. + + * gui.c (gui_item_list_find_selected): new function. + + * gui.h (gui_item_list_find_selected): declare. + + * glyphs-x.c (x_tab_control_redisplay): pick tab + explicitly. Re-code to use gui_item_equal_sans_selected and + gui_item_list_find_selected. + + * glyphs-x.h: add lwlib-utils.h + + * buffer.c (Frecord_buffer): undo previous change. + +2000-08-09 Vin Shelton + + * config.h.in, s/gnu.h, s/hpux.h, s/linux.h: Use UNIX98 PTYs if + possible. Create temporary files more securely. The patch was + generated by Torsten Duwe , Florian Weimer + and Olaf Kirch. See + http://www.xemacs.org/list-archives/xemacs-patches/200007/msg00123.html + for details. + +2000-08-07 Ben Wing + + * getloadavg.c: remove duplicate (and windows-breaking) + includes of fcntl.h and sys/file.h. + + * nt.c: remove duplicate getloadavg() definition. + + * sysdll.h (Qdll_filename_encoding): add missing stand-in + encodings. + +2000-08-07 Gunnar Evermann + + * eval.c (function_argcount): If function needs to be autoloaded + actually use the loaded definition. + GCPRO function. + +2000-08-05 Ben Wing + + * getloadavg.c: add prototype for getloadavg(). remove + duplicate WIN32_NATIVE/CYGWIN code (already in the middle + of the code). remove duplicate header includes. + + * s\cygwin32.h, s\mingw32.h: remove stray NO_ARG_ARRAY. + + * s\cygwin32.h, s\mingw32.h, m\windowsnt.h: + don't define LOAD_AVE_TYPE/LOAD_AVE_CVT because we have no + useful load average. + + * alloc.c (reinit_alloc_once_early): removed references to + VIRT_ADDR_VARIES, malloc_sbrk_used/free, and data-bytes-used/free. + the lisp vars are the only things referencing the malloc_sbrk_* + vars, and they were already if 0'd out. these vars only exist + in the older malloc.c, which is basically unused, and they're + only for informational purposes. + + * m\*.h: removed useless VIRT_ADDR_VARIES. + + * m\powerpc.h: removed stray NO_ARG_ARRAY. + +2000-04-26 IKEYAMA Tomonori + + * redisplay-msw.c (mswindows_output_dibitmap): Set foreground + color if the image is a mono pixmap. + +2000-07-30 Ben Wing + + * Makefile.in.in (release): + Remove stray @. + + * buffer.c (directory_is_current_directory): + * dired-msw.c (mswindows_get_files): + * dired.c: + * dired.c (Fdirectory_files): + * dired.c (file_name_completion_stat): + * dired.c (Ffile_attributes): + [[[[1]]]]: Rename stat() -> xemacs_stat() and eliminate nasty + preprocessor tricks, to avoid problems on some machines + (e.g. SCO). + + * callproc.c (egetenv): GC docs. + + * console-msw.h: + * console-msw.h (struct mswindows_dialog_id): + * lrecord.h (lrecord_type): + New object for use with MSW dialogs. + + * console.h (struct console_methods): + New enable/disable frame methods, for proper modal dialogs. + + * device-msw.c (msprinter_default_printer): Fix to follow + proper Mule conventions. + + * device-msw.c: + * device-msw.c (signal_open_printer_error): + * device-msw.c (msprinter_init_device): + * device-msw.c (ensure_not_printing): + * device-msw.c (plist_get_margin): + * device-msw.c (Fmsprinter_select_settings): + * device-msw.c (finalize_devmode): + * device-msw.c (Fmsprinter_settings_despecialize): + * device-msw.c (signal_enum_priner_error): + * extents.c (decode_extent): + * extents.c (decode_map_extents_flags): + * extents.c (decode_extent_at_flag): + * extents.c (Fextent_at): + * extents.c (Fextents_at): + * extents.c (symbol_to_glyph_layout): + [[[[2]]]] Use structured errors. + + * dialog-msw.c: + * dialog-msw.c (mswindows_is_dialog_msg): + * dialog-msw.c (mark_mswindows_dialog_id): + * dialog-msw.c (dialog_proc): + * dialog-msw.c (handle_question_dialog_box): + * dialog-msw.c (syms_of_dialog_mswindows): + Define new object to clean up marking; use it as a dialog identifier. + Call new delete-dialog-box-hook. + + * dialog-x.c (dbox_selection_callback): + * dialog-x.c (dbox_descriptor_to_widget_value): + * dialog-x.c (x_make_dialog_box_internal): + Call new delete-dialog-box-hook. + Return an id. + + * dialog.c: + * dialog.c (syms_of_dialog): + * dialog.c (vars_of_dialog): + Define new delete-dialog-box-hook, for use w/modal dialog boxes. + + * eval.c: + * eval.c (signal_call_debugger): + when noninteractive, output stack traces on the console instead + of in a (never-seen) buffer. + + * eval.c (signal_type_error): + * eval.c (invalid_argument_2): + * lisp.h: + new funs for use w/structured errors. + + * event-Xt.c: + * event-Xt.c (x_to_emacs_keysym): + * event-Xt.c (describe_event): + * event-Xt.c (emacs_Xt_event_handler): + * event-Xt.c (vars_of_event_Xt): + * event-msw.c: + * event-msw.c (mswindows_wnd_proc): + * event-msw.c (vars_of_event_mswindows): + rename {x,mswindows}-debug-events to debug-{}-events for + consistency with other debug-foo variables. + + * event-stream.c: + document next-event more clearly. + + * fileio.c (Ffile_name_directory): + * fileio.c (Ffile_name_nondirectory): + * fileio.c (Funhandled_file_name_directory): + * fileio.c (file_name_as_directory): + * fileio.c (Ffile_name_as_directory): + * fileio.c (directory_file_name): + * fileio.c (Fdirectory_file_name): + * fileio.c (Fmake_temp_name): + * fileio.c (Ffile_truename): + * fileio.c (Fsubstitute_in_file_name): + * fileio.c (expand_and_dir_to_file): + * fileio.c (barf_or_query_if_file_exists): + * fileio.c (check_executable): + * fileio.c (Ffile_exists_p): + * fileio.c (Ffile_writable_p): + * fileio.c (Ffile_directory_p): + * fileio.c (Ffile_regular_p): + * fileio.c (Ffile_modes): + * fileio.c (Ffile_newer_than_file_p): + * fileio.c (Fverify_visited_file_modtime): + * fileio.c (Fset_visited_file_modtime): + * fileio.c (auto_save_1): + (1). (2). + fix up gcpro's. + + * frame-msw.c: + * frame-msw.c (mswindows_init_frame_1): + * frame-msw.c (mswindows_enable_frame): + * frame-msw.c (error_frame_unsizable): + * frame-msw.c (msprinter_init_frame_1): + * frame-msw.c (msprinter_init_frame_3): + * frame-msw.c (console_type_create_frame_mswindows): + (2). + implement new enable/disable frame methods. + + * frame-x.c: + * frame-x.c (x_enable_frame): + * frame-x.c (console_type_create_frame_x): + implement new enable/disable frame methods. + + * frame.c: + * frame.c (Fdisable_frame): + * frame.c (syms_of_frame): + * frame.h (struct frame): + implement new enable/disable frame methods/functions. + + * general-slots.h: + add initial-focus. + + * glyphs-msw.c (mswindows_widget_instantiate): + comment that initial-focus should be implemented. + + * glyphs-widget.c: + * glyphs-widget.c (check_valid_instantiator): + * glyphs-widget.c (check_valid_orientation): + * glyphs-widget.c (check_valid_tab_orientation): + * glyphs-widget.c (check_valid_justification): + * glyphs-widget.c (check_valid_border): + * glyphs-widget.c (check_valid_callback): + * glyphs-widget.c (check_valid_int_or_function): + * glyphs-widget.c (check_valid_string_or_vector): + * glyphs-widget.c (check_valid_item_list_1): + * glyphs-widget.c (widget_validate): + * glyphs-widget.c (combo_box_validate): + * glyphs-widget.c (widget_instantiate): + * glyphs-widget.c (syms_of_glyphs_widget): + * glyphs-widget.c (VALID_WIDGET_KEYWORDS): + * glyphs-widget.c (image_instantiator_combo_box): + * glyphs-widget.c (image_instantiator_scrollbar): + * glyphs-widget.c (image_instantiator_tab_control): + * glyphs-widget.c (VALID_LAYOUT_KEYWORDS): + (2). + support (unimplemented) keyword initial-focus. + reindent long macros. + + * glyphs-x.c (x_redisplay_widget): + * glyphs-x.c (x_button_instantiate): + * glyphs-x.c (x_button_redisplay): + * glyphs-x.c (x_progress_gauge_instantiate): + * glyphs-x.c (x_edit_field_instantiate): + * glyphs-x.c (x_combo_box_instantiate): + * glyphs-x.c (x_tab_control_instantiate): + * glyphs-x.c (x_label_instantiate): + * gui-x.c: + * gui-x.c (button_item_to_widget_value): + * gui-x.c (gui_items_to_widget_values_1): + * gui-x.c (gui_item_children_to_widget_values): + * gui-x.c (gui_items_to_widget_values): + * gui-x.h: + * menubar-x.c (menu_item_descriptor_to_widget_value_1): + add new flag to gui-parsing routines to indicate whether + accelerator specs should be supported. + + * glyphs.c (syms_of_glyphs): use DEFSYMBOL. + + * glyphs.h (struct Lisp_Image_Instance): + * glyphs.h (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS): + add initial-focus flag. + + * gui.c: + * gui.c (syms_of_gui): + * gui.c (vars_of_gui): + clean up menu-no-selection-hook. + + * gui.h: + support delete-dialog-box-hook. + + * lread.c (Fload_internal): + * lread.c (locate_file_in_directory_mapper): + (1). + + * lrecord.h: + * lrecord.h (struct toolbar_button): + * lrecord.h (syms_of_toolbar): + document how to create a new object. + + * menubar-msw.c (mswindows_char_is_accelerator): + may be called on frames w/o menus. + + * menubar.c (vars_of_menubar): + clean up :filter docs. + + * nt.c (readdir): + * ntproc.c: + (1). + + * process-nt.c: + * process-nt.c (validate_signal_number): + * process-nt.c (signal_cannot_launch): + * process-nt.c (nt_create_process): + * process-nt.c (nt_send_process): + * process-nt.c (nt_kill_child_process): + * process-nt.c (nt_open_network_stream): + * process-nt.c (syms_of_process_nt): + (2). + delete quote-handling. call new lisp code that does it better. + + * process-unix.c (connect_to_file_descriptor): + * process-unix.c (allocate_pty): + * process-unix.c (unix_send_process): + * process-unix.c (unix_kill_child_process): + * process-unix.c (unix_open_network_stream): + * process-unix.c (unix_open_multicast_group): + (1). (2). + + * process.c: + * process.c (Fstart_process_internal): + (2). need to canonicalize process path even if absolute. + + * select-msw.c (symbol_to_ms_cf): + * select-msw.c (ms_cf_to_symbol): + * select-msw.c (cf_is_autofreed): + * select-msw.c (mswindows_destroy_selection): + * select.c: + * select.c (syms_of_select): + * select.h: + support dibv5, fix bugs. (from Mike Alexander) + + * select.c (Fget_selection_internal): + * select.c (select_convert_out): + + * sysdep.c: + * sysdep.c (xemacs_stat): + renamed. + + * sysdep.c (mkdir): + * sysdep.c (rmdir): + but keep original stat() here because we provide encapsulation + around these funs. + + * sysfile.h: + * sysfile.h (fstat): + remove stat garbage. + + * syswindows.h: + fix X/MSW conflict. + don't include tchar.h. it's inappropriate because it makes + compile-time distinctions when we want runtime distinctions. + (we provide our own tchar replacements) + + * toolbar.c: + use default object printer for toolbar-button. + + * unexcw.c: + make sure we don't encapsulate. + + * window.c (vars_of_window): + emphasize that temp-buffer-show-hook is obsolete. + +2000-08-05 Martin Buchholz + + * glyphs.c (image_instance_hash): HASH2 wants EMACS_INT args. + (Fimage_instance_subwindow_id): make_int wants EMACS_INT arg. + + * events.c (Fevent_timestamp_lessp): + Not 64-bit clean. Use EMACS_INT, not int. + +2000-06-05 Andrew Begel + + * lrecord.h (lrecord_types): Changed lrecord_type_count to an + unsigned int and changed the last enum to + lrecord_type_last_built_in_type. + (lrecord_implementations_table): changed prototype to know how + long the array is supposed to be. + (lrecord_type_count): new unsigned int to keep track of the + current number of lisp lrecord types. + (DEFINE_EXTERNAL_LRECORD): + (DECLARE_EXTERNAL_LRECORD): Added these two for external + dynamic-modules to declare new lisp types. They are the same + as the non-EXTERNAL forms, but declare an lrecord_type unsigned + int for each new type, and increment lrecord_type_count by 1. + + * alloc.c (lrecord_implementations_table): Changed to reference + lrecord_type_last_built_in_type for the size of the array. + Moved MODULE_DEFINABLE_TYPE_COUNT to lrecord.h. + +2000-08-03 Yoshiki Hayashi + + * glyphs.h (check_valid_item_list): Renamed from + check_valid_item_list_1. + +2000-08-01 Alastair J. Houghton + + * select.c (Qselect_coerce): New. + * select.c (Vselection_coercion_alist): New. + * select.c (syms_of_select): Declare. + * select.c (get-selection-internal): Use it. + Use the new select-coerce functionality. + + * select.c (select_coerce): New. + * select.h (select_coerce): Declare. + New function to coerce one type of data into another. + +2000-08-03 Martin Buchholz + + * callproc.c (Fcall_process_internal): + (Fcall_process_internal): + * process-unix.c (unix_create_process): + Save and restore the value of errno, so that error messages are accurate. + +2000-08-01 Martin Buchholz + + * elhash.c (print_hash_table): + Fix printing of hash tables to also use `key-and-value' instead of `t'. + Prettify docstrings and indentation. + +2000-07-31 Yoshiki Hayashi + + * window.c (Fwindow_pixel_edges): Subtract frame border and + gutter size. + +2000-07-31 Andy Piper + + * buffer.c (Frecord_buffer): make absolutely sure that redisplay + will acknowledge the change. + + * glyphs.h: declare tab_control_order_only_changed. + + * glyphs-x.c (x_tab_control_redisplay): use + tab_control_order_only_changed. + + * glyphs-widget.c (tab_control_order_only_changed): new function. + + * glyphs-msw.c (mswindows_tab_control_redisplay): use + tab_control_order_only_changed. + + * gui.c (gui_item_equal_sans_selected): new function. + (gui_item_equal): use it. + + * glyphs-msw.c (mswindows_combo_box_instantiate): deprecate + :properties in favor of :items.. + + * glyphs-widget.c (check_valid_item_list): rename from + check_valid_item_list_1. + (check_valid_item_list_1): renamed. + (combo_box_validate): deprecate :properties in favor of :items. + (widget_instantiate): ditto. + (tab_control_update): ditto. + (image_instantiator_combo_box): ditto. + (image_instantiator_tree_view): ditto. + (image_instantiator_tab_control): ditto. + (layout_post_instantiate): remove dead code. + + * print.c (debug_print_no_newline): only write to debugger if in + WIN32_NATIVE. + + * elhash.c (Fmake_hash_table): update doc string. + + * event-msw.c (mswindows_wnd_proc): don't allow processing of + messages whilst in GC. This at least stops XEmacs crashing but has + the potential for wierd behaviour. + +2000-07-31 Martin Buchholz + + * config.h.in: + Make existence of s&m files optional. + + * s/bsd386.h: Remove HAVE_GETLOADAVG. + * s/freebsd.h: Remove HAVE_GETLOADAVG. + * s/gnu.h: Remove HAVE_GETLOADAVG. + * s/netbsd.h: Remove HAVE_GETLOADAVG. + * s/sol2.h: Remove HAVE_GETLOADAVG. + * lisp.h: Remove getloadavg() declaration. + * fns.c: + Include if available. + Don't declare our own getloadavg() if HAVE_GETLOADAVG. + * config.h.in: Group together getloadavg()-related macros. + Use only configure-time tests to detect getloadavg(). + +2000-07-30 Martin Buchholz + + * Makefile.in.in (TransientEmacsShell.o): Fix race condition. + +2000-07-25 Andy Piper + + * syswindows.h: add tchar.h for native builds. + + * frame.c (syms_of_frame): remove set-glyph-image. + + * general-slots.h: add Qset_glyph_image. + + * glyphs-widget.c (layout_update): add domain arg to + set-glyph-image. + (syms_of_glyphs_widget): remove set-glyph-image. + +2000-07-23 Ben Wing + + * dialog-msw.c (vars_of_dialog_mswindows): need to staticpro + Vpopup_frame_list. + +2000-07-22 Andy Piper + + * symsinit.h: add syms_of_win32(). + + * gui-msw.c (syms_of_gui_mswindows): remove + Fmswindows_shell_execute. + (Fmswindows_shell_execute): moved to win32.c. + + * emacs.c (main_1): add syms_of_win32 (). + + * win32.c (init_potentially_nonexistent_functions): rewrite in + compiler-friendly terms. + (Fmswindows_shell_execute): move here from gui-msw.c. + (syms_of_win32): new. + + * device-msw.c (Fmswindows_printer_list): clean up args to + EnumPrinters. + Don't include tchar under cygwin or mingw. + (msprinter_default_printer): make cygwin-friendly. + +2000-07-21 Andy Piper + + * glyphs-widget.c (image_instantiator_tree_view): use tab + control's update function. + (layout_property): new function. Retrieve items. + + * glyphs-msw.c (mswindows_tree_view_redisplay): new + function. Re-populate the tree view from the pending items. + + * glyphs.c (instantiate_image_instantiator): Make sure the domain + is designated the parent if the domain is an image instance. This + is needed so that dirtiness can be cascade up the hierarchy and + thus for layout children to be redisplayed correctly. + (allocate_image_instance): rename glyph -> parent. + + * redisplay.h: change redisplay_output_layout signature. + + * redisplay-msw.c (mswindows_output_display_block): use domain + arg. + + * redisplay-x.c (x_output_display_block): use domain arg. + +2000-07-10 Andy Piper + + * window.c (Fset_window_configuration): add comment. + + * redisplay-output.c (compare_runes): + (redisplay_output_subwindow): redisplay rather than update subwindow. + (redisplay_output_layout): ditto. + + * redisplay-msw.c (mswindows_frame_output_end): + (mswindows_frame_output_end): make defer window pos optional. + + * lisp.h: add Flast. + + * glyphs.h (struct image_instantiator_methods): add dest_mask top + normalize method. Change update method to be for changed + instantiators. Add redisplay method. Change signature of layout + method. + (struct Lisp_Image_Instance): add instantiator. + (IMAGE_INSTANCE_INSTANTIATOR): new. + (IMAGE_INSTANCE_SUBWINDOW_FACE): new. + (XIMAGE_INSTANCE_INSTANTIATOR): new. + (XIMAGE_INSTANCE_SUBWINDOW_FACE): new. + + * glyphs.c: + (find_instantiator_differences): new function. + (Fset_instantiator_property): new convenience function. + (check_image_instance_structure): strictly check for vector + instantiators. + (normalize_image_instantiator): make non-static. + (instantiate_image_instantiator): pass on dest_mask and use new + signatures for image_instance_layout and friends. + (mark_image_instance): mark the instantiator. Mark the subwindow + face not the widget face. + (image_instance_equal): add instantiator. + (image_instance_hash): ditto. + (allocate_image_instance): ditto. + (Fset_image_instance_property): removed. + (Fimage_instance_file_name): ditto. + (Fcolorize_image_instance): ditto. + (image_instance_layout): add offsets to be set. + (update_image_instance): new function. update an image instance + from its changed instantiator. + (inherit_normalize): add dest_mask. + (xbm_normalize): ditto. + (xface_normalize): ditto. + (xpm_normalize): ditto. + (text_update): set_property -> update. + (image_instantiate): use the glyph identity as a hash key, not the + instantiator. + (glyph_width): use new image_instance_layout signature. + (glyph_ascent): ditto. + (glyph_descent): ditto. + (glyph_height): ditto. + (glyph_query_geometry): ressurrect. + (glyph_layout): ditto. + (redisplay_subwindow): update -> redisplay. + (syms_of_glyphs): add Fset_instantiator_property. + (image_instantiator_format_create): set_property -> update. + + * glyphs-x.c: + (autodetect_normalize): add dest_maks to signature. + (x_redisplay_subwindow): update -> redisplay. + (x_redisplay_widget): ditto. + (x_button_redisplay): ditto. + (x_progress_gauge_redisplay): ditto. + (x_tab_control_redisplay): ditto. Rewrite to cope with changed + stacking order. + (console_type_create_glyphs_x): update -> redisplay. + (image_instantiator_format_create_glyphs_x): ditto. + + * glyphs-widget.c: + (check_valid_instantiator): disallow glyphs in the instantiator, + they must now be vectors. + (check_valid_instantiator_list): ditto. + (glyph_instantiator_to_glyph): use internal symbol rather than + intern. + (widget_update): renamed from widget_set_property. Call cascaded + update methods. + (redisplay_widget): renamed from update_widget. + (widget_layout): image_instance_layout now takes position as well + as size. + (widget_normalize): ditto. + (widget_instantiate): ditto. + (tab_control_query_geometry) ditto.: + (tab_control_update): renamed from tab_control_set_property. + (progress_gauge_update): set_property -> update. + (layout_normalize): rewrite so that child instantiators are + normalized also. + (layout_update): new function. Create glyphs from the normalized + children and cope with any other layout keywords. We do not + instantiate children here that will be take care of by + redisplay_output_layout. + (layout_instantiate): call layout_update and not much else. + (layout_post_instantiate): not sure whether this is needed + anymore. + (layout_query_geometry): query glyph geometry rather than + image_instance geometry. + (layout_layout): set offsets from pass in parameters. Use glyph + geometry and layout functions rather than image instance ones. + (native_layout_layout): ditto. + (syms_of_glyphs_widget): add make-glyph and set-glyph-image. + (image_instantiator_widget): set_property -> update. + (image_instantiator_buttons): ditto. + (image_instantiator_progress_guage): ditto. + (image_instantiator_tab_control): ditto. + (VALID_LAYOUT_KEYWORDS): instantiators must now be vectors. + (image_instantiator_layout): add update method. + + * glyphs-msw.c (bmp_normalize): + (mswindows_resource_normalize): add dest_mask so that it can be + proprogated by layout_normalize. + (begin_defer_window_pos): make optional because it may not be the + right thing to do and it introduces differences with X. + (mswindows_unmap_subwindow): ditto. + (mswindows_map_subwindow): ditto. + (mswindows_redisplay_subwindow): renamed from + mswindows_update_subwindow. + (mswindows_redisplay_widget): ditto. + (mswindows_button_redisplay): renamed from + mswindows_button_update. Update is now what the instantiation + function does for a changed instantiator. + (mswindows_progress_gauge_instantiate): set the progress value + here if appropriate. + (mswindows_tab_control_redisplay): cope with re-ordering of the + members of the tab widget by simply selecting the new top + widget. This makes things appear ok if you click on a tab. + (mswindows_combo_box_instantiate): image_instance_layout now takes + position as well as size. + (mswindows_progress_gauge_redisplay): renamed from + mswindows_progress_gauge_update. + (console_type_create_glyphs_mswindows): fix update -> redisplay. + (image_instantiator_format_create_glyphs_mswindows): ditto. + + * glyphs-eimage.c (jpeg_normalize): + (gif_normalize): + (png_normalize): + (tiff_normalize): add dest_mask so that it can be proprogated by + layout_normalize. + + * elhash.c: + (print_hash_table): + (hash_table_weakness_validate): + (decode_hash_table_weakness): + (Fhash_table_weakness): + (Fhash_table_type): + (syms_of_elhash): use Ben's naming scheme for hashtable types.. + + * console.h (struct console_methods): move update_* to + redisplay_*. + +2000-07-20 Ben Wing + + * *.[ch] (XSETOBJ): remove unused middle argument. + lisp-disunion.h: correct wrap_object() to one argument. + +2000-07-15 Ben Wing + + * s/cygwin32.h: + * s/cygwin32.h (CYGWIN_CONV_PATH): + Add missing logb prototype for v1.1. + Use post-b20 names and alias to pre-b20 names when pre-b20. + + * s/windowsnt.h: [5]. + +2000-07-15 Ben Wing + + * Makefile.in.in (x_objs): + * Makefile.in.in (sheap_objs): + * Makefile.in.in (objs): + added win32.o, cosmetic cleanups. + + * alloc.c (Fmake_byte_code): + [[[1]]]: Changes for new LIST_LOOP, EXTERNAL_LIST_LOOP, + etc. macros which declare their own args now. + + * alloc.c (syms_of_alloc): + [[[2]]]: Use DEFSYMBOL, DEFKEYWORD, DEFERROR and friends. + + * buffer.c: + Moved buffer-dedicated-frame, set-buffer-dedicated-frame into lisp. + + * buffer.c (Fget_file_buffer): + Fixed GCPRO problem. + + * buffer.c (get_truename_buffer): + Fixed comment about GC checking. + + * buffer.c (syms_of_buffer): + Undeclared those dedicated frame funs. + [2]. + + * buffer.h: + Define convenience macros for internal/external conversions. + [[[3]]]: Define codesys aliases Qcommand_argument_encoding + and Qenvironment_variable_encoding for cleaner code. + + * bufslots.h: + Remove dedicated-frame; in lisp. + + * bytecode.c (funcall_compiled_function): + [1]. + + * bytecode.c (syms_of_bytecode): + [2]. + + * console-msw.c: + * console-msw.c (mswindows_show_console): Rewrote. + + * console-msw.c (Fmswindows_debugging_output): New. + Sends to OutputDebugString (special MSWin debugger interface). + + * console-msw.c (Fmswindows_message_box): + Fixed stupid bugs so it works when called from kill-emacs. + + * console-msw.c (syms_of_console_mswindows): + Declare Fmswindows_debugging_output. + + * console-msw.h: + New MSWin prototypes. + + * console-msw.h (struct mswindows_frame): + New entry last-click-mods for improved button-modifier support. + + * console-msw.h (FRAME_MSWINDOWS_POPUP): + New struct entry `popup' with corresponding accessor. + + * console-x.c: + * console-x.c (split_up_display_spec): + * console-x.c (get_display_arg_connection): + * console-x.c (x_semi_canonicalize_console_connection): + * console-x.c (x_canonicalize_device_connection): + [[[6]]]: Change char to more specific type. + [[[8]]]: Make use of abstracting codesys aliases defined in [3], [4]; + + * console-x.c (x_semi_canonicalize_console_connection): + * console-x.c (x_canonicalize_device_connection): + [[[9]]]: Fix up error signalling to use new structured error system. + + * console-x.h: + [[[4]]]: Define codesys aliases: + Qlwlib_encoding, Qx_atom_name_encoding, Qx_font_name_encoding, + Qx_color_name_encoding, Qx_display_name_encoding. + + * console.h (struct console_methods): + New method make_dialog_box_internal supersedes older + popup_dialog_box method. + + * data.c: + Define many new errors, part of new structured errors. + + * data.c (init_errors_once_early): + * data.c (syms_of_data): + [2]. + + * device-msw.c (mswindows_init_device): + [[[5]]]: Cleanup to support NT 3.51. + + * device-msw.c (decode_devmode): Cleanup. + + * device-msw.c (mswindows_handle_print_setup_dialog_box): + * device-msw.c (mswindows_handle_print_dialog_box): + * device-msw.c (mswindows_handle_page_setup_dialog_box): + * device-msw.c (syms_of_device_mswindows): + Delete the dialog box primitives recently introduced by Kirill and + instead interface to general dialog box interface. + + * device-x.c: + * device-x.c (compute_x_app_name): + * device-x.c (x_init_device): + * device-x.c (Fx_valid_keysym_name_p): + * device-x.c (Fx_set_font_path): + [6]. + [7]. + + * device.h (wrap_device): New. + First of its kind; meant to replace XSETDEVICE. + + * dialog-msw.c: Many file-dialog symbols. + + * dialog-msw.c (mswindows_register_popup_frame): New. + * dialog-msw.c (mswindows_is_dialog_msg): New. + For supporting kbd traversal in dialog boxes. + + * dialog-msw.c (dialog_proc): + Support hitting ESC in dialogs. + + * dialog-msw.c (struct): + Common dialog box errors. + + * dialog-msw.c (handle_file_dialog_box): New. + Add file dialog code. + + * dialog-msw.c (handle_question_dialog_box): + Redo existing code to support new question dialog syntax. + + * dialog-msw.c (console_type_create_dialog_mswindows): + We support new dialog console method. + + * dialog-msw.c (syms_of_dialog_mswindows): + * dialog-msw.c (vars_of_dialog_mswindows): + New file dialog symbols, vars. + + * dialog-x.c: + * dialog-x.c (maybe_run_dbox_text_callback): + * dialog-x.c (dbox_descriptor_to_widget_value): + * dialog-x.c (x_make_dialog_box_internal): + * dialog-x.c (console_type_create_dialog_x): + Mule-ize entire file. + Redo to support question dialog syntax. + [6]. + + * dialog.c: + * dialog.c (Fmake_dialog_box_internal): + * dialog.c (syms_of_dialog): + Kill old popup-dialog-box, replace with new primitive. + Just call device method or signal error. + + * eldap.c (Fldap_open): + * eldap.c (Fldap_search_basic): + * eldap.c (Fldap_add): + * eldap.c (Fldap_modify): + [1]. + [7]. + + * emacs.c: + * emacs.c (make_arg_list_1): + * emacs.c (make_arg_list): + Mule-ize call to dll_init(). + [6]. + [8]. + + * emacs.c (make_argc_argv): + * emacs.c (free_argc_argv): + * emacs.c (init_cmdargs): + * emacs.c (main_1): + * emacs.c (Fkill_emacs): + * emacs.c (Fdump_emacs): + Update comments about what can be used in syms_* etc. + Call init_win32() when necessary. + Fix up MS Win dialog box in kill-buffer to actually work right. + [7]. + + * eval.c: + * eval.c (For): + * eval.c (Fand): + * eval.c (Fprogn): + * eval.c (Fprog1): + * eval.c (Fprog2): + * eval.c (FletX): + * eval.c (Flet): + * eval.c (condition_case_3): + * eval.c (Feval): + * eval.c (function_argcount): + * eval.c (funcall_lambda): + [1]. + + * eval.c (type_error): New. + * eval.c (maybe_type_error): New. + * eval.c (continuable_type_error): New. + * eval.c (maybe_continuable_type_error): New. + * eval.c (type_error_with_frob): New. + * eval.c (maybe_type_error_with_frob): New. + * eval.c (continuable_type_error_with_frob): New. + * eval.c (maybe_continuable_type_error_with_frob): New. + New functions for use with structured errors. + + * event-Xt.c: + * event-Xt.c (x_event_to_emacs_event): + Buttons are now modifiers too. + + * event-Xt.c (emacs_Xt_current_event_timestamp): + Implement new event method. + * event-Xt.c (reinit_vars_of_event_Xt): Set it. + + * event-msw.c: + * event-msw.c (ntpipe_shove_writer): [5]. + * event-msw.c (mswindows_enqueue_mouse_button_event): + * event-msw.c (mswindows_drain_windows_queue): + * event-msw.c (mswindows_wnd_proc): [7]. + * event-msw.c (mswindows_current_layout_has_AltGr): [5]. + * event-msw.c (mswindows_modifier_state): + Throughout: support new button modifiers. + + * event-msw.c (emacs_mswindows_current_event_timestamp): + Implement new event method. + * event-msw.c (reinit_vars_of_event_mswindows): Set it. + + * event-stream.c: + * event-stream.c (event_stream_current_event_timestamp): New. + * event-stream.c (maybe_kbd_translate): New functionality. + * event-stream.c (vars_of_event_stream): + Document new kbd-translate-table functionality. + + * event-stream.c (Fcurrent_event_timestamp): New. + New primitive for use in fabricated events. + * event-stream.c (syms_of_event_stream): [2]. Declare new primitive. + + * events-mod.h (XEMACS_MOD_BUTTON1): new button modifiers. + + * events.c: + * events.c (Fmake_event): + * events.c (WRONG_EVENT_TYPE_FOR_PROPERTY): + [1]. + [9]. + + * events.c (format_event_object): fix gcc warnings. + + * events.c (Fevent_timestamp): Document new primitives. + + * events.c (TIMESTAMP_HALFSPACE): New. + + * events.c (Fevent_timestamp_lessp): New. New primitive for + comparing timestamps correctly (half-space algorithm). + + * events.c (Fevent_modifier_bits): Doc fix. + + * events.c (Fevent_modifiers): Major doc addition. + * events.c (event_x_y_pixel_internal): Typo fix. + * events.c (syms_of_events): Declare new primitives. + + * events.h: + Update long comment for button modifiers, timestamps. + + * events.h (struct event_stream): + New current_event_timestamp method. + + * extents.c: + * extents.c (extent_in_region_p): + * extents.c (decode_extent): + * extents.c (Fset_extent_parent): + * extents.c (decode_map_extents_flags): + Fix gcc warnings. + [9]. + + * extents.c (struct extent_at_arg): + * extents.c (decode_extent_at_flag): + * extents.c (extent_at_mapper): + * extents.c (extent_at_bytind): + * extents.c (Fextent_at): Adapt to new lower-level interface. [9]. + * extents.c (Fextents_at): New primitive. [9]. + * extents.c (symbol_to_glyph_layout): [9]. + Support new primitive `extents-at'. + + + * extents.c (get_text_property_bytind): + extent_at_bytind has another arg. + [9]. + + * extents.c (syms_of_extents): New primitive. + + * file-coding.c (Fmake_coding_system): [1]. + * file-coding.c (subsidiary_coding_system): fix gcc warning + * file-coding.c (syms_of_file_coding): [2]. + + * fileio.c (Fexpand_file_name): + * fileio.c (Fsysnetunam): + * fileio.c (Ffile_exists_p): + * fileio.c (Ffile_executable_p): + * fileio.c (Fverify_visited_file_modtime): + Clean up GCPROing. + + * fileio.c (syms_of_fileio): [2]. + + * filelock.c (lock_file_1): + * filelock.c (current_lock_owner): + * filelock.c (lock_if_free): + * filelock.c (lock_file): + * filelock.c (unlock_file): + Clean up GCPROing. + + * fns.c (concat): Fix gcc warning. + + * fns.c (Fmember): + * fns.c (Fold_member): + * fns.c (Fmemq): + * fns.c (Fold_memq): + * fns.c (memq_no_quit): + * fns.c (Fassoc): + * fns.c (Fold_assoc): + * fns.c (Fassq): + * fns.c (Fold_assq): + * fns.c (assq_no_quit): + * fns.c (Frassoc): + * fns.c (Fold_rassoc): + * fns.c (Frassq): + * fns.c (Fold_rassq): + * fns.c (rassq_no_quit): + * fns.c (Fdelete): + * fns.c (Fold_delete): + * fns.c (Fdelq): + * fns.c (Fold_delq): + * fns.c (delq_no_quit): + * fns.c (Fremassoc): + * fns.c (Fremassq): + * fns.c (remassq_no_quit): + * fns.c (Fremrassoc): + * fns.c (Fremrassq): + * fns.c (remrassq_no_quit): + * fns.c (Freverse): + * fns.c (mapcar1): + [1]. + + * frame-msw.c (mswindows_init_frame_1): + * frame-msw.c (mswindows_delete_frame): + Register popups with dialog code so keyboard traversing works. + + * frame-tty.c (tty_raise_frame_no_select): [1]. + + * frame-x.c: + * frame-x.c (x_set_frame_text_value): + * frame-x.c (x_set_frame_properties): + * frame-x.c (x_create_widgets): + [7]. + + * frame.c: + * frame.c (Fmouse_pixel_position): Minor doc fixes. + + * frame.h (wrap_frame): New. + Macro like wrap_device. + + * general.c: + * general.c (SYMBOL): + * general.c (syms_of_general): + Major reorg. This is now just a wrapper and symbols themselves + are listed in general-slots.h. + + * glyphs-eimage.c (tiff_instantiate): Need cast to fix warning. + * glyphs-msw.c (mswindows_resource_instantiate): [5]. + + * glyphs-msw.c (mswindows_native_layout_instantiate): + Add DS_CONTROL so keyboard traversal will work. + + * glyphs-widget.c: + * glyphs-widget.c (syms_of_glyphs_widget): + Move some symbols to general-slots.h. + + * glyphs-x.c: + * glyphs-x.c (xbm_instantiate_1): + * glyphs-x.c (x_xbm_instantiate): + * glyphs-x.c (x_xface_instantiate): + * glyphs-x.c (autodetect_instantiate): + * glyphs-x.c (cursor_font_instantiate): + * glyphs-x.c (x_update_widget): + * glyphs-x.c (x_widget_instantiate): + * glyphs.c (bitmap_to_lisp_data): + * glyphs.c (pixmap_to_lisp_data): + [7]. + + * glyphs.c (syms_of_glyphs): + [2]. + + * gui-x.c: + * gui-x.c (print_widget_value): + * gui-x.c (menu_separator_style_and_to_external): + * gui-x.c (add_accel_and_to_external): + * gui-x.c (button_item_to_widget_value): + * gui-x.c (gui_items_to_widget_values_1): + * gui-x.c (gui_items_to_widget_values): + * gui-x.c (syms_of_gui_x): + * gui-x.c (vars_of_gui_x): + Mule-ize entire file. Move menu-no-selection-hook to gui.c. + [9]. + + * gui-x.h: + Muleize, prototype changes matching gui-x.c. + + * gui.c: + * gui.c (separator_string_p): + * gui.c (gui_item_add_keyval_pair): + * gui.c (make_gui_item_from_keywords_internal): + * gui.c (signal_too_long_error): + * gui.c (parse_gui_item_tree_item): + * gui.c (syms_of_gui): + * gui.c (vars_of_gui): + * gui.h: + menu-no-selection-hook moved here (used by MSWin). + Move some symbols to general-slots.h. + [6]. + [9]. + + * insdel.c (get_buffer_pos_char): + * insdel.c (get_buffer_range_char): + Add GC comments. + + * keymap.c (keymap_lookup_directly): + * keymap.c (keymap_store): + * keymap.c (ensure_meta_prefix_char_keymapp): + * keymap.c (describe_map): + * keymap.h: + Support new button modifiers. + + * lisp-disunion.h (wrap_object): + * lisp-disunion.h (XSETOBJ): + Rename make_obj to wrap_object. + + * lisp-union.h: + * lisp-union.h (make_int): + * lisp-union.h (make_char): + Support wrap_object. + + * lisp.h: + * lisp.h (LIST_LOOP): + * lisp.h (EXTERNAL_LIST_LOOP): + * lisp.h (LIST_LOOP_2): + * lisp.h (EXTERNAL_LIST_LOOP_1): + * lisp.h (EXTERNAL_LIST_LOOP_2): + * lisp.h (EXTERNAL_LIST_LOOP_3): + * lisp.h (EXTERNAL_LIST_LOOP_4_NO_DECLARE): + * lisp.h (PRIVATE_EXTERNAL_LIST_LOOP_6): + * lisp.h (GET_EXTERNAL_LIST_LENGTH): + * lisp.h (EXTERNAL_ALIST_LOOP_5): + * lisp.h (EXTERNAL_ALIST_LOOP_6): + * lisp.h (EXTERNAL_ALIST_LOOP_6_NO_DECLARE): + * lisp.h (EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE): + * lisp.h (EXTERNAL_PROPERTY_LIST_LOOP_7): + * lisp.h (struct Lisp_Symbol): + * lisp.h (maybe_continuable_error_with_frob): + Fix up section comments. + Add new types for char to indicate usage. + Delete symbols auto-generated from general-slots.h. + Add prototypes for structured error functions. + Add long comments describing looping macros and change interface + so that lvalues are automatically declared. + Add NO_DECLARE macro in case callers want to declare lvalues + themselves. + + * lread.c (read_syntax_error): + * lread.c (continuable_read_syntax_error): + * lread.c (read_structure): + * lread.c (sequence_reader): + * lread.c (read_list_conser): + * lread.c (read_compiled_function): + Rename syntax_error and continuable_syntax_error to avoid clash + with same-named structured error functions. + + * menubar-msw.c (mswindows_translate_menu_or_dialog_item): + * menubar-msw.c (populate_menu_add_item): + * menubar-msw.c (populate_or_checksum_helper): + [5]. + [9]. + + * menubar-x.c: + * menubar-x.c (menu_item_descriptor_to_widget_value_1): + Mule-ize whole file. + + * menubar.c (Fnormalize_menu_item_name): Add optimization. + + * mule-charset.c (Fmake_charset): + * mule-wnnfns.c (Fwnn_set_param): + [1]. + + * ntproc.c (create_child): + * ntproc.c (Fwin32_set_current_locale): + Add comments portending doom. + + * objects-msw.c: + * objects-msw.c (old_font_enum_callback_2): + * objects-msw.c (font_enum_callback_1): + * objects-msw.c (mswindows_enumerate_fonts): + [5]. + + * objects-x.c: + * objects-x.c (allocate_nearest_color): + * objects-x.c (x_parse_nearest_color): + * objects-x.c (x_initialize_color_instance): + * objects-x.c (x_print_color_instance): + * objects-x.c (x_finalize_color_instance): + * objects-x.c (x_valid_color_name_p): + * objects-x.c (x_initialize_font_instance): + * objects-x.c (x_print_font_instance): + * objects-x.c (valid_x_font_name_p): + * objects-x.c (truename_via_FONT_prop): + * objects-x.c (truename_via_random_props): + * objects-x.c (truename_via_XListFonts): + * objects-x.c (x_font_truename): + * objects-x.c (x_font_instance_truename): + * objects-x.c (x_font_instance_properties): + * objects-x.c (x_list_fonts): + * objects-x.c (x_find_charset_font): + Mule-ize entire file. + [7]. + + * objects-x.h: + Mule-verify. + + * print.c: + * print.c (std_handle_out_external): + * print.c (debug_print_no_newline): + * print.c (syms_of_print): + Output to all debugger kinds in debug-print. + Fix console-output code under MSWin to actually work. + + * process-nt.c (send_signal): + * process-nt.c (nt_create_process): + Use newer Unicode macros. + + * process-unix.c (unix_create_process): + * process-unix.c (unix_canonicalize_host_name): + * process-unix.c (unix_open_network_stream): + [7]. + + * scrollbar-x.c: + Mule-verify. + + * search.c (syms_of_search): + [2]. + + * select-msw.c (mswindows_destroy_selection): + Use LIST_LOOP_2. + + * select-x.c (symbol_to_x_atom): + [7]. + + * select.c (syms_of_select): + [2]. + + * sound.c (Fplay_sound_file): + [7]. + + * specifier.c: + * specifier.c (decode_specifier_type): + * specifier.c (Fvalid_specifier_locale_type_p): + * specifier.c (check_valid_locale_or_locale_type): + * specifier.c (decode_locale): + * specifier.c (decode_locale_type): + * specifier.c (decode_locale_list): + * specifier.c (check_valid_domain): + * specifier.c (decode_specifier_tag_set): + * specifier.c (Fcanonicalize_tag_set): + * specifier.c (Fdefine_specifier_tag): + * specifier.c (Fspecifier_tag_predicate): + * specifier.c (check_valid_inst_list): + * specifier.c (check_valid_spec_list): + * specifier.c (decode_how_to_add_specification): + * specifier.c (check_modifiable_specifier): + * specifier.c (specifier_add_spec): + * specifier.c (boolean_validate): + * specifier.c (display_table_validate): + [9]. + + * specifier.c (syms_of_specifier): + Move some symbols to general-slots.h. + [2]. + + * symbols.c: + * symbols.c (Fmapatoms): + * symbols.c (Fapropos_internal): + Add GCPROs. + + * symbols.c (set_default_buffer_slot_variable): + * symbols.c (set_default_console_slot_variable): + [1]. + + * symbols.c (defsymbol_massage_name_1): + * symbols.c (defkeyword_massage_name): + * symbols.c (deferror_1): + * symbols.c (deferror): + * symbols.c (deferror_massage_name_and_message): + * symeval.h: + * symeval.h (DEFSYMBOL): + Support DEFSYMBOL*, DEFKEYWORD, DEFERROR + + * symbols.c (syms_of_symbols): + [2]. + + * symsinit.h: + * symsinit.h (init_win32): New. + Also new is syms_of_dialog_mswindows. + + * syswindows.h: + Add new Unicode macros, missing Cygwin wide-char functions, + convenience conversion macros for Qmswindows_tstr, macros for + encapsulating required MSWin <-> Cygwin filename conversions, + prototype for dynamically-extracted (not in NT 3.51) functions. + + * toolbar-x.c: + Mule-verify. + + * tooltalk.c (Fadd_tooltalk_message_arg): + * tooltalk.c (Fadd_tooltalk_pattern_attribute): + * tooltalk.c (Fadd_tooltalk_pattern_arg): + [7]. + + * tooltalk.c (syms_of_tooltalk): + [2]. + + * unexnt.c: + * unexnt.c (unexec): + Fix up headers, declaration of unexec() to be more standard. + +2000-07-20 Martin Buchholz + + * offix.h: Revert change to guard macros - they're used in offix.c! + +2000-07-18 Kirill 'Big K' Katsnelson + + * lisp.h: Defsubred Fdelete. + + * console-msw.h: (msprinter_default_printer): Added. + + * console-msw.c (msprinter_canonicalize_console_connection): + (msprinter_canonicalize_device_connection): Added. + + * device-msw.c (msprinter_default_printer): + (Fmswingows_get_default_printer): + (signal_enum_priner_error): + (Fmswingows_printer_list): Added. + +2000-07-19 Martin Buchholz + + * XEmacs 21.2.35 is released. + +2000-07-19 Martin Buchholz + + * select-x.c (x_handle_selection_request): + Text selected in xemacs and pasted into xterm failed to appear. + Spelling fixes and cosmetic changes. + +2000-07-18 Kirill 'Big K' Katsnelson + + * event-msw.c (mswindows_drain_windows_queue): Correctly check for + XEmacs frame (fix for doubling chars in dialog boxes). + +2000-07-17 Alastair J. Houghton + + * select.c (select_convert_in, select_convert_out): + Don't call intern() every time. + + * select.c (Qselect_convert_in, Qselect_convert_out): New. + * select.c (vars_of_select): Initialise them. + +2000-07-18 Alastair J. Houghton + + * select.c (selection-coercible-types): New. + + * select.c (own-selection-internal): + * select.c (get-selection-internal): + MULE bug fix - these should default to COMPOUND_TEXT and not + STRING for MULE. I think. + + * select.c (select_convert_out): Use selection-coercible-types + to find types that we can attempt to perform coercions on. + +2000-07-18 Martin Buchholz + + * mule-wnnfns.c: + * mule-canna.c: + Add coding: cookie to identify encoding. + + * mule-canna.c (CANNA_mode_keys): make static. + Use proper prototypes, even for functions of no arguments. + Remove external prototype for Fding(). + + * symsinit.h: Add missing prototype for reinit_vars_of_mule_wnn. + + * select.c (syms_of_select): Add missing DEFSUBR. + +2000-07-18 Alastair J. Houghton + + * select.c (get_selection_internal, own_selection_internal): + Make the type default to STRING, rather than placing a nil type + into Vselection_alist. + +2000-07-17 Alastair J. Houghton + + * gpmevent.c (tty_selection_exists_p): + * gpmevent.c (tty_own_selection): + Updated parameter lists. + +2000-07-15 Alastair J. Houghton + + * select.h (selection-alist): Removed declaration. + + * select.h (get_local_selection): + * select.c (get_local_selection): + Made static. + + * select.h (convert_selection): Removed declaration. + * select.c (convert_selection): Removed. + This function belongs in Lisp. + + * select.h (select_convert_in): Declare. + * select.h (select_convert_out): Declare. + * select.c (select_convert_in): New. + * select.c (select_convert_out): New. + New conversion functions for other files to call. + + * select.h (select_notify_buffer_kill): Declare. + * select.c (select_notify_buffer_kill): New. + New functions that get called from kill-buffer. + + * buffer.c (kill-buffer): Call select_notify_buffer_kill, rather than + X-specific lisp code. + + * select.h: Declare some of the lisp-visible functions for + external use. + + * select.c (clean_local_selection_data): Removed. This was + a disgusting function, and previously should have been in + select-x.c in any case. The functionality is now provided + in select-convert-from-integer (select.el). + + * select.c (available-selection-types): Fixed stupidity where + INTEGER and ATOM got added twice. Also add STRING when we see an + extent. + + * select.c (get-selection-internal): Removed symbol stripping. No + longer causes conversion when data comes from the internal cache. + + * select.c (syms_of_select): Added new functions. + + * select-x.c (motif_clipboard_cb): Use select_convert_out. Rewrote + error checking - previously this called abort! + + * select-x.c (x_own_selection): Changed comment. + + * select-x.c (x_handle_selection_request): Use select_convert_out. + Don't mess with selection-alist; it's an internal variable of select.c. + + * select-x.c (x_get_foreign_selection): Use select_convert_in. + + * select-x.c (x_handle_selection_clear): Use get-selection-timestamp, + rather than messing with selection-alist. + + * select-msw.c (mswindows_get_foreign_selection): + Use TO_INTERNAL_FORMAT rather than hacking. + +2000-07-14 Martin Buchholz + + * process-unix.c (unix_open_multicast_group): + (unix_open_multicast_group): Remove useless casts. + +2000-07-13 Martin Buchholz + + * sound.c (Fplay_sound): Fix `unused variable' warning. + + * emacs.c (main): Use correct type for _environ on SCO5. + +2000-07-12 Alastair J. Houghton + + * console.h (own_selection_method): + * console.h (selection_exists_p_method): + * console.h (available_selection_types_method): New. + * console.h (register_selection_data_type_method): New. + * console.h (selection_data_type_name): New. + + * console-msw.h (mswindows_destroy_selection): Declare it. New + function & alist to track GlobalAlloc()'d handles that need + releasing when the clipboard data gets replaced or emptied. + + * event-msw.c (mswindows_wnd_proc): Call it. + + * lisp.h, general.c (Qappend): New symbol representing a + `how-to-add' mode. + + * select.c (own-selection-internal): + * select.c (selection-exists-p): + * select.c (available-selection-types): New. + * select.c (register-selection-data-type): New. + * select.c (selection-data-type-name): New. New functions to deal + with device-specific selection data formats. + * select.c (selection-converter-out-alist): Renamed. + * select.c (selection-converter-in-alist): New. + * select.c (selection-appender-alist): New. Added new alists. + * select.c (syms_of_select, vars_of_select): Added new symbols & + variables. + * select.c (get_local_selection): Split. + * select.c: Removed spurious type checking - selections may now be + of any type, not just strings. + * select.c (own-selection-internal): + + * select.h, select.c (convert_selection): New. Created + convert_selection() function based on get_local_selection(). + * select.h, select.c (QCF_*): New symbols representing mswindows + clipboard formats. + * select.h, select.c (Qreplace_all, Qreplace_existing): New + symbols representing `how-to-add' modes. + + * select-msw.c (x_sym_p): New. + * select-msw.c (symbol_to_ms_cf): New. + * select-msw.c (ms_cf_to_symbol): New. New functions to deal with + symbols & clipboard formats. Can also handle string names. + * select-msw.c (mswindows_own_selection): + * select-msw.c (mswindows_selection_exists_p): + Added `data-type' parameter. Use it. + * select-msw.c (mswindows_available_selection_types): New. + * select-msw.c (mswindows_register_selection_data_type): New. + * select-msw.c (mswindows_selection_data_type_name): New. + * select-msw.c (mswindows_own_selection): + * select-msw.c (mswindows_get_foreign_selection): + * select-msw.c (mswindows_selection_exists_p): Rewrote. + * select-msw.c (console_create_select_mswindows): Added new methods. + * select-msw.c (mswindows_destroy_selection): New. + * select-msw.c (Vhandle_alist): New list. + * select-msw.c (mswindows_own_selection): + + * select-x.c (x_own_selection): + * select-x.c (x_selection_exists_p): + * select-x.c: Added some comments about maybe using new + functionality. + * select-x.c (x_own_selection): + + * specifier.c: Remove definition of Qappend (now in general.c) + * specifier.c (syms_of_specifier): Remove Qappend. + +2000-07-12 Martin Buchholz + + * config.h.in: Add socklen_t. + + * s/decosf4-0.h: No special compiler flags needed or desired. + In particular, undefine _BSD for DEC OSF 4.0. + +2000-07-07 Kirill 'Big K' Katsnelson + + * redisplay-msw.c (msprinter_frame_output_end): Added. + (console_type_create_redisplay_mswindows): Referred the above. + + * frame.c (setup_frame_without_minibuffer): Do not create a + default minibuffer frame on a printer device. + + * frame-msw.c (apply_dc_geometry): Added. + (msprinter_start_page): + (msprinter_init_frame_3): + (msprinter_eject_page): Use it. + + * console-msw.h (struct msprinter_frame): Added pix_left and top, + and removed residual duplex and orientation properties. + +2000-07-11 Martin Buchholz + + * eval.c (function_argcount): Work around a DEC CC compiler bug. + + * unexalpha.c: Remove system prototypes from C sources! + +2000-07-09 Adrian Aichner + + * eval.c: Remove references to M-x edit-options in DEFUNs for + `defvar' and `defconst'. + +2000-07-09 Martin Buchholz + + * config.h.in: Remove SMART_INCLUDE hackery. + + PostgreSQL hacking: + * config.h.in: Don't use SMART_INCLUDE. + + * postgresql.h: Include libpq-fe.h here. Fix typo. + * inline.c: Simply #include "postgresql.h" + * postgresql.c: + - Don't use SMART_INCLUDE + - Use simply "const". + - Use standard doc string conventions. + - Use correct type for result of PQstatus. + +2000-07-09 Martin Buchholz + + * glyphs-x.c (x_xface_instantiate): Fix C++ compilation warnings. + + C++ compilation changes. + * config.h.in (EXTERN_C): Define. + * config.h.in (not): This is also a C++ keyword. + * unexalpha.c (DEFAULT_ENTRY_ADDRESS): Enable C++ compilation. + * cm.c: Use EXTERN_C. + * redisplay-tty.c: Use EXTERN_C. + * sysdep.c: Use EXTERN_C. Remove Gould support. + +2000-07-09 Martin Buchholz + + * general.c: Remove duplicate definition for Qfunction. + +2000-07-08 Ben Wing + + * device-msw.c (msprinter_init_device): + * device-msw.c (sync_printer_with_devmode): + * device-msw.c (handle_devmode_changes): + * device-msw.c (print_dialog_worker): + * device-msw.c (Fmsprinter_apply_settings): + * device-msw.c (hash_devmode): + * device-msw.c (Fmsprinter_settings_despecialize): + use Qmswindows_tstr, not Qctext. + + * vm-limit.c (check_memory_limits): + avoid infinite loop printing warning messages. + +2000-07-05 Craig Lanning + + * Makefile.in.in: Add support for including the Windows resources + when building with the cygwin and mingw targets. + + * buffer.c: from Dan Holmsand, on Windows $PWD is most likely either + not set or not correct. + (directory_is_current_directory): Don't compile for WIN32_NATIVE. + (init_initial_directory): Don't try to use $PWD on the + WIN32_NATIVE target. + + * s\cygwin32.h: + [[Add -mwindows to eliminate console window.]] not required --ben + (HAVE_NATIVE_SOUND): removed; now handled by configure. + (MAIL_USE_POP): removed; now handled by configure. + + * s\mingw32.h: [[Add -mwindows to eliminate console window.]] not in + C_SWITCH_SYSTEM or it will affect lib-src progs. --ben + (HAVE_NATIVE_SOUND): removed; now handled by configure. + (MAIL_USE_POP): removed; now handled by configure. + (ENCAPSULATE_STAT): from Dan Holmsand, added. + (ENCAPSULATE_FSTAT): from Dan Holmsand, added. + (DIRECTORY_SEP): from Dan Holmsand, use lisp variable instead of + constant string. + (HAVE_TIMEVAL): from Dan Holmsand, added; struct timeval is picked + up from via systime.h. + (HAVE_GETPAGESIZE): from Dan Holmsand, added. + (getpagesize): from Dan Holmsand, added. + Added #endif which was left dangling by Ben's mega patch; added + comment to help prevent this in the future. + + * sysdll.c: added #include for WIN32_NATIVE case. + +2000-07-05 Kirill 'Big K' Katsnelson + + * console-msw.h (struct mswindows_device): Removed unnecessary + cached device geometry values. + Added update_tick and an accessor macro. + (Lisp_Devmode): Added lrecord declaration. + (struct msprinter_device): Contain devmode as a Lisp object. + Added mswindows_get_selected_frame_hwnd(); + + * console.h (struct console_methods): Indentation nitpicking. + + * device-msw.c (mswindows_init_device): Do not initialize geometry + cache. Initialize update tick. + (mswindows_device_system_metrics): Ask the device for its geometry. + (global_free_2_maybe): + (devmode_to_hglobal): + (handle_printer_changes): + (ensure_not_printing): + (print_dialog_worker): + (Fmsprinter_print_setup_dialog): + (Fmsprinter_print_dialog): + (plist_get_margin): + (plist_set_margin): + (Fmsprinter_page_setup_dialog): Added functions. + (sync_printer_with_devmode): + (handle_devmode_changes): + (Fmsprinter_get_settings): + (Fmsprinter_select_settings): + (Fmsprinter_apply_settings): + (allocate_devmode): + (Fmsprinter_settings_copy): + (Fmsprinter_settings_despecialize): + (print_devmode): + (finalize_devmode): + (equal_devmode): + (hash_devmode): Added functions + (syms_of_device_mswindows): Init devmode lrecord class. + + * device.h: Added an exfun for find-device. + + * event-msw.c (mswindows_wnd_proc): Do not update the cached + geometry; although, recreate the device compatible DC. + + * frame-msw.c (mswindows_get_selected_frame_hwnd): Added. + (msprinter_init_frame_3): + (msprinter_frame_property): + (msprinter_internal_frame_property_p): + (msprinter_frame_properties): + (msprinter_set_frame_properties): Removed 'orientation and 'duplex + print job properties (will move to device settings). + + * lisp.h: Added symbols. + + * general.c (syms_of_general): Declared them. + + * hash.c (string_hash): Added. + + * lrecord.h (lrecord_type): Added devmode lrecord type. + +2000-07-02 Mike Sperber + + * s/freebsd.h (INTERRUPTIBLE_OPEN): open *is* interruptible on + FreeBSD 4.0. + +2000-06-07 MORIOKA Tomohiko + + * doprnt.c (emacs_doprnt_1): Fix problem with %0XXd for a negative + integer. + +2000-06-07 MORIOKA Tomohiko + + * data.c (Fstring_to_number): Don't recognize floating point if + base is not 10. + +2000-06-22 Martin Buchholz + + * glyphs-widget.c (tab_control_query_geometry): + (widget_query_geometry): + (button_query_geometry): + * glyphs.c (text_query_geometry): + Enforce type correctness. + +2000-06-18 Martin Buchholz + + * s/decosf4-0.h (_etext): Use portable _etext instead of etext. + * s/decosf4-0.h (_edata): Use portable _edata instead of edata. + +2000-06-17 Martin Buchholz + + * s/decosf4-0.h: Never #include "/usr/include/FOO.h" because this + conflicts with gcc's fixincluded version of FOO.h. + + * glyphs.h (image_instance_geometry): Remove trailing `,' + +2000-06-08 Mike Alexander + + (MAX_SHOVE_BUFFER_SIZE): Change to 512 to match stream buffer size + (shove_thread): Don't write the same output twice + (make_ntpipe_output_stream): Increase priority of shove thread + (ntpipe_shove_writer): Call SwitchToThread to give shove thread a + chance to run + (ntpipe_shove_closer): Don't delete the pipe until we're done with + it. + +2000-06-12 Ben Wing + + * s\mingw32.h (sigset): + * s\windowsnt.h (sigset): + rename msw_ to mswindows_ for consistency with general convention. + +2000-06-12 Ben Wing + + * console-msw.c: + * console-msw.c (mswindows_get_console_hwnd): + * console-msw.c (mswindows_ensure_console_allocated): + * console-msw.c (mswindows_hide_console): + * console-msw.c (mswindows_show_console): + * console-msw.c (mswindows_ensure_console_buffered): + * console-msw.c (mswindows_output_console_string): + * console-msw.c (mswindows_windows9x_p): + * console-msw.h: + * device-msw.c (mswindows_get_workspace_coords): + * device-msw.c (mswindows_device_system_metrics): + * dialog-msw.c (mswindows_popup_dialog_box): + * event-msw.c (mswindows_wnd_proc): + * frame-msw.c (mswindows_size_frame_internal): + * menubar-msw.c (mswindows_translate_menu_or_dialog_item): + * menubar-msw.c (displayable_menu_item): + * menubar-msw.c (mswindows_char_is_accelerator): + * nt.c: + * nt.c (mswindows_sigset): + * nt.c (mswindows_sigrelse): + * nt.c (mswindows_sigpause): + * nt.c (mswindows_raise): + * nt.c (timer_proc): + * ntproc.c: + * ntproc.c (find_child_console): + * ntproc.c (sys_kill): + * print.c: + * print.c (std_handle_out_external): + * process-nt.c (find_child_console): + * process-nt.c (send_signal_the_95_way): + * process-nt.c (ensure_console_window_exists): + * process-nt.c (nt_create_process): + * syssignal.h: + rename msw_ to mswindows_ for consistency with general convention. + + * emacs.c: + * dumper.c: + include nt.h, not syswindows.h. + + * nt.c (mswindows_fstat): + * nt.c (mswindows_stat): + prefix mswindows_ instead of attempting to directly override the + library functions. fix declarations. + + * nt.h: + include syswindows.h. move some sysdep.h stuff here. + + * ntheap.h: + include syswindows.h, not . + + * ntplay.c: + clean up headers. + + * sysdep.c: + clean up headers. + + * sysdep.c (sys_fstat): + * sysdep.c (sys_stat): + call mswindows versions when appropriate. + + * sysdep.h: + move mswin decls to nt.h. + + * syswindows.h: + add long comment describing appropriate use of the various windows + headers. + +2000-06-11 Ben Wing + + * device-x.c: Correct doc string for sixth arg of x-get-resource. + +2000-06-10 Ben Wing + + * Makefile.in.in (release): + Correction to make sure xemacs.exe always dumped when correct. + + * alloca.c: + * balloon_help.c: + [[[[3]]]]: Conditionalize on actual problem, not WINDOWSNT. + + * buffer.c (set_buffer_internal): + [[[[2]]]]: Remove HAVE_FEP code. + + * buffer.c (init_initial_directory): + [3]. + + * bytecode.c: + [[[[4]]]]: limits.h standardly included in lisp.h; remove from + individual files. + + * callproc.c: + * callproc.c (call_process_cleanup): + * callproc.c (Fold_call_process_internal): + * callproc.c (child_setup): + * callproc.c (getenv_internal): + * callproc.c (init_callproc): + * callproc.c (vars_of_callproc): + [[[[1]]]]: WINDOWSNT -> WIN32_NATIVE. + __CYGWIN32__ -> CYGWIN. + DOS_NT -> WIN32_NATIVE. + Remove MSDOS support/references, converting to WIN32_NATIVE + where correct. + __MINGW32__ -> MINGW. + Fix windows.h includes. + Remove bogus HAVE_NTGUI. + + * config.h.in: + [2]. + + * console-msw.c: + mswindows_message_outputted added for use in allowing startup + errors on the console to be seen. + + * console-msw.c (msw_ensure_console_allocated): + * console-msw.c (msw_output_console_string): + * console-msw.c (DHEADER): + * console-msw.c (DOPAQUE_DATA): + * console-msw.c (DEVENT): + * console-msw.c (DCONS): + * console-msw.c (DCONSCDR): + * console-msw.c (DSTRING): + * console-msw.c (DVECTOR): + * console-msw.c (DSYMBOL): + * console-msw.c (DSYMNAME): + Fix warnings. + + * console-stream.c (stream_init_console): + Fix text/binary problems. + + * device-msw.c: + * device-msw.c (mswindows_finish_init_device): + * device-msw.c (mswindows_delete_device): + [1]. + + * device.c (handle_asynch_device_change): + [3]. + + * dgif_lib.c: + * dgif_lib.c (DGifOpenFileName): + * dgif_lib.c (DGifOpenFileHandle): + * dgif_lib.c (DGifGetLine): + * dgif_lib.c (DGifGetPixel): + Added config.h/lisp.h, fix up includes. + [1]. + + * dired-msw.c: + [4]. + + * dired.c: + * dired.c (file_name_completion): + * dired.c (Ffile_attributes): + * dired.c (syms_of_dired): + [1]. + + * dumper.c: + * dumper.c (pdump_file_unmap): + * dumper.c (pdump_load): + [1]. + + * editfns.c: + * editfns.c (Ftemp_directory): + * editfns.c (user_login_name): + * editfns.c (Fuser_real_login_name): + * editfns.c (get_home_directory): + [1]. + + * elhash.c (finish_marking_weak_hash_tables): + [[[[5]]]]: Fix GCC warnings. + + * emacs.c: + * emacs.c (mswindows_handle_hardware_exceptions): + * emacs.c (make_arg_list_1): + * emacs.c (main_1): + * emacs.c (Fkill_emacs): + * emacs.c (Fdump_emacs): + [1]. + Fix problems with nested crashes, add long comment. + + * event-Xt.c (init_event_Xt_late): + [1]. + + * event-msw.c: + * event-msw.c (mswindows_dde_callback): + * event-msw.c (mswindows_handle_sticky_modifiers): + * event-msw.c (mswindows_wnd_proc): + [1]. + [5]. + + * events.c (character_to_event): + [1]. + + * fileio.c: + * fileio.c (Ffile_name_directory): + * fileio.c (Ffile_name_nondirectory): + * fileio.c (directory_file_name): + * fileio.c (Fexpand_file_name): + * fileio.c (Fsubstitute_in_file_name): + * fileio.c (Ffile_name_absolute_p): + * fileio.c (check_executable): + * fileio.c (Ffile_readable_p): + * fileio.c (Ffile_accessible_directory_p): + * fileio.c (Ffile_modes): + * fileio.c (Funix_sync): + * fileio.c (vars_of_fileio): + [1]. [4]. + + [[[[7]]]]: Move CORRECT_DIR_SEPS to s\windowsnt.h. + + Expand getdefdir defn. + Fix bogus rename() comment. + + [[[[6]]]]: Fix Windows includes w.r.t. removed nt\inc. Attempt + to use standard XEmacs include files, e.g. sysfile.h, rather + than system-specific includes. + + * fns.c: + * fns.c (Fsubseq): + [5]. [6]. + + * frame.c (vars_of_frame): + [1]. + + * getloadavg.c: + * getloadavg.c (getloadavg): + [1]. [6]. + #ifdef XEMACS not defined on Cygwin. Remove this; no need for it. + (We don't use it elsewhere in the code; just add a comment.) + + * gif_io.c: + [6]. + Add config.h. + + * glyphs-msw.c: + * glyphs-msw.c (mswindows_resource_instantiate): + [1]. + + * glyphs-x.c (x_native_layout_instantiate): + [5]. + + * gui-msw.c (Fmswindows_shell_execute): + [1]. + + * insdel.c: + [4]. + + * lisp.h: + [4]. [5]. + + * lread.c (locate_file_in_directory_mapper): + [1]. + + * lstream.c: + [4]. + + * mem-limits.h: + * mem-limits.h (get_lim_data): + [1]. + + * menubar-msw.c: + [4]. + + * ndir.h: + [1]. + + * nt.c: + * nt.c (getwd): + * nt.c (closedir): + * nt.c (rva_to_section): + * nt.c (mswindows_executable_type): + [1]. [6]. + Fix closedir() defn. + + * nt.h: + [[[[8]]]]: *_OK defs moved to sysfile.h. + + * ntproc.c: + [6]. [7]. + + * objects-x.c: + [4]. + + * print.c: + * print.c (std_handle_out_external): + [1]. [4]. + + * process-nt.c: + * process-nt.c (nt_create_process): + [6]. + try to fix process quoting somewhat. + + * process-unix.c (unix_create_process): + [1]. + + * process.c: + * process.c (vars_of_process): + Add Vnull_device. + + * process.h: + [1]. + + * realpath.c: + * realpath.c (xrealpath): + [1]. + + * redisplay-tty.c (init_tty_for_redisplay): + [3]. + + * redisplay.c: + [4]. [6]. + + * scrollbar-msw.c: + [4]. + + * sheap.c: + * sheap.c (more_static_core): + * sheap.c (report_sheap_usage): + [5]. [6]. + + * signal.c: + * signal.c (alarm_signal): + [1]. [6]. + + * sound.c: + [6]. + + * strftime.c: + * strftime.c (zone_name): + [1]. [5]. + + * symsinit.h (init_sunpro): + [1]. + + * syscommctrl.h: + commctrl.h not in Cygwin b20.1. + + * sysdep.c: + * sysdep.c (endif): + * sysdep.c (sys_subshell): + * sysdep.c (init_baud_rate): + * sysdep.c (emacs_get_tty): + * sysdep.c (emacs_set_tty): + * sysdep.c (tty_init_sys_modes_on_device): + * sysdep.c (init_system_name): + * sysdep.c (sys_open): + * sysdep.c (interruptible_open): + * sysdep.c (sys_fopen): + * sysdep.c (sys_mkdir): + * sysdep.c (sys_rename): + * sysdep.c (get_process_times_1): + [1]. [6]. + + * sysdep.h: + [1]. + + * sysdir.h: + * sysdir.h (DIRENTRY_NONEMPTY): + [1]. [6]. + + * sysdll.c (dll_init): + * sysdll.h: + [1]. + + * sysfile.h: + [1]. [6]. [8]. + added text/binary defs. + + * sysfloat.h: + [1]. + + * sysproc.h: + * sysproc.h (EDESTADDRREQ): + * sysproc.h (poll_fds_for_input): + [1]. [6]. + + * syspwd.h: + [6]. + + * syssignal.h: + [1]. + + * systime.h: + [1]. [6]. + + * systty.h: + [1]. + + * syswindows.h: + [1]. + Always define WIN32_LEAN_AND_MEAN. + + * unexcw.c (unexec): + [5]. + + * unexec.c: + * unexec.c (copy_text_and_data): + * unexec.c (adjust_lnnoptrs): + [1]. + + * unexnt.c: + * unexnt.c (_start): + [1]. + +2000-06-07 Ben Wing + + * mule-mcpath.c, mule-mcpath.h: Removed. Old, crufty code that + was used only as a model. We've long since extracted any useful + logic or code out of this. (I just did an exhaustive search.) + + * s\msdos.h: Removed. + + * s\windows95.h: Removed. + +2000-06-10 Ben Wing + + * s\cygwin32.h: + [1]. [5]. + Don't use extern with fun defs. + + * s\mingw32.h: + [1]. [7]. + Remove nt\inc include. + Remove getdisk, getdefdir. (The former is unused, the latter + expanded in fileio.h.) + + * s\windowsnt.h: + * s\windowsnt.h (WIN32_NATIVE): + * s\windowsnt.h (HAVE_STRCASECMP): + [1]. [7]. + Add long comment about preprocessor changes. + Remove getdisk, getdefdir. (The former is unused, the latter + expanded in fileio.h.) + +2000-06-10 Ben Wing + + * m\arm.h: + * m\delta.h: + * m\intel386.h: + * m\sequent.h: + * m\template.h: + * m\windowsnt.h: + [1]. + Remove bogus/unused NO_SOCK_SIGIO. + +2000-06-08 Hrvoje Niksic + + * lisp.h (set_string_char): Call set_string_byte with a Bufbyte, + not an Emchar. + +2000-06-04 Mike Sperber + + * casetab.c (set_case_table): For `set-standard-case-table', + actually deposit the new case tables where the rest of XEmacs can + see them. + +2000-06-05 Yoshiki Hayashi + + * data.c (Faset): Don't cast XCHAR() to unsigned char. + +2000-06-05 Ben Wing + + * callproc.c (child_setup): Don't do close_load_descs() under + MS Windows. Put in a comment explaining why. + +2000-05-28 Adrian Aichner + + * process-nt.c: Reverting patch "Fixing nt_create_process for MKS + Toolkit shell" which breaks `kill-compilation' on Windows NT + native, retaining STDERR handling improvements. + +2000-06-01 Andreas Jaeger + + * s/s390.h: Support for S390, based on a patch by Martin + Schwidefsky . + +2000-05-30 Andy Piper + + * window.c (allocate_window): + (make_dummy_parent): + (Fset_window_configuration): use new hashtable type. + + * glyphs.h (IMAGE_UNSPECIFIED_GEOMETRY): + (struct image_instantiator_methods): + (struct Lisp_Image_Instance): make instance geometry signed. + + * glyphs.c (instantiate_image_instantiator): + (image_instance_query_geometry): + (image_instance_layout): + (image_instance_layout): + (query_string_geometry): + (text_query_geometry): + (image_instantiate): + (image_instantiate): + (cache_subwindow_instance_in_frame_maybe): + (subwindow_query_geometry): make instance geometry signed. + + * glyphs-widget.c (widget_query_geometry): + (widget_layout): + (button_query_geometry): + (tree_view_query_geometry): + (tab_control_query_geometry): + (layout_query_geometry): + (layout_layout): + (native_layout_layout): make instance geometry signed. + +2000-05-29 Olivier Galibert + + * lisp.h: Add Qfull_assoc symbol and WEAK_LIST_FULL_ASSOC + constant. + + * general.c (syms_of_general): Add Qfull_assoc symbol. + + * data.c (finish_marking_weak_lists): Mark full-assoc lists + correctly. + (decode_weak_list_type): Decode full-assoc type. + (encode_weak_list_type): Encode full-assoc type. + (Fmake_weak_list): Update doc string. + +2000-05-30 Andy Piper + + * elhash.h (hash_table_weakness): new KEY_VALUE weak hashtable. + + * elhash.c (print_hash_table): new KEY_VALUE weak hashtable. + (decode_hash_table_weakness): ditto. + (Fhash_table_weakness): ditto. + (Fhash_table_type): ditto. + (finish_marking_weak_hash_tables): ditto. + (hash_table_weakness_validate): ditto. + (syms_of_elhash): ditto. + +2000-05-28 Martin Buchholz + + * XEmacs 21.2.34 is released. + +2000-05-22 Jan Vroonhof + + * redisplay.c (VERTICAL_CLIP): No longer reset when updating line + start cache. + (updating_line_start_cache): Gone. + (regenerate_window): Replace resetting of VERTICAL_CLIP by + generic code to force a minimum of 1 line laid out in the + CMOTION_DISP case. + +2000-05-22 Jan Vroonhof + + * glyphs.c (instantiate_image_instantiator): Check for initialized + height & width no longer special cases IMAGE_NOTHING. + (nothing_instantiate): Set height and width of instance. + +2000-05-24 Yoshiki Hayashi + + * unexelf.c (unexec): Search for ".data" section. + Initialize new_data2_offset from old_data_index. + Remove redundant check for ElfW. + +2000-05-23 Andy Piper + + * glyphs.c (get_image_instantiator_governing_domain): allow more + specific domains as the governing domain rather than expecting an + exact match. This fixes problems with layouts. + +2000-05-22 Andy Piper + + * redisplay-output.c (compare_runes): check for non-images + + * glyphs.c (set_glyph_dirty_p): ditto. + (update_glyph_cachel_data): ditto. + + * glyphs-widget.c (layout_post_instantiate): ditto. + (layout_post_instantiate): ditto. + + * event-msw.c (mswindows_wnd_proc): warning removal. + +2000-05-12 Craig Lanning + + * s\mingw32.h: Added #undef for CLASH_DETECTION. + + * syswindows.h: Moved PBS_SMOOTH definition to syscommctrl.h. + + * syscommctrl.h (PBS_SMOOTH): Moved from syswindows.h. + + * nt.c (rva_to_section): mingw32 needs rva_to_section. + (mswindows_executable_type): mingw32 now has enough headers for + this to work. + +2000-05-20 Andy Piper + + * console-msw.c (mswindows_output_last_error): ; -> , + +2000-05-12 Andy Piper + + * console-msw.c (FROB): compare ints with ints. + +2000-05-11 Andy Piper + + * glyphs-x.c (x_finalize_image_instance): make minimal build + happy. + +2000-05-20 Ben Wing + + * event-Xt.c: + * event-Xt.c (vars_of_event_Xt): + move modifier-keys-are-sticky to event-stream.c. + + * event-msw.c: + * event-msw.c (mswindows_enqueue_mouse_button_event): + * event-msw.c (key_needs_default_processing_p): + * event-msw.c (XEMSW_LCONTROL): + * event-msw.c (mswindows_handle_sticky_modifiers): + * event-msw.c (FROB): + * event-msw.c (clear_sticky_modifiers): + * event-msw.c (output_modifier_keyboard_state): + * event-msw.c (output_alt_keyboard_state): + * event-msw.c (mswindows_wnd_proc): + * event-msw.c (mswindows_modifier_state): + * event-msw.c (emacs_mswindows_handle_magic_event): + implement sticky modifiers. + + * event-stream.c: + * event-stream.c (vars_of_event_stream): + move modifier-keys-are-sticky here. + + * lisp.h: + add CHECK_FUNCTION. + + * rangetab.c: + implement map-range-table. + + +2000-05-17 Yoshiki Hayashi + + * redisplay-tty.c (reset_tty_modes): + (tty_redisplay_shutdown): Adjust argument type to + tty_frame_output_end. + +2000-05-11 Yoshiki Hayashi + + * eval.c (Fbacktrace): Don't output a line with only right + parenthesis. + +2000-05-17 Kenji Itoh + + * postgresql.c (Fpq_connect_poll): Replace `PS' with `polling_status'. + (Fpq_reset_poll): Ditto. + +2000-05-16 Katsumi Yamaoka + + * redisplay-tty.c: Replace tty_output_end with tty_frame_output_end. + +2000-05-16 Ben Wing + + * buffer.c: + * buffer.c (dfc_convert_to/from_internal_format): + * buffer.c (reinit_vars_of_buffer): + Fix conversion functions to allow reentrancy. + + * console-msw.c: + * console-msw.c (mswindows_output_last_error): + New fun, generally useful -- output a human-readable + version of GetLastError() on the console. + + * console-msw.h: + * console-msw.h (struct mswindows_frame): + Changes for DeferWindowPos. Declare mswindows_output_last_error(). + + * console-stream.c (stream_output_begin): + * console-stream.c (stream_output_end): + * console-stream.c (stream_output_vertical_divider): + * console-stream.c (stream_clear_region): + * console-stream.c (stream_flash): + * console-stream.c (console_type_create_stream): + Delete blank stream methods, not needed. + + * console.h (struct console_methods): + Split begin/end methods into window and frame. + + * event-msw.c: + * event-msw.c (mswindows_handle_paint): + * event-msw.c (output_alt_keyboard_state): + * event-msw.c (mswindows_wnd_proc): + * event-msw.c (vars_of_event_mswindows): + Comment about problems with ignored-expose. + Define mswindows-debug-events; not really implemented. + + * frame-msw.c (mswindows_init_frame_1): + random cleanups. + + * glyphs-msw.c: + * glyphs-msw.c (begin_defer_window_pos): + * glyphs-msw.c (mswindows_unmap_subwindow): + * glyphs-msw.c (mswindows_map_subwindow): + * glyphs-msw.c (mswindows_resize_subwindow): + Use DeferWindowPos to reduce flashing when mapping/unmapping. + + * glyphs.c (make_image_instance_1): + Fix crash. + + * gutter.c (Fredisplay_gutter_area): + Use new begin/end methods. + + * lisp.h (Dynarr_new2): + New creation fun. + + * redisplay-msw.c: + * redisplay-msw.c (mswindows_frame_output_begin): + * redisplay-msw.c (mswindows_frame_output_end): + * redisplay-msw.c (console_type_create_redisplay_mswindows): + New begin/end methods -- handle DeferWindowPos. + + * redisplay-output.c (redisplay_move_cursor): + * redisplay-output.c (redraw_cursor_in_window): + * redisplay-output.c (redisplay_update_line): + * redisplay-output.c (redisplay_output_window): + New begin/end methods. + + * redisplay-tty.c: + * redisplay-tty.c (tty_frame_output_begin): + * redisplay-tty.c (tty_frame_output_end): + * redisplay-tty.c (console_type_create_redisplay_tty): + New begin/end methods. + + * redisplay-x.c: + * redisplay-x.c (x_window_output_begin): + * redisplay-x.c (x_window_output_end): + * redisplay-x.c (console_type_create_redisplay_x): + New begin/end methods. + + * redisplay.c (redisplay_frame): + * redisplay.c (Fredisplay_echo_area): + New begin/end methods. + use MAYBE_DEVMETH for clear_frame; it may not exist. + + * window.h (WINDOW_XFRAME): + WINDOW_XFOO macros -- get locale and decode struct pointer. + + +2000-05-12 Ben Wing + + * emacs.c: + * emacs.c (ensure_no_quitting_from_now_on): + * emacs.c (fatal_error_signal): + * emacs.c (mswindows_handle_hardware_exceptions): + * emacs.c (main): + * emacs.c (Fkill_emacs): + * emacs.c (shut_down_emacs): + * emacs.c (assert_failed): + various improvements in fatal error handling. + + * eval.c: + move preparing_for_armageddon to emacs.c. + + * lisp.h: + declare fatal_error_in_progress. + + * print.c: + * print.c (std_handle_out_external): + * print.c (std_handle_out_va): + * print.c (stderr_out): + * print.c (stdout_out): + use console under mswin when no standard output. + don't do code conversion during fatal error. + + * scrollbar.c (Fscrollbar_page_up): + * scrollbar.c (Fscrollbar_page_down): + fix missing else. reindent. + +2000-05-11 Jan Vroonhof + + Emergency fix. + + * glyphs.h (GLYPH_CACHEL_DESCENT): + (GLYPH_CACHEL_DESCENT): + (GLYPH_CACHEL_DESCENT): + * glyphs.h (GLYPH_CACHEL_ASCENT): Match parameters to variables + used in case these are inline functions. + Use more absurd values to error check. + + include window.h for error check functions. + +2000-05-11 Ben Wing + + * cmdloop.c (Freally_early_error_handler): + Display message box under windows; otherwise, message will disappear + before it can be viewed. + + * console-msw.c: + * console-msw.c (Fmswindows_message_box): + * console-msw.c (FROB): + * console-msw.c (syms_of_console_mswindows): + Define new fun `mswindows-message-box'. + #### I will merge this into `popup-dialog-box'; just give me + a bit of time. + + * general.c: + * general.c (syms_of_general): + Some new symbols used in `mswindows-message-box'. + + * glyphs.c: + * glyphs.c (Fset_image_instance_property): + put warning in this fun. + + * glyphs.h: + * glyphs.h (GLYPH_CACHEL_WIDTH): + * glyphs.h (GLYPH_CACHEL_ASCENT): + * glyphs.h (GLYPH_CACHEL): + * glyphs.h (GLYPH_CACHEL_GLYPH): + define error-checking versions to try to catch a bug i've seen -- + redisplay gets in an infinite loop because the glyph width of the + continuation glyph is 65535. + + * lisp.h: + Extern message-box stuff. + + * window.c (allocate_window): + * window.c (make_dummy_parent): + * window.c (Fset_window_configuration): + Use EQUAL not EQ for subwindow caches to make them work a bit + better. (Something is still very broken.) + + +2000-05-11 Yoshiki Hayashi + + * glyphs.c (image_instantiate): Suppress gcc warnings. + (Fmake_image_instance): Fix doc string. + * specifier.c (Fmake_specifier): Ditto. + +2000-05-02 Yoshiki Hayashi + + * paths.h.in (PATH_LOCK): Removed. + * config.h.in (LOCKDIR_USER_DEFINED): Removed. + * emacs.c (complex_vars_of_emacs): Remove configure-lock-directory. + +2000-05-08 Yoshiki Hayashi + + * fns.c (Ffeaturep): Update e-mail address in doc-string. + Document (featurep '(and xemacs 21.02)). + +2000-05-09 Ben Wing + + * buffer.c (complex_vars_of_buffer): + update modeline-format doc. + + * device.h: + comment about how DFW_DEVICE should be merged with DOMAIN_DEVICE. + + * emacs.c: + timeline of all released versions of Emacs, for use in creating + authorship comments and in synching up. + + * glyphs-widget.c (image_instantiator_buttons): + * glyphs-widget.c (image_instantiator_edit_fields): + * glyphs-widget.c (image_instantiator_combo_box): + * glyphs-widget.c (image_instantiator_scrollbar): + * glyphs-widget.c (image_instantiator_progress_guage): + * glyphs-widget.c (image_instantiator_tree_view): + * glyphs-widget.c (image_instantiator_tab_control): + * glyphs-widget.c (image_instantiator_labels): + * glyphs-widget.c (image_instantiator_layout): + * glyphs-widget.c (image_instantiator_native_layout): + rename decode_domain method to governing_domain. + + * glyphs.c: + * glyphs.c (Fvalid_image_instantiator_format_p): doc update. + * glyphs.c (add_entry_to_device_ii_format_list): + make sure we don't put an entry more than once into the list. + * glyphs.c (check_instance_cache_mapper): + ************************************************************* + allow for nil. THIS SHOULD FIX A REAL CRASH THAT MANY PEOPLE + HAVE BEEN GETTING. + ************************************************************* + * glyphs.c (get_image_instantiator_governing_domain): + clean up, expand on new concept of governing domain. + * glyphs.c (instantiate_image_instantiator): + * glyphs.c (allocate_image_instance): + use governing_domain instead of cache_domain in naming. + * glyphs.c (Fvalid_image_instance_type_p): fix docs. + * glyphs.c (make_image_instance_1): + * glyphs.c (Fmake_image_instance): + allow for any domain (not just device), and process the + governing domain correctly. very big doc fix. + * glyphs.c (Fimage_instance_domain): + new primitive, to retrieve the governing domain of an image instance. + * glyphs.c (image_instantiate): + use new governing_domain stuff. this fixes a crash you could get + by instantiating certain widget glyphs in frame locales. (should + signal an error instead of crashing.) + * glyphs.c (Fimage_specifier_p): move doc to make-image-specifier. + * glyphs.c (Fglyphp): clean up doc. + * glyphs.c (subwindow_governing_domain): renamed from *_decode_domain. + * glyphs.c (syms_of_glyphs): + declare Fimage_instance_domain, remove unused Qlayout_image_instance_p. + * glyphs.c (image_instantiator_format_create): add some comments about + bogus code. + * glyphs.c (specifier_vars_of_glyphs): totally rewrite the doc string + for current-display-table. (Apparently Hrjove implemented in 1998 a + design I wrote up in 1996, but didn't update the doc string.) + + * glyphs.h: clean up a doc string. + * glyphs.h (governing_domain): + * glyphs.h (struct image_instantiator_methods): + changes for governing_domain stuff. + + * gutter.c: + * gutter.c (Fgutter_specifier_p): + * gutter.c (Fgutter_size_specifier_p): + * gutter.c (Fgutter_visible_specifier_p): + * objects.c: + * objects.c (Fcolor_specifier_p): + * objects.c (Ffont_specifier_p): + * objects.c (Fface_boolean_specifier_p): + doc strings moved to make-*-specifier. + + * redisplay.c (add_disp_table_entry_runes_1): + * redisplay.c (generate_fstring_runes): + * redisplay.c (screen): + add random comments and doc strings. + + * specifier.c: + * specifier.c (Fmake_specifier): + major overhaul of this doc string. + + * specifier.c (Fvalid_specifier_domain_p): + comment about the bogosity of image instances being domains. + * specifier.c (decode_domain): + now non-static, used in glyphs.c. + * specifier.c (specifier_instance): + comment about the bogosity of image instances being domains. + * specifier.c (Fgeneric_specifier_p): + move doc string to make-generic-specifier. + * specifier.c (VALID_SINGLE_DISPTABLE_INSTANTIATOR_P): + rebackslashify. + + * specifier.h: + * specifier.h (DOMAIN_FRAME): + * specifier.h (DOMAIN_LIVE_P): + * specifier.h (DOMAIN_XDEVICE): + rebackslashify. + add comments about problems with these macros. + prototype for decode_domain. + + * toolbar.c: + * toolbar.c (Ftoolbar_specifier_p): + move doc string to `make-toolbar-specifier'. + + * window.c (window_unmap_subwindows_cache_mapper): + ************************************************************* + allow for nil. THIS SHOULD FIX A REAL CRASH THAT MANY PEOPLE + HAVE BEEN GETTING. + ************************************************************* + +2000-05-09 Andy Piper + + * glyphs.h: declare reset_frame_subwindow_instance_cache. + + * window.c (Fset_window_configuration): reset the frame subwindow + cache and re-initialize the window subwindow caches. + + * glyphs.c (reset_frame_subwindow_instance_cache): new function. + +2000-05-09 Ben Wing + + * ntheap.c (recreate_heap): Changed unknown (VC6 only?) SIZE_T to + DWORD. + +2000-04-26 Mike Woolley + + * ntheap.c: Changed recreate_heap to limit the amount reserved + for the heap to that which is actually available. Also now + displays a message box (with some dignostics) in the event that + it still can't start. + +2000-05-07 Jan Vroonhof + + * callproc.c (Fold_call_process_internal): GCPRO path + +2000-05-08 Jan Vroonhof + + Patch by Bill Perry. + + * scrollbar.c (Fscrollbar_page_up): Conditionalize on type of call + back data instead of #ifdef. + (Fscrollbar_page_down): ditto. + +2000-05-07 Ben Wing + + * buffer.h: + Kludge for defining Qmswindows_tstr. + + * nt.c: + * nt.c (open_input_file): + * nt.c (open_output_file): + * nt.c (rva_to_section): + * nt.c (mswindows_executable_type): + Move all memory-mapped-file routines here (some were in unexnt.c, + which is bad because they are used by process-nt.c, and unexnt + won't be around when portable dumping). Synched the above routines + with FSF 20.6. + + * nt.h: + Removed ifdef'd out bogus code. + Fixed some prototypes. + + * nt.h (file_data): + * nt.h (OFFSET_TO_RVA): + * nt.h (RVA_TO_OFFSET): + * nt.h (RVA_TO_PTR): + Moved the memory-mapped-file structures, macros and prototypes + here, to parallel nt.c. ntheap.h should really be removed + entirely, and it's a non-portable-dumper specific file. + + * ntheap.h (round_to_next): + Moved the memory-mapped-file structures, macros and prototypes + to nt.h. + + * ntproc.c (compare_env): + Moved rva_to_section and mswindows_executable_type to nt.c. + Moved compare_env to process-nt.c. + ntproc.c will die, one day. + + * ntproc.c (sys_spawnve): + Account for win32_ -> mswindows_. + + * process-nt.c: + * process-nt.c (struct nt_process_data): + * process-nt.c (ensure_console_window_exists): + * process-nt.c (compare_env): + * process-nt.c (nt_create_process): + * process-nt.c (nt_kill_process_by_pid): + * process-nt.c (syms_of_process_nt): + * process-nt.c (vars_of_process_nt): + Introduce variable `mswindows-quote-process-args', from FSF 20.6. + Copy argument quoting code from FSF 20.6 (with appropriate Mule-ization + changes). Eliminate our old `nt-quote-process-args' mechanism. + Synch up nt_create_process with FSF 20.6 sys_spawnve. + Move compare_env here from ntproc.c. + + * process.c (Fprocess_send_region): + Takes an optional fourth argument, BUFFER, which should fix some + problems with call-process. + + * syscommctrl.h: + Move ICC_BAR_CLASSES here from syswindows.h, to avoid a warning. + + * syswindows.h: + Move ICC_BAR_CLASSES to syscommctrl.h. + Add preliminary macros for MSWindows/Mule. More to come. + + * unexnt.c: + * unexnt.c (unexec): + open_output_file moved to nt.c. + + +2000-05-05 Andy Piper + + * window.c (window_unmap_subwindows_cache_mapper): remove the dead + instance from the frame cache also since GC may catch up too late + to make frame deletion sane. + +2000-05-04 Andy Piper + + * glyphs-x.c (x_widget_instantiate): gcpro widget callbacks. + (x_finalize_image_instance): ungcpro on deletion. + + * glyphs.c (image_instantiator_format_create): give pointers a + query geometry method so that the geometry is at least set. + + * glyphs-x.c (image_instantiator_format_create_glyphs_x): only + initialize layouts if using widgets. + +2000-05-03 Andy Piper + + * nt.c: remove bogus reference to sysmmsystem.h + + * gui-x.c (popup_selection_callback): fix no selection abort. + +2000-05-02 Andy Piper + + * glyphs-msw.c (mswindows_update_widget): cope with nil text. + (mswindows_widget_instantiate): ditto. + + * glyphs-widget.c (initialize_widget_image_instance): initialize + children correctly. + (widget_instantiate): cope with children and items in the same + instance. + + * glyphs.c (mark_image_instance): cope with children as a first + class member. + (image_instance_equal): ditto. + (image_instance_hash): ditto. + (image_instance_changed): ditto. + +2000-04-30 Andy Piper + + * glyphs.c (subwindow_query_geometry): new function. Return some + defaults. + (subwindow_instantiate): don't assign dimensions if none have been + given. + (image_instantiator_format_create): add subwindow_query_geometry. + (print_image_instance): cope with layouts as widgets. + +2000-04-29 Andy Piper + + * frame.c (delete_frame_internal): call + free_frame_subwindow_instance_cache so that all subwindows are + finalized before their parent. + (mark_frame): remove subwindow_cachels. + (Fmake_frame): remove subwindow_cachel manipulation. + (allocate_frame_core): subwindow_instance_cache is a weak list. + (delete_frame_internal): set subwindow_instance_cache to nil. + + * glyphs-msw.c (mswindows_finalize_image_instance): make double + finalization safe. + (mswindows_finalize_image_instance): use the device + not the domain as the domain may have died already. + + * glyphs-x.c (x_finalize_image_instance): ditto. + (x_subwindow_instantiate): remove SUBWINDOW_WIDTH & + HEIGHT. + + * redisplay-output.c (redisplay_unmap_subwindows): update for + subwindow instance cache as a weak list. + (redisplay_unmap_subwindows_maybe): ditto. + (redisplay_unmap_subwindows_except_us): ditto. + + * glyphs.c (unmap_subwindow): error checking will check the domain + so don't deal with it here. Don't use cachels anymore. + (map_subwindow): ditto. + (update_subwindow_cachel_data): remove old accessor names. + (subwindow_instantiate): remove SUBWINDOW_WIDTH & HEIGHT. + (Fresize_subwindow): don't update cachel. + (mark_subwindow_cachels): + (update_subwindow_cachel_data): + (add_subwindow_cachel): + (get_subwindow_cachel_index): + (update_subwindow_cachel): + (reset_subwindow_cachels): + (mark_subwindow_cachels_as_not_updated): deleted. + (cache_subwindow_instance_in_frame_maybe): new function. Add a + subwindow instance to the frame cache. + (find_matching_subwindow): update for subwindow instance cache as + a weak list. + (update_widget_instances): ditto. + (image_instance_type_to_mask):inlined. + (free_frame_subwindow_instance_cache): new function. finalize all + subwindows that are instantiated. + + * glyphs.h (struct Lisp_Image_Instance): add display_data instead + of cachel information. + (IMAGE_INSTANCE_DISPLAY_X): + (IMAGE_INSTANCE_DISPLAY_Y): + (IMAGE_INSTANCE_DISPLAY_WIDTH): + (IMAGE_INSTANCE_DISPLAY_HEIGHT): + (XIMAGE_INSTANCE_DISPLAY_X): + (XIMAGE_INSTANCE_DISPLAY_Y): + (XIMAGE_INSTANCE_DISPLAY_WIDTH): + (XIMAGE_INSTANCE_DISPLAY_HEIGHT): new accessors. + remove subwindow_cachel structure and function references. + (image_instance_type_to_mask): inline from glyphs.c + + * redisplay.c (redisplay_frame): remove subwindow_cachel + references. + + * frame.h (struct frame): remove subwindow_cachels. + (FRAME_SUBWINDOW_CACHE): access subwindow_instance_cache. + + * frameslots.h: add subwindow_instance_cache. + + * window.c (replace_window): check subwindow cache of replacement. + (window_unmap_subwindows_cache_mapper): + (window_unmap_subwindows): new functions. Unmap all subwindows + cached on this window. + (mark_window_as_deleted): unmap all subwindows. + +2000-04-27 Andy Piper + + * glyphs.h (IIFORMAT_METH_OR_GIVEN): cope with null meths. + + * glyphs-widget.c (widget_layout): return something. + (layout_layout): return something. Fail if not initialized. + (layout_query_geometry): ditto. + (image_instantiator_native_layout): new function. Initialized the + native layout type. + (widget_instantiate): don't do layout stuff here. + + * glyphs.c (instantiate_image_instantiator): reorded calling or + instantiate and post_instantiate with layout in between. + (image_instance_layout): be more selective about deciding whether + the layout has been done or not. + + * glyphs.h (struct image_instantiator_methods): return a value + from layout_method. + +2000-04-26 Andy Piper + + * glyphs.c (allocate_image_instance): make initial width and + height unspecified. Set initialized to 0. + + * syscommctrl.h new file. Encapsulates commctrl.h. + + * syswindows.h new file. Encapsulates windows.h. + + * ntplay.c: use new syswindows.h and syscommctrl.h header. + * nt.c: ditto. + * console-msw.h: ditto. + + * redisplay-tty.c (tty_output_display_block): remove layout references. + + * glyphs-msw.c (mswindows_widget_instantiate): use the domain + window handle rather than just the frame. + + * glyphs.c (mark_image_instance): remove layout references. + (print_image_instance): ditto. + (image_instance_equal): ditto. + (image_instance_hash): ditto. + (decode_image_instance_type): ditto. + (encode_image_instance_type): ditto. + (image_instantiate): ditto. + (allocate_glyph): ditto. + (Fimage_instance_height): ditto. + (Fimage_instance_width): ditto. + (update_subwindow): ditto. + + * redisplay-x.c (x_output_display_block): recode for layouts as + widgets. + + * redisplay-output.c (redisplay_output_layout): recode for layouts + as widgets. + (compare_runes): remove layout references. + + * redisplay-msw.c (mswindows_output_display_block): recode for + layouts as widgets. + + * glyphs-widget.c (image_instantiator_layout): remove + layout_possible_dest_types. + (layout_possible_dest_types): deleted. + + * glyphs.h (image_instance_type): remove layout references. + (struct Lisp_Image_Instance): ditto. Add initialized flag. + (IMAGE_INSTANCE_INITIALIZED): new accessor. + (XIMAGE_INSTANCE_INITIALIZED): ditto. + +2000-04-25 Andy Piper + + * glyphs-widget.c (image_instantiator_buttons): + (image_instantiator_edit_fields): + (image_instantiator_combo_box): + (image_instantiator_scrollbar): + (image_instantiator_progress_guage): + (image_instantiator_tree_view): + (image_instantiator_tab_control): + (image_instantiator_labels): + (image_instantiator_layout): call default post_instantiate method. + (widget_post_instantiate): new function. Simply lays out the + widgets. + + * glyphs.h (struct image_instantiator_methods): add + post_instantiate method. + + * glyphs.c (instantiate_image_instantiator): add post_instantiate + method calls. + +2000-04-23 Andy Piper + + * glyphs.h (struct image_instantiator_methods): add + decode_domain_method. + (struct Lisp_Image_Instance): remove subwindow frame - it can be + derived from the domain. + (IMAGE_INSTANCE_FRAME): new accessor. + (XIMAGE_INSTANCE_FRAME): ditto. + + * glyphs.c (print_image_instance): use IMAGE_INSTANCE_FRAME + instead of _SUBWINDOW_FRAME. + (finalize_image_instance): ditto. + (Fimage_instance_foreground): ditto. + (Fimage_instance_background): ditto. + (image_instantiate): ditto. + (update_subwindow_cachel): ditto. + (update_subwindow): ditto. + (unmap_subwindow): ditto. + (map_subwindow): ditto + (subwindow_instantiate): ditto. + * glyphs-msw.c (mswindows_update_widget): ditto. + (mswindows_progress_gauge_instantiate): ditto. + (mswindows_tab_control_update): ditto. + * glyphs-x.c (x_update_widget): ditto. + (x_widget_instantiate): ditto. + (x_tab_control_instantiate): ditto. + (x_tab_control_update): ditto. + * event-msw.c (mswindows_wnd_proc): ditto + + * glyphs-widget.c (image_instantiator_layout): use + subwindow_decode_domain. + (image_instantiator_buttons): ditto. + (image_instantiator_edit_fields): ditto. + (image_instantiator_combo_box): ditto. + (image_instantiator_scrollbar): ditto. + (image_instantiator_progress_guage): ditto. + (image_instantiator_tree_view): ditto. + (image_instantiator_tab_control): ditto. + (image_instantiator_labels): ditto. + (image_instantiator_layout): ditto. + + * glyphs.c: add instance error checking to many functions. + (instantiate_image_instantiator): decode device from cache_domain. + (image_instantiate): partially rewrite by using + decode_image_instantiator_domain to determine what domain the + instance needs to be cached in. + (decode_image_instantiator_domain): new function. Determine what + domain the image needs to be cached in. + (check_window_subwindow_cache): new error checking function. + (check_instance_cache_mapper): ditto. + (check_image_instance_structure): ditto. + (subwindow_decode_domain): new function. Encodes a window as a + subwindow's cache domain. + (image_instantiator_format_create): use it for text and + subwindows. + +2000-04-21 Andy Piper + + * glyphs.c (image_instance_device): new function. + (image_instance_frame): new function. + (image_instance_window): new function. + (image_instance_live_p): new function. + + * window.c (mark_window_as_deleted): reset the subwindow_instance_ + cache to nil. + + * glyphs.h (struct Lisp_Image_Instance): device->domain. + (IMAGE_INSTANCE_DOMAIN): new accessor. + (XIMAGE_INSTANCE_DOMAIN): ditto. + + * glyphs-x.c (x_finalize_image_instance): device->domain. + + * glyphs-msw.c (init_image_instance_geometry): device->domain. + (mswindows_finalize_image_instance): ditto. + + * glyphs-eimage.c (jpeg_instantiate): device->domain. + (gif_instantiate): ditto. + (png_instantiate): ditto. + (tiff_instantiate): ditto. + + * glyphs.c (instantiate_image_instantiator): use domain rather + than device. + (mark_image_instance): device -> domain. + (print_image_instance): ditto. + (finalize_image_instance): ditto. + (image_instance_equal): ditto. + (allocate_image_instance): ditto. + (Fcolorize_image_instance): ditto. + (query_string_geometry): ditto. + (image_instantiate): ditto + (query_string_font): ditto. + (image_instantiate): ditto. + (update_subwindow): ditto. + (unmap_subwindow): ditto. + (map_subwindow): ditto. + (subwindow_instantiate): ditto. + + * specifier.h (DOMAIN_DEVICE): new, semantically correct, decoder. + (DOMAIN_FRAME): ditto. + (DOMAIN_WINDOW): ditto. + (DOMAIN_LIVE_P): ditto. + (XDOMAIN_DEVICE): ditto. + (XDOMAIN_FRAME): ditto. + (XDOMAIN_WINDOW): ditto. + + * specifier.c (Fvalid_specifier_domain_p): add image instances as + a valid specifier domain. + +2000-04-19 Andy Piper + + * glyphs-widget.c (syms_of_glyphs_widget): remove + widget-callback-current-channel. + (vars_of_glyphs_widget): ditto. + * glyphs.h: ditto + + * gui.c (get_gui_callback): revert to previous behaviour. + +2000-04-18 Andy Piper + + * glyphs.h (struct Lisp_Image_Instance): add margin_width. + (IMAGE_INSTANCE_MARGIN_WIDTH): new. + (XIMAGE_INSTANCE_MARGIN_WIDTH): new. + + * glyphs.c (image_instance_equal): add margin_width. + (image_instance_hash): ditto. + + * glyphs-widget.c (widget_instantiate): deal with margin-width. + (layout_query_geometry): ditto. + (layout_layout): ditto. + (syms_of_glyphs_widget): add margin-width. + (image_instantiator_layout): allow margin-width. + + * glyphs.c (update_widget_instances): make a normal function. + (syms_of_glyphs): remove Qupdate_widget_instances. + * glyphs.h: ditto. + + * gui-x.c (popup_selection_callback): use enqueue_magic_eval_event + so that we don't corrupt ideas about the last event or + command. Remove widget-callback-current-channel fiddling. + * gui-msw.c (mswindows_handle_gui_wm_command): ditto. + +2000-05-01 Martin Buchholz + + * XEmacs 21.2.33 is released. + +2000-05-01 Yoshiki Hayashi + + * make-src-depend: Allow dots in header file name. + +2000-05-01 Yoshiki Hayashi + + * mule-charset.h (struct charset_lookup): Add + next_allocated_1_byte_leading_byte and + next_allocated_2_byte_leading_byte. + * mule-charset.c: Move above two variables so that those values + will be dumped. + +2000-04-26 Yoshiki Hayashi + + * insdel.c (find_charsets_in_bufbyte_string): Add Vcharset_ascii + when string length is zero. + (find_charsets_in_emchar_string): Ditto. + +2000-04-29 Bjrn Torkelsson + + * lisp.h: extern Qdialog and Qmenubar. + + * gui-x.c: added events.h. + also fixed typo which made the file uncompilable. + + * general.c: Added Qmenubar and Qdialog + +2000-04-28 Ben Wing + + * frame-msw.c (mswindows_init_frame_1): + * frame-msw.c (mswindows_mark_frame): + * event-msw.c (mswindows_enqueue_dispatch_event): + * console-msw.h: + * console-msw.h (struct mswindows_frame): + * console-msw.h (FRAME_MSWINDOWS_WIDGET_HASH_TABLE1): + there are now three hash tables for callbacks. + mswindows_enqueue_dispatch_event is no longer static. + + * dialog-x.c (maybe_run_dbox_text_callback): + * dialog-x.c (dbox_descriptor_to_widget_value): + switch to new cons3 form for callbacks. + + * glyphs-msw.c (mswindows_register_gui_item): + * glyphs-msw.c (mswindows_widget_instantiate): + * glyphs-msw.c (add_tree_item): + * glyphs-msw.c (add_tab_item): + new image instance parameter, so it can be passed to callback-ex. + respect :callback-ex as well as :callback. + + * glyphs-widget.c (VALID_GUI_KEYWORDS): + add :callback-ex. + + * glyphs.c (print_image_instance): + prettify, e.g. now prints widget type. + + * gui-x.h: + certain funs have new image instance parameter. + + * gui.c: + * gui.c (get_gui_callback): + * gui.c (gui_item_add_keyval_pair): + * gui.c (gui_item_init): + * gui.c (gui_add_item_keywords_to_plist): + * gui.c (mark_gui_item): + * gui.c (gui_item_hash): + * gui.c (gui_item_equal): + * gui.c (copy_gui_item): + * gui.c (syms_of_gui): + recognize callback-ex in a number of places. + also, fix the annoying "can't get out of yes-no dialog" bug. + + * gui.h: + * gui.h (struct Lisp_Gui_Item): + recognize callback-ex in a number of places. + + * menubar-x.c (menu_item_descriptor_to_widget_value_1): + new parameter in button_item_to_widget_value. + + * glyphs-x.c (x_update_widget): + * glyphs-x.c (x_button_instantiate): + * glyphs-x.c (x_button_update): + * glyphs-x.c (x_progress_gauge_instantiate): + * glyphs-x.c (x_edit_field_instantiate): + * glyphs-x.c (x_combo_box_instantiate): + * glyphs-x.c (x_tab_control_instantiate): + * glyphs-x.c (x_label_instantiate): + new image instance parameter in various places. + + * event-Xt.c: + * event-Xt.c (enqueue_Xt_dispatch_event): + this fun gets exported. + + * gui-msw.c: + * gui-msw.c (mswindows_handle_gui_wm_command): + handle both :callback and :callback-ex, and generate our own + event because it's one of the callback-ex arguments. + + * gui-x.c: + * gui-x.c (popup_selection_callback): + handle both :callback and :callback-ex, and generate our own + event because it's one of the callback-ex arguments. + * gui-x.c (button_item_to_widget_value): + * gui-x.c (gui_items_to_widget_values_1): + * gui-x.c (gui_item_children_to_widget_values): + * gui-x.c (gui_items_to_widget_values): + new image instance parameter in various places. + + * fns.c (Freplace_list): + fix small typo in doc string. + + * lisp.h: + declare enqueue_Xt_dispatch_event. + +2000-04-28 Ben Wing + + * buffer.c: + * buffer.c (Frecord_buffer): + * buffer.c (syms_of_buffer): + delete record-buffer-hook. + + * fns.c: + * fns.c (Freplace_list): + * fns.c (syms_of_fns): + new primitive replace-list. + + * frameslots.h: + slot for old buffer-alist. + + * lisp.h: + exfun replace-list. + + * redisplay.c: + * redisplay.c (redisplay_frame): + * redisplay.c (syms_of_redisplay): + * redisplay.c (vars_of_redisplay): + new hook buffer-list-changed-hook. + call it. + +2000-04-27 Ben Wing + + * extents.h: extern in_modeline_generation. + + * redisplay.c (generate_formatted_string_db): set + in_modeline_generation. + + * extents.c (extent_changed_for_redisplay): don't mark redisplay + flags if in modeline generation. otherwise frame-modified-tick + is ticked far too often. + Declare in_modeline_generation. + +2000-04-26 Ben Wing + + * emacs.c (vars_of_emacs): document quick-build "error-checking" + option. + (vars_of_emacs): add quick-build as an error-checking option. + A bit kludgy, but there doesn't seem much point in creating + a real var for this. + + * config.h.in: put in an entry for QUICK_BUILD; remove NO_DOC_FILE. + +2000-04-14 IKEYAMA Tomonori + + * redisplay.h (struct display_line): Add a new variable, + line_continuation. + + * redisplay.c (create_text_block): Set dl->line_continuation if + the line continues. + (create_string_text_block): Ditto. + (regenerate_window_incrementally): Use line_continuation instead + of searching continuation glyph. + (add_margin_runes): Call add_glyph_rune. + (add_glyph_rune): Handle margin glyph. + +2000-04-20 Martin Buchholz + + * filelock.c (fill_in_lock_file_name): + ANSIfy. + Check for IS_ANY_SEP instead of '/'. + (lock_file_1): + Avoid generating gratuitous garbage. Call user_login_name() directly. + Never check errno without first seeing that system call failed. + (unlock_file): Add GCPRO. + (Flock_buffer): Fix docstring. + (Ffile_locked_p): Fix docstring. Add GCPRO. + +2000-04-19 Martin Buchholz + + * sysdep.c (get_pty_max_bytes): + Fix hangs on DEC OSF 4.0 when (process-send-string) sends + strings longer than 252 bytes. + + * md5.c: Unconditionally include ANSI header + + * glyphs-x.c (convert_EImage_to_XImage): + * lisp-union.h (union Lisp_Object): + Use consistently the syntax #ifdef FEATURE, not #if FEATURE. + +2000-04-13 Yoshiki Hayashi + + * filelock.c (current_lock_owner): Remove unused variable o, p. + +2000-04-17 Norbert Koch + + * callint.c: Remove multiply defined symbol Qlet + (syms_of_callint): ditto. + +2000-04-14 Andy Piper + + * general.c (syms_of_general): add last-command, this-command, let + and funcall. + + * lisp.h: declare various symbols. + + * glyphs.h: declare Qwidget_callback_current_channel; + + * glyphs-widget.c (syms_of_glyphs_widget): add + Qgui_callback_current_channel. + (vars_of_glyphs_widget): add Vgui_callback_current_channel. + + * gui-msw.c (mswindows_handle_gui_wm_command): bind + widget-callback-current-channel when invoking the interactive + arg. Also bind last-command and next-command when invoking the + widget updates. + * gui-x.c (popup_selection_callback): ditto. + + * gui.c (get_gui_callback): massage args so that we are always + calling eval. This allows us to add our own variable bindings + outside. + + * glyphs-x.c (x_button_instantiate): use + gui_items_to_widget_values since this is GC safe. + (x_progress_gauge_instantiate): ditto. + (x_edit_field_instantiate): ditto. + (x_label_instantiate): ditto. + + * event-Xt.c (emacs_Xt_handle_magic_event): remove old printfs. + (emacs_Xt_event_widget_focus_out): new function + (emacs_Xt_event_widget_focus_in): new function. Set the keyboard + focus. + (emacs_Xt_event_add_widget_actions): new function. add focus + functions as actions. + (init_event_Xt_late): use it. + +2000-04-14 Hrvoje Niksic + + * event-stream.c (Fdispatch_event): Doc fix. + +2000-03-29 SL Baur + + * postgresql.c: Remove all references to PQsetenv*. + + * postgresql.h: Remove references to PGsetenvHandler object. + * lrecord.h (lrecord_type): Ditto. + +2000-04-11 Kirill 'Big K' Katsnelson + + * glyphs-msw.h (struct mswindows_image_instance_data): Added + real_heigh and real_width members, and accessor macros for these. + + * glyphs-msw.c (init_image_instance_geometry): New function. + (init_image_instance_from_dibitmap): Use it. + (mswindows_resource_instantiate): Use it. + (init_image_instance_from_xbm_inline): Use it. + (mswindows_initialize_image_instance_mask): Use real bitmap + geometry. + (mswindows_create_resized_bitmap): Ditto. + (mswindows_create_resized_mask): Ditto. + + * redisplay-msw.c (mswindows_output_dibitmap): Stretch real mask + and bitmap to their surface size. + +2000-04-11 Jan Vroonhof + + * process-unix.c (unix_send_process): Guard against process MIA + after Faccept_process_output. + +2000-04-11 Ben Wing + + * eval.c (unbind_to_hairy): fix brokenness introduced by + nanosecond speed improvements. + +2000-04-07 Raymond Toy + + * sunplay.c (init_device): To play sounds correctly, the device + apparently needs to be initialized at least once by XEmacs. Make + it so. + +2000-04-10 IKEYAMA Tomonori + + * redisplay.c (add_margin_runes): Add text image glyph + handling. + +2000-04-06 Yoshiki Hayashi + + * lisp.h (DOESNT_RETURN): Don't declare as volatile when + gcc is newer than 2.5. + +2000-04-06 Colin Rafferty + + * lisp.h (FLEXIBLE_ARRAY_STRUCT_SIZEOF): Created. + + * fns.c (size_bit_vector): + * alloc.c (size_vector): + (make_vector_internal): + (make_bit_vector_internal): + (sweep_bit_vectors_1): + Replace calls to offsetof with FLEXIBLE_ARRAY_STRUCT_SIZEOF macro. + +2000-04-06 Andy Piper + + * gmalloc.c (malloc): undo previous change. + (malloc): ditto. + (free): ditto. + (realloc): ditto. + +2000-04-06 IKEYAMA Tomonori + + * line-number.c (buffer_line_number): Revert to former version. + +2000-04-06 Andy Piper + + * gmalloc.c (malloc): add error checking. + (malloc): ditto. + (free): ditto. + (realloc): ditto. + + * dialog-x.c (dbox_descriptor_to_widget_value): add extra + button_item_to_widget_value arg. + + * glyphs-x.c (x_button_instantiate): add extra + button_item_to_widget_value arg. + (x_progress_gauge_instantiate): ditto. + (x_edit_field_instantiate): ditto. + (x_label_instantiate): ditto. + + * gui-x.c (gui_items_to_widget_values_1): add extra + button_item_to_widget_value arg. + (button_item_to_widget_value): add extra menu_item_p arg. + + * gui-x.h: change signature of button_item_to_widget_value. + + * menubar-x.c (menu_item_descriptor_to_widget_value_1): add extra + button_item_to_widget_value arg. + +2000-04-03 Yoshiki Hayashi + + * buffer.h (struct buffer): auto_save_modified should be long. + +2000-04-05 Andy Piper + + * glyphs-widget.c (widget_instantiate): pixwidth != pixheight + type. + (button_query_geometry): give a little more room so that athena + buttons fit. + +2000-04-05 Andy Piper + + * faces.c (complex_vars_of_faces): The widget face should inherit + the font of the gui-element face. + +2000-04-04 Andy Piper + + * glyphs-x.c (x_button_update): new function. unconditionally + update a button's state when the instance is dirty. + (image_instantiator_format_create_glyphs_x): add x_button_update. + (x_widget_instantiate): remove old resize cruft. + +2000-04-02 Andy Piper + + * frame.c (change_frame_size_1): The introduction of gutters means + that we need to allow 0 as a potential frame dimension. + +2000-04-02 IKEYAMA Tomonori + + * redisplay.c (add_glyph_rune): Don't set 0 to bufpos for text + image glyph if allow_cursor. + (add_hscroll_rune): Don't allow cursor to border glyph. + (create_text_block): Ditto. + + * redisplay-output.c (redisplay_move_cursor): Do nothing even if + text not in buffer. + (redisplay_output_layout): Call ensure_face_cachel_complete for + text image glyph. + + +2000-03-16 IKEYAMA Tomonori + + * redisplay.c (add_glyph_rune): Adding text image as text runes. + + * redisplay-output.c (redisplay_move_cursor): NO_CURSOR if text + not in buffer + + * redisplay-tty.c (tty_output_display_block): Delete the routine + for text image glyph + * redisplay-x.c (x_output_display_block): ditto + * redisplay-msw.c (mswindows_output_display_block): ditto + +2000-02-02 Mike Alexander + + Note: Some of these were committed by accident as part of other + patches. + + * regex.c (regex_compile): Avoid compiler warnings. + + * ntproc.c (sys_spawnve): Avoid compiler warnings. + + * nt.h: Declare term_ntproc correctly. + + * nt.c: Remove incorrect declaration of get_home_directory which + is declared correctly in lisp.h. + + * keymap.c (get_keyelt): Avoid compiler warnings. + (raw_lookup_key_mapper): Avoid compiler warnings. + + * gutter.c (gutter_was_visible): Add return statement to avoid warning. + + * glyphs-eimage.c (png_instantiate): Avoid compiler warnings. + + * filemode.c (mode_string): Avoid compiler warnings. + + * file-coding.c (Fcoding_system_aliasee): Add return statement to + avoid warning. + + * events-mod.h: Undef some things that winuser.h defines differently. + + * data.c (Faset): Avoid compiler warnings. + + * alloc.c (Fmake_byte_code): Avoid compiler warnings. + +2000-03-03 Jan Vroonhof + + * sound.c (Fplay_sound_file): Wrap ESD in start/stop_interrupts. + Fall through to simple beep on error. + Replace "extern" by real header file. + + * linuxplay.c: Use nativesound.h + (play_sound_data): Return error code. Be less verbose on error. + + * sunplay.c: Use nativesound.h + (play_sound_data): Return error code. Be less verbose on error. + + * ntplay.c: Use nativesound.h + (play_sound_data): Return fake error code + + * sgiplay.c: Use nativesound.h + (play_sound_data): Return error code + + * hpplay.c: Use nativesound.h, partially implement + new error code. Break compilation until finished. + (play_sound_data): error code. + + * nativesound.h (play_sound_file): + (play_sound_data): Prototype in new header. + +2000-03-31 Andy Piper + + * glyphs-widget.c: (button_query_geometry): new function. Adjust + for toggle and radio buttons. + (image_instantiator_buttons): use it. + +2000-03-03 Jan Vroonhof + + * scrollbar-x.c (x_update_vertical_scrollbar_callback): + (x_update_horizontal_scrollbar_callback): Return if no mirror was + found. Scrollbar event probably belonged to some old config. + +2000-03-31 Andy Piper + + * glyphs-widget.c (widget_instantiate): use LAYOUT_VERTICAL rather + than 1. + (initialize_widget_image_instance): default layout to + LAYOUT_HORIZONTAL rather than 0. + (widget_instantiate): reverse the item list at the end rather than + every iteration. + (layout_layout): re-code for the border text at the front of the + item list rather than at the end. + (layout_query_geometry): ditto. Pick up fixed and dynamic sizes + provided by the user. + (widget_query_geometry): comment. + +2000-03-30 Andy Piper + + * glyphs-widget.c (image_instantiator_layout): allow standard + widget keywords in layouts. + + * gutter.c (output_gutter): cope with nil gutter contents. + + * frame.c (Fset_frame_properties): add gutter docs. + +2000-03-29 Andy Piper + + * toolbar-msw.c (TBSTYLE_FLAT): add. + (mswindows_output_toolbar): minor fiddling. + +2000-03-29 Andy Piper + + * gutter.c (output_gutter): force gutter size recalculation if + what we are trying to display won't fit. + (update_gutter_geometry): new function. A per-gutter version of + update_frame_gutter_geometry. + (update_frame_gutter_geometry): use it. + (redraw_exposed_gutter): add extra debugging output. + +2000-03-28 Mike Alexander + + * dumper.c: Declare pdump_hFile and pdump_hMap (Windows only) + (pdump_file_unmap): Implement it on Windows + (pdump_file_get): Save alocated handles for pdump_file_unmap + +2000-03-28 Andy Piper + + * gui.c (get_gui_callback): treat Quit specially. + +2000-03-27 Andy Piper + + * glyphs.c (image_instantiate): be careful to check in the same + way we assigned. + +2000-03-27 Didier Verna + + * config.h.in: define the proper SMART_INCLUDE macro. + handle renaming of `foo_h_path' to `foo_h_file'. + + * database.c: ditto. + + * emacs.c: ditto. + + * linuxplay.c: ditto. + + * terminfo.c: ditto. + + * tooltalk.h: ditto. + +2000-03-27 Andy Piper + + * glyphs-msw.c (mswindows_update_widget): make sure the widget + gets updated whenever the face might have changed. + +2000-03-26 Mike Alexander + + * dumper.c (pdump_resource_free): Fix the comment. + +2000-03-21 Olivier Galibert + + * input-method-xlib.c (XIM_init_frame): Remove painful warning. + +2000-03-22 Mike Alexander + + * dumper.c: Include Windows headers on Windows + (pdump_resource_free): Add a body to the function + (pdump_load): exe_name -> exe_path and add some comments. + +2000-03-25 Mike Alexander + + * gui.c (copy_gui_item_tree): Return a value in all cases + +2000-03-21 Didier Verna + + * config.h.in: move INCLUDE_GLUE_1 and INCLUDE_GLUE_2 here from + lwlib/config.h.in. + (SMART_INCLUDE): new macro. + (POSTGRES_INCLUDE): new macro to include postgresql headers from + the proper location. + + * postgresql.c: use it. + + * inline.c: ditto. + +2000-03-24 Andy Piper + + * gutter.c (redraw_exposed_gutters): must be "in display" when we + do this. + +2000-03-24 Andy Piper + + * redisplay-output.c (compare_runes): use image_instance_changed + to detect changes. Do not depend on glyphs_changed, only depend on + dirtiness. + (redisplay_output_layout): add debug messages. + (compare_runes): ditto. + + * glyphs.h: declare new functions. + (struct Lisp_Image_Instance): remove percent and associated + accessors. + + * gui.h: declare new copying functions. + + * gui.c (copy_gui_item_tree): new function. + (copy_gui_item): new function. + (gui_item_id_hash): revert to standard hash. + (gui_item_hash): ditto. + (gui_item_hash_internal): deleted. + (mark_gui_item): mark value. + (gui_item_add_keyval_pair): add value. + (gui_item_init): ditto. + (gui_add_item_keywords_to_plist): ditto. + (gui_item_equal): ditto. + (syms_of_gui): add Q_value. + + * glyphs-x.c (x_progress_gauge_update): use pending items and + value for setting the state. + (x_update_widget): don't set items from pending here. + + * glyphs-widget.c (update_widget): update items here. + (progress_gauge_set_property): use items for storing value. Put + new value in pending items. + + * glyphs-msw.c (mswindows_progress_gauge_update): use pending + items for new value. Convert percent -> value. + (mswindows_tab_control_update): don't update items here. + + * glyphs.c (Fupdate_widget_instances): use image_instance_changed. + (update_subwindow): ditto. + (image_instance_changed): new function. Compare hash values and + past and present widget items. + (image_instantiate): We more careful about where we instantiate + things. + (image_instantiate): add error checking. + + * gutter.c (syms_of_gutter): use -hook. + +2000-03-20 Yoshiki Hayashi + + * console-tty.c (Fset_console_tty_input_coding_system): Use + Qkeyboard. + (Fset_console_tty_output_coding_system): Use Qterminal. + (tty_init_console): Use Qkeyboard and Qterminal. + +2000-03-21 Ben Wing + + * ntproc.c (create_child): remove bogus HAVE_NTGUI's. + From Mike Alexander . + +2000-03-21 Ben Wing + + * event-msw.c (mswindows_need_event): Horrible kludge to fix + process brokenness. Proper implementation to come. + * callproc.c: + Rename call-process-internal to old-call-process-internal. + New impl. in process.el. + +2000-03-21 Martin Buchholz + + * Makefile.in.in: Coalesce HAVE_NATIVE_SOUND code fragments. + +2000-03-20 Andy Piper + + * glyphs.c (full_list_hash): make hashes of the same elements in + different orders return different values. + +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-20 Martin Buchholz + + * buffer.h (DFC_ALLOCA_USE_CONVERTED_DATA): + (DFC_MALLOC_USE_CONVERTED_DATA): + Add aliasing-safe casts to allow use with char* or unsigned char* + lvalues. + + * eldap.c (Fldap_open): + (Fldap_search_basic): + (Fldap_add): + (Fldap_modify): + Make C++-compilable. + Make sure GCPRO'ed variables are initialized. + Use temp variables to avoid repeated calls to Flength. + +2000-03-16 Martin Buchholz + + * sysfile.h: + Make sure PATH_MAX is always defined. + Include limits.h for PATH_MAX. + Deprecate use of MAXPATHLEN. + +2000-03-10 Martin Buchholz + + * emacs.c: Add reinit_vars_of_fileio. + * symsinit.h: Add reinit_vars_of_fileio. + * fileio.c (reinit_vars_of_fileio): New. + * fileio.c (Fmake_temp_name): + Initialize temp_name random number from microseconds to make + collisions even less likely. Initialize always at process startup + time. (make-temp-name) used to return the same file name twice in + a row when PDUMP. + Random stylistic fiddling. + Comment fixes. + +2000-03-20 Andy Piper + + * glyphs.c (image_instantiate): allow text glyphs to be + instantiated in the minibuffer window. + +2000-03-19 Andy Piper + + * glyphs.c (image_instance_hash): be careful about which items we + hash on. + + * glyphs-widget.c (tab_control_set_property): record into pending + items rather than the actual items. + + * glyphs-x.c (x_update_widget): use pending items to update with. + + * glyphs-msw.c (mswindows_tab_control_update): use pending items + to update with. + + * glyphs.c (mark_image_instance): mark pending items. + + * window.c (Fset_window_configuration): record the buffer. + (Fselect_window): totally revert previous change which breaks many + things. + +2000-03-18 Andy Piper + + * glyphs-msw.c (mswindows_tab_control_update): force selected + item. + + * glyphs.c (image_instantiate): don't allow the minibuffer as a + window domain cache, otherwise we get inconsistencies at + startup. There is something fishy at startup which can lead to the + minibuffer being the selected window when the gutter content is + instantiated. + + * gui.c (parse_gui_item_tree_list): add probably unnecessary + gcpros. + (parse_gui_item_tree_children): ditto. + (parse_gui_item_tree_item): ditto. + + * glyphs.c (Fupdate_widget_instances): return something. + +2000-03-18 Yoshiki Hayashi + + * window.c (Fselect_window): Undo 2000-03-17 change. + +2000-03-17 SL Baur + + * postgresql.c (Fpq_setenv): Remove this turkey when linking + against v7.0 libraries. Insta-coredump city until the postgres + folks fix it. + +2000-03-17 Andy Piper + + * faces.c (complex_vars_of_faces): don't give the widget face an + inherited background pixmap. + + * glyphs-msw.c (mswindows_tab_control_instantiate): select the + selected item. + + * event-stream.c (Fdispatch_non_command_events): return something. + + * gutter.c (output_gutter): use widget face. + (clear_gutter): ditto. + + * NEWS: adjust again. + + * window.c (Fselect_window): make sure this runs to completion to + avoid oddities with Fset_window_configuration. + (Fcurrent_window_configuration): in general do not save the + minibuffer as the selected window. + + * glyphs.h (IMAGE_INSTANCE_HASH_DEPTH): increase. + +2000-03-16 Olivier Galibert + + * emacs.c (Frunning_temacs_p): Revert previous patch. + (main_1): Reinitialize running_temacs_argc if pdump_load succeeds. + +2000-03-16 Andy Piper + + * glyphs-x.c (x_tab_control_update): if no widget values then + return. + + * NEWS: update for new features. + + * event-Xt.c (emacs_Xt_force_event_pending): new function. Post a + synthetic event to the native system. + (reinit_vars_of_event_Xt): set force_event_pending to + emacs_Xt_force_event_pending. + + * events.h (struct event_stream): add force_event_pending. + + * specifier.c (recompute_one_cached_specifier_in_window): add + comment. + + * redisplay.c (redisplay_frame): don't call + update_frame_subwindows. Reset subwindow cachels when + subwindows_changed, removing this was an optimization too far. + + * redisplay-output.c (compare_runes): reorganize so that we catch + glyph changes when we want them. Set optimize_output when this + would help layouts. + (redisplay_output_layout): remove frame_really_changed, use + optimize_output instead. + + * redisplay-msw.c (mswindows_output_display_block): reset + optimize_output after outputting a glyph. + * redisplay-x.c (x_output_display_block): ditto. + * redisplay-tty.c (tty_output_display_block): ditto. + + * gutter.c: (specifier_vars_of_gutter): use new spec changed + functions. + (gutter_specs_changed): do specific gutter positions. + (top_gutter_specs_changed): new function. Only update the + specified gutter specs. + (bottom_gutter_specs_changed): ditto. + (left_gutter_specs_changed): ditto. + (right_gutter_specs_changed): ditto. + + * gui.c (gui_item_hash_internal): new function, does a real hash. + (gui_item_id_hash): use it. + (gui_item_hash): hash the eval'ed gui_item. + + * gui-x.c (popup_selection_callback): send an eval event to call + Fupdate_widget_instances. + + * gui-msw.c (mswindows_handle_gui_wm_command): send an eval event + to call Fupdate_widget_instances. + + * glyphs.h (struct Lisp_Image_Instance): add optimize_output flag. + (IMAGE_INSTANCE_OPTIMIZE_OUTPUT): access it. + + * glyphs.c: (update_frame_subwindows): deleted. + (Fupdate_widget_instances): new function for updating the dirty + state of widgets that might have changed. + (syms_of_glyphs): add Qupdate_widget_instances. + (full_list_hash): hash a list completely. + (image_instance_hash): use it for items and properties. + + * frame-msw.c (mswindows_size_frame_internal): remove unused + variable. + + * faces.h (struct face_cachel): fix comment. + + * event-stream.c (Fdispatch_non_command_events): new + function. Process non-command events, forcing an event cycle + beforehand. + (syms_of_event_stream): declare. + (event_stream_force_event_pending): new function. Force an event + on the native event queue so that an event cycle will occur next + time we check. + + * event-msw.c: + (struct ntpipe_shove_stream): + (mswindows_enqueue_dispatch_event): + (mswindows_dequeue_dispatch_event): + (mswindows_cancel_dispatch_event): + (mswindows_pump_outstanding_events): + (mswindows_drain_windows_queue): + (mswindows_handle_paint): + (mswindows_wnd_proc): + (mswindows_key_to_emacs_keysym): + (get_process_input_waitable): + (emacs_mswindows_delete_stream_pair): re-indent file. + (mswindows_need_event): do not process further fds if the windows + fd is set, otherwise you get endless XM_BUMPQUEUE cycles. This + fixes the 100% cpu problem. + (reinit_vars_of_event_mswindows): set force_event_pending to 0. + +2000-03-15 Olivier Galibert + + * alloc.h: New. + * dumper.h: New. + * dumper.c: New. + + * emacs.c: Moved dump file searching to dumper.c. + (Frunning_temacs_p): Fixed. + + * alloc.c: Moved everything pdump-related to dumper.c. Removed + last_lrecord_type_index_assigned. + +2000-02-20 Olivier Galibert + + * symsinit.h: Added reinit parameter to init_console_stream + declaration. + + * lisp.h: Added file parameter to pdump_load declaration. + + * emacs.c (main_1): Added -nd/--nodump-file and -sd/--show-dump-id + support. Added dump file searching. + + * config.h.in: Added EMACS_PROGNAME. + + * console-stream.c (init_console_stream): Fix reinitialisation + when running from temacs. + + * alloc.c (pdump): Add id support. + (pdump_load): Add file parameter and signature/id support. + + * Makefile.in.in: Add full pdump support. + +2000-03-15 SL Baur + + * postgresql.c: Update documentation to reflect latest code + status. + (print_result): Show tuple counts in printed representation when + appropriate. + (Fpq_put_nbytes): MULE-ize. + (Fpq_get_line_async): Ditto. + +2000-03-14 SL Baur + + * postgresql.c (Fpq_lo_import): Fix return value. + Suggested by: Kenji Itoh . + +2000-03-13 Ben Wing + + * alloc.c (pdump_load): + Fix compile warning under mswin. + +2000-03-14 SL Baur + + * postgresql.c: Mule-ization, bug fixes. + Use PG_CODING to encapsulate coding system name changes. + Backport a version of TO_EXTERNAL format for 21.1/InfoDock. + (pg-coding-system): Create. + + (Fpq_conn_defaults): Mule-ize. + (Fpq_connectdb): Mule-ize & bug fix. + (Fpq_connect_start): Mule-ize. + (Fpq_set_client_encoding): Mule-ize. + (Fpq_finish): Document `DEAD' connection status. + (Fpq_clear): Ditto. + (Fpq_pgconn): Mule-ize. + (Fpq_exec): Mule-ize & bug fix. + (Fpq_send_query): Ditto. + (Fpq_get_result): Ditto. + (Fpq_res_status): Mule-ize. + (Fpq_result_error_message): Mule-ize. + (Fpq_ntuples): fix comments. + (Fpq_fname): Mule-ize. + (Fpq_fnumber): Mule-ize. + (Fpq_ftype): fix comments. + (Fpq_get_value): Mule-ize. + (Fpq_cmd_status): Ditto. + (Fpq_cmd_tuples): Ditto. + (Fpq_oid_value): Ditto. + (Fpq_notifies): Ditto. + (Fpq_lo_import): Ditto. + (Fpq_lo_export): Ditto. + (Fpq_get_line): Ditto. + (Fpq_put_line): Mule-ize and bug fix. + (syms_of_postgresql): Fix ifdef'ing, add pg-coding-system. + +2000-03-10 SL Baur + + * postgresql.c (vars_of_postgresql): Mule-ize. + (Fpq_conn_defaults): Ditto. + +2000-03-12 Ben Wing + + * alloc.c (Fmake_byte_code): + * alloc.c (debug_string_purity_print): + * alloc.c (pdump_backtrace): + * alloc.c (pdump_get_indirect_count): + * alloc.c (pdump_register_sub): + * alloc.c (pdump_register_object): + * alloc.c (pdump_register_struct): + * alloc.c (pdump_dump_data): + * alloc.c (pdump_reloc_one): + Minor cleanups. + + * console-msw.c: + * console-msw.c (GetConsoleHwnd): + * console-msw.c (msw_hide_console): + * console-msw.c (msw_show_console): + * console-msw.c (msw_ensure_console_buffered): + * console-msw.c (msw_output_console_string): + * console-msw.c (console_type_create_mswindows): + + a) Added functions to manipulate the console window for use with + shell support. + + b) Added support for writing text to the console, which is now + used under Windows when xemacs is not being run non-interactively, + to write text that would otherwise be destined for stdout because + under these circumstances, text written to stdout tends to + disappear and not be seen. + + * console-msw.h: + * event-Xt.c: + * event-Xt.c (x_event_to_emacs_event): + * event-Xt.c (describe_event_window): + * events-mod.h (XEMACS_MOD_CONTROL): + * events.c: + * events.c (Fmake_event): + * events.c (character_to_event): + * events.c (event_to_character): + * events.c (format_event_object): + * events.c (Fevent_modifiers): + * events.h: + * events.h (struct key_data): + * events.h (struct button_data): + * events.h (struct misc_user_data): + * frame-x.c (Fcde_start_drag_internal): + * frame-x.c (Foffix_start_drag_internal): + * gpmevent.c (Freceive_gpm_event): + * keymap.c: + * keymap.c (bucky_sym_to_bucky_bit): + * keymap.c (control_meta_superify): + * keymap.c (make_key_description): + * keymap.c (keymap_lookup_directly): + * keymap.c (create_bucky_submap): + * keymap.c (keymap_store): + * keymap.c (define_key_check_and_coerce_keysym): + * keymap.c (define_key_parser): + * keymap.c (define_key_alternate_name): + * keymap.c (Fdefine_key): + * keymap.c (raw_lookup_key_mapper): + * keymap.c (struct map_keymap_unsorted_closure): + * keymap.c (map_keymap_unsorted_mapper): + * keymap.c (map_keymap_sort_predicate): + * keymap.c (map_keymap_sorted): + * keymap.c (accessible_keymaps_mapper_1): + * keymap.c (where_is_recursive_mapper): + * keymap.c (describe_map_mapper): + * keymap.c (describe_map_sort_predicate): + * keymap.c (describe_map): + * keymap.c (complex_vars_of_keymap): + And a number of other files, the key modifier preprocessor + constants that xemacs uses have names that conflict with constants + defined under MS Windows for other purposes, so they were renamed + to begin with the prefix XEMACS_. The variables that hold such + modifiers were changed to consistently be of type int to fix + various compile warnings. + + * console.c (complex_vars_of_console): + * device.c: + * device-msw.c: + * device-msw.c (mswindows_finish_init_device): + * device-msw.c (msw_get_workspace_coords): + * device-msw.c (mswindows_device_system_metrics): + and various other files, added support for a new + device property called offset-workspace which returns the position + of the upper left corner of the workspace area and goes along with + the existing size-workspace property. + + * dialog-msw.c: + * dialog-msw.c (push_bufbyte_string_as_unicode): + * dialog-msw.c (mswindows_popup_dialog_box): + Added support for XEmacs-style accelerator specifications in + button text. Note: I didn't add support for this under X Windows, + and somebody needs to do this. + + * dialog.c: + * dialog.c (Fpopup_dialog_box): + Documented the support for accelerators that was just mentioned. + + editfns.c (get_home_directory): Changed behavior under Windows + when HOME not defined; former behavior was irretrievably broken. + + * emacs.c: + * emacs.c (main_1): + * emacs.c (main): + * minibuf.c (clear_echo_area_internal): + * minibuf.c (echo_area_append): + * print.c: + * print.c (std_handle_out_external): + * print.c (std_handle_out_va): + * print.c (fatal): + * print.c (write_string_to_stdio_stream): + * print.c (output_string): + * print.c (debug_print): + * print.c (debug_backtrace): + * print.c (debug_short_backtrace): + Cleaned up the code that prints text to stdout so that this can be + changed to output into a console window instead under MS Windows, + as described above. + + * eval.c: + * eval.c (DEFEND_AGAINST_THROW_RECURSION): + * eval.c (internal_catch): + * eval.c (unwind_to_catch): + * eval.c (throw_or_bomb_out): + * eval.c (condition_case_1): + * eval.c (signal_1): + * eval.c (check_error_state_sanity): + * eval.c (call_with_suspended_errors_1): + * eval.c (call_with_suspended_errors): + * eval.c (reinit_vars_of_eval): + Added code to catch throw loops and check for a pesky bug that may + be gone now. + + * event-msw.c: + * event-msw.c (key_needs_default_processing_p): + * event-msw.c (mswindows_wnd_proc): + * event-msw.c (mswindows_modifier_state): + * event-msw.c (emacs_mswindows_quit_p): + * event-msw.c (vars_of_event_mswindows): + a) Added support for using the alt key to select menu items as is + standard under MS Windows. This is controlled using the variable + menu-accelerator-enabled, just like under X Windows. There is an + option on the options menu to turn this support on. I really + think that it should be on by default under Windows, but I'm not + going to make this change yet. + + b) Added support for dynamic display size changes under Windows. + + * event-stream.c: + * event-stream.c (maybe_echo_keys): + * event-stream.c (Fnext_event): + * event-stream.c (command_builder_find_leaf): + * event-stream.c (lookup_command_event): + * event-stream.c (execute_command_event): + * event-stream.c (pre_command_hook): + * event-stream.c (post_command_hook): + * event-stream.c (syms_of_event_stream): + * event-stream.c (vars_of_event_stream): + * event-stream.c (complex_vars_of_event_stream): + * events.h (struct command_builder): + + a) Tried to clean up a little bit the horribly written x-specific + accelerator code that crept into this file. I moved this code + into menubar-x.c where it belongs. I also needed to move the + command builder structure into the file events.h because it is + accessed directly by this accelerator code. What I didn't do, but + which should be done at some point, is to properly abstract this + code using device methods instead of the kludgy way that it + currently hooks into the event code. + + b) Added the lisp variables this-command-properties and + last-command- properties, which should be used to synchronize two + adjacent commands in preference to playing games with the variable + this-command, which is typically what happens. + + c) Added some slightly nasty code to hook into the lisp support + for shifted- motion-key selection. This is actually necessary for + somewhat complicated reasons, which are described in + simple.el. (NB: I think the proper thing would be to have the code + that calls the pre and post command hooks also call out to generic + lisp functions in simple.el, where all built-in stuff could be + added. I will think about this more.) + + * event-unixoid.c (poll_fds_for_input): + * lread.c (readchar): + * redisplay-tty.c (tty_clear_frame): + * redisplay-x.c (x_get_gc): + * signal.c (interrupt_signal): + And a whole bunch of other files: fixed up places that printed + directly to stderr to instead call the function stderr_out so that + the changes I made under Windows work correctly. + + * filemode.c (mode_string): + Warning fixes. + + * frame-msw.c: + * frame-msw.c (mswindows_size_frame_internal): + Fixed the computation of frame size and position to keep the frame + within the workspace area, rather than within the physical + dimensions of the screen, so that the frame doesn't overlap window + manager decorations, such as the start menu and toolbar, typically + at the bottom of the screen. + + * frame.c (vars_of_frame): + Changed the default frame title format under MS Windows to consist + of buffername-XEmacs, which is standard under MS Windows. I think + it might be a good idea to change this everywhere because I think + it is superior to the current frame title format, but this is the + kind of change that is likely to cause some people to get annoyed, + so I'm not making it. + + * glyphs-eimage.c (png_instantiate): Fixed some compile warnings. + + * gui-msw.c (mswindows_handle_gui_wm_command): + Fixed compile warnings. + + * gui-x.c: + * gui-x.c (strdup_and_add_accel): + * gui-x.c (button_item_to_widget_value): + * gui-x.h: + Added code to automatically put an accelerator onto the beginning + of menu items that don't have one as is now the standard, and is + described more later. Also fixed things so that the menu item + name can be an evaluated expression, again a new standard. + + * gui.c: + * gui.c (gui_item_add_keyval_pair): + * gui.c (make_gui_item_from_keywords_internal): + * gui.c (gui_add_item_keywords_to_plist): + * gui.c (gui_item_accelerator): + * gui.c (gui_name_accelerator): + * gui.c (gui_item_included_p): + * gui.c (gui_item_display_flush_left): + * gui.c (gui_item_display_flush_right): + * gui.c (parse_gui_item_tree_item): + * gui.c (parse_gui_item_tree_children): + * gui.c (parse_gui_item_tree_list): + Mule-ized. Cleanup. GCPRO addition. + + * line-number.c (buffer_line_number): + * lisp.h: + * lisp.h (EMACS_INT_MAX): + Added the manifest constant EMACS_INT_MIN corresponding to the + existing constant EMACS_INT_MAX. This is partially to fix compile + warnings under Windows, and partly for cleanliness. + + * menubar-msw.c: + * menubar-msw.c (REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH): + * menubar-msw.c (msw_translate_menu_or_dialog_item): + * menubar-msw.c (displayable_menu_item): + * menubar-msw.c (populate_menu_add_item): + * menubar-msw.c (populate_or_checksum_helper): + * menubar-msw.c (populate_menu): + * menubar-msw.c (update_frame_menubar_maybe): + * menubar-msw.c (prune_menubar): + * menubar-msw.c (msw_char_is_accelerator): + * menubar-msw.c (unsafe_handle_wm_initmenu_1): + * menubar-msw.c (mswindows_handle_wm_command): + * menubar-msw.c (mswindows_handle_wm_initmenupopup): + * menubar-msw.c (mswindows_handle_wm_initmenu): + * menubar-msw.c (mswindows_update_frame_menubars): + * menubar-msw.c (mswindows_free_frame_menubars): + * menubar-msw.c (mswindows_popup_menu): + Fixed a bug in handling accelerators where an extra character + would be displayed in the menu item. Also generalized the + function displayable_menu_item because it is now used by the + dialog box code as well. And finally, added code in the functions + that create the menubar to extract a list of accelerators for the + top level menubar, which is used in the event code to determine + whether a particular alt-key combination should be used to invoke + a menu item, or should be passed through to access the standard + XEmacs keymap binding for this key combination. + + Much needed GCPROing. + + * menubar-x.c: + * menubar-x.c (menu_item_descriptor_to_widget_value_1): + * menubar-x.c (menu_item_descriptor_to_widget_value): + * menubar-x.c (restore_in_menu_callback): + * menubar-x.c (x_popup_menu): + * menubar-x.c (menu_move_up): + * menubar-x.c (menu_move_down): + * menubar-x.c (menu_move_left): + * menubar-x.c (menu_move_right): + * menubar-x.c (menu_select_item): + * menubar-x.c (command_builder_operate_menu_accelerator): + * menubar-x.c (menu_accelerator_junk_on_error): + * menubar-x.c (command_builder_find_menu_accelerator): + * menubar-x.c (Faccelerate_menu): + * menubar.h: + Moved a whole bunch of code here that was previously in + event-stream.c as described above. There is also code connected + to the new standard of adding an accelerator to the beginning of + menu items that don't have one as described above and below. + + * menubar.c: + * menubar.c (menu_parse_submenu_keywords): + * menubar.c (Fmenu_find_real_submenu): + * menubar.c (Fnormalize_menu_item_name): + * menubar.c (syms_of_menubar): + * menubar.c (vars_of_menubar): + * menubar.c (complex_vars_of_menubar): + + a) Cleaned up a bunch of documentation and improved it. + + b) XEmacs now automatically adds an accelerator onto the beginning + of any menu items that don't have one. I did this because there + will inevitably be some menu items on the main menubar that don't + have accelerators on them because the package that adds that + particular menu item hasn't yet been fixed up to have accelerators + in them and it looked rather strange to have some items with and + some items without accelerators, especially since even in items + without accelerators, you can, at least under windows, still + access the item through an accelerator corresponding to the first + character in the item's name. If people don't like this behavior, + I can add a variable to turn it off optionally, but I'm not sure + this is a good idea because we really do need to have accelerators + on all of the menu items, and if a package doesn't like the + accelerators being put on the first character, then it should put + the accelerators where they belong. + + c) I made a behavior change, which is that the descriptor that + specifies the text of the menu item, which formerly was just a + string, can now also be an evaluated expression. This makes this + descriptor parallel with all of the others, which could also be + evaluated expressions. This also obviates the need for the + keyword :label, which was previously listed in the documentation + as unimplemented, and which was for the same purpose. + + d) GCPROing. + + * ntproc.c: + * ntproc.c (new_child): + * ntproc.c (sys_spawnve): + * ntproc.c (find_child_console): + * ntproc.c (sys_kill): + Fixed compile warnings. By the way, this file should really go + away entirely, and this will happen as soon as Kirill makes his + final round of process cleanups, which affect the function + call-process. + + * process-nt.c: + * process-nt.c (struct nt_process_data): + * process-nt.c (find_process_from_pid): + * process-nt.c (send_signal_the_nt_way): + * process-nt.c (enable_child_signals): + * process-nt.c (find_child_console): + * process-nt.c (send_signal_the_95_way): + * process-nt.c (nt_finalize_process_data): + * process-nt.c (ensure_console_window_exists): + * process-nt.c (nt_create_process): + * process-nt.c (nt_kill_child_process): + * process-nt.c (nt_kill_process_by_pid): + * process-nt.c (nt_open_network_stream): + * process-nt.c (vars_of_process_nt): + Copied over code from Emacs 20.5 to correctly send signals to sub- + processes under Windows 95. Also added code to automatically + create and hide console window when a sub-process is created under + Windows 95, which obviates the need for the separate runemacs.exe + executable, and finally implemented some variables that were + implemented in Emacs 20.5, but previously not in XEmacs. These + include mswindows- start-process-share-console and + mswindows-start-process-inherit-error-mode. (Both of these only + apply to Windows 95.) + + * regex.c (regex_compile): Fixed a compile warning. + + * select-msw.c: + * select-msw.c (mswindows_own_selection): + * select-msw.c (mswindows_get_foreign_selection): + * select-msw.c (mswindows_disown_selection): + * select-msw.c (console_type_create_select_mswindows): + * select-msw.c (syms_of_select_mswindows): + Cleaned up the file and implemented the device method + selection_exists_p, which had accidentally been left out. Also + removed four lisp functions that were remnants from before the + time when the selection code was properly device abstracted. + These functions are no longer needed because there are generic + equivalents, and because they were added recently and don't exist + in FSF Emacs, I don't think there's any problem with just deleting + them. + + * sysdep.c: + * sysdep.c (sys_subshell): + Fixed a compile warning, although in this case there's probably + something wrong with this code, and it ought to be looked into + more thoroughly by somebody who understands it. + + * window.c: + * window.c (Fwindow_text_area_height): + * window.c (Fwindow_width): + * window.c (Fwindow_full_width): + * window.c (Fwindow_pixel_width): + * window.c (debug_print_window): + * window.c (syms_of_window): + Added functions window-text-area-height and window-full-width, + which are functions for returning various width and height + characteristics of a window. (One of these functions is necessary + for making the file dialog box work correctly, and the other one + was added for completeness.) Also added a table to the + documentation for window-height which describes the entire scheme + for accessing width and height characteristics of a window. + +2000-03-12 Kirill 'Big K' Katsnelson + + * nt.c (fstat): Added a comment for another problem with + non-encapsulated [f]stat(), reported by Adrian Aichner + . + +2000-03-11 Andy Piper + + * window.c (make_dummy_parent): initialize subwindow instance + cache. + (Fset_window_configuration): zero extent_modiff. + +2000-03-10 Andy Piper + + * redisplay.c (Fredraw_frame): reset the changed_set flags so that + more changes can be triggered. + (Fredisplay_frame): ditto. + (Fredraw_device): ditto. + (Fredisplay_device): ditto. + (redisplay_frame): make non-static. + (redisplay_frame): call update_frame_gutter_geometry outside of + display proper. + + * gutter.h: declare update_frame_gutter_geometry. + + * redisplay.h: declare redisplay_frame. + + * gutter.c (update_frame_gutter_geometry): move geometry changes + in update_frame_gutters here. Geometry changes can only occur + outside of redisplay. + (update_frame_gutters): remove geometry change code. + (Fredisplay_gutter_area): make sure that we are in display when we + update and that we have flushed any size changes. + +2000-03-11 Andy Piper + + * alloc.c (pdump_dump_data): remove i & count shadows. + +2000-02-27 Mike Alexander + + * sysdep.h: Declare pdump_read_file + + * sysdep.c (pdump_read_file): New function + + * alloc.c (pdump_load): Call pdump_read_file to get the portable + dump data + +2000-03-10 SL Baur + + * lrecord.h: add `lrecord_type_pgsetenv'. + +2000-03-08 SL Baur + + * symsinit.h: declare (vars|syms)_of* functions. + * lrecord.h: add `lrecord_type_pgconn' and 'lrecord_type_pgresult'. + +2000-03-06 SL Baur + + * config.h.in: Add symbols HAVE_POSTGRESQL and HAVE_POSTGRESQLV7 + + * inline.c: Include postgresql.h lrecord stuffs to placate buggy + GCCs. + + * emacs.c (main_1): Call postgres initialization code. + + * postgresql.h: New file. PostgreSQL RDBMS support. + * postgresql.c: New file. + +2000-03-08 Yoshiki Hayashi + + * redisplay-output.c (redisplay_output_display_block): Disable + redundant code. + +2000-03-09 Yoshiki Hayashi + + * mule-canna.c (Fcanna_henkan_region): Translate doc-string. + (Fcanna_henkan_next): Ditto. + (Fcanna_bunsetu_henkou): Ditto. + (Fcanna_henkan_kakutei): Ditto. + (Fcanna_henkan_end): Ditto. + (Fcanna_henkan_quit): Ditto. + (Fcanna_henkan_next): Set retun value correctly. + (c2mu): Use unsigned char instead of signed char. + +2000-03-09 Yoshiki Hayashi + + * emacs.c (main_1): Always call syms_of_gui. + * inline.c: include gui.h + +2000-03-09 Yoshiki Hayashi + + * redisplay.c (Vvisible_bell): Renamed from visible_bell and + converted to Lisp_Object. + (Qtop_bottom): New variable. + (syms_of_redisplay): Initialize it. + * redisplay.h (Vvisible_bell): Ditto. + * sound.c (ding): Ditto and check if Vvisible_bell is nil. + * redisplay-x.c (x_flash): When Vvisible_bell is top-bottom, + only flash top and bottom. + +2000-03-08 Andy Piper + + * buffer.c (Frename_buffer): record new buffer name the right way. + +2000-03-08 Andy Piper + + * glyphs.c (update_subwindow): increase hash depth so that widget + items get picked up properly. + + * redisplay-output.c (compare_runes): increase hash depth so that + widget items get picked up properly. + +2000-03-08 Andy Piper + + * gutter.c (output_gutter): add some debug. + + * glyphs.h (struct Lisp_Image_Instance): add display_hash. + (IMAGE_INSTANCE_DISPLAY_HASH): new macro. + (XIMAGE_INSTANCE_DISPLAY_HASH): ditto. + + * redisplay-output.c (compare_runes): use display_hash to + determine if glyphs really are not the same. + + * glyphs.c (update_subwindow): check display_hash to see if + anything really needs to be updated. If not then do + nothing. Record the display_hash after updating. + (image_instance_equal): compare the image_instance face also. + +2000-03-07 Yoshiki Hayashi + + * redisplay.h: Fix comment style. + +2000-03-08 Jonathan Harris + + * consle-msw.h (struct mswindows_frame): + Added new member paint_pending to indicate whether a WM_PAINT + magic event has been queued for this frame. + + * event-msw.c (mswindows_drain_windows_queue): + Don't queue a WM_PAINT magic event if one is already queued. + (emacs_mswindows_handle_magic_event): clear paint_pending flag. + + * frame-msw.c (mswindows_init_frame_1): initialise paint_pending flag. + +2000-03-07 Didier Verna + + * dired.c: #include `regex.h' after `sysfile.h'. + +2000-03-06 Martin Buchholz + + * sound.c (init_nas_sound): Fix compiler warning. + + * alloc.c (ALIASING_VOIDPP_DEREFERENCE): New. + (FREE_STRUCT_P): + (MARK_STRUCT_AS_FREE): + (MARK_STRUCT_AS_NOT_FREE): + Make `gcc -fstrict-aliasing' work properly. + +2000-03-07 Jonathan Harris + + * device-msw.c (mswindows_finish_init_device): Call CoInitialize(). + (mswindows_delete_device): Call CoUnnitialize(). + + * event-msw.c (mswindows_wnd_proc): WM_DROPFILES: Decode Shortcuts. + +2000-02-25 + + * process-nt.c: MinGW now has , but still needs + . + + * sysdep.c: This extern declaration for environ prevents MinGW + from finding the variable in CRTDLL.DLL. + + * s\mingw32.h (PBS_SMOOTH): Removed, now defined in cygwin's + windows headers. + (SHGFI_EXETYPE): .. + (WM_MOUSEWHEEL): .. + (_WIN32_IE): Added, needed to get the TCS_BOTTOM and TCS_VERTICAL + definitions. + (MMRESULT): Removed, now defined in cygwin's windows headers. + (TIMECAPS): .. + (uid_t,gid_t,pid_t,ssize_t): .. + (_timeb): Removed, MinGW defines both _timeb and timeb. + (HAVE_H_ERRNO): Added. + (HAVE_TZNAME): Added, configure is not detecting this. + +2000-02-03 IKEYAMA Tomonori + + * chartab.h (XCHAR_TABLE_VALUE_UNSAFE): New macro. + * syntax.c (syntax_match): Use it. + + * cmds.c: Import auto-fill-chars from FSF Emacs. + (Vauto_fill_chars): New variables. + (internal_self_insert): Check Vauto_fill_chars. + (vars_of_cmds): + Declare auto-fill-chars as a Lisp variable and initialize it. + +2000-03-05 Jonathan Harris + + * fileio.c (Fmake_symbolic_link): + (Ffile_symlink_p): + Run handlers even if local machine doesn't have symlinks. + +2000-03-05 Jonathan Harris + + * event-msw.c (mswindows_drain_windows_queue): + Don't generate paint magic events for non-XEmacs frames. + +2000-03-05 Andy Piper + + * redisplay.c (redisplay_frame): generate_displayable_area and + friends assumes that we are not in GC, we therefore have to make + sure that this doesn't happen. + + * gutter.c (calculate_gutter_size): generate_displayable_area + assumes that we are not in GC, we therefore have to make sure that + this doesn't happen. + +2000-03-05 Martin Buchholz + + * opaque.c (DEFINE_LRECORD_IMPLEMENTATION): opaque_ptr ==> opaque-ptr + +2000-03-03 Jan Vroonhof + + * redisplay.c (regenerate_window): Make sure we set a sane value + for end_pos even if we jump out of the loop. + (regenerate_window): Answer Ben's question :-). + (start_end_of_last_line): Add may_error argument. + (start_of_last_line): + (end_of_last_line): Pass may_error = 0. + (end_of_last_line_may_error): New function. + (pixel_to_glyph_translation): Use it, so we don't crash in + event_to_glyph. + +2000-03-04 Andy Piper + + * window.h (struct window): add gutter_extent_modiff. + + * window.c (allocate_window): zero out gutter_extent_modiff. + + * redisplay.h: declare sync_display_line_structs. + + * redisplay.c (add_glyph_rune): add a better comment. + + * redisplay-output.c (sync_display_line_structs): made non-static. + (compare_runes): remove unneccesary glyph cachel access. + + * gutter.h: declare gutter_extent_signal_changed_region_maybe. + + * gutter.c (output_gutter): don't output the gutter if extent + changes only involve extents in buffers. use 4 sets of display + lines. + (gutter_extent_signal_changed_region_maybe): new function. Mark + extents in gutters as changed. + (update_frame_gutters): use 4 sets of display lines. + (reset_gutter_display_lines): ditto. + (free_frame_gutters): ditto. + (redraw_exposed_gutter): force output of gutters. + + * frame.h (struct frame): add 4 sets of gutter display lines. + + * extents.c: (extent_changed_for_redisplay): signal changes to + extents in strings in the gutter as well as extents in buffers. + +2000-03-02 Andy Piper + + * gutter.c (specifier_vars_of_gutter): cosmetic changes. + + * frame.c (Fmake_frame): make sure the gutters get initialized + after the frame is visible. + (set_frame_selected_window): re-arrange compilation macros a + little. + (change_frame_size_1): mark gutters changed. + + * device.c (Fset_device_class): mark gutters changed. + +2000-03-01 Andy Piper + + * window.c (window_top_frame_gutter_height): deleted. + (window_bottom_frame_gutter_height): ditto. + (window_left_frame_gutter_height): ditto. + (window_right_frame_gutter_height): ditto. + (window_top_gutter_height): don't use them. + (window_bottom_gutter_height): ditto. + (window_left_gutter_width): ditto. + (window_right_gutter_width): ditto. + (Fsplit_window): ditto. + (Fwindow_pixel_edges): don't use border dimensions here. + + * scrollbar.c (update_scrollbar_instance): don't take gutters into account. + (update_scrollbar_instance): ditto. + + * redisplay.c (generate_modeline): don't take gutters into account. + (generate_modeline): ditto. + (redisplay_frame): small gutter display optimization. + + * redisplay-x.c (x_output_vertical_divider): don't take gutters into account. + + * redisplay-msw.c (mswindows_output_vertical_divider): don't take + gutters into account. + + * gutter.h (WINDOW_REAL_*_GUTTER_BOUNDS): remove bogus checks + for window position and type. + + * gutter.c (get_gutter_coords): fix for frame gutters. + (update_frame_gutters): update frame geometry if the gutters have + changed. + (init_frame_gutters): record current gutter geometries. + + * glyphs-msw.c (mswindows_subwindow_instantiate): remove unused + var. + (mswindows_widget_instantiate): ditto. + + * frame.h (struct frame): add current_gutter_bounds. + + * frame.c (change_frame_size_1): position window and minibuffer + appropriately taking into account the frame gutters. + + * frame-x.c: (x_initialize_frame_size): take into account the + frame gutters. + +2000-02-29 Stephen J. Turnbull + + * emacs.c (data-directory): Xref `locate-data-file' in docstring. + +2000-02-29 Stephen J. Turnbull + + * alloc.c (dumpopaquevec): Increase dimension for --with-canna. + +1999-12-30 Yoshiki Hayashi + + * file-coding.c (reset_decoding_stream): Clear previous + detection state when autodetect. + +2000-02-29 Didier Verna + + * extents.c (set_extent_glyph_1): don't require extents to be + attached. + +2000-02-27 Andy Piper + + * gutter.c (Fset_default_gutter_position): don't default left and + right gutter visibility to t. + (Fset_default_gutter_position): run + default-gutter-position-changed-hook. + (syms_of_gutter): add default-gutter-position-changed-hook. + +2000-02-26 Andy Piper + + * specifier.c (Fmake_specifier): add gutter references. + + * gutter.h (RAW_WINDOW_GUTTER): new macro. + + * lisp.h: declare Fvalid_plist_p. + + * gutter.c (gutter_geometry_changed_in_window): mark the modeline + as changed. + (default_gutter_visible_p_changed_in_window): invalidate gutter as + well as its visibility so that it gets reconstructed. + (construct_window_gutter_spec): new function. Construct a string + to be displayed in the gutter from a plist of strings. Take care + to only use elements that are declared as visible. + (calculate_gutter_size): use RAW_WINDOW_GUTTER instead of + WINDOW_GUTTER. + (gutter_validate): allow plists of strings in the specifier. + (gutter_specs_changed): construct the real_gutter from the gutter + specs using construct_window_gutter_spec. + (gutter_visible_validate): gutter-visible is a new specifier type. + (Fgutter_visible_specifier_p): new function for the new specifier. + (syms_of_gutter): declare gutter-visible and + Fgutter_visible_specifier_p. + (specifier_type_create_gutter): intitalize new gutter-visible + specifier. + (reinit_specifier_type_create_gutter): ditto. + (specifier_vars_of_gutter): use new specifier type for gutter + visibility. + (init_frame_gutters): construct real_gutter correctly. + (Fgutter_specifier_p): beef up documentation. + (Fgutter_size_specifier_p): ditto. + + * winslots.h: add real_gutter slots. + +2000-02-25 Andy Piper + + * device-msw.c: Be kind to older cygwin versions. From Raymond + Toy . + + * gui-msw.c (Fmswindows_shell_execute): Remove things unknown to + earlier cygwins. From Raymond Toy . + +2000-02-25 Martin Buchholz + + * elhash.c (MARK_OBJ): Practice macro hygiene. + +2000-02-24 Martin Buchholz + + * miscplay.c: s/__inline__/inline/g; + * glyphs-msw.c (set_mono_pixel): INLINE ==> static inline + (get_device_compdc): INLINE ==> static inline + * *.[ch]: Change INLINE to INLINE_HEADER globally. + find -name '*.h' | \ + xargs global-replace \ + 's/(^|(?<=[^A-Za-z0-9_]))INLINE((?=[^A-Za-z0-9_])|$)/INLINE_HEADER/g' + +2000-02-25 Andy Piper + + * window.c (window_top_frame_gutter_height): new function. + (window_top_window_gutter_height): ditto. + (window_top_gutter_height): use them. + (window_bottom_frame_gutter_height): new function. + (window_bottom_window_gutter_height): ditto. + (window_bottom_gutter_height): use them. + (window_left_window_gutter_width): new function. + (window_left_frame_gutter_width): ditto. + (window_left_gutter_width): use them. + (window_right_window_gutter_width): new function. + (window_right_frame_gutter_width): ditto. + (window_right_gutter_width): use them. + (window_pixel_height): new function. calulate window pixel height + with frame gutter involvement. + (Fsplit_window): calculate new sizes taking frame gutters into + account. + (window_char_height_to_pixel_height): don't include frame gutters. + (window_char_height): use window_pixel_height. + (window_pixheight): rename from window_pixel_height. + (change_window_height): use it. + (window_pixel_height_to_char_height): don't include frame gutters. + (window_char_width_to_pixel_width): ditto. + +2000-02-25 Andy Piper + + * glyphs.h (IMAGE_INSTANCE_FACE): glyph might be nil, don't crash + if it is. + +2000-02-24 Martin Buchholz + + * alloc.c (staticpro): + (staticpro_nodump): + (dumpstruct): + (dumpopaque): + (pdump_wire): + (pdump_wire_list): + (compact_string_chars): + (pdump_dump_wired): + Convert: if (foo) abort(); ==> assert (! foo); + + * eldap.c (Fldap_search_basic): + (Fldap_add): + (Fldap_modify): + (Fldap_delete): + Fix compiler warnings, and possible crashes if (random) return + value were to be used. + +2000-02-21 Kirill 'Big K' Katsnelson + + * device-msw.c: Workaround ResetDC failure. + + * frame-msw.c (msprinter_init_frame_3): Added an assertion before + applying a devmode. + + * redisplay-msw.c (get_frame_dc): Added start_page_p. + (mswindows_text_width): Do not start printer page. + + * console-msw.h (CHECK_MSGDI_DEVICE): Added this and friends. + + * glyphs-msw.c: Added image methods to msprinter console and + msprinter-specific image instantiation. + +2000-02-20 Mike Alexander + + * select-msw.c (Fmswindows_set_clipboard): GC protect more things + to avoid crashes when selection-sets-clipboard is on + (mswindows_own_selection): ditto + +2000-02-19 Kirill 'Big K' Katsnelson + + * glyphs-msw.c: + * redisplay-msw.c (get_frame_dc): + (get_frame_compdc): + * console-msw.h: + * device-msw.c (mswindows_init_device): + (mswindows_delete_device): + (msprinter_init_device): + (msprinter_delete_device): + * frame-msw.c (mswindows_init_frame_1): + (mswindows_delete_frame): + (msprinter_init_frame_3): + (msprinter_delete_frame): Move compatible DC to device object from + frame object, for both mswindows and msprinter. Only one at a time + is needed, it is a real waste to have one per frame! + +2000-02-23 Andy Piper + + * glyphs.c: add dynamic width and height elements. + (image_instance_equal): ditto. + + * glyphs-widget.c (widget_query_geometry): calculate width and + height dynamically if required. + (initialize_widget_image_instance): initialize dynamic dimensions. + (widget_instantiate): pick-up dynamic dimensions. + + * glyphs.h (struct Lisp_Image_Instance): add width and height for + dynamic determination. Add appropriate macros. + + * gutter.h (WINDOW_GUTTER_BORDER_WIDTH): make non-integer + dimensions safe. + (WINDOW_GUTTER_SIZE): ditto. + (WINDOW_GUTTER_SIZE_INTERNAL): ditto. + + * redisplay-msw.c (get_frame_compdc): gcc can't cope with this + inline. + (get_frame_dc): ditto. + + * redisplay.h (GLOBAL_RESET_CHANGED_FLAGS): don't reset faces + here. + +2000-02-23 Martin Buchholz + + * XEmacs 21.2.31 is released. + +2000-02-22 Ben Wing + + * ntheap.c (allocate_heap): Make sure `ptr' is initialized. + +2000-02-22 Andy Piper + + * glyphs-x.c (x_widget_instantiate): don't explicitly resize here. + +2000-02-21 Mike Sperber + + * .dbxrc: + * .gdbinit: + * Makefile.in.in: Remove obsolete EMACSBOOTSTRAP... environment + variables. + +2000-02-21 Mike Sperber + + * s/aix4.h: Declare getaddrinfo broken for AIX 4, which it is. + +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-20 Martin Buchholz + + Performance hacking. + * *.c (syms_of_*): + Add INIT_LRECORD_IMPLEMENTATION macros, paired with + DEFINE_LRECORD_IMPLEMENTATION macros in the same file. + * emacs.c (main_1): + * lisp.h (DEFUN): + * console.c (DEFVAR_CONSOLE_LOCAL_1): + * buffer.c (DEFVAR_BUFFER_LOCAL_1): + * symeval.h (DEFVAR_SYMVAL_FWD): + * symbols.c (guts_of_unbound_marker): + Make all c_readonly objects also lisp_readonly and marked for life. + * lrecord.h (struct lrecord_implementation): + Document flags better. + * lrecord.h (DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS): + * lrecord.h (DECLARE_LRECORD): + * lrecord.h (XSETRECORD): + * lrecord.h (RECORDP): + * lrecord.h (RECORD_TYPEP): + * lrecord.h (RECORD_MARKER): New. + * lrecord.h (error_check_*): + * lrecord.h (CONCHECK_NONRECORD): + * lrecord.h (MAKE_LRECORD_IMPLEMENTATION): + * lrecord.h (INIT_LRECORD_IMPLEMENTATION): New. + * lrecord.h (set_lheader_implementation): + * lrecord.h (enum lrecord_type): New. + * symeval.h (SYMBOL_VALUE_MAGIC_P): + * alloc.c (disksave_object_finalization_1): + * alloc.c (mark_object): + * alloc.c (lrecord_type_index): + * alloc.c (tick_lcrecord_stats): + * alloc.c (Fgarbage_collect): + * alloc.c (init_alloc_once_early): + * alloc.c (pdump_load): + * alloc.c (GC_CHECK_LHEADER_INVARIANTS): New. + * alloc.c (lrecord_type_index): Delete. + Make lisp object type indexes be constant. + Makes (byte-compile) 5% faster. + Put all marker functions into their own array. + Makes (garbage-collect) 5% faster. + Optimize SYMBOL_VALUE_MAGIC_P. + Makes (byte-compile) 2-3% faster. + * config.h.in (gc_checking_assert): New. + * alloc.c: Use gc_checking_assert(). + * .dbxrc: Make compatible with new object type implementation. + * .gdbinit: Make compatible with new object type implementation. + * alloc.c: Delete all symbols defined only for debugging, such as + Lisp_Type_Vector and lrecord_charset. + +2000-02-21 Andy Piper + + * gui-msw.c (Fmswindows_shell_execute): fix file location + problems. + + * buffer.c (Fkill_buffer): remove buffer from alist buffer + unshowing so that set_window_buffer doesn't undo + kill_buffer_hook's hard work. + + * glyphs-widget.c (tab_control_query_geometry): don't count the + first item when calculating geometry. + + * glyphs.c (map_subwindow): remove redundant code. + (update_frame_subwindows): be more circumspect about when to + update subwindows. + + * glyphs-x.c (x_update_widget): Properly fix sizing bug. Fix bug + when items haven't changed. Update faces if faces have changed as + well as just the widget face. + (x_tab_control_update): Update faces if faces have changed as well + as just the widget face. + +2000-02-21 Jonathan Harris + + * device-msw.c: (mswindows_delete_device): Remove redundant DDE + registration. + (build_syscolor_string): Use mswindows_color_to_string to try to + get a named color. + (mswindows_device_system_metrics): Reverse the foreground and + background colors so that they match the documentation. + + * objects-msw.c: (mswindows_X_color_map): tweak some values so + they match the default Windows palette. + (mswindows_color_to_string): New function. + +2000-02-21 Jonathan Harris + + * s/windowsnt.h: Only use __declspec(noreturn) with MSVC>=6. + +2000-02-18 Olivier Galibert + + * m/*, s/*: Removed obsolete DATA_SEG_BITS, PURE_SEG_BITS, + WORD_MACHINE, SIGN_EXTEND_CHAR and EXPLICIT_SIGN_EXTEND. + + * symbols.c (init_symbols_once_early): Removed obsolete + DATA_SEG_BITS related kludge. + (defvar_magic): Ditto. + + * malloc.c: Removed obsolete DATA_SEG_BITS + * ralloc.c: Ditto. + * mem-limits.h: Ditto. + + * Makefile.in.in: Removed obsolete HAVE_SHM + * emacs.c: Ditto. + +2000-02-13 Jonathan Harris + + * device-msw.c (mswindows_delete_device): Free DDE string + handles. + +2000-02-16 Kirill 'Big K' Katsnelson + + * keymap.c (get_keyelt): + * unexnt.c (unexec): + * vm-limit.c (memory_warnings): + * ntheap.c (recreate_heap): + * ntheap.h (UNINIT_PTR): + * select-msw.c (Fmswindows_get_clipboard): + (Fmswindows_set_clipboard): + * objects-msw.h (MSWINDOWS_BAD_HFONT): + * objects-msw.c: + * menubar-msw.c (displayable_menu_item): + * glyphs-msw.c: + * glyphs-msw.h (IMAGE_INSTANCE_MSWINDOWS_MASK): + * sysdep.c (sys_subshell): + * process-nt.c (nt_create_process): + * nt.c (normalize_filename): + (dostounix_filename): + (unixtodos_filename): + * ntproc.c (win32_executable_type): + * ntplay.c (play_sound_data_1): + (play_sound_file): + * editfns.c (get_home_directory): + * event-msw.c (struct winsock_stream): + (mswindows_dde_callback): + * device-msw.c (msprinter_init_device): + (msprinter_get_devmode_copy): Frobbed syntax frivolities. + + * toolbar-msw.c (mswindows_free_frame_toolbars): Paramters to + mswindows_clear_toolbar were swapped! + + * objects-msw.c:(colormap_t): + (fontmap_t): + * emacs.c (struct standard_args): Fixed const jumble. + + * glyphs-widget.c (update_widget): Fixed comparison notation. + + * event-msw.c (mswindows_dde_callback): Removed extraneous ';'. + + * s\windowsnt.h (DOESNT_RETURN): Defined to support the MSVC + __declspec(noreturn) syntax. + +2000-02-19 Martin Buchholz + + * eldap.c (Fldap_open): + (Fldap_search_basic): + (Fldap_add): + (Fldap_modify): + Use new coding system conversion macros. + +2000-01-06 Yoshiki Hayashi + + * console-tty.c (tty_init_console): Change MULE to FILE_CODING. + +1999-11-27 Oscar Figueiredo + + * eldap.h (Fldap_search) Renamed from Fldap_search_internal: + (Fldap_add, Fldap_modify, Fldap_delete): New functions + + * eldap.c (Qadd, Qreplace): New constant symbols + (Fldap_open): Use the LDAP_OPT_RESTART option to avoid + interruptions by XEmacs signals + Remove unnecessary calls to slow_down_interrupts and + speed_up_interrupts + (Fldap_search_basic): Renamed from Fldap_search_internal + Added new optional parameter VERBOSE that triggers the + display of progress messages + Remove unnecessary calls to slow_down_interrupts and + speed_up_interrupts + LDAP result code analysis rewritten + (Fldap_add, Fldap_modify, Fldap_delete): New functions + (syms_of_eldap): Define the new symbols and functions + + +2000-02-17 Martin Buchholz + + * realpath.c: Determine PATH_MAX maximally portably. + + * insdel.c (bytecount_to_charcount): Optimize. + The function used to be optimized for entirely ASCII sequences. + Now it is optimized for successive characters from the same + charset. This also wins big for _mostly_ ASCII sequences. + + * fileio.c (Ffile_truename): convert return from realpath() using + Qfile_name, not Qbinary. Fixes obvious bug with non-ASCII symlinks. + - Rewrite GCPROing slightly. + + * sysdep.c (sys_open): Do filename conversion, like all other + sys_* functions. Fixes bug: + (let ((file-name-coding-system 'iso-8859-2)) + (write-region x y latin2-name)) + ==> writes filename using internal encoding. + +2000-02-18 Martin Buchholz + + * buffer.c (DEFVAR_BUFFER_LOCAL_1): Turn on c_readonly. Always const. + * console.c (DEFVAR_CONSOLE_LOCAL_1): Turn on c_readonly. Always const. + * symeval.h (DEFVAR_SYMVAL_FWD): Turn on c_readonly. Always const. + * eval.c (lrecord_subr): Remove this_one_is_unmarkable. + * symbols.c (lrecord_symbol_value_forward): Remove this_one_is_unmarkable. + * symbols.c (guts_of_unbound_marker): Turn on c_readonly. + * lrecord.h (UNMARKABLE_LRECORD_HEADER_P): Delete. + (CONST_IF_NOT_DEBUG): Delete. + * alloc.c (this_one_is_unmarkable): Delete. + (mark_object): Don't check for this_one_is_unmarkable. Use the + c_readonly flag instead. + * lisp.h (DEFUN): Define a Lisp_Subr as c_readonly. + +2000-02-18 Jonathan Harris + + * event-msw.c (mswindows_drain_windows_queue): + (emacs_mswindows_handle_magic_event): Remove attempt to optimise + away redundant repaint events. + +2000-02-17 Andy Piper + + * redisplay.h: declare mark_redisplay_structs. + + * redisplay.c (redisplay_window): + (redisplay_frame): don't check subwindows_state_changed. + (mark_redisplay): mark gutters here. + + * glyphs.c: (instantiate_image_instantiator): always layout if we + haven't done so already. + (allocate_image_instance): don't mark as dirty. + (update_subwindow): bind inhibit_quit. + + * gutter.c (mark_gutters): new function. + + * glyphs-x.c (x_update_widget): Always resize to get round a + widget bug. + + * glyphs-msw.c (mswindows_tab_control_update): remove `;' that was + breaking absolutely everything. + + * gutter.h: declare mark_gutters. + +2000-02-16 Martin Buchholz + + * XEmacs 21.2.29 is released. + +2000-02-15 Olivier Galibert + + * fns.c (size_bit_vector): Fix computation of the size. + +2000-02-15 Martin Buchholz + + * *.[ch]: Change CONST to const globally. + find -name '*.[ch]' | \ + xargs global-replace \ + 's/(^|(?<=[^A-Za-z0-9_]))CONST((?=[^A-Za-z0-9_])|$)/const/g' + - Remove vestigial references to CONST_IS_LOSING + +2000-02-13 Jonathan Harris + + * event-msw.c (mswindows_drain_windows_queue): Remove hack to + bailout early on quit. Enqueue WM_PAINT events as XEmacs magic + events instead of dispatching them directly. + (mswindows_handle_paint): New function to do repainting. + (mswindows_wnd_proc): + (emacs_mswindows_handle_magic_event): Call above function. + +2000-02-13 Jonathan Harris + + * objects-msw.c (mswindows_create_font_variant): Return the new + font handle. + (initialize_font_instance): Get font metrics from the underlined + variant of the font to cope with the case where the underlined + font has a bigger descent. + +2000-02-08 Daiki Ueno + + * gui.c (gui_item_accelerator): Return the first underlined + character in item name. + +2000-02-11 Kirill 'Big K' Katsnelson + + * lisp.h: Added Qprinter. + + * general.c (syms_of_general): Initialized it. + + * redisplay-msw.c (get_frame_dc): Conditionally start a new page. + (get_frame_dc): + (get_frame_compdc): Made inline. + + * console.h (struct console_methods): Added eject_page method. + + * frame.h: Added FRAME_DISPLAY_P and friends. + Aligned backslahes in many macros in more readable fashion. + Added page_number to struct frame, and an accessor macro + for it. + + * defice.h: Added DEVICE_DISPLAY_P and friends. + + * device.c (Fdevice_printer_p): Used these. + + * frame.c (allocate_frame_core): Initialize page number. + (Fprint_job_page_number): + (Fprint_job_eject_page): Implemented. + + * frame-msw.c (msprinter_eject_page): Added method. + (msprinter_start_page): Added. + + * window.c (Fwindow_truncated_p): Fixed docstring. + (Fwindow_last_line_visible_height): Implemented. + +2000-02-09 Yoshiki Hayashi + + * frame.c (change_frame_size_1): Undo 2000-02-03 change. + +1999-12-20 Yoshiki Hayashi + + * syntax.c (scan_words): Always advance at least one character. + +2000-02-13 Andy Piper + + * redisplay.c (add_glyph_rune): call get_glyph_cachel_index here + to make sure the glyph is in the cachels. + + * glyphs.h (struct Lisp_Image_Instance): make layout_changed a + global image instance flag. + (IMAGE_INSTANCE_NEEDS_LAYOUT): new macro. + (XIMAGE_INSTANCE_NEEDS_LAYOUT): ditto. + + * glyphs.c (allocate_image_instance): set dirty bits correctly. + (Fset_image_instance_property): mark layout as changed. + (invalidate_glyph_geometry_maybe): mark layout as changed. + (glyph_width): use new NEEDS_LAYOUT macro. + (glyph_ascent): ditto. + (glyph_descent): ditto. + (glyph_height): ditto. + (image_instance_layout): mark layout as clean after laying out. + (update_subwindow): don't mark layout as clean here. + + * glyphs-x.h (IMAGE_INSTANCE_X_WIDGET_ID): undo C++ changes, they + should no longer be needed. + + * glyphs-x.c (x_update_widget): sanitize asserts. + (x_finalize_image_instance): sanitize assignment to widgets. + + * glyphs-widget.c (widget_instantiate): don't need to clear the + layout flag here. + +2000-02-13 Martin Buchholz + + * sysdep.c (getcwd): Use standard prototype. + * sysdep.h (getcwd): Use standard prototype. + + * fns.c (Fsubseq): Change parameters to more natural ANSI Lisp + (sequence, start, end). + Remove redundant type checking. + (Fmapconcat): Remove useless GCPRO, a wrong-headed attempt (in + view of `caller-protects') to avoid a crash where the real fix was + found elsewhere. + +2000-02-12 Martin Buchholz + + * glyphs-x.c (x_finalize_image_instance): Compile error fixes. + + * s/sol2.h: Remove feature macro initialization. + + * alloc.c (alloc_lcrecord): Add more type checking assertions. + (vector_hash): New. Code from internal_hash. + * lrecord.h: + Fix up allocation subsystem comments. + + * config.h.in: Add __EXTENSIONS__ for Solaris. + + * systime.h (EMACS_GETTIMEOFDAY): New. + (EMACS_GET_TIME): Use EMACS_GETTIMEOFDAY. + Remove Solaris-specific code. + Use void* for the (ignored) second arg for gettimeofday(). + + * elhash.c (hash_table_hash): Implement it, finally. + * elhash.c: Use hashcode_t. + + * linuxplay.c (sighandler): Fix prototypes to use SIGTYPE. + * sunplay.c (sighandler): Fix prototype to use SIGTYPE. + + * lisp.h (STRETCHY_STRUCT_SIZEOF): Delete. + * fns.c (size_bit_vector): + * alloc.c (size_vector): + (make_vector_internal): + (make_bit_vector_internal): + (sweep_bit_vectors_1): + Replace calls to STRETCHY_STRUCT_SIZEOF with offsetof expression. + +2000-02-10 Martin Buchholz + + * s/aix4.h: #define MAP_FAILED if sys/mman.h didn't. + Include strings.h to avoid warnings for bzero and strcasecmp. + +2000-02-10 Olivier Galibert + + * alloc.c: Move STRETCHY_STRUCT_SIZEOF from here... + * lisp.h (STRETCHY_STRUCT_SIZEOF): ...to here + + * fns.c (size_bit_vector): New. Declare bit vectors as a + sequence. + +2000-02-10 Olivier Galibert + + * symeval.h (struct symbol_value_magic): Remove "next" kludge and + use a value field instead. + (symbol_value_forward_forward): Use value field. + (DEFVAR_SYMVAL_FWD): Use value field. + (DEFVAR_SYMVAL_FWD_INT): Added. Dumps the int with dumpopaque. + (DEFVAR_INT): Use DEFVAR_SYMVAL_FWD_INT. + (DEFVAR_CONST_INT): Ditto. + (DEFVAR_BOOL): Ditto. + (DEFVAR_CONST_BOOL): Ditto. + (DEFVAR_INT_MAGIC): Ditto. + (DEFVAR_BOOL_MAGIC): Ditto. + + * symbols.c (guts_of_unbound_marker): Use value field. + * console.c (DEFVAR_CONSOLE_LOCAL_1): Ditto. + * buffer.c (DEFVAR_BUFFER_LOCAL_1): Ditto. + + * lisp.h: Declare dumpopaque and noninteractive1. + + * alloc.c (dumpopaque): Added. + (pdump_dump_opaquevec): Added. + (pdump): Call pdump_dump_opaquevec to dump opaque data. + (pdump_load): Reload opaque data. Sync noninteractive1 with + noninteractive. + +2000-02-10 Andy Piper + + * glyphs.c (image_instance_layout): if the size changes, mark it + as such. + + * redisplay-output.c (redisplay_output_layout): Update the + subwindow here. + (redisplay_output_subwindow): ditto. + + * glyphs.c (update_subwindow): make sure we reset flags for + layouts as well as everything else. + + * glyphs-widget.c (layout_layout): don't need to set the instances + dimensions here. + +2000-02-09 Martin Buchholz + + * device-x.c (x_init_device): Wrap calls to dll_* in HAVE_SHLIB, + not HAVE_DLOPEN, which is a lower-level thing. + + * .cvsignore: Ignore gmon.out + +2000-02-09 Hamish Macdonald + + * .cvsignore: Ignore portable dumper xemacs.dmp file + +2000-02-09 Andy Piper + + * redisplay-output.c (redisplay_output_layout): be more clever + about when we output based on the changed flags. + + * glyphs.h (struct image_instantiator_methods): add update_method. + (struct Lisp_Image_Instance): add changed flags. Declare new + macros for manipulating them. + + * glyphs.c (allocate_image_instance): renamed glyph -> parent. + (image_instance_parent_glyph): find an image_instance's parent + glyph or image_instance. + (image_instance_layout): mark the size as changed. + (set_image_instance_dirty_p): new function. mark an image + instance, plus all of its parents, as dirty. + (Fset_image_instance_property): use it. + (Fglyph_animated_timeout_handler): use it. + (update_subwindow): call update_widget and device methods for + update_subwindow. Mark all changed flags as clean. + (Fresize_subwindow): mark size as changed. + + * glyphs-x.c (x_finalize_image_instance): try and detect gc + failures. + (x_update_subwindow): only resize subwindows here. + (x_update_widget): new function. Update all changed properties of + a widget. + (x_resize_subwindow): deleted. + (x_widget_set_property): deleted. + (x_progress_gauge_set_property): deleted. + (x_progress_gauge_update): new function. Implement recorded + changes. + (x_tab_control_update): ditto. + (x_tab_control_set_property): deleted. + (console_type_create_glyphs_x): declare new functions. + (image_instantiator_format_create_glyphs_x): ditto. + + * glyphs-widget.c (widget_set_property): mark text changed. + (update_widget): new function. Update properties of a widget. + (widget_instantiate): for layouts make sure we set their + children's parent correctly. + (tab_control_set_property): new function. Record changes that will + take place under redisplay's control. + (progress_gauge_set_property): ditto. + (image_instantiator_progress_guage): declare new functions. + (image_instantiator_tab_control): ditto. + + * glyphs-msw.c (mswindows_update_subwindow): just do resizing here + now. + (mswindows_update_widget): new function. Update all properties on + a widget that have changed. + (mswindows_button_update): new function. Update a button's set + state. + (mswindows_tab_control_update): new function. Update the items in + a tab. + (mswindows_tab_control_set_property): deleted. + (mswindows_progress_gauge_update): new function. Update the + progress gauge's progress. + (mswindows_widget_set_property): deleted. This is all done + asynchronously now. + (mswindows_progress_gauge_set_property): ditto. + (console_type_create_glyphs_mswindows): declare new methods. + (image_instantiator_format_create_glyphs_mswindows): ditto. + + * frame-msw.c (msprinter_init_frame_1): Remove unused variables. + (msprinter_set_frame_properties): ditto. + + * console.h (struct console_methods): Add update_widget_method. + +2000-02-09 Andy Piper + + * gui-msw.c (Fmswindows_shell_execute): Make + mswindows-shell-execute industrial strength. + +2000-02-08 Martin Buchholz + + * lrecord.h: Make macro argument `props' match member function `plist'. + * fns.c (Fget): + * fns.c (Fput): + * fns.c (Fremprop): + * fns.c (Fobject_plist): + * alloc.c: + * symbols.c: + Object property list frobbing cleanup. + - Allow any lisp object (compared with `eq'), not just symbols, as + keys in object plists. + - Move symbol plist frobbing into symbols.c, where it belongs. + - Move string plist frobbing into alloc.c, where it belongs. + - Everything's an lrecord now, so no need to test for symbolp, etc. + - Fix up doc strings to refer to PROPERTY, not PROPNAME. + + * extents.c: Reorder code to remove declarations. + + * frame.h (store_in_alist): Remove useless declaration. + +2000-02-07 Martin Buchholz + + * event-Xt.c (x_has_keysym): Use XConvertCase only if available. + * config.h.in: Add HAVE_XCONVERTCASE. + +2000-02-07 Andy Piper + + * glyphs.c (image_instance_layout): undo 2000-01-29 change since + it breaks many things. + +2000-02-07 Jan Vroonhof + + * src/syntax.h (SYNTAX_START_P): Check whether the two chars + actually can start a common comment type. + * src/syntax.h (SYNTAX_END_P): ditto for end. + 2000-02-07 Martin Buchholz * XEmacs 21.2.28 is released. @@ -15,26 +6034,26 @@ * minibuf.c (echo_area_append): Workaround egcs-20000131 c++ compiler bug - * ExternalShell.c: - * ExternalClient.c: - * EmacsShell-sub.c: - * EmacsManager.c: - * EmacsFrame.c: + * ExternalShell.c: + * ExternalClient.c: + * EmacsShell-sub.c: + * EmacsManager.c: + * EmacsFrame.c: Use consistent style for specifying X resources. * symbols.c (Fset): Further implement SYMVAL_LISP_MAGIC. This makes (dontusethis-set-symbol-value-handler) actually usable. * lrecord.h (lrecord_decription_type): - * alloc.c (pdump_register_sub): - (pdump_dump_data): - (pdump_reloc_one): + * alloc.c (pdump_register_sub): + (pdump_dump_data): + (pdump_reloc_one): Add XD_LISP_OBJECT_ARRAY to describe multiple Lisp_Objects. Comply with XEmacs coding style. All lrecord descriptions updated to use XD_LISP_OBJECT with 2 args, and XD_LISP_OBJECT_ARRAY with 3 args. - * keymap.c (Faccessible_keymaps): + * keymap.c (Faccessible_keymaps): Make (accessible-keymaps map "\C-h") do the Right Thing. Make (accessible-keymaps map []) do the Right Thing. Make (accessible-keymaps map "") do the Right Thing. @@ -48,8 +6067,8 @@ 2000-01-30 Martin Buchholz * redisplay.c (init_redisplay): Fix small memory leak. - * elhash.h: - * elhash.c (pdump_reorganize_hash_table): + * elhash.h: + * elhash.c (pdump_reorganize_hash_table): Rename from reorganize_hash_table. Change prototype. Reuse the original memory for hentries. Save 100k. * alloc.c (PDUMP_READ): new macro. @@ -85,10 +6104,10 @@ ifdefs in readable order. (NEED_STARTS): Do not force NEED_STARTS when PDUMPing. (start_of_text): - (end_of_text): + (end_of_text): (end_of_data): Do not compile in if using PDUMP. - * symsinit.h: Protptyped vars_of_nt(). + * symsinit.h: Prototyped vars_of_nt(). * ntproc.c (windows9x_p): Added, instead of os_subtype. (find_child_console): Use it. @@ -106,7 +6125,7 @@ (fstat, stat): Do not compile in if using MSVC 5.0 and above - stat has been fixed in the C runtime. (vars_of_nt): Added, defined the nt_fake_unix_uid variable there. - + * file-coding.c (struct file_coding_dump): Do not define ucs_to_mule_table in the struct if not MULE. (struct struct lrecord_description fcd_description_1): Do not dump @@ -153,7 +6172,7 @@ * faces.c: Moved 'left-margin and 'right-margin defsymbols to general.c. - * console-msw.h: Added more msprinter device private slots. + * console-msw.h: Added more msprinter device private slots. 2000-02-01 Kirill 'Big K' Katsnelson @@ -284,7 +6303,7 @@ only. * console-msw.h: Moved a few function prototypes here from - event-msw.c. + event-msw.c. * gui-msw.c (mswindows_handle_gui_wm_command): Changed the ID parameter from unsigned short to unsigned long. @@ -292,8 +6311,8 @@ 2000-01-27 URA Hiroshi - * sysdep.c (init_system_name): - process-unix.c (unix_canonicalized_host_name): + * sysdep.c (init_system_name): + process-unix.c (unix_canonicalized_host_name): Don't call freeaddrinfo() if getaddrinfo() fails. * process-unix.c (unix_open_unix_network_stream): @@ -301,7 +6320,7 @@ 2000-01-27 Martin Buchholz - * buffer.c (reinit_vars_of_buffer): + * buffer.c (reinit_vars_of_buffer): The right place to initialize conversion_in_dynarr and conversion_out_dynarr. @@ -462,7 +6481,7 @@ file-name-coding-system, terminal-coding-system, and keyboard-coding-system magical variables that are equivalent to defining the corresponding coding system aliases. - + * file-coding.c (Fcoding_system_canonical_name_p): New function. * file-coding.c (Fcoding_system_alias_p): New function. * file-coding.c (Fcoding_system_aliasee): New function. @@ -500,13 +6519,13 @@ xnew_array_and_zero, thereby simplifying the code. * mule-charset.c (make_charset): Make sure entire object is - intialized, to avoid Purify warnings. + initialized, to avoid Purify warnings. * alloc.c (resize_string): Fix unlikely crash with big strings. 2000-01-24 Martin Buchholz - * realpath.c (xrealpath): + * realpath.c (xrealpath): Don't call getwd(). 2000-01-25 Martin Buchholz @@ -550,7 +6569,7 @@ 2000-01-24 Martin Buchholz - * glyphs-widget.c (layout_query_geometry): + * glyphs-widget.c (layout_query_geometry): (layout_layout): Use correct types for gheight, gwidth. 2000-01-24 Martin Buchholz @@ -559,7 +6578,7 @@ 2000-01-23 Martin Buchholz - * alloc.c (make_float): Make sure entire object is intialized, to + * alloc.c (make_float): Make sure entire object is initialized, to avoid Purify warnings. (pdump_register_sub): Remove useless assignment. (pdump): Use xmalloc, not malloc. @@ -567,11 +6586,11 @@ 2000-01-23 Kirill 'Big K' Katsnelson - * callproc.c: - * dired-msw.c: - * fileio.c: - * process-nt.c: - * redisplay-msw.c: + * callproc.c: + * dired-msw.c: + * fileio.c: + * process-nt.c: + * redisplay-msw.c: * sysdep.c: Removed redundant #include 2000-01-22 Kirill 'Big K' Katsnelson @@ -579,7 +6598,7 @@ * frame.c (delete_frame_internal): Do not delete device when its implementation so declares. (delete_frame_internal): Set device selected frame to nil when - last frame goes away. + last frame goes away. * device-msw.c (msprinter_device_system_metrics): Implemented. (mswindows_device_system_metrics): Added 'device-dpi property. @@ -646,24 +6665,24 @@ (image_instantiator_tab_control): (image_instantiator_labels): (image_instantiator_layout): ditto. - (image_instantiator_format_create_glyphs_widget): Call preceeding + (image_instantiator_format_create_glyphs_widget): Call preceding functions. 2000-01-22 Martin Buchholz * process.c (Fset_process_coding_system): - * device-x.c (Fx_keysym_hash_table): + * device-x.c (Fx_keysym_hash_table): Docstring fixes. * lstream.c (Lstream_write): Return documented value, not 0. - * fileio.c (directory_file_name): - (Fsubstitute_in_file_name): - (Fsubstitute_insert_file_contents_internal): + * fileio.c (directory_file_name): + (Fsubstitute_in_file_name): + (Fsubstitute_insert_file_contents_internal): (Fwrite_region_internal): * emacs.c: * sysdep.c: - * getloadavg.c: + * getloadavg.c: * systty.h: Remove vestigial APOLLO-conditional code. @@ -688,7 +6707,7 @@ * miscplay.h: Add guard macros. * *.h: Use consistent C-standards-approved guard macro names. - * opaque.c (make_opaque): Switch parameter order. + * opaque.c (make_opaque): Switch parameter order. * opaque.h (make_opaque): Switch parameter order. Update all callers. * buffer.h (MAKE_MIRROR_TRT_TABLE): Use symbolic constant OPAQUE_CLEAR. diff -r 72a7cfa4a488 -r abe6d1db359e src/ChangeLog.1 --- a/src/ChangeLog.1 Mon Aug 13 11:33:40 2007 +0200 +++ b/src/ChangeLog.1 Mon Aug 13 11:35:02 2007 +0200 @@ -50,7 +50,7 @@ * This change adds four scrollbar specifiers: {horizontal,vertical}-scrollbar-visible-p and scrollbar-on-{top,left}-p. - Spare parts supplied by Didier Verna + Spare parts supplied by Didier Verna * frameslots.h: Added slots for the four specifier caching. @@ -80,7 +80,7 @@ (specifier_vars_of_scrollbar): Declared the four specifiers. * window.h (struct window): Defined slots for caching the new - specifiers. + specifiers. * window.c (mark_window): Mark them. (allocate_window): Initialize them. @@ -123,7 +123,7 @@ 1998-05-10 Kirill M. Katsnelson - * EmacsFrame.c (update_various_frame_slots): Do not store internal + * EmacsFrame.c (update_various_frame_slots): Do not store internal border width there. (EmacsFrameInitialize): Do it rather here. (EmacsFrameSetValues): If EditRes has changed internal border @@ -135,11 +135,11 @@ variables and access macros Added size_slipped redisplay bit and mark/clear macros. - * redisplay.c (redisplay_frame): Adjust frame size if size slipped + * redisplay.c (redisplay_frame): Adjust frame size if size slipped bit is set. (redisplay_device): Call redisplay_frame if size slipped bit is set. - - * frame.c (adjust_frame_size): Redisplay beats frame back in shape + + * frame.c (adjust_frame_size): Redisplay beats frame back in shape with this. Added. (frame_size_slipped): Added. (internal_set_frame_size): Clear size slipped bit. @@ -183,7 +183,7 @@ (EmacsFrameSetValues): Simulate a call to resize callback when no actual geometry change happened. - * console.h (struct console_methods): Removed declarations for all + * console.h (struct console_methods): Removed declarations for all _changed_in_frame methods for toolbars and scrollbars. Added frame_size_fixed_p method. @@ -267,7 +267,7 @@ the system. * ntproc.c: Removed select emulation crap and dynamic Windock - loading. + loading. * nt.c: Removed a lot of terrible wrappers for socket functions. @@ -395,9 +395,9 @@ 1998-05-04 Martin Buchholz - * rangetab.c: + * rangetab.c: * rangetab.h: Move #include's from rangetab.h into rangetab.c for - consistency. + consistency. * inline.c: include rangetab.h to get GCC inlines 1998-05-03 SL Baur @@ -466,17 +466,17 @@ * specifier.h: Corrected documentation on magic specifiers. Documented DEPTH parameter to instantiate_method. - Renamed reveal->unlock_ghost_specifiers_protected(). + Renamed reveal->unlock_ghost_specifiers_protected(). * specifier.c: Removed the reveal mechanism and made ghost specifiers read-only, so they are accessible as fallbacks of magic specifier, but aren't modifiable unless C code enables so. (specifier_equal): Compare specifier fallbacks as well. - * scrollbar.c (init_frame_scrollbars): - (init_device_scrollbars): + * scrollbar.c (init_frame_scrollbars): + (init_device_scrollbars): (init_global_scrollbars): Renamed - reveal->unlock_ghost_specifiers_protected(). + reveal->unlock_ghost_specifiers_protected(). 1998-05-01 Hrvoje Niksic @@ -613,7 +613,7 @@ Compute new character sizes passed to change_frame_size, do not use the old (pre-toolbar-change) ones. (update_frame_toolbars): Honor frame_changed and clear frame bits. - (recompute_overlaying_specifier): New helper function, called from + (recompute_overlaying_specifier): New helper function, called from default toolbar specifier change handlers. (default_toolbar_specs_changed): Use it. (default_toolbar_size_changed_in_frame): Ditto. @@ -622,7 +622,7 @@ (toolbar_geometry_changed_in_window): New handler. The old one, some_windows_value_changed, did not do the trick. (default_toolbar_size_changed_in_window): New handler for default - toolbar. + toolbar. (default_toolbar_border_width_changed_in_window): Ditto. (default_toolbar_visible_p_changed_in_window): Ditto. (specifier_vars_of_toolbar): Use one of the above four handlers @@ -765,8 +765,8 @@ 1998-04-24 Martin Buchholz - * mule-charset.h: - * mule-charset.c: + * mule-charset.h: + * mule-charset.c: Use ints instead of bitfields for Lisp_Charset fields. This should work around bugs in the latest egcs snapshot, and make XEmacs faster. Introduce dimension and chars as fields in @@ -812,7 +812,7 @@ * data.c (Fnot): There has traditionally been kludgy startup lisp code that called `null' even if `not' was more appropriate, because `not' was defined in lisp. This is one primitive - sufficiently important that it should ALWAYS be defined. + sufficiently important that it should ALWAYS be defined. Sat Apr 24 1998 Andy Piper @@ -874,10 +874,10 @@ 1998-04-23 Hrvoje Niksic - * fns.c (Fload_average): Respect errno when reporting getloadavg() + * fns.c (Fload_average): Respect errno when reporting getloadavg() errors. - * getloadavg.c (getloadavg): Cleaner Solaris implementation, based + * getloadavg.c (getloadavg): Cleaner Solaris implementation, based on sample code by Casper Dik. 1998-04-23 SL Baur @@ -903,7 +903,7 @@ * toolbar-msw.c (mswindows_clear_toolbar): Fixed wabbit buttons. (mswindows_output_toolbar): Gave 3D look to toolbars. Still no pretty, needs more work. - (mswindows_move_toolbar): Renamed so because it does not deal with + (mswindows_move_toolbar): Renamed so because it does not deal with redrawing exposed toolbars. Properly position toolbars. (mswindows_redraw_exposed_toolbars): Changed calls to the above. @@ -1026,7 +1026,7 @@ * eldap.c: (print_ldap): Ignore escapeflag (Fldap_search_internal): Added unwind protection to appropriately - free the LDAP temporary structures in case of interruption. Added + free the LDAP temporary structures in case of interruption. Added a QUIT to the result fetching loop. 1998-04-19 SL Baur @@ -1193,7 +1193,7 @@ * indent.c (vertical_motion_1): new helper function to share common code between Fvertical_motion and Fvertical_motion_pixels. - Properly handle the WINDOW argument as the doc string indicates it + Properly handle the WINDOW argument as the doc string indicates it should. Update docstrings to be more clear and concise. (Fvertical_motion): use vertical_motion_1. (Fvertical_motion_pixels): use vertical_motion_1. @@ -1206,7 +1206,7 @@ * specifier.c: Reworked many functions to support magic specifiers. - * scrollbar.c (specifier_vars_of_scrollbar): Made magic specifiers + * scrollbar.c (specifier_vars_of_scrollbar): Made magic specifiers Vscrollbar_width and Vscrollbar_height. (init_frame_scrollbars): Enabled critical lisp code operate on ghost specifiers. @@ -1215,7 +1215,7 @@ * scrollbar-msw.c (Fmswindows_init_scrollbar_metrics): Scrollbar init function, called from init-scrollbars-from-resuorce in - lisp/scrollbar.c + lisp/scrollbar.c (syms_of_scrollbar_mswindows): DEFSUBR it. * emacs.c (main_1): Called syms_of_scrollbar_mswindows() @@ -1252,7 +1252,7 @@ * data.c (pure_write_error): Accept an argument. - * emacs.c (vars_of_emacs): New variable `internal-error-checking'; + * emacs.c (vars_of_emacs): New variable `internal-error-checking'; initialize it. 1998-04-16 Hrvoje Niksic @@ -1301,7 +1301,7 @@ * device-x.c (have_xemacs_resources_in_xrdb): adhere to coding standards and avoid opening display twice by breaking - XtOpenDisplay into XOpenDisplay and XtDisplayInitialize. + XtOpenDisplay into XOpenDisplay and XtDisplayInitialize. (x_init_device): Ditto. 1998-04-15 Olivier Galibert @@ -1359,7 +1359,7 @@ 1998-04-13 Greg Klanderman - * redisplay.c (redisplay_window): When echo area is active, and we + * redisplay.c (redisplay_window): When echo area is active, and we swap in the echo area buffer, restore the minibuffer's pointm and startp when we restore the minibuffer to the window. This avoids having the minibuffer point randomly change when it is active but @@ -1391,9 +1391,9 @@ (emacs_mswindows_select_process): Get Win32 process handle directly from process lrecord. (get_process_handle): Removed function. - (emacs_mswindows_handle_magic_event): Removed handling of + (emacs_mswindows_handle_magic_event): Removed handling of XM_BUMPQUEUE magic event. - (mswindows_wnd_proc): Removed handling of WM_EXITMENULOOP message, + (mswindows_wnd_proc): Removed handling of WM_EXITMENULOOP message, which called a do-nothing handler in menubar-msw.c (mswindows_wnd_proc, WM_EXITSIZEMOVE): Queue an empty event instead of magic event, via mswindows_bump_queue(). @@ -1410,18 +1410,18 @@ * event-stream.c (event_stream_deal_with_async_timeout): Conditionalized timer-based polling for finished processes on - HAVE_UNIX_PROCESSES. + HAVE_UNIX_PROCESSES. * menubar-msw.c (mswindows_handle_wm_command): Queued proper bump queue event. (mswindows_handle_wm_exitmenuloop): Removed function. - + * menubar-msw.h: Removed unused function prototype. * process-nt.c (get_nt_process_handle): Added function. * signal.c (init_poll_for_sigchld): Conditionalized on - HAVE_UNIX_PROCESSES. + HAVE_UNIX_PROCESSES. 1998-04-13 Kirill M. Katsnelson @@ -1455,40 +1455,40 @@ * callproc.c (init_callproc): Correctly initialize `shell-file-name' for WINDOWSNT - + * emacs.c (main_1): Properly called new functions (see symsinit.h entry for which). - * event-msw.c (struct ntpipe_slurp_stream): - (slurp_thread): - (make_ntpipe_input_stream): - (get_ntpipe_input_stream_waitable): - (get_ntpipe_input_stream_param): - (ntpipe_slurp_reader): - (ntpipe_slurp_closer): + * event-msw.c (struct ntpipe_slurp_stream): + (slurp_thread): + (make_ntpipe_input_stream): + (get_ntpipe_input_stream_waitable): + (get_ntpipe_input_stream_param): + (ntpipe_slurp_reader): + (ntpipe_slurp_closer): (init_slurp_stream): Win32 pipe input stream implementation. - (struct ntpipe_shove_stream): - (shove_thread): - (make_ntpipe_output_stream): - (get_ntpipe_output_stream_param): - (ntpipe_shove_writer): - (ntpipe_shove_was_blocked_p): - (ntpipe_shove_flusher): - (ntpipe_shove_closer): + (struct ntpipe_shove_stream): + (shove_thread): + (make_ntpipe_output_stream): + (get_ntpipe_output_stream_param): + (ntpipe_shove_writer): + (ntpipe_shove_was_blocked_p): + (ntpipe_shove_flusher): + (ntpipe_shove_closer): (init_shove_stream): Win32 pipe output stream implementation. (mswindows_enqueue_process_event): Dispatch helper. - (find_waitable_handle): - (add_waitable_handle): + (find_waitable_handle): + (add_waitable_handle): (remove_waitable_handle): New three, waitable handles handling. (mswindows_need_event_in_modal_loop): Simplified. (mswindows_need_event): Simplified. - (mswindows_need_event): Generate process events on process output; + (mswindows_need_event): Generate process events on process output; kick status_notify when a process ends. (mswindows_find_console): Simplified. (emacs_mswindows_event_pending_p): Adjusted parameters to mswindows_need_event(). (emacs_mswindows_next_event): Ditto. - (get_process_input_waitable): + (get_process_input_waitable): (get_process_handle): Process select/unselect helpers. (emacs_mswindows_select_process): Implemented. (emacs_mswindows_unselect_process): Implemented. @@ -1521,7 +1521,7 @@ 1998-04-10 Martin Buchholz - * fns.c (Fnthcdr): + * fns.c (Fnthcdr): Most times through the loop will get a cons, so optimize for that. * bytecode.c (Fbyte_code): Remove '91 vintage compiler bug workaround. @@ -1572,8 +1572,8 @@ * event-msw.c (mswindows_wnd_proc): Fix member access macro names. - * frame-msw.c (mswindows_frame_property): - (mswindows_internal_frame_property_p): + * frame-msw.c (mswindows_frame_property): + (mswindows_internal_frame_property_p): (mswindows_frame_properties): Implemented for the 'left and 'top properties. (console_type_create_frame_mswindows): Regsitered the above. @@ -1650,10 +1650,10 @@ * insdel.c (make_gap): Thou shan't cast EMACS_INT_MAX to int. (buffer_insert_string_1): ditto. - * regex.c (print_partial_compiled_pattern): Neither EMACS_INTs nor + * regex.c (print_partial_compiled_pattern): Neither EMACS_INTs nor ptrdiff_t are portably printable as an int. - * redisplay.c (window_line_number): Don't assume that an EMACS_INT + * redisplay.c (window_line_number): Don't assume that an EMACS_INT in an int. * alloc.c (report_pure_usage): Don't assume that a size_t is @@ -1717,24 +1717,24 @@ (sys_chmod): (sys_creat): - * sysdep.c (sys_read_1): - (sys_read): - (sys_write_1): - (sys_write): - (sys_mkdir): - (sys_readlink): - (sys_chmod): - (sys_creat): - - * nt.c (sys_read): - (sys_chmod): - (sys_creat): + * sysdep.c (sys_read_1): + (sys_read): + (sys_write_1): + (sys_write): + (sys_mkdir): + (sys_readlink): + (sys_chmod): + (sys_creat): + + * nt.c (sys_read): + (sys_chmod): + (sys_creat): (sys_write): Change types of sys_* in accordance with published standards. Use size_t and mode_t instead of unsigned int and int. 1998-04-03 Martin Buchholz - * config.h.in (enum_field): + * config.h.in (enum_field): * lisp-union.h: * extents.h: * redisplay.c (add_margin_runes): @@ -1798,7 +1798,7 @@ * window.c (set_window_pixsize): Move up call to check_min_window_sizes. - * indent.c (vmotion_1): renamed from vmotion() and added + * indent.c (vmotion_1): renamed from vmotion() and added additional argument to optionally return the pixel motion. (vpix_motion): Helper for vmotion_1. (vmotion): Wrapper - just call vmotion_1() with the right args. @@ -1807,36 +1807,36 @@ 1998-04-02 Martin Buchholz - * xselect.c: - * event-Xt.c: - * emacs.c: + * xselect.c: + * event-Xt.c: + * emacs.c: Remove last vestiges of #ifdef EPOCH code. It had no chance of - working anyways. In honour of seeing Marc Andreesen in person for + working anyways. In honour of seeing Marc Andreesen in person for the first time today. 1998-04-01 Martin Buchholz - * extents.h: - * lisp-union.h: + * extents.h: + * lisp-union.h: Don't use enums as bitfields - only unsigned ints. Fixes: warning: nonportable bit-field type * eval.c (call_with_suspended_errors): More volatilizing to appease Sunpro cc. - * mem-limits.h: + * mem-limits.h: * ralloc.c: Remove #undef NULL; they're not even used! - * process-unix.c (unix_send_process): send_process is a method, so + * process-unix.c (unix_send_process): send_process is a method, so we can't include volatile in the prototype. We make the argument - non-volatile, make a volatile copy, and then use that instead. - - * frame-x.c (x_delete_frame): The `frame' variable is initialized + non-volatile, make a volatile copy, and then use that instead. + + * frame-x.c (x_delete_frame): The `frame' variable is initialized but not actually used. * Makefile.in.in (xselect.o): The last line of b34-pre2's src/Makefile.in.in contains a dependency that should have been - patched away. + patched away. (mostlyclean): Remove the removal of depend.* - no such files exist anymore @@ -1908,7 +1908,7 @@ 1998-03-30 Martin Buchholz - * redisplay.c (create_right_glyph_block): glyph_type should really + * redisplay.c (create_right_glyph_block): glyph_type should really be glyph_layout. 1998-03-29 Martin Buchholz @@ -1918,7 +1918,7 @@ #include sysfile.h. Check all .o files for missing #includes. * config.h.in: - Discovered that config.h.in was missing ENCAPSULATE_CLOSEDIR, as a + Discovered that config.h.in was missing ENCAPSULATE_CLOSEDIR, as a result of fixing the above. * gui.c (gui_item_add_keyval_pair): We should not use the idiom @@ -1927,7 +1927,7 @@ (signal_too_long_error): Ditto. * glyphs.c (image_instantiate_cache_result): Use XC[AD]R instead - of Fc[ad]r. This is always called with valid conses, and in fact, + of Fc[ad]r. This is always called with valid conses, and in fact, already assumed it. * font-lock.c (find_context): Use context_none with context @@ -1940,7 +1940,7 @@ 1998-03-28 Martin Buchholz - * fns.c (string_putprop): + * fns.c (string_putprop): (string_getprop): Make method functions static. * window.c (find_window_by_pixel_pos): Warning suppression. @@ -1949,7 +1949,7 @@ * redisplay-x.c (x_output_eol_cursor): Remove redundant XSETWINDOW. - * glyphs-x.c (signal_image_error): + * glyphs-x.c (signal_image_error): (signal_image_error_2): (convert_EImage_to_XImage): Make functions static. @@ -1966,7 +1966,7 @@ 1998-03-27 Martin Buchholz - * console-tty.c (free_tty_console_struct): + * console-tty.c (free_tty_console_struct): Replace con->console_data with CONSOLE_type_DATA (con) * *.[ch]: C++ compilability of xemacs, on Linux and Solaris. @@ -1976,7 +1976,7 @@ * eval.c: * bytecode.c: Rename Fcondition_case_3 to condition_case_3 - it's not a DEFUN. - + * buffer.h: Remove all *BUFFER_OR_STRING* macros - unused. (memind_to_bytind): Merge two versions of function by moving @@ -1998,27 +1998,27 @@ * marker.c (print_marker): Fix compiler warning, real bug! - * device.h (MARK_DEVICE_FRAMES_FACES_CHANGED): - * frame.h (MARK_FRAME_FACES_CHANGED): - (MARK_FRAME_TOOLBARS_CHANGED): - (MARK_FRAME_SIZE_CHANGED): - (MARK_FRAME_CHANGED): - (MARK_FRAME_WINDOWS_CHANGED): - (MARK_FRAME_WINDOWS_STRUCTURE_CHANGED): + * device.h (MARK_DEVICE_FRAMES_FACES_CHANGED): + * frame.h (MARK_FRAME_FACES_CHANGED): + (MARK_FRAME_TOOLBARS_CHANGED): + (MARK_FRAME_SIZE_CHANGED): + (MARK_FRAME_CHANGED): + (MARK_FRAME_WINDOWS_CHANGED): + (MARK_FRAME_WINDOWS_STRUCTURE_CHANGED): Fix multiple evaluation of macro arguments. Macros are a fact of life. Callers have to use temp variables to avoid multiple evaluation of arguments. * data.c (Ftrue_list_p): New function, with obvious meaning. - This is terminology from Cltl2. + This is terminology from Cltl2. Also define a corresponding macro TRUE_LIST_P. * device-x.c (validify_resource_component): Optimize. Rename. Use the standard technique of using a precomputed table of valid chars. - - (x_get_resource_prefix): - (Fx_get_resource): - (Fx_get_resource_prefix): + + (x_get_resource_prefix): + (Fx_get_resource): + (Fx_get_resource_prefix): Avoid fixed buffer sizes. Use a char_dynarr. Run validify_resource_component on all computed components. @@ -2033,50 +2033,50 @@ Use acons in functions which create alists. * lisp/cl.el (acons): Add docstring. Really otta be a macro, tho. - * buffer.c (Fbuffer_memory_usage): + * buffer.c (Fbuffer_memory_usage): * window.c (Fwindow_memory_usage): Clean up horrible consing code using new acons function. Fix incorrect value reported for gap-overhead. - + * fns.c (Fmember): - (Fold_member): - (Fmemq): - (Fold_memq): - (memq_no_quit): - (Fassoc): - (Fold_assoc): - (Fassq): - (Fold_assq): - (assq_no_quit): - (Frassoc): - (Fold_rassoc): - (Frassq): - (Fold_rassq): - (rassq_no_quit): - (Fdelete): - (Fold_delete): - (Fdelq): - (Fold_delq): - (delq_no_quit): - (delq_no_quit_and_free_cons): - (Fremassoc): - (Fremassq): - (remassq_no_quit): - (Fremrassoc): - (Fremrassq): - (remrassq_no_quit): - (Fnreverse): - (Freverse): - (Fnthcdr): - Optimize. - Replace calls to Fcar, Fcdr, Fsetcar with XCAR and XCDR. + (Fold_member): + (Fmemq): + (Fold_memq): + (memq_no_quit): + (Fassoc): + (Fold_assoc): + (Fassq): + (Fold_assq): + (assq_no_quit): + (Frassoc): + (Fold_rassoc): + (Frassq): + (Fold_rassq): + (rassq_no_quit): + (Fdelete): + (Fold_delete): + (Fdelq): + (Fold_delq): + (delq_no_quit): + (delq_no_quit_and_free_cons): + (Fremassoc): + (Fremassq): + (remassq_no_quit): + (Fremrassoc): + (Fremrassq): + (remrassq_no_quit): + (Fnreverse): + (Freverse): + (Fnthcdr): + Optimize. + Replace calls to Fcar, Fcdr, Fsetcar with XCAR and XCDR. Simplify logic. Many of these functions wouldn't QUIT if called on cyclic lists. e.g. try (progn (setq x '(nil)) (setcdr x x) (reverse x)) One benchmark of delq showed it to be 3 times faster. * emacs.c: - * database.c: + * database.c: Cleanup of database functions. Make the get_subtype and get_type methods return Lisp_Objects, instead of C strings. No more need for both dbm_type and dbm_lisp_type. @@ -2084,7 +2084,7 @@ Replace old `dbm' names with `database'. Rename struct database to struct Lisp_Database. Rename DEFUN arguments to `database', when applicable. - + * buffer.c: * chartab.c: * console.c: @@ -2112,7 +2112,7 @@ * window.c: Place DEFINE_LRECORD_* after definition of static object methods, to avoid redundant declarations. - + * console.c: * console.h: * device.c: @@ -2142,7 +2142,7 @@ 1998-03-21 Martin Buchholz * alloc.c (list*): Optimize recursion levels. - + * alloc.c: Add debugger support via enum dbg_constants. * gdbinit: Complete rewrite. * gdbinit.union: Remove @@ -2153,7 +2153,7 @@ Support all combinations of Kylish DEFINEs. Work out of the box with no user customizations. See the updated faq for details. - + * emacsfns.h: Remove. Move declarations to lisp.h * dynarr.h: Remove. Move declarations to lisp.h * lisp.h. @@ -2161,8 +2161,8 @@ Introduce EXFUN macro for external declaration to correspond to DEFUN. Include header files only when necessary, i.e. not from lisp.h: - unistd.h, limits.h, fnctl.h, blocktype.h, dynarr.h, emacsfns.h - - + + * lisp.h: * lisp-union.h: * lisp-disunion.h: @@ -2217,7 +2217,7 @@ * depend: New file. Generated by make-src-depend * make-src-depend: New file. generates up-to-date dependencies. Makefile dependencies are now automagically maintained, and - CORRECT. lisp.h and friends are now included in the dependencies, + CORRECT. lisp.h and friends are now included in the dependencies, since this complies with the principle of least astonishment. * symbols.c (symbol_is_constant): Optimize. @@ -2230,7 +2230,7 @@ 1998-03-29 SL Baur * emacs.c (voodoo_free_hook): ELF libraries built with newer - versions of GCC do horrible things in dumped binaries after exit() + versions of GCC do horrible things in dumped binaries after exit() is called. (Fkill_emacs): Use it. @@ -2288,8 +2288,8 @@ glyph_changed_set variables, mimicking clip_changed and clip_changed_set. - (redisplay_window): Reset the window's glyph cache is - f->glyphs_changed is non-zero. Call regenerate_window + (redisplay_window): Reset the window's glyph cache is + f->glyphs_changed is non-zero. Call regenerate_window if f->glyphs_changed is non-zero. (redisplay_frame): Clear f->glyphs_changed after @@ -2311,12 +2311,12 @@ related, mark all frames. * redisplay-output.c (compare_display_blocks): - Output the whole display block if f->glyphs_changed is + Output the whole display block if f->glyphs_changed is non-nil. 1998-03-27 Kyle Jones - * callproc.c (Fcall_process_internal): In the case where + * callproc.c (Fcall_process_internal): In the case where fd_error and fd1 are the same don't close that descriptor twice. @@ -2352,7 +2352,7 @@ (mswindows_init_frame_1): Fixed support for popup frames. (mswindows_delete_frame): Fixed memory leak. (mswindows_get_frame_parent): Implemented. - (mswindows_update_frame_external_traits): Moved part of the former + (mswindows_update_frame_external_traits): Moved part of the former update_EmacsFrame() here. (console_type_create_frame_mswindows): Declare get_frame_parent and update_frame_external_traits methods. @@ -2366,16 +2366,16 @@ windows does not yet have associated frame object (mswindows_find_frame): Casted long to Lisp_Object properly. - * device.c (window_system_pixelated_geometry): Changed to call the + * device.c (window_system_pixelated_geometry): Changed to call the device_implementation_flags device method. * device-msw.c (mswindows_device_implementation_flags): - Implemented. + Implemented. (console_type_create_device_mswindows): Declared the above. * console.h (struct console_methods): Added device_implementation_flags_method and - update_frame_external_traits_method. + update_frame_external_traits_method. Defined flags retuned by device_implementation_flags_method. * console-msw.h (struct mswindows_frame): Added charheight and @@ -2384,7 +2384,7 @@ Moved Windows-specific macros from frame.h here. (typedef struct XEMACS_RECT_WH): Added. Declared global variables. - + 1998-03-19 Kirill M. Katsnelson * console-msw.h: Added prototypes for @@ -2408,8 +2408,8 @@ indication to fake font size to 1. (char_to_pixel_size): Ditto. (round_size_to_char): Ditto. - (pixel_to_real_char_size): - (char_to_real_pixel_size): + (pixel_to_real_char_size): + (char_to_real_pixel_size): (round_size_to_real_char): New three counterparts of the above metioned functions, which always use real character metrics. (change_frame_size_1): Use real character metrics when computing @@ -2423,7 +2423,7 @@ (mswindows_init_frame_2): Commented out, unused. (mswindows_after_init_frame): Added frame method. (mswindows_set_frame_size): Reworked to support pixel base - geometry. + geometry. (mswindows_set_frame_position): Cahnged to use SetWindowPos. (mswindows_lower_frame): Ditto. (mswindows_set_frame_properties): Fixed to perform correct @@ -2432,7 +2432,7 @@ after_init_frame added. * faces.c (default_face_height_and_width_1): Added. - (update_EmacsFrame): Changed method of notifying mswindwows frame, + (update_EmacsFrame): Changed method of notifying mswindwows frame, so modeline border gets redrawn. * faces.h: Prototype for default_face_height_and_width_1(). @@ -2443,13 +2443,13 @@ char if window is maximized. Use real char metrics for rounding. Call DefWindowProc to process WM_GETMINMAXINFO - (mswindows_set_chord_timer): Changed chord timeout from 1/2 to 1/3 + (mswindows_set_chord_timer): Changed chord timeout from 1/2 to 1/3 system double click time * device.c (domain_device_type): New function. - (window_system_pixelated_geometry): New function. + (window_system_pixelated_geometry): New function. (Fdomain_device_type): New function, lisp interface to - domain_device_type(). + domain_device_type(). (syms_of_device): DEFSUBRed the above. * device.h: Ptorotypes for domain_device_type() and @@ -2492,7 +2492,7 @@ 1998-03-27 P. E. Jareth Hein - * glyphs-x.c: + * glyphs-x.c: * imgproc.c: * imgproc.h: * glyphs-x.h: Added in a colormap variable in the X specific image @@ -2501,7 +2501,7 @@ coding standards. * glyphs.h: - * glyphs.c: + * glyphs.c: * glyphs-x.c: added image-conversion-error type * objects-x.c (allocate_nearest_color): Corrected a minor bug involving @@ -2530,13 +2530,13 @@ 1998-03-24 Kirill M. Katsnelson - * fileio.c (Ffile_readable_p): GC protect fix, MS Windows specific. + * fileio.c (Ffile_readable_p): GC protect fix, MS Windows specific. Mon Mar 23 22:14:12 1998 Andy Piper * configure.in: compile in glyphs-msw.o when compiling fopr mswindows. - + Mon Mar 23 22:14:12 1998 Andy Piper * msw-glyphs.el: add support for xpm and bmp. change @@ -2547,7 +2547,7 @@ * Makefile.in.in: fastdump - new target for dumping bypassing bytecompilation, DOC. Add dependencies for glyphs-msw.o. Move imgproc.o to object list. - + * glyphs-msw.h: * glyphs-msw.c: new files adding support for xpm and bmp and EImages. @@ -2557,7 +2557,7 @@ * console-msw.h: add bitspixel field to mswindows frame. * device-msw.c: initialise bitspixel field in mswindows frame. - + * glyphs-x.c (xpm_instantiate): call mswindows_xpm_instantiate if the device type is mswindows. @@ -2565,7 +2565,7 @@ mswindows. * symsinit.h: add prototypes for glyphs-msw.c functions. - + * sheap.c: make includes src-dir compliant. * events.c: remove cygwin ^H <-> erase hack. @@ -2609,7 +2609,7 @@ if the symbol is in Vobarray. * symbols.c (reject_constant_symbols): Signal error when - attempting to assign a value to a keyword, unless the value is the + attempting to assign a value to a keyword, unless the value is the keyword itself. * symbols.c (Fintern): Initialize symbol's ->obarray to t only @@ -2716,7 +2716,7 @@ * config.h.in: Add HAVE_LIBMCHECK and HAVE_MCHECK_H. * hash.c (grow_hashtable): Fix tests to compare against - Qnull_pointer since this function may be called before any symbols + Qnull_pointer since this function may be called before any symbols or the Lisp engine is initialized. * emacs.c (main_1): Restore usage of free-hook.c. @@ -2730,7 +2730,7 @@ control variable is being modified underneath us. - Avoid calling delete_console_internal on stream consoles. - * console-tty.c (free_tty_console_struct): NULL out pointers after + * console-tty.c (free_tty_console_struct): NULL out pointers after xfree'ing. * console-stream.c (allocate_stream_console_struct): Fix memory @@ -2758,7 +2758,7 @@ (Fwrite_region_internal): Ditto. (decide_buffer_type): Function removed. (buf_decide_buffer_type): Function removed. - (Many places): References to DOS_NT replaced with WINDOWSNT. MSDOS- + (Many places): References to DOS_NT replaced with WINDOWSNT. MSDOS- specific code removed. * lread.c (Fload_internal): Removed ugly DOS style re-opening a @@ -2774,7 +2774,7 @@ implemented in nt.c * fileio.c (Ffile_readable_p): Conditionalized declared never used - variables. + variables. (Fexpand_file_name): Ditto. (check_executable): Ditto. @@ -2823,7 +2823,7 @@ 1998-03-15 Kyle Jones - * console.h: Added set_final_cursor_coords method to console + * console.h: Added set_final_cursor_coords method to console struct. * console-tty.h: Added final_cursor_x and final_cursor_y @@ -2872,7 +2872,7 @@ * glyphs-x.c (png_instantiate): Added in override support for png backgrounds. - + 1998-03-13 P. E. Jareth Hein * glyphs-x.c (png_instantiate): Fixed a bug that was causing @@ -3058,7 +3058,7 @@ (Fenlarge_window_pixels): New function. (Fshrink_window_pixels): New function. (window_displayed_pixel_height): New, helper for - Fwindow_displayed_pixel_height. + Fwindow_displayed_pixel_height. (change_window_height): Add `inpixels' argument. (syms_of_window): 3 new DEFSUBR's. @@ -3179,16 +3179,16 @@ (get_eof_char): Ditto * symsinit.h: Prototypes for initialization functions called from - emacs.c: process_type_create_mswindows, process_type_create_unix, + emacs.c: process_type_create_mswindows, process_type_create_unix, vars_of_process_mswindows, vars_of_process_unix. - * procimpl.h: New file. Includes prototypes and other stuff shared + * procimpl.h: New file. Includes prototypes and other stuff shared by process.c and implementation files (process-unix.c, process-msw.c in future). * process.h (PROCESS_LIVE_P): Changed to test against stream existence, to avoid dependency on fds. - + * process.c: Only process implementation independent code is now in this file. Moved the rest into process-unix.c (Fopen_network_stream_internal): Added 5th parameter, protocol @@ -3198,7 +3198,7 @@ processes. UNIX-specific code from the old process.c is here. * Lstream.c (Lstream_was_blocked_p): New function. Replaces - filedesc_stream_was_blocked_p. + filedesc_stream_was_blocked_p. (filedesc_was_blocked_p): Implementation of the method for filedesc stream (filedesc_stream_set_pty_flushing): set pty_flushing flag @@ -3208,10 +3208,10 @@ optional lstream method. Added prototypes for functions in lstream.c - * lisp.h: (USID): Typedef for Unique Stream IDentifier. Reuqired + * lisp.h: (USID): Typedef for Unique Stream IDentifier. Reuqired by the new code in many places. - * events.h (struct event_stream): Declaration of the two mandatory + * events.h (struct event_stream): Declaration of the two mandatory event stream methods, required by process support. * event-unixoid.c (event_stream_unixoid_create_stream_pair): @@ -3235,7 +3235,7 @@ (emacs_Xt_delete_stream_pair): Ditto * emacs.c (main_1): Added calls to process_type_create*() and - vars_of_process() + vars_of_process() * callproc.c: (many places): removed DOS support @@ -3290,7 +3290,7 @@ 1998-03-01 Kyle Jones - * file-coding.c (setup_eol_coding_systems): Don't try + * file-coding.c (setup_eol_coding_systems): Don't try to copy the mnemonic property of the coding system unless it is a string. @@ -3304,7 +3304,7 @@ 1998-03-01 Kyle Jones - * callint.c: Read coding system names for the 'z' and + * callint.c: Read coding system names for the 'z' and 'Z' interactive specs if FILE_CODING or MULE is defined. Previously, coding system names were read only if MULE was defined. @@ -3393,7 +3393,7 @@ * mule-coding.c: #if 0 out functionality until file-coding is split up. - * file-coding.h: + * file-coding.h: * file-coding.c: new files. copies of mule-coding.h and mule-coding.c. The mule case is unchanged. The non-mule case removes coding relating to other charsets - iso2022, big5, sjis, @@ -3431,7 +3431,7 @@ case, the application class is chosen based on whether the user has any resources with application class `XEmacs' set in the resource database. - (vars_of_device_x): make x-emacs-application-class nil by default + (vars_of_device_x): make x-emacs-application-class nil by default and document new behavior in its doc string. 1998-02-23 Aki Vehtari @@ -3451,11 +3451,11 @@ * s/sol2.h: define HAVE_GETLOADAVG for late edition Solaris From Georg Nikodym -1998-02-24 Didier Verna +1998-02-24 Didier Verna * redisplay.c (generate_fstring_runes): fixed the modeline scrolling lossage (the % constructs appearing in the - modeline). Now that we can have negative positions and boundaries, + modeline). Now that we can have negative positions and boundaries, max_pos == -1 can't mean 'no limit' anymore. Me, stupido! (add_string_to_fstring_db_runes): Ditto. (add_glyph_to_fstring_db_runes): Ditto. @@ -3508,7 +3508,7 @@ * unexelf.c: The proper way to check for GNU libc is with __GLIBC__. Suggested by Andreas Jaeger - + 1998-02-18 SL Baur * Makefile.in.in: Remove all references to prefix-args. @@ -3536,28 +3536,28 @@ (Fset-window-configuration): Restore window-cached specifier values. -1998-02-18 Didier Verna +1998-02-18 Didier Verna * modeline.el (mouse-drag-modeline): added the horizontal scrolling functionality for the modeline. This could still be improved, for instance when the mouse goes out of the modeline. -1998-02-18 Didier Verna +1998-02-18 Didier Verna * redisplay.c: (generate_formatted_string_db): new flag to distinguish a modeline string from a title or icon one, plus use a negative first pos to - indicate the modeline hscroll ammount. + indicate the modeline hscroll amount. (add_string_to_fstring_db_runes): completely rewrote this function to handle the case of scrolled modelines. (add_glyph_to_fstring_db_runes): handle the case of scrolled - modelines. + modelines. * window.c: (Fmodeline_hscroll): new function to return the modeline current - horizontal scroll ammount. + horizontal scroll amount. (Fset_modeline_hscroll): new function to scroll the modeline - horizontaly. + horizontaly. Plus some updates related to this new functionality (windows configuration, notably). @@ -3604,8 +3604,8 @@ 1998-02-14 Martin Buchholz - * event-Xt.c (x_reset_key_mapping): - * device-x.c: + * event-Xt.c (x_reset_key_mapping): + * device-x.c: (x-keysym-on-keyboard-p): (x-keysym-on-keyboard-sans-modifiers-p): Use x-keysym-on-keyboard-sans-modifiers-p instead of @@ -3677,7 +3677,7 @@ (gui_item_display_flush_left): Ditto (gui_item_display_flush_right): Ditto. The above listen new functions manipulate on properties common to menu items and GUI - buttons. + buttons. * menubar.c (current_frame_menubar): Moved from menubar-msw.c (menu_parse_submenu_keywords): New function @@ -3771,7 +3771,7 @@ Wed Jan 28 13:41:22 1998 Andy Piper * Makefile.in.in: add support for sheap-adjust.h generation for - static heap. + static heap. Wed Jan 28 13:41:22 1998 Andy Piper @@ -3842,7 +3842,7 @@ HEAP_IN_DATA is defined. beef up error message about what to do if sheap space runs out. - * sysdep.c: make start_of_data reurn something sensible for + * sysdep.c: make start_of_data return something sensible for HEAP_IN_DATA. * systime.h: don't use itimer stuff on cygwin b19. @@ -3906,7 +3906,7 @@ * frame-msw.c: Added file-based drag and drop support. The "System/Open" DDE command is also implemented as if it were a drag and drop operation. - + * emacsfns.h: * event-stream.c: * events.c: @@ -4004,7 +4004,7 @@ * unexcw.cc: new file for cygwin32 unexec() requires cygwin32 b19. Predicated on HAVE_COFF_H. - * console.c: + * console.c: * device-msw.c: * event-msw.c: * frame-msw.c: @@ -4034,7 +4034,7 @@ 1998-01-23 Hrvoje Niksic * print.c (print_cons): Use XCAR/XCDR. - (print_string): Fix up so it Vprint_string_length works under Mule + (print_string): Fix up so it Vprint_string_length works under Mule correctly. * eval.c (Feval): Increase profile call count. @@ -4122,15 +4122,15 @@ * offix-cursors.h (cursor_bits): Warning elimination. - * redisplay.c (add_blank_rune): - * redisplay.c (add_glyph_rune): - * redisplay.c (add_emchar_rune): + * redisplay.c (add_blank_rune): + * redisplay.c (add_glyph_rune): + * redisplay.c (add_emchar_rune): Warning elimination. Avoid useless computation in non-mule case. * config.h.in: Define HAVE_INVERSE_HYPERBOLIC using 1 configure test, not 3. - * src/alloc.c: - * src/events.c: + * src/alloc.c: + * src/events.c: Rearrange order of declarations and definitions to avoid forward * src/mem-limits.h: Add motivating comment for future cleanup. @@ -4140,7 +4140,7 @@ Always define _GNU_SOURCE when using GNU libc. Support --without-FOO as a synonym for --with-FOO=no. Always use $srcdir to locate config.guess. - Make it clear that CONFIGURATION is optional. + Make it clear that CONFIGURATION is optional. De-emphasize CONFIGURATION parameter. Random cleanup. More compatible with standard GNU install instructions. --with-menubars=athena3d ==> --with-menubars=lucid. @@ -4247,7 +4247,7 @@ Suggested by Aki Vehtari * src/symbols.c (Fsetq_default): Fix docstring. - From Didier Verna + From Didier Verna 1998-01-07 Kirill M. Katsnelson @@ -4283,13 +4283,13 @@ * lread.c (Fload_internal): On Win32, this reopened the file without first closing the handle. This caused running out of handles. - + * nt.c (sys_open): This one made big mess when opening a handle next after MAXDESC-1. Fixed. 1998-01-06 Kirill M. Katsnelson - * objects-msw.c (mswindows_string_to_color): Patched not to modify + * objects-msw.c (mswindows_string_to_color): Patched not to modify const char* parameter. (hexval): Modified to accept uppercase hex digits. @@ -4321,7 +4321,7 @@ * nt.h: Removed FD_* macros. Rely on definitions in winsock.h. Changed EMACSDEBUG references to DEBUG_XEMACS - * event-msw.c (mswindows_cancel_dispatch_event): Returns Qnil when + * event-msw.c (mswindows_cancel_dispatch_event): Returns Qnil when event not found in the queue. Used to return undefined value. 1998-01-07 SL Baur @@ -4362,7 +4362,7 @@ 1997-12-29 Kirill M. Katsnelson - * msw-proc.c (mswindows_enqueue_magic_event): Made extern. User by + * msw-proc.c (mswindows_enqueue_magic_event): Made extern. User by menubar-msw.c * event-msw.h: Prototype for mswindows_enqueue_magic_event @@ -4410,7 +4410,7 @@ * alloc.c (disksave_object_finalization): Don't zero out load-history if history of pure symbols is desired. - * lread.c (build_load_history): If LOADHIST_DUMPED is defined, add + * lread.c (build_load_history): If LOADHIST_DUMPED is defined, add pure symbols to load-history. * emacsfns.h: New symbols added -- LOADHIST_DUMPED, define to get @@ -4432,7 +4432,7 @@ 1997-12-26 Kirill M. Katsnelson * menubar-msw.c, menubar-msw.h: New files. Menus support. - + * console-msw.h: Added frame menu hashtable variable. * gui.c: popup_up_p variable and Fpopup_up_p and @@ -4456,9 +4456,9 @@ * opaque.c: opaque objects given hash and equal methods, so they can be compared with 'equal. Menubar uses opaque pointers as - hash keys in an 'equal style hastable. - - * Most of the above touched files: Eliminated compiler warnings. + hash keys in an 'equal style hashtable. + + * Most of the above touched files: Eliminated compiler warnings. 1997-12-18 Hrvoje Niksic @@ -4471,7 +4471,7 @@ 1997-12-26 P. E. Jareth Hein - * glyphs-x.c (imagick_instantiate): Add in error and + * glyphs-x.c (imagick_instantiate): Add in error and warning handling for ImageMagick files 1997-12-26 SL Baur @@ -4587,7 +4587,7 @@ * fileio.c (Finsert_file_contents_internal): Use report_file_error() to report reading error. - * cmds.c (internal_self_insert): Don't self-insert if the expanded + * cmds.c (internal_self_insert): Don't self-insert if the expanded symbol's hook has a non-nil `no-self-insert' property; synch with FSF 20.2. @@ -4622,22 +4622,22 @@ * dired.c (file_name_completion): Use noseeum_cons. (file_name_completion_unwind): Free the cons. -1997-12-16 - +1997-12-16 + * scrollbar.c: Add HAVE_MS_WINDOWS to scrollbar-page functions. - + * msw-proc.c: Handle scrolling events. - + * frame-msw.c: Initialize scrollbar width and height. This should not be necessary, since the window shouldn't be created until init_frame_2 - + * emacs.c: Call mswindows scrolbar setup when appropriate. - + * scrollbar-msw.c: Created for mswindows-scrollbar support. - + * scrollbar-msw.h: Ditto. - + 1997-12-16 Kirill M. Katsnelson * msw-proc.c: Minor bug in the middle button emulation code @@ -4706,7 +4706,7 @@ 1997-12-12 SL Baur - * input-method-xlib.c (describe_XIC): Add casts, use unsigned long + * input-method-xlib.c (describe_XIC): Add casts, use unsigned long int. * eval.c (funcall_subr): Ifdef out as it is now unused. @@ -4786,9 +4786,9 @@ * input-method-xfs.c (Initialize_Locale): Ditto. * input-method-motif.c (Initialize_Locale): Ditto. * input-method-xlib.c (Initialize_Locale): Ditto. - Suggested by Didier Verna and + Suggested by Didier Verna and Martin Buchholz - + 1997-12-10 Karl M. Hegbloom * config.h.in: #undef MAGICK_HEADERS_ARE_UNDER_X11 @@ -4902,11 +4902,11 @@ set the correct window size. 1997-12-04 Jeff Sparkes - + * frame-msw.c: added frame functions for move, resize, iconify, raise, lower, visible_p, iconified_p, focus, make visible, make invisible, set title. - + 1997-12-01 Jonathon Harris * event-msw.c, event-msw.h, frame-msw.c, msw-proc.c: @@ -4931,7 +4931,7 @@ * menubar-x.c: change #ifdef LWLIB_MENUBARS_MOTIF to #if defined LWLIB_MENUBARS_LUCID || defined LWLIB_MENUBARS_MOTIF - around code for incremental menu build. + around code for incremental menu build. * event-stream.c: Changed HAVE_MENUBARS to HAVE_MENUBARS_LUCID in the #ifdef wrappers around menubar accelerator stuff. @@ -5033,7 +5033,7 @@ vector and call mapcar1 with its data. 1997-12-02 P E Jareth Hein - + * objects-x.c: Added colormap/visual support, rewrote allocate_nearest_color, and changed the x-color-instance to deal with possibly not freeing a color. @@ -5142,7 +5142,7 @@ (Fredisplay_echo_area): Clear echo_area_garbaged flag on frame after displaying in echo area. - * redisplay.c: Added hscroll_glyph_width_adjust field + * redisplay.c: Added hscroll_glyph_width_adjust field to position_redisplay_data_type struct. (add_hscroll_rune): Compute the difference in width @@ -5178,7 +5178,7 @@ 1997-11-17 Marc Paquette - * callproc.c (Fcall_process_internal): Fix for bug in + * callproc.c (Fcall_process_internal): Fix for bug in CRLF -> LF conversion. 1997-11-19 Jonathan Harris @@ -5199,7 +5199,7 @@ * callproc.c (Fcall_process_internal): Close fd_error. -1997-11-19 Didier Verna +1997-11-19 Didier Verna * emacs.c (main_1): Added the missing argmatch call to check for the '-h' option. @@ -5255,7 +5255,7 @@ * frame.c: Document new toolbar border width speciifer as being usable as frame properties. - (frame_conversion_internal): Factor the toolbar border + (frame_conversion_internal): Factor the toolbar border widths into the geometry calculations. (change_frame_size_1): Ditto. @@ -5274,11 +5274,11 @@ support for drawing a border along with the blank button. Accept border_width and vertical args. - (x_output_toolbar_button): Added support for drawing a + (x_output_toolbar_button): Added support for drawing a border along with the button. (X_OUTPUT_BUTTONS_LOOP): Pass border_width and vert - args to x_draw_blank_toolbar_button. Set vertical and + args to x_draw_blank_toolbar_button. Set vertical and border_width fields in toolbar button. (x_output_toolbar): Support toolbar border widths. @@ -5324,7 +5324,7 @@ 1997-11-16 Hrvoje Niksic - * events.c (print_event): Use `event-x-pixel' and `event-y-pixel', + * events.c (print_event): Use `event-x-pixel' and `event-y-pixel', to be consistent with `make-event' and `event-properties'. (Fmake_event): Allow nil dnd-data. @@ -5630,7 +5630,7 @@ * redisplay.c: init_redisplay Initialise window system to w32, conditioned on HAVE_W32GUI. - + * symsinit.h: Added syms_of_*_w32, vars_of_*_w32 and init_event_w32_late. @@ -5717,33 +5717,33 @@ 1997-11-02 Andreas Jaeger - * m/vax.h: - * s/cxux.h: - * s/xenix.h: - * s/umax.h: - * s/msdos.h: - * s/template.h: - * termcap.c: - * signal.c: - * lread.c: + * m/vax.h: + * s/cxux.h: + * s/xenix.h: + * s/umax.h: + * s/msdos.h: + * s/template.h: + * termcap.c: + * signal.c: + * lread.c: * callproc.c * buffer.c: Remove VMS dependent code. 1997-11-02 Andreas Jaeger * syspwd.h: - * systty.h: - * systime.h: - * syssignal.h: - * sysproc.h: - * sysfloat.h: - * sysfile.h: - * regex.h: - * process.h: - * ndir.h: - * mule-mcpath.h: - * getpagesize.h: - * sysdep.h: + * systty.h: + * systime.h: + * syssignal.h: + * sysproc.h: + * sysfloat.h: + * sysfile.h: + * regex.h: + * process.h: + * ndir.h: + * mule-mcpath.h: + * getpagesize.h: + * sysdep.h: * fileio.c: * process.c: Remove old VMS code. @@ -5753,8 +5753,8 @@ 1997-11-02 Andreas Jaeger - * sysdep.c: - * getloadavg.c: + * sysdep.c: + * getloadavg.c: * malloc.c: Remove old VMS code. 1997-11-02 Hrvoje Niksic @@ -5803,12 +5803,12 @@ 1997-10-31 Kyle Jones - * callproc.c: GC protect current_dir while infile and + * callproc.c: GC protect current_dir while infile and error_file are being initialized. 1997-10-30 SL Baur - * config.h.in: Remove HAVE_GIF, HAVE_JPEG, HAVE_PNG, HAVE_TIFF and + * config.h.in: Remove HAVE_GIF, HAVE_JPEG, HAVE_PNG, HAVE_TIFF and replace with HAVE_IMAGEMAGICK. 1997-10-30 Kyle Jones @@ -5824,7 +5824,7 @@ 1997-10-28 Kyle Jones - * Under LRECORD_VECTOR, moved vectors from being an basic + * Under LRECORD_VECTOR, moved vectors from being an basic lrecord tpye to an lcrecord. Added support for 31 bits Lisp integers. Added support for maskless pointers to Lisp objects. @@ -5854,7 +5854,7 @@ type checking code on an uninitialized implementation pointer. - (Fpurecopy): return if given a null pointer. THis can + (Fpurecopy): return if given a null pointer. THis can happen when initializing Qnil. (mark_object): return if passed a null pointer. I @@ -5870,7 +5870,7 @@ indirect children list gets reset to a null pointer when a bfufer is killed. - (complex_vars_of_buffer): initialize indirect_children + (complex_vars_of_buffer): initialize indirect_children slow of Vbuffer_local_symbols and Vbuffer_defaults to nil. @@ -6010,11 +6010,11 @@ * README: Remove references to VMS. - * vlimit.h: - * s/vms5-5.h: - * s/vms4-4.h: - * s/vms4-2.h: - * s/vms4-0.h: + * vlimit.h: + * s/vms5-5.h: + * s/vms4-4.h: + * s/vms4-2.h: + * s/vms4-0.h: * s/vms.h: Remove files since VMS isn't supported any more. 1997-10-25 Kyle Jones @@ -6030,7 +6030,7 @@ * alloc.c: Disable purespace statistics unless --debug is in effect. - * console-stream.c (init_console_stream): At the price of a tiny + * console-stream.c (init_console_stream): At the price of a tiny memory leak, reinitialize FILE fields of the console. From Tonny Madsen @@ -6072,15 +6072,15 @@ separate function so that it could be used as a `print' method for lrecord-based strings. -1997-10-20 Jan Vroonhof - +1997-10-20 Jan Vroonhof + * extents.c: Renamed shot property to initial-redisplay-function (extent_fragment_update): Changed the bookkeeping whether an event has been spawned. The initial-redisplay-function property is no longer set to nil. - + * extents.h: ditto - + 1997-10-20 Kyle Jones * Added support for conses and vectors to be lrecords. @@ -6153,7 +6153,7 @@ (make-coding-system, coding-system-type, detect-coding-region): Rename `Qautomatic_conversion' -> `Qundecided'. - + * general.c (syms_of_general): Rename `automatic-conversion' -> `undecided' to sync with Emacs 20.2. @@ -6202,7 +6202,7 @@ 1997-10-11 SL Baur - * realpath.c (realpath): CONST IS LOSING but removing it conflicts + * realpath.c (realpath): CONST IS LOSING but removing it conflicts with system headers. * callproc.c: New variable infopath-internal. @@ -6272,7 +6272,7 @@ * regex.c: Global change: register -> REGISTER. - Ensure REGISTER is always defined. - + * nt.c: Global change: register -> REGISTER. * linuxplay.c: Global change: register -> REGISTER. @@ -6281,7 +6281,7 @@ * gifalloc.c: Global change: register -> REGISTER. - Ensure REGISTER is always defined. - + * getloadavg.c (getloadavg): register -> REGISTER. * eval.c (unwind_to_catch): [Unused variable] register -> REGISTER. @@ -6344,7 +6344,7 @@ Fri Oct 3 12:28:08 1997 Kyle Jones * lisp-disunion.h: Move markbit to be between the - type bits and the value bits. Previously it was always + type bits and the value bits. Previously it was always the sign bit of a EMACS_INT, unless modified by a #define in a machine dependent .h file. @@ -6446,7 +6446,7 @@ is a cons. (Fremrassoc): Ditto. - * dired.c (Fdirectory_files): Nreverse the list only if it will be + * dired.c (Fdirectory_files): Nreverse the list only if it will be sorted. Fri Sep 26 13:55:28 1997 Kyle Jones @@ -6458,7 +6458,7 @@ 1997-09-26 Hrvoje Niksic * dired.c (close_directory_fd): New function. - (Fdirectory_files): Use it to set up an unwind-protection to close + (Fdirectory_files): Use it to set up an unwind-protection to close the descriptor. (Fdirectory_files): Allow QUIT in re_search. (Fdirectory_files): If the file is too big, allocate necessary @@ -6494,7 +6494,7 @@ * syntax.c (Fchar_syntax): convert nil input to \000 for compatibility. - * alloc.c (report_pure_usage): Increase slop to 512 bytes in betas + * alloc.c (report_pure_usage): Increase slop to 512 bytes in betas and reduce it to 4 bytes in releases. 1997-09-23 SL Baur @@ -6535,7 +6535,7 @@ * eval.c (Fapply): replace Flength call with for-loop to compute list length. - + * eval.c (apply_lambda):Use XCAR and XCDR in some places where it is safe to do so. @@ -6577,7 +6577,7 @@ * events.c (Fmake_event): Add default case, remove unused variables. 1997-08-21 Jan Vroonhof - + * extents.c (extent_fragment_update): Trigger one_shot_function * extents.c (set-extent-one-shot-function): New function @@ -6629,7 +6629,7 @@ 1997-08-05 Jens-Ulrik Holger Petersen - * eval.c (vars_of_eval): Updated docstring for `debug_on_error' to + * eval.c (vars_of_eval): Updated docstring for `debug_on_error' to mention `debug-ignored-errors'. 1997-08-01 SL Baur @@ -6644,7 +6644,7 @@ * frame-x.c (x_offix_drop_event_handler): Use stderr_out instead of fprintf. - * mule-coding.c (parse_iso2022_esc): Add abort() trap on unhandled + * mule-coding.c (parse_iso2022_esc): Add abort() trap on unhandled condition. * mule-wnnfns.c (Fwnn_dict_search): Remove unused variable. @@ -6719,7 +6719,7 @@ New variable Vpackage_path. (vars_of_emacs): Use it. - * editfns.c (Fstring_to_char): Return nil instead of `0' for empty + * editfns.c (Fstring_to_char): Return nil instead of `0' for empty string. 1997-07-10 Hrvoje Niksic @@ -6760,7 +6760,7 @@ Was forgotten cut & paste identical clone to Fcompiled_function_interactive? - * Makefile.in.in (alloc.o): Remove dependency on puresize_adjust.h + * Makefile.in.in (alloc.o): Remove dependency on puresize_adjust.h so alloc.c need not be recompiled when puresize changes. * alloc.c (PURIFIED): Use get_PURESIZE() instead of constant. @@ -6775,7 +6775,7 @@ (get_PURESIZE): New function -- declare it. * pure.c: Move final PURESIZE computation and include of - puresize_adjust.h into here so alloc.c need not be recompiled each + puresize_adjust.h into here so alloc.c need not be recompiled each time the puresize is adjusted. (get_PURESIZE): New function. @@ -6795,7 +6795,7 @@ I am still not sure what this buys us, but I guess it doesn't hurt to have it. From Hrvoje Niksic - + * glyphs.c (make_string_from_file): Use insert-file-contents-literally instead of insert-file-contents-internal. @@ -6925,7 +6925,7 @@ 1997-06-18 Martin Buchholz - * Makefile.in: + * Makefile.in: * s/*.h: * m/*.h: * config.h.in: @@ -6946,10 +6946,10 @@ - Make quoted pre-processor string tokens out of all macro values to be used only by configure. * xmu.c: DON'T use Xos.h - * sysdep.c (wait_for_termination): - * search.c: - * editfns.c: - * console-*: + * sysdep.c (wait_for_termination): + * search.c: + * editfns.c: + * console-*: 1997-06-18 Steven L Baur @@ -7049,7 +7049,7 @@ * syntax.c (Fchar_syntax): Handle case of being passed nil. - * data.c (eq_with_ebola_notice): Add more legitimate places in the + * data.c (eq_with_ebola_notice): Add more legitimate places in the bytecompiler that should not get Ebola notices. Tue Jun 10 00:34:40 1997 Kyle Jones @@ -7097,7 +7097,7 @@ * keydefs.c (get_relevant_extent_keymaps): Choose correct keymap at extent boundaries. - + Mon Jun 9 19:35:19 1997 Kyle Jones * redisplay.c (pixel_to_glyph_translation): @@ -7119,7 +7119,7 @@ * sysdep.c: MS Windows NT doesn't (yet) do child TTY processes. From David Hobley - + Sat Jun 7 22:00:54 1997 Kyle Jones * device-x.c (x_delete_device): @@ -7130,7 +7130,7 @@ * frame.c (Fmake_frame): Correct checking of first_frame_on_device. From Hrvoje Niksic - + 1997-06-04 Steven L Baur * device.c (delete_deviceless_console): New function. @@ -7170,7 +7170,7 @@ Sat May 31 19:59:49 1997 Kyle Jones * frame-tty.c (tty_init_frame_3: - Defer selection of the newly created frame until + Defer selection of the newly created frame until an event is read. 1997-06-02 Steven L Baur @@ -7233,7 +7233,7 @@ (Fset_recent_keys_ring_size): New function. Modifies the above. From Hrvoje Niksic - + * event-stream.c: New variable recent_keys_ring_size replacing a hard-coded macro. @@ -7251,7 +7251,7 @@ Wed May 21 11:58:17 1997 Kyle Jones * insdel.c (signal_first_change): - record the current buffer for the unwind instead of the + record the current buffer for the unwind instead of the buffer that's about to become the current buffer. Tue May 20 23:23:39 1997 Steven L Baur @@ -7333,7 +7333,7 @@ * lread.c: New variable featurep. (read1): Add processing for #- and #+. - (read_list_conser): Handle case where a feature test has removed a + (read_list_conser): Handle case where a feature test has removed a portion of the input stream. (vars_of_lread): New feature `xemacs'. @@ -7362,7 +7362,7 @@ HAVE_X_WINDOWS. (main_1): Add vars_of_balloon_x and guard with HAVE_X_WINDOWS. - * process.c (get_process): This function can be passed a BUFFER as + * process.c (get_process): This function can be passed a BUFFER as a parameter. Tue Apr 22 01:32:00 1997 Kyle Jones @@ -7493,7 +7493,7 @@ * dired.c (Fdirectory_files): Clean up GC protection. - * insdel.c (signal_after_change): Don't run after_change_functions + * insdel.c (signal_after_change): Don't run after_change_functions on special Vprin1_to_string_buffer. (signal_before_change): Ditto for before_change_functions. @@ -7551,7 +7551,7 @@ * config.h.in: Strip unimplemented NeXTStep/Epoch stuff out. - * Makefile.in.in: Remove unused NeXTStep support. It's all in the + * Makefile.in.in: Remove unused NeXTStep support. It's all in the cvs attic if someone wishes to revive it. (epoch.o): Remove last vestiges of non-existent epoch support. @@ -7566,7 +7566,7 @@ Tue Apr 1 12:22:32 1997 Steven L Baur - * config.h.in: MAIL_USE_POP, KERBEROS, HESIOD -- new parameters to + * config.h.in: MAIL_USE_POP, KERBEROS, HESIOD -- new parameters to deal with upgraded movemail.c. Fri Mar 28 19:25:22 1997 Steven L Baur @@ -7613,7 +7613,7 @@ Mon Mar 24 12:40:56 1997 David Moore * profile.c: Fixed some comments about GC status of functions. - + * profile.c (inside_profiling): New variable to lock the profiling table. (sigprof_handler): Check it. @@ -7647,8 +7647,8 @@ (Fset_file_modes): ditto (Ffile_newer_than_file_p): ditto (Fset_visited_file_modtime): ditto - - *fileio.c (Ffile_truename): Unneccessary GC protection. + + *fileio.c (Ffile_truename): Unnecessary GC protection. (Fdelete_directory): Fix broken caller-must-GC-protect call. * filelock.c (lock_file): New comments warning that this function @@ -7684,7 +7684,7 @@ * glyphs-x.c (x_print_image_instance): Move define of HAVE_SUBWINDOWS to glyphs-x.h. - (our_skip_input_data): Implement with some error checking based on + (our_skip_input_data): Implement with some error checking based on patch by Dominic Froud. * glyphs-x.h (HAVE_SUBWINDOWS): Define to keep inline.c from @@ -7755,7 +7755,7 @@ Sun Mar 9 21:46:53 1997 Tomasz J. Cholewo - * minibuf.c (regexp_ignore_completion_p): Reverse meaning of + * minibuf.c (regexp_ignore_completion_p): Reverse meaning of completion-regexp-list. Thu Mar 6 19:15:29 1997 Steven L Baur @@ -7843,7 +7843,7 @@ * process.c (record_exited_processes): Fix obvious typo in checking for SIGCLD. - + Sun Feb 23 01:45:49 1997 Martin Buchholz * scrollbar.c (update_scrollbar_instance): Fix for @@ -7907,7 +7907,7 @@ * keymap.c (lookup_keys): Wrong sense in test. - * Makefile.in.in: Dont dump font.elc. + * Makefile.in.in: Don't dump font.elc. Sat Feb 15 02:30:51 1997 Steven L Baur @@ -8312,4 +8312,3 @@ Wed Dec 4 23:38:03 1996 Steven L Baur * redisplay.c: Allow column numbers in modeline to start from 1. - diff -r 72a7cfa4a488 -r abe6d1db359e src/ChangeLog.2 --- a/src/ChangeLog.2 Mon Aug 13 11:33:40 2007 +0200 +++ b/src/ChangeLog.2 Mon Aug 13 11:35:02 2007 +0200 @@ -8,9 +8,9 @@ * lisp.h (xfree_1): Make non-public. * (xzero): Use '\0' in memset call for clarity. * (ALIGNOF): Use __alignof__ instead of undocumented __alignof. - * alloc.c (allocate_string_chars_struct): - (make_uninit_string): - (resize_string): + * alloc.c (allocate_string_chars_struct): + (make_uninit_string): + (resize_string): (verify_string_chars_integrity): (compact_string_chars): Now only called for small strings. (sweep_strings): @@ -216,7 +216,7 @@ 2000-01-04 Martin Buchholz - * mule-charset.h (REP_BYTES_BY_FIRST_BYTE): + * mule-charset.h (REP_BYTES_BY_FIRST_BYTE): Remove macro, always use inline function. * mule-charset.c (make_charset): Don't assign to rep_bytes_by_first_byte. (rep_bytes_by_first_byte): Make const. @@ -331,31 +331,31 @@ 1999-12-21 Martin Buchholz - * editfns.c (Fpoint_min): - (Fpoint_min_marker): - (Fpoint_max): - (Fpoint_max_marker): - (Fchar_after): - (Fchar_before): + * editfns.c (Fpoint_min): + (Fpoint_min_marker): + (Fpoint_max): + (Fpoint_max_marker): + (Fchar_after): + (Fchar_before): Docstring fixes. What's a `buffer pointer' anyways? * editfns.c (char=): Remove unused and undocumented optional third BUFFER argument. - * toolbar.h (DEVICE_SUPPORTS_TOOLBARS_P): - * fns.c (plists_differ): - * elhash.c (HASH_CODE): - * elhash.c (KEYS_EQUAL_P): - * redisplay-output.c (redisplay_move_cursor): - * redisplay.c (create_text_block): - * floatfns.c (Flogb): - * glyphs-msw.c (mswindows_initialize_image_instance_mask): - * glyphs-msw.c (xpm_to_eimage): - * buffer.h (POINT_MARKER_P): - * syntax.c (scan_lists): - * cmdloop.c (Fcommand_loop_1): - * widget.c (Fwidget_apply): - * regex.c (STREQ): + * toolbar.h (DEVICE_SUPPORTS_TOOLBARS_P): + * fns.c (plists_differ): + * elhash.c (HASH_CODE): + * elhash.c (KEYS_EQUAL_P): + * redisplay-output.c (redisplay_move_cursor): + * redisplay.c (create_text_block): + * floatfns.c (Flogb): + * glyphs-msw.c (mswindows_initialize_image_instance_mask): + * glyphs-msw.c (xpm_to_eimage): + * buffer.h (POINT_MARKER_P): + * syntax.c (scan_lists): + * cmdloop.c (Fcommand_loop_1): + * widget.c (Fwidget_apply): + * regex.c (STREQ): Remove extra parens, esp. of the form ((expr)) * floatfns.c (Flogb): Make 64-bit clean. @@ -405,7 +405,7 @@ * glyphs-widget.c (VALID_GUI_KEYWORDS): use NONCOPY keyword for callbacks and other things that could recurse. - (VALID_GUI_KEYWORDS): + (VALID_GUI_KEYWORDS): * event-msw.c: fix cpp stuff for cygwin < b20. @@ -456,10 +456,10 @@ 1999-12-18 Martin Buchholz - * fns.c (mapcar1): - (Fmapconcat): - (Fmapcar): - (Fmapvector): + * fns.c (mapcar1): + (Fmapconcat): + (Fmapcar): + (Fmapvector): Docstring fixes. Make them consistent with the lispref and ANSI Lisp. 1999-12-17 Martin Buchholz @@ -479,7 +479,7 @@ * window.c: * event-stream.c: Remove last vestigial uses of GC_* - + * fns.c (mapcar1): Fix ***THREE*** obscure crashes in one function! - Two of those involve evil mapping functions that destructively modify a list being mapped over. @@ -519,7 +519,7 @@ 1999-12-10 Shenghuo ZHU - * file-coding.c (add_coding_system_to_list_mapper): + * file-coding.c (add_coding_system_to_list_mapper): - (coding-system-list) should list aliases correctly. 1999-12-07 Andy Piper @@ -548,7 +548,7 @@ found. (nt_open_network_stream): warn_when_safe if network stream fails to open. - + * ntproc.c (create_child): Remove negative pid hack for Windows 95. Remove incorrect and unnecessary USE_UNION_TYPE handling. @@ -568,7 +568,7 @@ * events.c (Fcopy_event): Don't copy the lrecord_header. - * lisp.h (DO_REALLOC): + * lisp.h (DO_REALLOC): Optimize. Remove redundant parens. Remove generic hygienic macro comment. @@ -577,7 +577,7 @@ 1999-12-05 Martin Buchholz - * lstream.c (Lstream_adding): + * lstream.c (Lstream_adding): - Never compare a size_t and a possibly negative number. - Optimize. @@ -614,11 +614,11 @@ 1999-12-04 Martin Buchholz - * lstream.c: (filedesc_reader): + * lstream.c: (filedesc_reader): (filedesc_writer): Try number 2: Support broken systems where return type of read() and write() is different from ssize_t. - * systty.h: + * systty.h: * sysdep.h: * sysdep.c: - Replace macro calls to EMACS_GET_TTY and EMACS_SET_TTY with @@ -637,7 +637,7 @@ (menu_move_right): Ditto. * lrecord.h (copy_lcrecord): - (zero_lcrecord): + (zero_lcrecord): Always add parentheses around uses of macro arguments. * sysdll.c: #include for exit(). @@ -762,7 +762,7 @@ * file-coding.c (convert_to_external_format): * file-coding.c (convert_from_external_format): - Lstream functions mirror Unix98 read(),write(). Therefore use - Unix98 types size_t and ssize_t. + Unix98 types size_t and ssize_t. - Try to make Lstream* functions 64-bit clean. Someday someone may actually want to read from a Lstream with more than 2**32 bytes. - Add configure support for ssize_t. @@ -790,12 +790,12 @@ 1999-11-26 Martin Buchholz - * device-x.c (x_init_device): + * device-x.c (x_init_device): - Replace magic number `17' with equivalent expn using sizeof. - Replace strcmp with marginally more efficient memcmp. - Avoid using C++ reserved word `class'. - * file-coding.c (determine_real_coding_system): + * file-coding.c (determine_real_coding_system): - Look for both initial and final -*- cookies. - Replace EQ (foo, Qnil) with NILP (foo) - Make searching for cookies more efficient. @@ -848,7 +848,7 @@ * redisplay.h (struct rune): Do not use bitfields for members. (struct rune): Add various comments about further optimizations. - + 1999-11-19 Eric Darve * abbrev.c (abbrev_oblookup): Check whether wordend <= wordstart @@ -914,16 +914,16 @@ * tooltalk.c (tt_build_string): Remove extra parens. * process.c (print_process): Remove extra parens. - * buffer.h (BI_BUF_PTR_BYTE_POS): - (BUF_PTR_BYTE_POS): - (BI_BUF_BYTE_ADDRESS): - (BI_BUF_BYTE_ADDRESS_BEFORE): - (valid_memind_p): - (bytind_to_memind): + * buffer.h (BI_BUF_PTR_BYTE_POS): + (BUF_PTR_BYTE_POS): + (BI_BUF_BYTE_ADDRESS): + (BI_BUF_BYTE_ADDRESS_BEFORE): + (valid_memind_p): + (bytind_to_memind): (memind_to_bytind): Remove extra parens. Inline functions are not macros. - * editfns.c (Fuser_login_name): + * editfns.c (Fuser_login_name): (user_login_name): Use proper type uid_t. @@ -992,18 +992,18 @@ 1999-10-25 Martin Buchholz - * redisplay.h (CLASS_RESET_CHANGED_FLAGS): - (GLOBAL_RESET_CHANGED_FLAGS): - (CLASS_REDISPLAY_FLAGS_CHANGEDP): - (RESET_CHANGED_SET_FLAGS): + * redisplay.h (CLASS_RESET_CHANGED_FLAGS): + (GLOBAL_RESET_CHANGED_FLAGS): + (CLASS_REDISPLAY_FLAGS_CHANGEDP): + (RESET_CHANGED_SET_FLAGS): Fix C++ compile errors/warnings. These macros were just a tad too clever. * process-unix.c (unix_open_network_stream): * objects-x.c (allocate_nearest_color): - * mule-charset.c (vars_of_mule_charset): - * fileio.c (Ffile_truename): - * file-coding.c (vars_of_file_coding): + * mule-charset.c (vars_of_mule_charset): + * fileio.c (Ffile_truename): + * file-coding.c (vars_of_file_coding): Fix compile errors/warnings. * alloc.c (xstrdup): Use fact that memcpy returns its first arg. @@ -1039,8 +1039,8 @@ * sound.c: support HAVE_ESD_SOUND - * miscplay.c: - * miscplay.h: + * miscplay.c: + * miscplay.h: * linuxplay.c: Move large part of linuxplay to generalized file miscplay. Make it platform independent. @@ -1062,7 +1062,7 @@ 1999-10-24 Jan Vroonhof - * unexelf.c: Merge Martin's c++ fixes back in + * unexelf.c: Merge Martin's c++ fixes back in 1999-10-20 Jan Vroonhof @@ -1141,7 +1141,7 @@ * lisp.h (DUMPEDP): Added. Removed dumped flag from dynarr. * alloc.c: Removed hash_next linked list pointer. - + * *.c *.h: Removed markobj and mark_object parameters, removed GC_ and XGC macros. @@ -1731,7 +1731,7 @@ XEmacs slow down to a crawl. I also hope to be able to create a list with more than INT_MAX cons cells. - * redisplay.c (decode_mode_spec): + * redisplay.c (decode_mode_spec): The %p and %P specs in the mode line were not correct for buffers larger than MAX_INT/100! The %p spec was off by .5% even for small buffers! @@ -1741,7 +1741,7 @@ * cmdloop.c (num_input_keys): * print.c (debug_temp): * emacs.c (Vinfo_directory): - Delete unused variables + Delete unused variables * console-x.h (x_interline_space): Mark as unimplemented. * redisplay-x.c (x_interline_space): Mark as unimplemented. @@ -1801,7 +1801,7 @@ * scrollbar-x.c (x_window_is_scrollbar): deleted. * scrollbar-x.h: ditto. - + 1999-09-23 Martin Buchholz * alloc.c (this_marks_a_marked_record): Remove. @@ -2560,7 +2560,7 @@ * console.h (struct console_methods): new console methods for outputting pixmaps and strings. -1999-08-23 Didier Verna +1999-08-23 Didier Verna * sound.c: revert the renaming of `bell_volume' to `Vbell_volume' and `bell_inhibit_time' to `Vbell_inhibit_time'. @@ -2806,7 +2806,7 @@ (mswindows_tab_control_instantiate): ditto. (mswindows_tab_control_set_property): ditto. (image_instantiator_format_create_glyphs_mswindows): predicate - existance of widgets on HAVE_WIDGETS. + existence of widgets on HAVE_WIDGETS. * frame.h (struct frame): add subwindow_exposures variables. @@ -3184,7 +3184,7 @@ * s/linux.h: gcc-2.8 changes for powerpc From Justin Vallon -1999-07-05 Didier Verna +1999-07-05 Didier Verna * indent.c: new symbol Qcoerce. (Fmove_to_column): use it + doc string update. @@ -3973,7 +3973,7 @@ * systime.h: ditto. * systty.h: ditto. - * config.h.in: dont turn on DEBUG_ENCAPSULATION by default because + * config.h.in: don't turn on DEBUG_ENCAPSULATION by default because some systems don't have all of the encapsulated system calls. * callproc.c: warning elimination. @@ -5150,7 +5150,7 @@ * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded bytecode. -1998-12-02 Didier Verna +1998-12-02 Didier Verna * menubar-x.c (menu_item_descriptor_to_widget_value_1): set the accelerator field to nil for labels. @@ -5161,7 +5161,7 @@ Escape occurrences of '&' and support occurrences of the '%_' accelerator indicator in menus. -1998-11-26 Didier Verna +1998-11-26 Didier Verna * dired.c (Fdirectory_files): use make_string instead of make_ext_string on the filename. The conversion external->internal @@ -5551,7 +5551,7 @@ subwindows on a msw frame. (mswindows_map_subwindow): ditto. (mswindows_register_image_instance): register instantiated widgets - with the widget hastable. + with the widget hashtable. (mswindows_button_instantiate): instantiate a button type widget on an msw frame. (mswindows_subwindow_instantiate): instanttiate a subwindow on a @@ -6460,14 +6460,14 @@ * chartab.c (canonicalize_char_table_value): Coerce ints to chars for tables of type `char'. -1998-11-26 Didier Verna +1998-11-26 Didier Verna * input-method-xlib.c (Initialize_Locale): don't call XtSetLanguageProc. We've done the whole work here. * input-method-xfs.c (Initialize_Locale): ditto. * input-method-motif.c (Initialize_Locale): ditto. -1998-11-26 Didier Verna +1998-11-26 Didier Verna * process-unix.c (unix_create_process): handle properly Vfile_name_coding_system for converting the program and directory @@ -6912,7 +6912,7 @@ * fns.c (Fremrassq, remrassq_no_quit): A XCAR that should have been an XCDR turned Fremrassq into Fremassq -1998-07-17 Didier Verna +1998-07-17 Didier Verna * redisplay-x.c (x_get_gc): returns a GC with a FillStipple fill style as foreground GC for faces that have the `dim' property. @@ -7121,7 +7121,7 @@ * fileio.c: (expand_file_name): under win32: Don't treat names as UNC names if a drive letter has been specified. If a drive - has been specified, strip out extra directory-seperators that + has been specified, strip out extra directory-separators that reportedly cause problems under Win95. 1998-07-09 Jonathan Harris @@ -7171,7 +7171,7 @@ * fileio.c: (expand_file_name): under win32: Don't treat names as UNC names if a drive letter has been specified. If a drive has - been specified, strip out extra directory-seperators that + been specified, strip out extra directory-separators that reportedly cause problems under Win95. 1998-07-05 Andy Piper @@ -7194,7 +7194,7 @@ 1998-06-24 Jonathan Harris - * fileio.c: Don't do directory seperator canonicalisation in + * fileio.c: Don't do directory separator canonicalisation in substitute-in-file-name because we don't know that the filename refers to a local file. @@ -7278,7 +7278,7 @@ * objects-msw.c: Added helper function match_font used by mswindows_initialize_font_instance and mswindows_list_fonts. Allow a charset to be specified in a font string, even if - previous fields havn't been specified. + previous fields haven't been specified. 1998-06-23 Greg Klanderman @@ -7335,7 +7335,7 @@ * objects-msw.c: Added helper function match_font used by mswindows_initialize_font_instance and mswindows_list_fonts. Allow a charset to be specified in a font string, even if - previous fields havn't been specified. + previous fields haven't been specified. 1998-06-15 Jonathan Harris @@ -7379,7 +7379,7 @@ parameters. define macors to access it. * frame-msw.c (mswindows_init_frame_1): use new target_rect - parameter to intialise desired sizing. (mswindows_init_frame_2): + parameter to initialize desired sizing. (mswindows_init_frame_2): enable and size the frame to something sensible when we get here. (mswindows_set_frame_properites): use new mswindows_size_frame_internal function and size frame if frame @@ -8081,7 +8081,7 @@ (set_frame_toolbar): Removed allocation of toolbar_data lrecord. (update_frame_toolbars): Do not check for changed buffer here. Toolbar information is provided by cached specs in - windows. The check for buffer is eliminated becuase toolbars are + windows. The check for buffer is eliminated because toolbars are marked changed in set_frame_selected_window() in frame.c Added check for changed toolbars geometry. (compute_frame_toolbars_data): Removed unused second parameter; @@ -8250,7 +8250,7 @@ divider face using Vvertical_divider_face background. Fix drawing spacing gaps around the divider. -1998-05-14 Didier Verna +1998-05-14 Didier Verna * redisplay-x.c (x_output_vertical_divider): removed hard-wired values for the vertical divider line width and spacing. Use the @@ -8449,13 +8449,13 @@ * redisplay-msw.c (mswindows_output_vertical_divider): Syntax fix. -1998-05-12 Didier Verna +1998-05-12 Didier Verna * redisplay-x.c (x_output_vertical_divider): draw shadows around the divider line. The shadow thickness is currently hard-wired. This will probably be turned into a specifier soon. -1998-05-12 Didier Verna +1998-05-12 Didier Verna * console.h (struct console_methods): the divider_width console method now requires a struct window * argument. @@ -8593,7 +8593,7 @@ hand-crafted regexps. - Use standard coding conventions for modules/Makefile.in -1998-05-12 Didier Verna +1998-05-12 Didier Verna * redisplay.c: removed the scrolling modeline code that didn't make it for 21.0. To be continued ... diff -r 72a7cfa4a488 -r abe6d1db359e src/ExternalClient.c --- a/src/ExternalClient.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/ExternalClient.c Mon Aug 13 11:35:02 2007 +0200 @@ -46,7 +46,7 @@ #include "extw-Xt.h" #ifdef TOOLTALK -#include TT_C_H_PATH +#include TT_C_H_FILE #endif /* This is the client widget, used to communicate with an ExternalShell diff -r 72a7cfa4a488 -r abe6d1db359e src/Makefile.in.in --- a/src/Makefile.in.in Mon Aug 13 11:33:40 2007 +0200 +++ b/src/Makefile.in.in Mon Aug 13 11:35:02 2007 +0200 @@ -25,7 +25,20 @@ PROGNAME=@PROGNAME@ -all: ${PROGNAME} +#define NOT_C_CODE +#include "config.h" + +#ifdef PDUMP +DUMP_TARGET = ${PROGNAME}.dmp +EXE_TARGET = ${PROGNAME} +ID_FILE = dump-id.c +#else +DUMP_TARGET = ${PROGNAME} +EXE_TARGET = temacs +ID_FILE = +#endif + +all: ${DUMP_TARGET} .PHONY : all release dump-elc dump-elcs all-elc all-elcs lint ## For performance and consistency, no built-in rules. @@ -73,8 +86,6 @@ lib_gcc=@lib_gcc@ ##libmcheck=@libmcheck@ -#define NOT_C_CODE -#include "config.h" ## With the traditional VPATH setting, it is not possible to ## simultaneously compile in-place and in another directory. The @@ -98,16 +109,13 @@ vpath paths.h vpath Emacs.ad.h vpath sheap-adjust.h +vpath dump-id.c #else VPATH=@srcdir@ #endif RM = rm -f -#ifdef HAVE_NATIVE_SOUND -sound_cflags=@sound_cflags@ -#endif - LWLIB_SRCDIR = ${srcdir}/../lwlib #ifdef HAVE_X_WINDOWS @@ -116,7 +124,7 @@ $(lwlib_libs) : cd ../lwlib && $(RECURSIVE_MAKE) -x_objs=balloon_help.o balloon-x.o console-x.o device-x.o event-Xt.o frame-x.o\ +x_objs=console-x.o device-x.o event-Xt.o frame-x.o\ glyphs-x.o objects-x.o redisplay-x.o select-x.o xgccache.o #ifdef AIX4 @@ -126,8 +134,12 @@ X11_libs = $(LIBI18N) #endif /* HAVE_X_WINDOWS */ -#ifdef HEAP_IN_DATA -sheap_obj=sheap.o +#if defined (HEAP_IN_DATA) && !defined (PDUMP) +sheap_objs=sheap.o +#endif + +#if defined (WIN32_NATIVE) || defined (CYGWIN) +win32_objs=win32.o xemacs_res.o #endif ## -Demacs is needed to make some files produce the correct version @@ -181,9 +193,9 @@ macros.o marker.o md5.o minibuf.o objects.o opaque.o\ print.o process.o profile.o\ rangetab.o redisplay.o redisplay-output.o regex.o\ - search.o select.o $(sheap_obj) signal.o sound.o\ + search.o select.o $(sheap_objs) signal.o sound.o\ specifier.o strftime.o symbols.o syntax.o sysdep.o\ - undo.o $(x_objs) widget.o window.o + undo.o $(x_objs) widget.o window.o $(win32_objs) obj_rtl = $(objs:.o=.c.rtl) @@ -309,67 +321,50 @@ mo_file = ${mo_dir}emacs.mo #endif -#ifdef WINDOWSNT -LOADPATH = EMACSBOOTSTRAPLOADPATH="${lispdir};${blddir}" -MODULEPATH = EMACSBOOTSTRAPMODULEPATH="${moduledir};${blddir}" -#else -LOADPATH = EMACSBOOTSTRAPLOADPATH="${lispdir}:${blddir}" -MODULEPATH = EMACSBOOTSTRAPMODULEPATH="${moduledir}:${blddir}" -#endif -DUMPENV = $(LOADPATH) $(MODULEPATH) -temacs_loadup = $(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el +temacs_loadup = ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/loadup.el dump_temacs = ${temacs_loadup} dump run_temacs = ${temacs_loadup} run-temacs -debug_temacs = $(DUMPENV) gdb temacs +debug_temacs = gdb ${EXE_TARGET} -release: temacs ${libsrc}DOC $(mo_file) ${other_files} +release: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} #ifdef CANNOT_DUMP - ln temacs ${PROGNAME} + ln ${EXE_TARGET} ${PROGNAME} #else -#ifdef HAVE_SHM -if [ -w ${srcdir}/../lisp ]; then \ - w=`pwd`; cd ${srcdir} && $${w}/temacs -nl -batch -l ${srcdir}/../lisp/inc-vers; \ + w=`pwd`; cd ${srcdir} && $${w}/${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/inc-vers; \ else true; fi - -$(DUMPENV) ./temacs -nl -batch -l ${srcdir}/../lisp/loadup.el dump -#else /* ! defined (HAVE_SHM) */ - -if [ -w ${srcdir}/../lisp ]; then \ - w=`pwd`; cd ${srcdir} && $${w}/temacs -batch -l ${srcdir}/../lisp/inc-vers; \ - else true; fi - -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump -#endif /* ! defined (HAVE_SHM) */ + -./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/loadup.el dump touch release #endif /* ! defined (CANNOT_DUMP) */ -${PROGNAME}: temacs ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp +${DUMP_TARGET}: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp #ifdef HEAP_IN_DATA - @$(RM) $@ $@.exe && touch SATISFIED + @$(RM) $@ && touch SATISFIED -${dump_temacs} @if test -f $@; then if test -f SATISFIED; then \ echo "Testing for Lisp shadows ..."; \ ./${PROGNAME} -batch -vanilla -f list-load-path-shadows; fi; \ $(RM) SATISFIED; exit 0; fi; \ if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \ + $(RM) $@; \ $(RECURSIVE_MAKE) $@; #else - @$(RM) $@ xemacs.dmp + @$(RM) $@ ${dump_temacs} -#ifdef PDUMP - @mv temacs $@ -#endif @echo "Testing for Lisp shadows ..." @./${PROGNAME} -batch -vanilla -f list-load-path-shadows #endif -fastdump: temacs - @$(RM) ${PROGNAME} && touch SATISFIED +fastdump: ${EXE_TARGET} + @$(RM) ${DUMP_TARGET} && touch SATISFIED -${dump_temacs} @./${PROGNAME} -batch -vanilla -f list-load-path-shadows FRC.update-elc.stamp : -update-elc.stamp : temacs FRC.update-elc.stamp +update-elc.stamp : ${EXE_TARGET} FRC.update-elc.stamp @touch NOBYTECOMPILE - ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el + ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/update-elc.el @if test ! -f $@ -o -f NOBYTECOMPILE; then touch $@; fi; \ $(RM) NOBYTECOMPILE @@ -388,16 +383,16 @@ cd ../dynodump && $(RECURSIVE_MAKE) #endif /* DYNODUMP */ -${libsrc}DOC: temacs update-elc.stamp +${libsrc}DOC: ${EXE_TARGET} update-elc.stamp $(RM) ${libsrc}DOC; \ - ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/make-docfile.el -- \ + ${DUMPENV} ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/make-docfile.el -- \ -o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \ ${obj_src} ${mallocdocsrc} ${rallocdocsrc} dump_elcs: dump-elcs -dump-elcs: temacs - -${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el +dump-elcs: ${EXE_TARGET} + -${DUMPENV} ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/update-elc.el all-elc all-elcs: cd .. && $(RECURSIVE_MAKE) all-elc @@ -431,6 +426,9 @@ #endif /* I18N3 */ +${libsrc}make-dump-id: + cd ${libsrc} && $(RECURSIVE_MAKE) make-dump-id + ${libsrc}make-docfile: cd ${libsrc} && $(RECURSIVE_MAKE) make-docfile @@ -444,23 +442,26 @@ $(LINT.c) $(LINTFILES) ## end of Lint Section -temacs_deps=\ +link_deps=\ $(start_files) ${objs} ${otherobjs}\ $(lwlib_deps) $(dynodump_deps) -temacs_link_args=\ - ${start_flags} ${ldflags}\ - -o $@ ${start_files} ${objs} ${otherobjs} ${LIBES} +temacs_deps=\ + $(link_deps) $(ID_FILE) -temacs: $(temacs_deps) +temacs_link_args=\ + ${start_flags} ${ldflags} -I${srcdir} \ + -o $@ ${start_files} ${objs} ${otherobjs} ${ID_FILE} ${LIBES} + +${EXE_TARGET}: $(temacs_deps) $(LD) $(temacs_link_args) -#ifdef PDUMP - @$(RM) xemacs.dmp -#endif + +dump-id.c: ${libsrc}make-dump-id ${link_deps} + ${libsrc}make-dump-id .PHONY : run-temacs -run-temacs: temacs +run-temacs: ${EXE_TARGET} -${run_temacs} ## We have automated tests!! @@ -485,8 +486,8 @@ rtc_patch_area -o $@ rtcmacs: $(temacs_deps) rtc_patch.o - $(RM) temacs; $(RECURSIVE_MAKE) temacs RTC_patch_objs=rtc_patch.o - mv temacs rtcmacs + $(RM) ${EXE_TARGET}; $(RECURSIVE_MAKE) ${EXE_TARGET} RTC_patch_objs=rtc_patch.o + mv ${EXE_TARGET} rtcmacs .PHONY: run-rtcmacs run-rtcmacs: rtcmacs @@ -499,7 +500,7 @@ runargs -batch -l ${srcdir}/../lisp/loadup.el run-temacs -q; \ run' rtcmacs -debug-temacs: temacs +debug-temacs: ${EXE_TARGET} -${debug_temacs} ## Purify, Quantify, PureCoverage are software quality products from @@ -512,12 +513,12 @@ -search-mmaps=yes\ #endif -chain-length=32 -ignore-signals=SIGPOLL -threads=yes\ - -cache-dir=./purecache -always-use-cache-dir=yes + -cache-dir=${srcdir}/purecache -always-use-cache-dir=yes PURIFY_LIBS = -lpthread puremacs: $(temacs_deps) $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS) - cp $@ temacs + cp $@ ${EXE_TARGET} ## Quantify #ifdef QUANTIFY @@ -529,7 +530,7 @@ quantmacs: $(temacs_deps) $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args) - cp $@ temacs + cp $@ ${EXE_TARGET} #endif /* QUANTIFY */ @@ -554,6 +555,10 @@ $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl +## The above rules are subject to a race condition if using a parallel make. +TransientEmacsShell.o : TopLevelEmacsShell.o +TransientEmacsShell.c.rtl : TopLevelEmacsShell.c.rtl + ## Position-independent code for shared library creation #if USE_GCC pic_arg = -fpic @@ -686,19 +691,23 @@ #endif /* ! defined (C_ALLOCA) */ #ifdef HAVE_NATIVE_SOUND +sound_cflags=@sound_cflags@ sunplay.o: ${srcdir}/sunplay.c $(CC) -c $(sound_cflags) $(cflags) ${srcdir}/sunplay.c hpplay.o: ${srcdir}/hpplay.c $(CC) -c -Demacs $(sound_cflags) $(cflags) ${srcdir}/hpplay.c #endif /* HAVE_NATIVE_SOUND */ +xemacs_res.o: ${srcdir}/../nt/xemacs.rc + windres --include-dir ${srcdir}/../nt -i ${srcdir}/../nt/xemacs.rc -o $@ + ## System-specific programs to be made. ## ${other_files}, $(objects_system) and $(objects_machine) ## select which of these should be compiled. */ .PHONY: mostlyclean clean distclean realclean versionclean extraclean mostlyclean: - $(RM) temacs puremacs quantmacs prefix-args *.o *.i \ + $(RM) temacs puremacs quantmacs *.o *.i \ core temacs.exe sheap-adjust.h clean: mostlyclean versionclean $(RM) libextcli* update-elc.stamp @@ -709,7 +718,7 @@ GNUmakefile Makefile Makefile.in TAGS ${PROGNAME}.* realclean: distclean versionclean: - $(RM) ${PROGNAME} ${PROGNAME}.exe ${libsrc}DOC + $(RM) ${EXE_TARGET} ${DUMP_TARGET} ${libsrc}DOC extraclean: realclean $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#* diff -r 72a7cfa4a488 -r abe6d1db359e src/README --- a/src/README Mon Aug 13 11:33:40 2007 +0200 +++ b/src/README Mon Aug 13 11:35:02 2007 +0200 @@ -44,9 +44,6 @@ 2. Storage classes: - -- All occurrences of `const' should get replaced by CONST. This - is to work around a header conflict with X11R4. - -- All occurrences of `register' should be replaced by `REGISTER'. It interferes with backtraces so we disable it if DEBUG_XEMACS is defined. diff -r 72a7cfa4a488 -r abe6d1db359e src/alloc.c --- a/src/alloc.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/alloc.c Mon Aug 13 11:35:02 2007 +0200 @@ -36,12 +36,13 @@ Added lcrecord lists for 19.14. slb: Lots of work on the purification and dump time code. Synched Doug Lea malloc support from Emacs 20.2. - og: Killed the purespace. Portable dumper. + og: Killed the purespace. Portable dumper (moved to dumper.c) */ #include #include "lisp.h" +#include "alloc.h" #include "backtrace.h" #include "buffer.h" #include "bytecode.h" @@ -56,6 +57,7 @@ #include "redisplay.h" #include "specifier.h" #include "sysfile.h" +#include "sysdep.h" #include "window.h" #include "console-stream.h" @@ -63,32 +65,12 @@ #include #endif -#ifdef HAVE_MMAP -#include -#include -#endif - #ifdef PDUMP -typedef struct -{ - const struct lrecord_description *desc; - int count; -} pdump_reloc_table; - -static char *pdump_rt_list = 0; +#include "dumper.h" #endif EXFUN (Fgarbage_collect, 0); -/* Return the true size of a struct with a variable-length array field. */ -#define STRETCHY_STRUCT_SIZEOF(stretchy_struct_type, \ - stretchy_array_field, \ - stretchy_array_length) \ - (offsetof (stretchy_struct_type, stretchy_array_field) + \ - (offsetof (stretchy_struct_type, stretchy_array_field[1]) - \ - offsetof (stretchy_struct_type, stretchy_array_field[0])) * \ - (stretchy_array_length)) - #if 0 /* this is _way_ too slow to be part of the standard debug options */ #if defined(DEBUG_XEMACS) && defined(MULE) #define VERIFY_STRING_CHARS_INTEGRITY @@ -174,19 +156,9 @@ /* "Garbage collecting" */ Lisp_Object Vgc_message; Lisp_Object Vgc_pointer_glyph; -static CONST char gc_default_message[] = "Garbage collecting"; +static const char gc_default_message[] = "Garbage collecting"; Lisp_Object Qgarbage_collecting; -#ifndef VIRT_ADDR_VARIES -extern -#endif /* VIRT_ADDR_VARIES */ - EMACS_INT malloc_sbrk_used; - -#ifndef VIRT_ADDR_VARIES -extern -#endif /* VIRT_ADDR_VARIES */ - EMACS_INT malloc_sbrk_unused; - /* Non-zero means we're in the process of doing the dump */ int purify_flag; @@ -234,7 +206,7 @@ /* malloc calls this if it finds we are near exhausting storage */ void -malloc_warning (CONST char *str) +malloc_warning (const char *str) { if (ignore_malloc_warnings) return; @@ -357,7 +329,7 @@ #undef xstrdup char * -xstrdup (CONST char *str) +xstrdup (const char *str) { int len = strlen (str) + 1; /* for stupid terminating 0 */ @@ -368,7 +340,7 @@ #ifdef NEED_STRDUP char * -strdup (CONST char *s) +strdup (const char *s) { return xstrdup (s); } @@ -382,26 +354,27 @@ } -/* lrecords are chained together through their "next.v" field. - * After doing the mark phase, the GC will walk this linked - * list and free any record which hasn't been marked. - */ +/* lcrecords are chained together through their "next" field. + After doing the mark phase, GC will walk this linked list + and free any lcrecord which hasn't been marked. */ static struct lcrecord_header *all_lcrecords; void * -alloc_lcrecord (size_t size, CONST struct lrecord_implementation *implementation) +alloc_lcrecord (size_t size, const struct lrecord_implementation *implementation) { struct lcrecord_header *lcheader; -#ifdef ERROR_CHECK_GC - if (implementation->static_size == 0) - assert (implementation->size_in_bytes_method); - else - assert (implementation->static_size == size); -#endif + type_checking_assert + ((implementation->static_size == 0 ? + implementation->size_in_bytes_method != NULL : + implementation->static_size == size) + && + (! implementation->basic_p) + && + (! (implementation->hash == NULL && implementation->equal != NULL))); lcheader = (struct lcrecord_header *) allocate_lisp_storage (size); - set_lheader_implementation (&(lcheader->lheader), implementation); + set_lheader_implementation (&lcheader->lheader, implementation); lcheader->next = all_lcrecords; #if 1 /* mly prefers to see small ID numbers */ lcheader->uid = lrecord_uid_counter++; @@ -460,24 +433,12 @@ for (header = all_lcrecords; header; header = header->next) { - if (LHEADER_IMPLEMENTATION(&header->lheader)->finalizer && + if (LHEADER_IMPLEMENTATION (&header->lheader)->finalizer && !header->free) - ((LHEADER_IMPLEMENTATION(&header->lheader)->finalizer) - (header, 1)); + LHEADER_IMPLEMENTATION (&header->lheader)->finalizer (header, 1); } } -/* Semi-kludge -- lrecord_symbol_value_forward objects get stuck - in CONST space and you get SEGV's if you attempt to mark them. - This sits in lheader->implementation->marker. */ - -Lisp_Object -this_one_is_unmarkable (Lisp_Object obj) -{ - abort (); - return Qnil; -} - /************************************************************************/ /* Debugger support */ @@ -496,42 +457,6 @@ unsigned char dbg_USE_UNION_TYPE = 0; #endif -unsigned char Lisp_Type_Int = 100; -unsigned char Lisp_Type_Cons = 101; -unsigned char Lisp_Type_String = 102; -unsigned char Lisp_Type_Vector = 103; -unsigned char Lisp_Type_Symbol = 104; - -#ifndef MULE -unsigned char lrecord_char_table_entry; -unsigned char lrecord_charset; -#ifndef FILE_CODING -unsigned char lrecord_coding_system; -#endif -#endif - -#if !((defined HAVE_X_WINDOWS) && \ - (defined (HAVE_MENUBARS) || \ - defined (HAVE_SCROLLBARS) || \ - defined (HAVE_DIALOGS) || \ - defined (HAVE_TOOLBARS) || \ - defined (HAVE_WIDGETS))) -unsigned char lrecord_popup_data; -#endif - -#ifndef HAVE_TOOLBARS -unsigned char lrecord_toolbar_button; -#endif - -#ifndef TOOLTALK -unsigned char lrecord_tooltalk_message; -unsigned char lrecord_tooltalk_pattern; -#endif - -#ifndef HAVE_DATABASE -unsigned char lrecord_database; -#endif - unsigned char dbg_valbits = VALBITS; unsigned char dbg_gctypebits = GCTYPEBITS; @@ -713,7 +638,7 @@ This is called when a relocatable block is freed in ralloc.c. */ void refill_memory_reserve (void); void -refill_memory_reserve () +refill_memory_reserve (void) { if (breathing_space == 0) breathing_space = (char *) malloc (4096 - MALLOC_OVERHEAD); @@ -852,12 +777,18 @@ You have some weird system and need to supply a reasonable value here. #endif +/* The construct (* (void **) (ptr)) would cause aliasing problems + with modern optimizing compilers like `gcc -O3 -fstrict-aliasing'. + But `char *' can legally alias any pointer. Hence this union trick. */ +typedef union { char c; void *p; } *aliasing_voidpp; +#define ALIASING_VOIDPP_DEREFERENCE(ptr) \ + (((aliasing_voidpp) (ptr))->p) #define FREE_STRUCT_P(ptr) \ - (* (void **) ptr == (void *) INVALID_POINTER_VALUE) + (ALIASING_VOIDPP_DEREFERENCE (ptr) == (void *) INVALID_POINTER_VALUE) #define MARK_STRUCT_AS_FREE(ptr) \ - (* (void **) ptr = (void *) INVALID_POINTER_VALUE) + (ALIASING_VOIDPP_DEREFERENCE (ptr) = (void *) INVALID_POINTER_VALUE) #define MARK_STRUCT_AS_NOT_FREE(ptr) \ - (* (void **) ptr = 0) + (ALIASING_VOIDPP_DEREFERENCE (ptr) = 0) #ifdef ERROR_CHECK_GC @@ -940,12 +871,13 @@ static int cons_equal (Lisp_Object ob1, Lisp_Object ob2, int depth) { - while (internal_equal (XCAR (ob1), XCAR (ob2), depth + 1)) + depth++; + while (internal_equal (XCAR (ob1), XCAR (ob2), depth)) { ob1 = XCDR (ob1); ob2 = XCDR (ob2); if (! CONSP (ob1) || ! CONSP (ob2)) - return internal_equal (ob1, ob2, depth + 1); + return internal_equal (ob1, ob2, depth); } return 0; } @@ -978,7 +910,7 @@ Lisp_Cons *c; ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c); - set_lheader_implementation (&(c->lheader), &lrecord_cons); + set_lheader_implementation (&c->lheader, &lrecord_cons); XSETCONS (val, c); c->car = car; c->cdr = cdr; @@ -995,7 +927,7 @@ Lisp_Cons *c; NOSEEUM_ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c); - set_lheader_implementation (&(c->lheader), &lrecord_cons); + set_lheader_implementation (&c->lheader, &lrecord_cons); XSETCONS (val, c); XCAR (val) = car; XCDR (val) = cdr; @@ -1112,7 +1044,7 @@ if (sizeof (struct lrecord_header) + sizeof (double) != sizeof (*f)) xzero (*f); - set_lheader_implementation (&(f->lheader), &lrecord_float); + set_lheader_implementation (&f->lheader, &lrecord_float); float_data (f) = float_value; XSETFLOAT (val, f); return val; @@ -1138,10 +1070,10 @@ } static size_t -size_vector (CONST void *lheader) +size_vector (const void *lheader) { - return STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents, - ((Lisp_Vector *) lheader)->size); + return FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, contents, + ((Lisp_Vector *) lheader)->size); } static int @@ -1161,6 +1093,15 @@ return 1; } +static hashcode_t +vector_hash (Lisp_Object obj, int depth) +{ + return HASH2 (XVECTOR_LENGTH (obj), + internal_array_hash (XVECTOR_DATA (obj), + XVECTOR_LENGTH (obj), + depth + 1)); +} + static const struct lrecord_description vector_description[] = { { XD_LONG, offsetof (Lisp_Vector, size) }, { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Vector, contents), XD_INDIRECT(0, 0) }, @@ -1170,12 +1111,7 @@ DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION("vector", vector, mark_vector, print_vector, 0, vector_equal, - /* - * No `hash' method needed for - * vectors. internal_hash - * knows how to handle vectors. - */ - 0, + vector_hash, vector_description, size_vector, Lisp_Vector); @@ -1184,7 +1120,7 @@ make_vector_internal (size_t sizei) { /* no vector_next */ - size_t sizem = STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents, sizei); + size_t sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, contents, sizei); Lisp_Vector *p = (Lisp_Vector *) alloc_lcrecord (sizem, &lrecord_vector); p->size = sizei; @@ -1347,9 +1283,9 @@ make_bit_vector_internal (size_t sizei) { size_t num_longs = BIT_VECTOR_LONG_STORAGE (sizei); - size_t sizem = STRETCHY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, num_longs); + size_t sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, num_longs); Lisp_Bit_Vector *p = (Lisp_Bit_Vector *) allocate_lisp_storage (sizem); - set_lheader_implementation (&(p->lheader), &lrecord_bit_vector); + set_lheader_implementation (&p->lheader, &lrecord_bit_vector); INCREMENT_CONS_COUNTER (sizem, "bit-vector"); @@ -1453,7 +1389,7 @@ Lisp_Object fun; ALLOCATE_FIXED_TYPE (compiled_function, Lisp_Compiled_Function, f); - set_lheader_implementation (&(f->lheader), &lrecord_compiled_function); + set_lheader_implementation (&f->lheader, &lrecord_compiled_function); f->stack_depth = 0; f->specpdl_depth = 0; @@ -1505,7 +1441,6 @@ /* Check for valid formal parameter list now, to allow us to use SPECBIND_FAST_UNSAFE() later in funcall_compiled_function(). */ { - Lisp_Object symbol, tail; EXTERNAL_LIST_LOOP_3 (symbol, arglist, tail) { CHECK_SYMBOL (symbol); @@ -1537,7 +1472,7 @@ f->constants = constants; CHECK_NATNUM (stack_depth); - f->stack_depth = XINT (stack_depth); + f->stack_depth = (unsigned short) XINT (stack_depth); #ifdef COMPILED_FUNCTION_ANNOTATION_HACK if (!NILP (Vcurrent_compiled_function_annotation)) @@ -1600,7 +1535,7 @@ CHECK_STRING (name); ALLOCATE_FIXED_TYPE (symbol, Lisp_Symbol, p); - set_lheader_implementation (&(p->lheader), &lrecord_symbol); + set_lheader_implementation (&p->lheader, &lrecord_symbol); p->name = XSTRING (name); p->plist = Qnil; p->value = Qunbound; @@ -1624,7 +1559,7 @@ struct extent *e; ALLOCATE_FIXED_TYPE (extent, struct extent, e); - set_lheader_implementation (&(e->lheader), &lrecord_extent); + set_lheader_implementation (&e->lheader, &lrecord_extent); extent_object (e) = Qnil; set_extent_start (e, -1); set_extent_end (e, -1); @@ -1654,7 +1589,7 @@ Lisp_Event *e; ALLOCATE_FIXED_TYPE (event, Lisp_Event, e); - set_lheader_implementation (&(e->lheader), &lrecord_event); + set_lheader_implementation (&e->lheader, &lrecord_event); XSETEVENT (val, e); return val; @@ -1677,7 +1612,7 @@ Lisp_Marker *p; ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p); - set_lheader_implementation (&(p->lheader), &lrecord_marker); + set_lheader_implementation (&p->lheader, &lrecord_marker); p->buffer = 0; p->memind = 0; marker_next (p) = 0; @@ -1694,7 +1629,7 @@ Lisp_Marker *p; NOSEEUM_ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p); - set_lheader_implementation (&(p->lheader), &lrecord_marker); + set_lheader_implementation (&p->lheader, &lrecord_marker); p->buffer = 0; p->memind = 0; marker_next (p) = 0; @@ -1752,21 +1687,67 @@ { XD_END } }; -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("string", string, - mark_string, print_string, - /* - * No `finalize', or `hash' methods. - * internal_hash already knows how - * to hash strings and finalization - * is done with the - * ADDITIONAL_FREE_string macro, - * which is the standard way to do - * finalization when using - * SWEEP_FIXED_TYPE_BLOCK(). - */ - 0, string_equal, 0, - string_description, - Lisp_String); +/* We store the string's extent info as the first element of the string's + property list; and the string's MODIFF as the first or second element + of the string's property list (depending on whether the extent info + is present), but only if the string has been modified. This is ugly + but it reduces the memory allocated for the string in the vast + majority of cases, where the string is never modified and has no + extent info. + + #### This means you can't use an int as a key in a string's plist. */ + +static Lisp_Object * +string_plist_ptr (Lisp_Object string) +{ + Lisp_Object *ptr = &XSTRING (string)->plist; + + if (CONSP (*ptr) && EXTENT_INFOP (XCAR (*ptr))) + ptr = &XCDR (*ptr); + if (CONSP (*ptr) && INTP (XCAR (*ptr))) + ptr = &XCDR (*ptr); + return ptr; +} + +static Lisp_Object +string_getprop (Lisp_Object string, Lisp_Object property) +{ + return external_plist_get (string_plist_ptr (string), property, 0, ERROR_ME); +} + +static int +string_putprop (Lisp_Object string, Lisp_Object property, Lisp_Object value) +{ + external_plist_put (string_plist_ptr (string), property, value, 0, ERROR_ME); + return 1; +} + +static int +string_remprop (Lisp_Object string, Lisp_Object property) +{ + return external_remprop (string_plist_ptr (string), property, 0, ERROR_ME); +} + +static Lisp_Object +string_plist (Lisp_Object string) +{ + return *string_plist_ptr (string); +} + +/* No `finalize', or `hash' methods. + internal_hash() already knows how to hash strings and finalization + is done with the ADDITIONAL_FREE_string macro, which is the + standard way to do finalization when using + SWEEP_FIXED_TYPE_BLOCK(). */ +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); /* String blocks contain this many useful bytes. */ #define STRING_CHARS_BLOCK_SIZE \ @@ -1868,7 +1849,7 @@ /* Allocate the string header */ ALLOCATE_FIXED_TYPE (string, Lisp_String, s); - set_lheader_implementation (&(s->lheader), &lrecord_string); + set_lheader_implementation (&s->lheader, &lrecord_string); set_string_data (s, BIG_STRING_FULLSIZE_P (fullsize) ? xnew_array (Bufbyte, length + 1) @@ -2111,7 +2092,7 @@ /* Take some raw memory, which MUST already be in internal format, and package it up into a Lisp string. */ Lisp_Object -make_string (CONST Bufbyte *contents, Bytecount length) +make_string (const Bufbyte *contents, Bytecount length) { Lisp_Object val; @@ -2128,7 +2109,7 @@ /* Take some raw memory, encoded in some external data format, and convert it into a Lisp string. */ Lisp_Object -make_ext_string (CONST Extbyte *contents, EMACS_INT length, +make_ext_string (const Extbyte *contents, EMACS_INT length, Lisp_Object coding_system) { Lisp_Object string; @@ -2139,28 +2120,28 @@ } Lisp_Object -build_string (CONST char *str) +build_string (const char *str) { /* Some strlen's crash and burn if passed null. */ - return make_string ((CONST Bufbyte *) str, (str ? strlen(str) : 0)); + return make_string ((const Bufbyte *) str, (str ? strlen(str) : 0)); } Lisp_Object -build_ext_string (CONST char *str, Lisp_Object coding_system) +build_ext_string (const char *str, Lisp_Object coding_system) { /* Some strlen's crash and burn if passed null. */ - return make_ext_string ((CONST Extbyte *) str, (str ? strlen(str) : 0), + return make_ext_string ((const Extbyte *) str, (str ? strlen(str) : 0), coding_system); } Lisp_Object -build_translated_string (CONST char *str) +build_translated_string (const char *str) { return build_string (GETTEXT (str)); } Lisp_Object -make_string_nocopy (CONST Bufbyte *contents, Bytecount length) +make_string_nocopy (const Bufbyte *contents, Bytecount length) { Lisp_String *s; Lisp_Object val; @@ -2172,7 +2153,7 @@ /* Allocate the string header */ ALLOCATE_FIXED_TYPE (string, Lisp_String, s); - set_lheader_implementation (&(s->lheader), &lrecord_string); + set_lheader_implementation (&s->lheader, &lrecord_string); SET_C_READONLY_RECORD_HEADER (&s->lheader); s->plist = Qnil; set_string_data (s, (Bufbyte *)contents); @@ -2227,22 +2208,23 @@ struct free_lcrecord_header *free_header = (struct free_lcrecord_header *) lheader; -#ifdef ERROR_CHECK_GC - CONST struct lrecord_implementation *implementation - = LHEADER_IMPLEMENTATION(lheader); - - /* There should be no other pointers to the free list. */ - assert (!MARKED_RECORD_HEADER_P (lheader)); - /* Only lcrecords should be here. */ - assert (!implementation->basic_p); - /* Only free lcrecords should be here. */ - assert (free_header->lcheader.free); - /* The type of the lcrecord must be right. */ - assert (implementation == list->implementation); - /* So must the size. */ - assert (implementation->static_size == 0 - || implementation->static_size == list->size); -#endif /* ERROR_CHECK_GC */ + gc_checking_assert + (/* There should be no other pointers to the free list. */ + ! MARKED_RECORD_HEADER_P (lheader) + && + /* Only lcrecords should be here. */ + ! LHEADER_IMPLEMENTATION (lheader)->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 + && + /* So must the size. */ + (LHEADER_IMPLEMENTATION (lheader)->static_size == 0 || + LHEADER_IMPLEMENTATION (lheader)->static_size == list->size) + ); MARK_RECORD_HEADER (lheader); chain = free_header->chain; @@ -2256,7 +2238,7 @@ 0, 0, 0, 0, struct lcrecord_list); Lisp_Object make_lcrecord_list (size_t size, - CONST struct lrecord_implementation *implementation) + const struct lrecord_implementation *implementation) { struct lcrecord_list *p = alloc_lcrecord_type (struct lcrecord_list, &lrecord_lcrecord_list); @@ -2280,23 +2262,21 @@ (struct free_lcrecord_header *) XPNTR (val); #ifdef ERROR_CHECK_GC - struct lrecord_header *lheader = - (struct lrecord_header *) free_header; - CONST struct lrecord_implementation *implementation - = LHEADER_IMPLEMENTATION (lheader); + struct lrecord_header *lheader = &free_header->lcheader.lheader; /* There should be no other pointers to the free list. */ - assert (!MARKED_RECORD_HEADER_P (lheader)); + assert (! MARKED_RECORD_HEADER_P (lheader)); /* Only lcrecords should be here. */ - assert (!implementation->basic_p); + assert (! LHEADER_IMPLEMENTATION (lheader)->basic_p); /* Only free lcrecords should be here. */ assert (free_header->lcheader.free); /* The type of the lcrecord must be right. */ - assert (implementation == list->implementation); + assert (LHEADER_IMPLEMENTATION (lheader) == list->implementation); /* So must the size. */ - assert (implementation->static_size == 0 - || implementation->static_size == list->size); + assert (LHEADER_IMPLEMENTATION (lheader)->static_size == 0 || + LHEADER_IMPLEMENTATION (lheader)->static_size == list->size); #endif /* ERROR_CHECK_GC */ + list->free = free_header->chain; free_header->lcheader.free = 0; return val; @@ -2305,8 +2285,7 @@ { Lisp_Object val; - XSETOBJ (val, Lisp_Type_Record, - alloc_lcrecord (list->size, list->implementation)); + XSETOBJ (val, alloc_lcrecord (list->size, list->implementation)); return val; } } @@ -2317,19 +2296,16 @@ struct lcrecord_list *list = XLCRECORD_LIST (lcrecord_list); struct free_lcrecord_header *free_header = (struct free_lcrecord_header *) XPNTR (lcrecord); - struct lrecord_header *lheader = - (struct lrecord_header *) free_header; - CONST struct lrecord_implementation *implementation + struct lrecord_header *lheader = &free_header->lcheader.lheader; + const struct lrecord_implementation *implementation = LHEADER_IMPLEMENTATION (lheader); -#ifdef ERROR_CHECK_GC /* Make sure the size is correct. This will catch, for example, putting a window configuration on the wrong free list. */ - if (implementation->size_in_bytes_method) - assert (implementation->size_in_bytes_method (lheader) == list->size); - else - assert (implementation->static_size == list->size); -#endif /* ERROR_CHECK_GC */ + gc_checking_assert ((implementation->size_in_bytes_method ? + implementation->size_in_bytes_method (lheader) : + implementation->static_size) + == list->size); if (implementation->finalizer) implementation->finalizer (lheader, 0); @@ -2353,17 +2329,20 @@ return obj; } - /************************************************************************/ /* Garbage Collection */ /************************************************************************/ -/* This will be used more extensively In The Future */ -static int last_lrecord_type_index_assigned; - -CONST struct lrecord_implementation *lrecord_implementations_table[128]; -#define max_lrecord_type (countof (lrecord_implementations_table) - 1) +/* All the built-in lisp object types are enumerated in `enum lrecord_type'. + Additional ones may be defined by a module (none yet). We leave some + room in `lrecord_implementations_table' for such new lisp object types. */ +const struct lrecord_implementation *lrecord_implementations_table[(unsigned int)lrecord_type_last_built_in_type + MODULE_DEFINABLE_TYPE_COUNT]; +unsigned int lrecord_type_count = (unsigned int)lrecord_type_last_built_in_type; +/* Object marker functions are in the lrecord_implementation structure. + But copying them to a parallel array is much more cache-friendly. + This hack speeds up (garbage-collect) by about 5%. */ +Lisp_Object (*lrecord_markers[countof (lrecord_implementations_table)]) (Lisp_Object); struct gcpro *gcprolist; @@ -2375,90 +2354,105 @@ #else #define NSTATICS 2000 #endif -/* Not "static" because of linker lossage on some systems */ -Lisp_Object *staticvec[NSTATICS] - /* Force it into data space! */ - = {0}; -static int staticidx; + +/* Not "static" because used by dumper.c */ +Lisp_Object *staticvec[NSTATICS]; +int staticidx; /* Put an entry in staticvec, pointing at the variable whose address is given */ void staticpro (Lisp_Object *varaddress) { - if (staticidx >= countof (staticvec)) - /* #### This is now a dubious abort() since this routine may be called */ - /* by Lisp attempting to load a DLL. */ - abort (); + /* #### This is now a dubious assert() since this routine may be called */ + /* by Lisp attempting to load a DLL. */ + assert (staticidx < countof (staticvec)); staticvec[staticidx++] = varaddress; } -/* Not "static" because of linker lossage on some systems */ -Lisp_Object *staticvec_nodump[200] - /* Force it into data space! */ - = {0}; -static int staticidx_nodump; + +Lisp_Object *staticvec_nodump[200]; +int staticidx_nodump; /* Put an entry in staticvec_nodump, pointing at the variable whose address is given */ void staticpro_nodump (Lisp_Object *varaddress) { - if (staticidx_nodump >= countof (staticvec_nodump)) - /* #### This is now a dubious abort() since this routine may be called */ - /* by Lisp attempting to load a DLL. */ - abort (); + /* #### This is now a dubious assert() since this routine may be called */ + /* by Lisp attempting to load a DLL. */ + assert (staticidx_nodump < countof (staticvec_nodump)); staticvec_nodump[staticidx_nodump++] = varaddress; } -/* Not "static" because of linker lossage on some systems */ -struct -{ - void *data; - const struct struct_description *desc; -} dumpstructvec[200]; - -static int dumpstructidx; + +struct pdump_dumpstructinfo dumpstructvec[200]; +int dumpstructidx; /* Put an entry in dumpstructvec, pointing at the variable whose address is given */ void dumpstruct (void *varaddress, const struct struct_description *desc) { - if (dumpstructidx >= countof (dumpstructvec)) - abort (); + assert (dumpstructidx < countof (dumpstructvec)); dumpstructvec[dumpstructidx].data = varaddress; dumpstructvec[dumpstructidx].desc = desc; dumpstructidx++; } +struct pdump_dumpopaqueinfo dumpopaquevec[250]; +int dumpopaqueidx; + +/* Put an entry in dumpopaquevec, pointing at the variable whose address is given + */ +void +dumpopaque (void *varaddress, size_t size) +{ + assert (dumpopaqueidx < countof (dumpopaquevec)); + + dumpopaquevec[dumpopaqueidx].data = varaddress; + dumpopaquevec[dumpopaqueidx].size = size; + dumpopaqueidx++; +} + Lisp_Object *pdump_wirevec[50]; -static int pdump_wireidx; +int pdump_wireidx; /* Put an entry in pdump_wirevec, pointing at the variable whose address is given */ void pdump_wire (Lisp_Object *varaddress) { - if (pdump_wireidx >= countof (pdump_wirevec)) - abort (); + assert (pdump_wireidx < countof (pdump_wirevec)); pdump_wirevec[pdump_wireidx++] = varaddress; } Lisp_Object *pdump_wirevec_list[50]; -static int pdump_wireidx_list; +int pdump_wireidx_list; /* Put an entry in pdump_wirevec_list, pointing at the variable whose address is given */ void pdump_wire_list (Lisp_Object *varaddress) { - if (pdump_wireidx_list >= countof (pdump_wirevec_list)) - abort (); + assert (pdump_wireidx_list < countof (pdump_wirevec_list)); pdump_wirevec_list[pdump_wireidx_list++] = varaddress; } +#ifdef ERROR_CHECK_GC +#define GC_CHECK_LHEADER_INVARIANTS(lheader) do { \ + struct lrecord_header * GCLI_lh = (lheader); \ + assert (GCLI_lh != 0); \ + assert (GCLI_lh->type < lrecord_type_count); \ + assert (! C_READONLY_RECORD_HEADER_P (GCLI_lh) || \ + (MARKED_RECORD_HEADER_P (GCLI_lh) && \ + LISP_READONLY_RECORD_HEADER_P (GCLI_lh))); \ +} while (0) +#else +#define GC_CHECK_LHEADER_INVARIANTS(lheader) +#endif + /* Mark reference to a Lisp_Object. If the object referred to has not been seen yet, recursively mark all the references contained in it. */ @@ -2468,9 +2462,6 @@ { tail_recurse: -#ifdef ERROR_CHECK_GC - assert (! (EQ (obj, Qnull_pointer))); -#endif /* Checks we used to perform */ /* if (EQ (obj, Qnull_pointer)) return; */ /* if (!POINTER_TYPE_P (XGCTYPE (obj))) return; */ @@ -2479,25 +2470,21 @@ if (XTYPE (obj) == Lisp_Type_Record) { struct lrecord_header *lheader = XRECORD_LHEADER (obj); -#if defined (ERROR_CHECK_GC) - assert (lheader->type <= last_lrecord_type_index_assigned); -#endif - if (C_READONLY_RECORD_HEADER_P (lheader)) - return; - - if (! MARKED_RECORD_HEADER_P (lheader) && - ! UNMARKABLE_RECORD_HEADER_P (lheader)) + + GC_CHECK_LHEADER_INVARIANTS (lheader); + + gc_checking_assert (LHEADER_IMPLEMENTATION (lheader)->basic_p || + ! ((struct lcrecord_header *) lheader)->free); + + /* 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)) { - CONST struct lrecord_implementation *implementation = - LHEADER_IMPLEMENTATION (lheader); MARK_RECORD_HEADER (lheader); -#ifdef ERROR_CHECK_GC - if (!implementation->basic_p) - assert (! ((struct lcrecord_header *) lheader)->free); -#endif - if (implementation->marker) + + if (RECORD_MARKER (lheader)) { - obj = implementation->marker (obj); + obj = RECORD_MARKER (lheader) (obj); if (!NILP (obj)) goto tail_recurse; } } @@ -2537,24 +2524,6 @@ /* static int gc_count_total_records_used, gc_count_records_total_size; */ -int -lrecord_type_index (CONST struct lrecord_implementation *implementation) -{ - int type_index = *(implementation->lrecord_type_index); - /* Have to do this circuitous validation test because of problems - dumping out initialized variables (ie can't set xxx_type_index to -1 - because that would make xxx_type_index read-only in a dumped emacs. */ - if (type_index < 0 || type_index > max_lrecord_type - || lrecord_implementations_table[type_index] != implementation) - { - assert (last_lrecord_type_index_assigned < max_lrecord_type); - type_index = ++last_lrecord_type_index_assigned; - lrecord_implementations_table[type_index] = implementation; - *(implementation->lrecord_type_index) = type_index; - } - return type_index; -} - /* stats on lcrecords in use - kinda kludgy */ static struct @@ -2567,23 +2536,23 @@ } lcrecord_stats [countof (lrecord_implementations_table)]; static void -tick_lcrecord_stats (CONST struct lrecord_header *h, int free_p) +tick_lcrecord_stats (const struct lrecord_header *h, int free_p) { - CONST struct lrecord_implementation *implementation = - LHEADER_IMPLEMENTATION (h); - int type_index = lrecord_type_index (implementation); + unsigned int type_index = h->type; if (((struct lcrecord_header *) h)->free) { - assert (!free_p); + gc_checking_assert (!free_p); lcrecord_stats[type_index].instances_on_free_list++; } else { - size_t sz = (implementation->size_in_bytes_method - ? implementation->size_in_bytes_method (h) - : implementation->static_size); - + const struct lrecord_implementation *implementation = + LHEADER_IMPLEMENTATION (h); + + size_t sz = (implementation->size_in_bytes_method ? + implementation->size_in_bytes_method (h) : + implementation->static_size); if (free_p) { lcrecord_stats[type_index].instances_freed++; @@ -2621,9 +2590,10 @@ for (header = *prev; header; header = header->next) { struct lrecord_header *h = &(header->lheader); - if (!C_READONLY_RECORD_HEADER_P(h) - && !MARKED_RECORD_HEADER_P (h) - && ! (header->free)) + + GC_CHECK_LHEADER_INVARIANTS (h); + + if (! MARKED_RECORD_HEADER_P (h) && ! header->free) { if (LHEADER_IMPLEMENTATION (h)->finalizer) LHEADER_IMPLEMENTATION (h)->finalizer (h, 0); @@ -2633,9 +2603,9 @@ for (header = *prev; header; ) { struct lrecord_header *h = &(header->lheader); - if (C_READONLY_RECORD_HEADER_P(h) || MARKED_RECORD_HEADER_P (h)) + if (MARKED_RECORD_HEADER_P (h)) { - if (MARKED_RECORD_HEADER_P (h)) + if (! C_READONLY_RECORD_HEADER_P (h)) UNMARK_RECORD_HEADER (h); num_used++; /* total_size += n->implementation->size_in_bytes (h);*/ @@ -2674,15 +2644,15 @@ { Lisp_Bit_Vector *v = XBIT_VECTOR (bit_vector); int len = v->size; - if (C_READONLY_RECORD_HEADER_P(&(v->lheader)) || MARKED_RECORD_P (bit_vector)) + if (MARKED_RECORD_P (bit_vector)) { - 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 + - STRETCHY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, - BIT_VECTOR_LONG_STORAGE (len)); + FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, + BIT_VECTOR_LONG_STORAGE (len)); num_used++; /* #### May modify next on a C_READONLY bitvector */ prev = &(bit_vector_next (v)); @@ -2733,7 +2703,7 @@ { \ num_used++; \ } \ - else if (!MARKED_RECORD_HEADER_P (&SFTB_victim->lheader)) \ + else if (! MARKED_RECORD_HEADER_P (&SFTB_victim->lheader)) \ { \ num_free++; \ FREE_FIXED_TYPE (typename, obj_type, SFTB_victim); \ @@ -2788,7 +2758,7 @@ SFTB_empty = 0; \ num_used++; \ } \ - else if (!MARKED_RECORD_HEADER_P (&SFTB_victim->lheader)) \ + else if (! MARKED_RECORD_HEADER_P (&SFTB_victim->lheader)) \ { \ num_free++; \ FREE_FIXED_TYPE (typename, obj_type, SFTB_victim); \ @@ -2967,12 +2937,8 @@ void free_marker (Lisp_Marker *ptr) { -#ifdef ERROR_CHECK_GC /* Perhaps this will catch freeing an already-freed marker. */ - Lisp_Object temmy; - XSETMARKER (temmy, ptr); - assert (MARKERP (temmy)); -#endif /* ERROR_CHECK_GC */ + gc_checking_assert (ptr->lheader.type = lrecord_type_marker); #ifndef ALLOC_NO_POOLS FREE_FIXED_TYPE_WHEN_NOT_IN_GC (marker, Lisp_Marker, ptr); @@ -3073,8 +3039,7 @@ size = string_length (string); fullsize = STRING_FULLSIZE (size); - if (BIG_STRING_FULLSIZE_P (fullsize)) - abort (); + gc_checking_assert (! BIG_STRING_FULLSIZE_P (fullsize)); /* Just skip it if it isn't marked. */ if (! MARKED_RECORD_HEADER_P (&(string->lheader))) @@ -3136,7 +3101,7 @@ { Charcount i; Charcount s = string_char_length (p); - putc ('\"', stderr); + stderr_out ("\""); for (i = 0; i < s; i++) { Emchar ch = string_char (p, i); @@ -3164,8 +3129,9 @@ UNMARK_RECORD_HEADER (&(p->lheader)); \ num_bytes += size; \ if (!BIG_STRING_SIZE_P (size)) \ - { num_small_bytes += size; \ - num_small_used++; \ + { \ + num_small_bytes += size; \ + num_small_used++; \ } \ if (debug) \ debug_string_purity_print (p); \ @@ -3188,9 +3154,6 @@ int marked_p (Lisp_Object obj) { -#ifdef ERROR_CHECK_GC - assert (! (EQ (obj, Qnull_pointer))); -#endif /* Checks we used to perform. */ /* if (EQ (obj, Qnull_pointer)) return 1; */ /* if (!POINTER_TYPE_P (XGCTYPE (obj))) return 1; */ @@ -3199,10 +3162,10 @@ if (XTYPE (obj) == Lisp_Type_Record) { struct lrecord_header *lheader = XRECORD_LHEADER (obj); -#if defined (ERROR_CHECK_GC) - assert (lheader->type <= last_lrecord_type_index_assigned); -#endif - return C_READONLY_RECORD_HEADER_P (lheader) || MARKED_RECORD_HEADER_P (lheader); + + GC_CHECK_LHEADER_INVARIANTS (lheader); + + return MARKED_RECORD_HEADER_P (lheader); } return 1; } @@ -3267,26 +3230,7 @@ sweep_events (); #ifdef PDUMP - /* Unmark all dumped objects */ - { - int i; - char *p = pdump_rt_list; - if (p) - for (;;) - { - pdump_reloc_table *rt = (pdump_reloc_table *)p; - p += sizeof (pdump_reloc_table); - if (rt->desc) - { - for (i=0; icount; i++) - { - UNMARK_RECORD_HEADER ((struct lrecord_header *)(*(EMACS_INT *)p)); - p += sizeof (EMACS_INT); - } - } else - break; - } - } + pdump_objects_unmark (); #endif } @@ -3439,7 +3383,7 @@ : 0); Lisp_Object args[2], whole_msg; args[0] = build_string (msg ? msg : - GETTEXT ((CONST char *) gc_default_message)); + GETTEXT ((const char *) gc_default_message)); args[1] = build_string ("..."); whole_msg = Fconcat (2, args); echo_area_message (f, (Bufbyte *) 0, whole_msg, 0, -1, @@ -3591,7 +3535,7 @@ { Lisp_Object args[2], whole_msg; args[0] = build_string (msg ? msg : - GETTEXT ((CONST char *) + GETTEXT ((const char *) gc_default_message)); args[1] = build_string ("... done"); whole_msg = Fconcat (2, args); @@ -3617,7 +3561,7 @@ /* Debugging aids. */ static Lisp_Object -gc_plist_hack (CONST char *name, int value, Lisp_Object tail) +gc_plist_hack (const char *name, int value, Lisp_Object tail) { /* C doesn't have local functions (or closures, or GC, or readable syntax, or portable numeric datatypes, or bit-vectors, or characters, or @@ -3651,17 +3595,17 @@ garbage_collect_1 (); - for (i = 0; i <= last_lrecord_type_index_assigned; i++) + for (i = 0; i < lrecord_type_count; i++) { if (lcrecord_stats[i].bytes_in_use != 0 || lcrecord_stats[i].bytes_freed != 0 || lcrecord_stats[i].instances_on_free_list != 0) { char buf [255]; - CONST char *name = lrecord_implementations_table[i]->name; + const char *name = lrecord_implementations_table[i]->name; int len = strlen (name); /* save this for the FSFmacs-compatible part of the summary */ - if (i == *lrecord_vector.lrecord_type_index) + if (i == lrecord_vector.lrecord_type_index) gc_count_vector_total_size = lcrecord_stats[i].bytes_in_use + lcrecord_stats[i].bytes_freed; @@ -3965,10 +3909,6 @@ #else gc_cons_threshold = 15000; /* debugging */ #endif -#ifdef VIRT_ADDR_VARIES - malloc_sbrk_unused = 1<<22; /* A large number */ - malloc_sbrk_used = 100000; /* as reasonable as any number */ -#endif /* VIRT_ADDR_VARIES */ lrecord_uid_counter = 259; debug_string_purity = 0; gcprolist = 0; @@ -3990,31 +3930,18 @@ void init_alloc_once_early (void) { - int iii; - reinit_alloc_once_early (); - last_lrecord_type_index_assigned = -1; - for (iii = 0; iii < countof (lrecord_implementations_table); iii++) - { - lrecord_implementations_table[iii] = 0; - } - - /* - * All the staticly - * defined subr lrecords were initialized with lheader->type == 0. - * See subr_lheader_initializer in lisp.h. Force type index 0 to be - * assigned to lrecord_subr so that those predefined indexes match - * reality. - */ - lrecord_type_index (&lrecord_subr); - assert (*(lrecord_subr.lrecord_type_index) == 0); - /* - * The same is true for symbol_value_forward objects, except the - * type is 1. - */ - lrecord_type_index (&lrecord_symbol_value_forward); - assert (*(lrecord_symbol_value_forward.lrecord_type_index) == 1); + { + int i; + for (i = 0; i < countof (lrecord_implementations_table); i++) + lrecord_implementations_table[i] = 0; + } + + INIT_LRECORD_IMPLEMENTATION (cons); + INIT_LRECORD_IMPLEMENTATION (vector); + INIT_LRECORD_IMPLEMENTATION (string); + INIT_LRECORD_IMPLEMENTATION (lcrecord_list); staticidx = 0; } @@ -4030,9 +3957,9 @@ void syms_of_alloc (void) { - defsymbol (&Qpre_gc_hook, "pre-gc-hook"); - defsymbol (&Qpost_gc_hook, "post-gc-hook"); - defsymbol (&Qgarbage_collecting, "garbage-collecting"); + DEFSYMBOL (Qpre_gc_hook); + DEFSYMBOL (Qpost_gc_hook); + DEFSYMBOL (Qgarbage_collecting); DEFSUBR (Fcons); DEFSUBR (Flist); @@ -4076,16 +4003,6 @@ Number of bytes of sharable Lisp data allocated so far. */ ); -#if 0 - DEFVAR_INT ("data-bytes-used", &malloc_sbrk_used /* -Number of bytes of unshared memory allocated in this session. -*/ ); - - DEFVAR_INT ("data-bytes-free", &malloc_sbrk_unused /* -Number of bytes of unshared memory remaining available in this session. -*/ ); -#endif - #ifdef DEBUG_XEMACS DEFVAR_INT ("debug-allocation", &debug_allocation /* If non-zero, print out information to stderr about all objects allocated. @@ -4145,1023 +4062,3 @@ { Vgc_pointer_glyph = Fmake_glyph_internal (Qpointer); } - - -#ifdef PDUMP - -/* The structure of the file - * - * 0 - header - * 256 - dumped objects - * stab_offset - nb_staticpro*(Lisp_Object *) from staticvec - * - nb_staticpro*(relocated Lisp_Object) pointed to by staticpro - * - nb_structdmp*pair(void *, adr) for pointers to structures - * - lrecord_implementations_table[] - * - relocation table - * - wired variable address/value couples with the count preceding the list - */ -typedef struct -{ - char signature[8]; - EMACS_UINT stab_offset; - EMACS_UINT reloc_address; - int nb_staticpro; - int nb_structdmp; - int last_type; -} dump_header; - -char *pdump_start, *pdump_end; - -static const unsigned char align_table[256] = -{ - 8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 -}; - -typedef struct pdump_entry_list_elmt -{ - struct pdump_entry_list_elmt *next; - const void *obj; - size_t size; - int count; - int is_lrecord; - EMACS_INT save_offset; -} pdump_entry_list_elmt; - -typedef struct -{ - pdump_entry_list_elmt *first; - int align; - int count; -} pdump_entry_list; - -typedef struct pdump_struct_list_elmt -{ - pdump_entry_list list; - const struct struct_description *sdesc; -} pdump_struct_list_elmt; - -typedef struct -{ - pdump_struct_list_elmt *list; - int count; - int size; -} pdump_struct_list; - -static pdump_entry_list pdump_object_table[256]; -static pdump_entry_list pdump_opaque_data_list; -static pdump_struct_list pdump_struct_table; -static pdump_entry_list_elmt *pdump_qnil; - -static int pdump_alert_undump_object[256]; - -static unsigned long cur_offset; -static size_t max_size; -static int pdump_fd; -static void *pdump_buf; - -#define PDUMP_HASHSIZE 200001 - -static pdump_entry_list_elmt **pdump_hash; - -/* Since most pointers are eight bytes aligned, the >>3 allows for a better hash */ -static int -pdump_make_hash (const void *obj) -{ - return ((unsigned long)(obj)>>3) % PDUMP_HASHSIZE; -} - -static pdump_entry_list_elmt * -pdump_get_entry (const void *obj) -{ - int pos = pdump_make_hash (obj); - pdump_entry_list_elmt *e; - - assert (obj != 0); - - while ((e = pdump_hash[pos]) != 0) - { - if (e->obj == obj) - return e; - - pos++; - if (pos == PDUMP_HASHSIZE) - pos = 0; - } - return 0; -} - -static void -pdump_add_entry (pdump_entry_list *list, const void *obj, size_t size, int count, int is_lrecord) -{ - pdump_entry_list_elmt *e; - int align; - int pos = pdump_make_hash (obj); - - while ((e = pdump_hash[pos]) != 0) - { - if (e->obj == obj) - return; - - pos++; - if (pos == PDUMP_HASHSIZE) - pos = 0; - } - - e = xnew (pdump_entry_list_elmt); - - e->next = list->first; - e->obj = obj; - e->size = size; - e->count = count; - e->is_lrecord = is_lrecord; - list->first = e; - - list->count += count; - pdump_hash[pos] = e; - - align = align_table[size & 255]; - if (align < 2 && is_lrecord) - align = 2; - - if (align < list->align) - list->align = align; -} - -static pdump_entry_list * -pdump_get_entry_list (const struct struct_description *sdesc) -{ - int i; - for (i=0; iname, - backtrace[i].position, - backtrace[i].offset); - } - } -} - -static void pdump_register_object (Lisp_Object obj); -static void pdump_register_struct (const void *data, const struct struct_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_SIZE_T: - count = *(size_t *)irdata; - break; - case XD_INT: - count = *(int *)irdata; - break; - case XD_LONG: - count = *(long *)irdata; - break; - case XD_BYTECOUNT: - count = *(Bytecount *)irdata; - break; - default: - fprintf (stderr, "Unsupported count type : %d (line = %d, code=%ld)\n", idesc[line].type, line, (long)code); - pdump_backtrace (); - abort (); - } - count += delta; - return count; -} - -static void -pdump_register_sub (const void *data, const struct lrecord_description *desc, int me) -{ - int pos; - - restart: - for (pos = 0; desc[pos].type != XD_END; pos++) - { - const void *rdata = (const char *)data + desc[pos].offset; - - backtrace[me].position = pos; - backtrace[me].offset = desc[pos].offset; - - switch (desc[pos].type) - { - case XD_SPECIFIER_END: - pos = 0; - desc = ((const Lisp_Specifier *)data)->methods->extra_description; - goto restart; - case XD_SIZE_T: - case XD_INT: - case XD_LONG: - case XD_BYTECOUNT: - case XD_LO_RESET_NIL: - case XD_INT_RESET: - case XD_LO_LINK: - 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); - - pdump_add_entry (&pdump_opaque_data_list, - *(void **)rdata, - count, - 1, - 0); - break; - } - case XD_C_STRING: - { - const char *str = *(const char **)rdata; - if (str) - pdump_add_entry (&pdump_opaque_data_list, str, strlen (str)+1, 1, 0); - 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, 0); - break; - } - case XD_LISP_OBJECT: - { - const Lisp_Object *pobj = (const Lisp_Object *)rdata; - - assert (desc[pos].data1 == 0); - - 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); - - for (i = 0; i < count; i++) - { - const Lisp_Object *pobj = ((const Lisp_Object *)rdata) + i; - Lisp_Object dobj = *pobj; - - 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; - 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); - } - break; - } - default: - fprintf (stderr, "Unsupported dump type : %d\n", desc[pos].type); - pdump_backtrace (); - abort (); - }; - } -} - -static void -pdump_register_object (Lisp_Object obj) -{ - struct lrecord_header *objh; - - if (!POINTER_TYPE_P (XTYPE (obj))) - return; - - objh = XRECORD_LHEADER (obj); - if (!objh) - return; - - if (pdump_get_entry (objh)) - return; - - if (LHEADER_IMPLEMENTATION (objh)->description) - { - int me = depth++; - if (me>65536) - { - fprintf (stderr, "Backtrace overflow, loop ?\n"); - abort (); - } - backtrace[me].obj = objh; - backtrace[me].position = 0; - backtrace[me].offset = 0; - - pdump_add_entry (pdump_object_table + objh->type, - objh, - LHEADER_IMPLEMENTATION (objh)->static_size ? - LHEADER_IMPLEMENTATION (objh)->static_size : - LHEADER_IMPLEMENTATION (objh)->size_in_bytes_method (objh), - 1, - 1); - pdump_register_sub (objh, - LHEADER_IMPLEMENTATION (objh)->description, - me); - --depth; - } - else - { - pdump_alert_undump_object[objh->type]++; - fprintf (stderr, "Undumpable object type : %s\n", LHEADER_IMPLEMENTATION (objh)->name); - pdump_backtrace (); - } -} - -static void -pdump_register_struct (const void *data, const struct struct_description *sdesc, int count) -{ - if (data && !pdump_get_entry (data)) - { - int me = depth++; - int i; - if (me>65536) - { - fprintf (stderr, "Backtrace overflow, loop ?\n"); - abort (); - } - backtrace[me].obj = 0; - backtrace[me].position = 0; - backtrace[me].offset = 0; - - pdump_add_entry (pdump_get_entry_list (sdesc), - data, - sdesc->size, - count, - 0); - for (i=0; isize*i, - sdesc->description, - me); - } - --depth; - } -} - -static void -pdump_dump_data (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) -{ - size_t size = elmt->size; - int count = elmt->count; - if (desc) - { - int pos, i; - memcpy (pdump_buf, elmt->obj, size*count); - - for (i=0; iobj))->methods->extra_description; - goto restart; - case XD_SIZE_T: - case XD_INT: - case XD_LONG: - case XD_BYTECOUNT: - break; - case XD_LO_RESET_NIL: - { - EMACS_INT count = desc[pos].data1; - int i; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, elmt->obj); - for (i=0; isave_offset; - break; - } - case XD_INT_RESET: - { - EMACS_INT val = desc[pos].data1; - if (XD_IS_INDIRECT (val)) - val = pdump_get_indirect_count (val, desc, elmt->obj); - *(int *)rdata = val; - break; - } - case XD_OPAQUE_DATA_PTR: - case XD_C_STRING: - case XD_STRUCT_PTR: - { - void *ptr = *(void **)rdata; - if (ptr) - *(EMACS_INT *)rdata = pdump_get_entry (ptr)->save_offset; - break; - } - case XD_LO_LINK: - { - Lisp_Object obj = *(Lisp_Object *)rdata; - pdump_entry_list_elmt *elmt1; - for (;;) - { - elmt1 = pdump_get_entry (XRECORD_LHEADER (obj)); - if (elmt1) - break; - obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); - } - *(EMACS_INT *)rdata = elmt1->save_offset; - break; - } - case XD_LISP_OBJECT: - { - Lisp_Object *pobj = (Lisp_Object *) rdata; - - assert (desc[pos].data1 == 0); - - if (POINTER_TYPE_P (XTYPE (*pobj)) && XRECORD_LHEADER (*pobj)) - *(EMACS_INT *)pobj = - pdump_get_entry (XRECORD_LHEADER (*pobj))->save_offset; - break; - } - case XD_LISP_OBJECT_ARRAY: - { - EMACS_INT count = desc[pos].data1; - int i; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, elmt->obj); - - for (i=0; isave_offset; - } - break; - } - case XD_DOC_STRING: - { - EMACS_INT str = *(EMACS_INT *)rdata; - if (str > 0) - *(EMACS_INT *)rdata = pdump_get_entry ((void *)str)->save_offset; - break; - } - default: - fprintf (stderr, "Unsupported dump type : %d\n", desc[pos].type); - abort (); - }; - } - } - } - write (pdump_fd, desc ? pdump_buf : elmt->obj, size*count); - if (elmt->is_lrecord && ((size*count) & 3)) - write (pdump_fd, "\0\0\0", 4-((size*count) & 3)); -} - -static void -pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_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) - { - case XD_SPECIFIER_END: - pos = 0; - desc = ((const Lisp_Specifier *)data)->methods->extra_description; - goto restart; - case XD_SIZE_T: - case XD_INT: - case XD_LONG: - case XD_BYTECOUNT: - case XD_INT_RESET: - break; - case XD_OPAQUE_DATA_PTR: - case XD_C_STRING: - case XD_STRUCT_PTR: - case XD_LO_LINK: - { - EMACS_INT ptr = *(EMACS_INT *)rdata; - if (ptr) - *(EMACS_INT *)rdata = ptr+delta; - break; - } - case XD_LISP_OBJECT: - { - Lisp_Object *pobj = (Lisp_Object *) rdata; - - assert (desc[pos].data1 == 0); - - if (POINTER_TYPE_P (XTYPE (*pobj)) - && ! EQ (*pobj, Qnull_pointer)) - XSETOBJ (*pobj, XTYPE (*pobj), (char *) XPNTR (*pobj) + delta); - - break; - } - case XD_LISP_OBJECT_ARRAY: - case XD_LO_RESET_NIL: - { - EMACS_INT count = desc[pos].data1; - int i; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, data); - - for (i=0; i 0) - *(EMACS_INT *)rdata = str + delta; - break; - } - default: - fprintf (stderr, "Unsupported dump type : %d\n", desc[pos].type); - abort (); - }; - } -} - -static void -pdump_allocate_offset (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) -{ - size_t size = (elmt->is_lrecord ? (elmt->size + 3) & ~3 : elmt->size)*elmt->count; - elmt->save_offset = cur_offset; - if (size>max_size) - max_size = size; - cur_offset += size; -} - -static void -pdump_scan_by_alignment (void (*f)(pdump_entry_list_elmt *, const struct lrecord_description *)) -{ - int align, i; - const struct lrecord_description *idesc; - pdump_entry_list_elmt *elmt; - for (align=8; align>=0; align--) - { - for (i=0; i<=last_lrecord_type_index_assigned; i++) - if (pdump_object_table[i].align == align) - { - elmt = pdump_object_table[i].first; - if (!elmt) - continue; - idesc = lrecord_implementations_table[i]->description; - while (elmt) - { - f (elmt, idesc); - elmt = elmt->next; - } - } - - for (i=0; idescription; - while (elmt) - { - f (elmt, idesc); - elmt = elmt->next; - } - } - - elmt = pdump_opaque_data_list.first; - while (elmt) - { - if (align_table[elmt->size & 255] == align) - f (elmt, 0); - elmt = elmt->next; - } - } -} - -static void -pdump_dump_staticvec (void) -{ - EMACS_INT *reloc = xnew_array (EMACS_INT, staticidx); - int i; - write (pdump_fd, staticvec, staticidx*sizeof (Lisp_Object *)); - - for (i=0; isave_offset; - else - reloc[i] = *(EMACS_INT *)(staticvec[i]); - } - write (pdump_fd, reloc, staticidx*sizeof (Lisp_Object)); - free (reloc); -} - -static void -pdump_dump_structvec (void) -{ - int i; - for (i=0; isave_offset; - write (pdump_fd, &adr, sizeof (adr)); - } -} - -static void -pdump_dump_itable (void) -{ - write (pdump_fd, lrecord_implementations_table, sizeof (lrecord_implementations_table)); -} - -static void -pdump_dump_rtables (void) -{ - int i, j; - pdump_entry_list_elmt *elmt; - pdump_reloc_table rt; - - for (i=0; i<=last_lrecord_type_index_assigned; i++) - { - elmt = pdump_object_table[i].first; - if (!elmt) - continue; - rt.desc = lrecord_implementations_table[i]->description; - rt.count = pdump_object_table[i].count; - write (pdump_fd, &rt, sizeof (rt)); - while (elmt) - { - EMACS_INT rdata = pdump_get_entry (elmt->obj)->save_offset; - write (pdump_fd, &rdata, sizeof (rdata)); - elmt = elmt->next; - } - } - - rt.desc = 0; - rt.count = 0; - write (pdump_fd, &rt, sizeof (rt)); - - for (i=0; idescription; - rt.count = pdump_struct_table.list[i].list.count; - write (pdump_fd, &rt, sizeof (rt)); - while (elmt) - { - EMACS_INT rdata = pdump_get_entry (elmt->obj)->save_offset; - for (j=0; jcount; j++) - { - write (pdump_fd, &rdata, sizeof (rdata)); - rdata += elmt->size; - } - elmt = elmt->next; - } - } - rt.desc = 0; - rt.count = 0; - write (pdump_fd, &rt, sizeof (rt)); -} - -static void -pdump_dump_wired (void) -{ - EMACS_INT count = pdump_wireidx + pdump_wireidx_list; - int i; - - write (pdump_fd, &count, sizeof (count)); - - for (i=0; isave_offset; - write (pdump_fd, &pdump_wirevec[i], sizeof (pdump_wirevec[i])); - write (pdump_fd, &obj, sizeof (obj)); - } - - for (i=0; idescription; - for (pos = 0; desc[pos].type != XD_LO_LINK; pos++) - if (desc[pos].type == XD_END) - abort (); - - obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); - } - res = elmt->save_offset; - - write (pdump_fd, &pdump_wirevec_list[i], sizeof (pdump_wirevec_list[i])); - write (pdump_fd, &res, sizeof (res)); - } -} - -void -pdump (void) -{ - int i; - Lisp_Object t_console, t_device, t_frame; - int none; - dump_header hd; - - /* These appear in a DEFVAR_LISP, which does a staticpro() */ - t_console = Vterminal_console; - t_frame = Vterminal_frame; - t_device = Vterminal_device; - - Vterminal_console = Qnil; - Vterminal_frame = Qnil; - Vterminal_device = Qnil; - - pdump_hash = xnew_array_and_zero (pdump_entry_list_elmt *, PDUMP_HASHSIZE); - - for (i=0; i<=last_lrecord_type_index_assigned; i++) - { - pdump_object_table[i].first = 0; - pdump_object_table[i].align = 8; - pdump_object_table[i].count = 0; - pdump_alert_undump_object[i] = 0; - } - pdump_struct_table.count = 0; - pdump_struct_table.size = -1; - - pdump_opaque_data_list.first = 0; - pdump_opaque_data_list.align = 8; - pdump_opaque_data_list.count = 0; - depth = 0; - - for (i=0; iname, pdump_alert_undump_object[i]); - } - if (!none) - return; - - for (i=0; inb_staticpro; - last_lrecord_type_index_assigned = ((dump_header *)pdump_start)->last_type; - delta = ((EMACS_INT)pdump_start) - ((dump_header *)pdump_start)->reloc_address; - p = pdump_start + ((dump_header *)pdump_start)->stab_offset; - - /* Put back the staticvec in place */ - memcpy (staticvec, p, staticidx*sizeof (Lisp_Object *)); - p += staticidx*sizeof (Lisp_Object *); - for (i=0; inb_structdmp; i++) - { - void **adr = PDUMP_READ (p, void **); - *adr = (void *) (PDUMP_READ (p, char *) + delta); - } - - /* Put back the lrecord_implementations_table */ - memcpy (lrecord_implementations_table, p, sizeof (lrecord_implementations_table)); - p += sizeof (lrecord_implementations_table); - - /* Give back their numbers to the lrecord implementations */ - for (i = 0; i < countof (lrecord_implementations_table); i++) - if (lrecord_implementations_table[i]) - { - *(lrecord_implementations_table[i]->lrecord_type_index) = i; - last_lrecord_type_index_assigned = i; - } - - /* Do the relocations */ - pdump_rt_list = p; - count = 2; - for (;;) - { - pdump_reloc_table rt = PDUMP_READ (p, pdump_reloc_table); - if (rt.desc) - { - for (i=0; i < rt.count; i++) - { - char *adr = delta + *(char **)p; - *(char **)p = adr; - pdump_reloc_one (adr, delta, rt.desc); - p += sizeof (char *); - } - } else - if (!(--count)) - break; - } - - /* Put the pdump_wire variables in place */ - count = PDUMP_READ (p, EMACS_INT); - - for (i=0; i 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) { - REGISTER header *np = hp->h.next; + register header *np = hp->h.next; free ((pointer) hp); /* Collect garbage. */ @@ -228,7 +228,7 @@ /* Allocate combined header + user data storage. */ { - REGISTER pointer new = malloc (sizeof (header) + size); + register pointer new = malloc (sizeof (header) + size); /* Address of header. */ ((header *) new)->h.next = last_alloca_header; diff -r 72a7cfa4a488 -r abe6d1db359e src/balloon-x.c --- a/src/balloon-x.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/balloon-x.c Mon Aug 13 11:35:02 2007 +0200 @@ -32,7 +32,7 @@ /* #### start of hack */ static unsigned long -alloc_color (Display* dpy, CONST char* colorname, int light) +alloc_color (Display* dpy, const char* colorname, int light) { Colormap cmap = DEVICE_X_COLORMAP (XDEVICE(Vdefault_x_device)); unsigned long pixel = 0; @@ -61,7 +61,7 @@ } static XFontStruct * -open_font (Display* dpy, CONST char* font_name) +open_font (Display* dpy, const char* font_name) { XFontStruct* fontStruct = NULL; diff -r 72a7cfa4a488 -r abe6d1db359e src/balloon_help.c --- a/src/balloon_help.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/balloon_help.c Mon Aug 13 11:35:02 2007 +0200 @@ -44,7 +44,7 @@ #include "balloon_help.h" -#ifndef WINDOWSNT +#ifndef max #define max(x,y) (x>y?x:y) #endif @@ -83,7 +83,7 @@ static int b_maskWidth, b_maskHeight; static GC b_maskGC; -static CONST char* b_text; +static const char* b_text; static int b_width, b_height; static XtIntervalId b_timer; @@ -214,7 +214,7 @@ ============================================================================*/ static void -text_extent (XFontStruct* fontStruct, CONST char* text, int len, +text_extent (XFontStruct* fontStruct, const char* text, int len, int* width, int* height) { XCharStruct extent; @@ -227,13 +227,13 @@ } static void -get_text_size (Display* dpy, XFontStruct* fontStruct, CONST char* text, +get_text_size (Display* dpy, XFontStruct* fontStruct, const char* text, int* max_width, int* max_height) { int width; int height; - CONST char* start; - CONST char* end; + const char* start; + const char* end; *max_width = *max_height = 0; @@ -257,10 +257,10 @@ static void draw_text (Display* dpy, Window win, GC gc, XFontStruct* fontStruct, - int x, int y, CONST char* text) + int x, int y, const char* text) { - CONST char* start; - CONST char* end; + const char* start; + const char* end; int font_height; y += fontStruct->ascent; @@ -538,7 +538,7 @@ } void -balloon_help_show (CONST char* text) +balloon_help_show (const char* text) { assert (b_dpy != NULL); diff -r 72a7cfa4a488 -r abe6d1db359e src/balloon_help.h --- a/src/balloon_help.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/balloon_help.h Mon Aug 13 11:35:02 2007 +0200 @@ -29,7 +29,7 @@ Pixel fg, Pixel bg, Pixel shine, Pixel shadow, XFontStruct* font); void balloon_help_set_delay (unsigned long milliseconds); -void balloon_help_show (CONST char* text); +void balloon_help_show (const char* text); void balloon_help_hide (void); void balloon_help_move_to_pointer (void); diff -r 72a7cfa4a488 -r abe6d1db359e src/broken-sun.h --- a/src/broken-sun.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/broken-sun.h Mon Aug 13 11:35:02 2007 +0200 @@ -34,15 +34,15 @@ /*********************** stdlib functions *********************/ -/* void * memchr (CONST void *, int, size_t); */ +/* void * memchr (const void *, int, size_t); */ -/* int memcmp (CONST void *, CONST void *, size_t); */ -/* void * memcpy (void *, CONST void *, size_t); */ -/* void * memmove (void *, CONST void *, size_t);*/ +/* int memcmp (const void *, const void *, size_t); */ +/* void * memcpy (void *, const void *, size_t); */ +/* void * memmove (void *, const void *, size_t);*/ /* void * memset (void *, int, int); */ -/* char * strcat (char *, CONST char *); */ -/* char * strchr (CONST char *, int); */ -/* int strcmp (CONST char *, CONST char *); */ +/* char * strcat (char *, const char *); */ +/* char * strchr (const char *, int); */ +/* int strcmp (const char *, const char *); */ int strcasecmp (char *, char *); /* Yes, they even left these functions out! */ @@ -53,39 +53,39 @@ #include /* else can't declare FILE */ -/* FILE *fopen (CONST char *, CONST char *); */ -/* FILE *freopen (CONST char *, CONST char *, FILE *); */ +/* FILE *fopen (const char *, const char *); */ +/* FILE *freopen (const char *, const char *, FILE *); */ FILE *tmpfile (void); int fclose (FILE *); char *fgets (char *, int, FILE *); int fgetc (FILE *); int fflush (FILE *); -int fprintf (FILE *, CONST char *, ...); +int fprintf (FILE *, const char *, ...); int fputc (char, FILE *); -int fputs (CONST char *, FILE *); +int fputs (const char *, FILE *); size_t fread (void *, size_t, size_t, FILE *); -int fscanf (FILE *, CONST char *, ...); +int fscanf (FILE *, const char *, ...); int fgetpos (FILE *, long *); int fseek (FILE *, long, int); -int fsetpos (FILE *, CONST long *); +int fsetpos (FILE *, const long *); long ftell (FILE *); -size_t fwrite (CONST void *, size_t, size_t, FILE *); +size_t fwrite (const void *, size_t, size_t, FILE *); char *gets (char *); int pclose (FILE *); -void perror (CONST char *); -int printf (CONST char *, ...); -int puts (CONST char *); -int remove (CONST char *); -int rename (CONST char *, CONST char *); +void perror (const char *); +int printf (const char *, ...); +int puts (const char *); +int remove (const char *); +int rename (const char *, const char *); int rewind (FILE *); -int scanf (CONST char *, ...); -int sscanf (CONST char *, CONST char *, ...); +int scanf (const char *, ...); +int sscanf (const char *, const char *, ...); void setbuf (FILE *, char *); int setvbuf (FILE *, char *, int, size_t); int ungetc (int, FILE *); -int vprintf (CONST char *, void *); -int vfprintf (FILE *, CONST char *, void *); -char *vsprintf (char *, CONST char *, void *); +int vprintf (const char *, void *); +int vfprintf (FILE *, const char *, void *); +char *vsprintf (char *, const char *, void *); /*********************** signal functions *********************/ @@ -101,7 +101,7 @@ struct timeval; struct timezone; -int utimes (CONST char *, struct timeval *); +int utimes (const char *, struct timeval *); void tzset (void); time_t time (time_t *); int gettimeofday (struct timeval *, struct timezone *); @@ -112,12 +112,12 @@ #include int fsync (int); -int lstat (CONST char *, struct stat *); +int lstat (const char *, struct stat *); int fchmod (int, mode_t); char *mktemp (char *); -/* int creat (CONST char *, mode_t); better no decl than a conflicting one... */ -int symlink (CONST char *, CONST char *); -int readlink (CONST char *, char *, int); +/* int creat (const char *, mode_t); better no decl than a conflicting one... */ +int symlink (const char *, const char *); +int readlink (const char *, char *, int); void sync (void); int select (int, fd_set *, fd_set *, fd_set *, struct timeval *); char * getwd (char *); @@ -146,7 +146,7 @@ int ioctl (int, int, ...); struct nlist; -int nlist (CONST char *, struct nlist *); +int nlist (const char *, struct nlist *); int munmap (void *, int); int brk (void *); void * sbrk (int); @@ -158,7 +158,7 @@ /*********************** miscellaneous functions *********************/ -void tputs (CONST char *cp, int affcnt, void (*)(int)); +void tputs (const char *cp, int affcnt, void (*)(int)); long random (void); int srandom (int seed); diff -r 72a7cfa4a488 -r abe6d1db359e src/buffer.c --- a/src/buffer.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/buffer.c Mon Aug 13 11:35:02 2007 +0200 @@ -84,6 +84,7 @@ #ifdef REGION_CACHE_NEEDS_WORK #include "region-cache.h" #endif +#include "select.h" /* for select_notify_buffer_kill */ #include "specifier.h" #include "syntax.h" #include "sysdep.h" /* for getwd */ @@ -195,7 +196,6 @@ Lisp_Object Qdefault_directory; Lisp_Object Qkill_buffer_hook; -Lisp_Object Qrecord_buffer_hook; Lisp_Object Qrename_auto_save_file; @@ -439,7 +439,7 @@ */ (filename)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can GC. GC checked and fixed 7-11-2000 ben. */ REGISTER Lisp_Object buf; struct gcpro gcpro1; @@ -474,15 +474,17 @@ dn = Ffile_name_directory (filename); fn = Ffile_truename (dn, Qnil); if (! NILP (fn)) dn = fn; - fn = Fexpand_file_name (Ffile_name_nondirectory (filename), - dn); + /* Formerly the two calls below were combined, but that is + not GC-safe because the first call returns unprotected + data and the second call can GC. --ben */ + fn = Ffile_name_nondirectory (filename); + fn = Fexpand_file_name (fn, dn); } filename = fn; NUNGCPRO; } { - Lisp_Object elt; LIST_LOOP_2 (elt, Vbuffer_alist) { buf = Fcdr (elt); @@ -534,6 +536,7 @@ Lisp_Object get_truename_buffer (REGISTER Lisp_Object filename) { + /* This function can GC. GC correct 7-11-00 ben */ /* FSFmacs has its own code here and doesn't call get-file-buffer. That's because their equivalent of find-file-compare-truenames (find-file-existing-other-name) isn't looked at in get-file-buffer. @@ -567,7 +570,7 @@ local_var_alist is set to Qnil at the same point, in nuke_all_buffer_slots(). */ reset_buffer_local_variables (b, 1); - b->directory = ((current_buffer) ? current_buffer->directory : Qnil); + b->directory = current_buffer ? current_buffer->directory : Qnil; b->last_window_start = 1; @@ -869,37 +872,6 @@ return result; } -DEFUN ("buffer-dedicated-frame", Fbuffer_dedicated_frame, 0, 1, 0, /* -Return the frame dedicated to this BUFFER, or nil if there is none. -No argument or nil as argument means use current buffer as BUFFER. -*/ - (buffer)) -{ - struct buffer *buf = decode_buffer (buffer, 0); - - /* XEmacs addition: if the frame is dead, silently make it go away. */ - if (!NILP (buf->dedicated_frame) && - !FRAME_LIVE_P (XFRAME (buf->dedicated_frame))) - buf->dedicated_frame = Qnil; - - return buf->dedicated_frame; -} - -DEFUN ("set-buffer-dedicated-frame", Fset_buffer_dedicated_frame, 2, 2, 0, /* -For this BUFFER, set the FRAME dedicated to it. -FRAME must be a frame or nil. -*/ - (buffer, frame)) -{ - struct buffer *buf = decode_buffer (buffer, 0); - - if (!NILP (frame)) - CHECK_LIVE_FRAME (frame); /* XEmacs change */ - - return buf->dedicated_frame = frame; -} - - DEFUN ("buffer-modified-p", Fbuffer_modified_p, 0, 1, 0, /* Return t if BUFFER was modified since its file was last read or saved. @@ -1027,6 +999,7 @@ /* The aconses in the Vbuffer_alist are shared with frame->buffer_alist, so this will change it in the per-frame ordering as well. */ Fsetcar (Frassq (buf, Vbuffer_alist), newname); + if (NILP (current_buffer->filename) && !NILP (current_buffer->auto_save_file_name)) call0 (Qrename_auto_save_file); @@ -1186,7 +1159,7 @@ killp = call1 (Qyes_or_no_p, (emacs_doprnt_string_c - ((CONST Bufbyte *) GETTEXT ("Buffer %s modified; kill anyway? "), + ((const Bufbyte *) GETTEXT ("Buffer %s modified; kill anyway? "), Qnil, -1, XSTRING_DATA (b->name)))); UNGCPRO; if (NILP (killp)) @@ -1220,15 +1193,13 @@ /* Then run the hooks. */ run_hook (Qkill_buffer_hook); -#ifdef HAVE_X_WINDOWS - /* If an X selection was in this buffer, disown it. - We could have done this by simply adding this function to the - kill-buffer-hook, but the user might mess that up. - */ - if (EQ (Vwindow_system, Qx)) - call0 (intern ("xselect-kill-buffer-hook")); - /* #### generalize me! */ -#endif /* HAVE_X_WINDOWS */ + + /* Inform the selection code that a buffer just got killed. + We do this in C because (a) it's faster, and (b) it needs + to access data internal to select.c that can't be seen from + Lisp (so the Lisp code would just call into C anyway. */ + select_notify_buffer_kill (buf); + unbind_to (speccount, Qnil); UNGCPRO; b = XBUFFER (buf); /* Hypothetical relocating GC. */ @@ -1304,13 +1275,13 @@ kill_buffer_processes (buf); + delete_from_buffer_alist (buf); + /* #### This is a problem if this buffer is in a dedicated window. Need to undedicate any windows of this buffer first (and delete them?) */ Freplace_buffer_in_windows (buf); - delete_from_buffer_alist (buf); - font_lock_buffer_was_killed (b); /* Delete any auto-save file, if we saved it in this session. */ @@ -1413,8 +1384,6 @@ XCDR (lynk) = f->buffer_alist; f->buffer_alist = lynk; - va_run_hook_with_args (Qrecord_buffer_hook, 1, buffer); - return Qnil; } @@ -1483,20 +1452,6 @@ current_buffer = b; invalidate_current_column (); /* invalidate indentation cache */ -#ifdef HAVE_FEP - if (!noninteractive && initialized) - { - extern Lisp_Object Ffep_force_on (), Ffep_force_off (), Ffep_get_mode (); - - old_buf->fep_mode = Ffep_get_mode (); - - if (!NILP (current_buffer->fep_mode)) - Ffep_force_on (); - else - Ffep_force_off (); - } -#endif /* HAVE_FEP */ - if (old_buf) { /* Put the undo list back in the base buffer, so that it appears @@ -1832,8 +1787,18 @@ #define coding_system_is_binary(coding_system) 1 #endif -static Extbyte_dynarr *conversion_out_dynarr; -static Bufbyte_dynarr *conversion_in_dynarr; +typedef struct +{ + Dynarr_declare (Bufbyte_dynarr *); +} Bufbyte_dynarr_dynarr; + +typedef struct +{ + Dynarr_declare (Extbyte_dynarr *); +} Extbyte_dynarr_dynarr; + +static Extbyte_dynarr_dynarr *conversion_out_dynarr_list; +static Bufbyte_dynarr_dynarr *conversion_in_dynarr_list; static int dfc_convert_to_external_format_in_use; static int dfc_convert_to_internal_format_in_use; @@ -1862,6 +1827,7 @@ dfc_conversion_data *sink) { int count = specpdl_depth (); + Extbyte_dynarr *conversion_out_dynarr; type_checking_assert (((source_type == DFC_TYPE_DATA) || @@ -1871,20 +1837,20 @@ ((sink_type == DFC_TYPE_DATA) || (sink_type == DFC_TYPE_LISP_LSTREAM && LSTREAMP (source->lisp_object)))); - if (dfc_convert_to_external_format_in_use != 0) - error ("Can't call a conversion function from a conversion function"); - else - dfc_convert_to_external_format_in_use = 1; - record_unwind_protect (dfc_convert_to_external_format_reset_in_use, - Qzero); + make_int (dfc_convert_to_external_format_in_use)); + if (Dynarr_length (conversion_out_dynarr_list) <= + dfc_convert_to_external_format_in_use) + Dynarr_add (conversion_out_dynarr_list, Dynarr_new (Extbyte)); + conversion_out_dynarr = Dynarr_at (conversion_out_dynarr_list, + dfc_convert_to_external_format_in_use); + dfc_convert_to_external_format_in_use++; + Dynarr_reset (conversion_out_dynarr); #ifdef FILE_CODING coding_system = Fget_coding_system (coding_system); #endif - Dynarr_reset (conversion_out_dynarr); - /* Here we optimize in the case where the coding system does no conversion. However, we don't want to optimize in case the source or sink is an lstream, since writing to an lstream can cause a @@ -2017,6 +1983,7 @@ dfc_conversion_data *sink) { int count = specpdl_depth (); + Bufbyte_dynarr *conversion_in_dynarr; type_checking_assert ((source_type == DFC_TYPE_DATA || @@ -2025,20 +1992,20 @@ (sink_type == DFC_TYPE_DATA || sink_type == DFC_TYPE_LISP_LSTREAM)); - if (dfc_convert_to_internal_format_in_use != 0) - error ("Can't call a conversion function from a conversion function"); - else - dfc_convert_to_internal_format_in_use = 1; - record_unwind_protect (dfc_convert_to_internal_format_reset_in_use, - Qzero); + make_int (dfc_convert_to_internal_format_in_use)); + if (Dynarr_length (conversion_in_dynarr_list) <= + dfc_convert_to_internal_format_in_use) + Dynarr_add (conversion_in_dynarr_list, Dynarr_new (Bufbyte)); + conversion_in_dynarr = Dynarr_at (conversion_in_dynarr_list, + dfc_convert_to_internal_format_in_use); + dfc_convert_to_internal_format_in_use++; + Dynarr_reset (conversion_in_dynarr); #ifdef FILE_CODING coding_system = Fget_coding_system (coding_system); #endif - Dynarr_reset (conversion_in_dynarr); - if (source_type != DFC_TYPE_LISP_LSTREAM && sink_type != DFC_TYPE_LISP_LSTREAM && coding_system_is_binary (coding_system)) @@ -2148,12 +2115,13 @@ void syms_of_buffer (void) { + INIT_LRECORD_IMPLEMENTATION (buffer); + defsymbol (&Qbuffer_live_p, "buffer-live-p"); defsymbol (&Qbuffer_or_string_p, "buffer-or-string-p"); defsymbol (&Qmode_class, "mode-class"); defsymbol (&Qrename_auto_save_file, "rename-auto-save-file"); defsymbol (&Qkill_buffer_hook, "kill-buffer-hook"); - defsymbol (&Qrecord_buffer_hook, "record-buffer-hook"); defsymbol (&Qpermanent_local, "permanent-local"); defsymbol (&Qfirst_change_hook, "first-change-hook"); @@ -2190,8 +2158,6 @@ DEFSUBR (Fbuffer_base_buffer); DEFSUBR (Fbuffer_indirect_children); DEFSUBR (Fbuffer_local_variables); - DEFSUBR (Fbuffer_dedicated_frame); - DEFSUBR (Fset_buffer_dedicated_frame); DEFSUBR (Fbuffer_modified_p); DEFSUBR (Fset_buffer_modified_p); DEFSUBR (Fbuffer_modified_tick); @@ -2212,15 +2178,17 @@ DEFSUBR (Fbuffer_memory_usage); #endif - deferror (&Qprotected_field, "protected-field", - "Attempt to modify a protected field", Qerror); + DEFERROR (Qprotected_field, "Attempt to modify a protected field", + Qinvalid_change); } void reinit_vars_of_buffer (void) { - conversion_in_dynarr = Dynarr_new (Bufbyte); - conversion_out_dynarr = Dynarr_new (Extbyte); + conversion_in_dynarr_list = Dynarr_new2 (Bufbyte_dynarr_dynarr, + Bufbyte_dynarr *); + conversion_out_dynarr_list = Dynarr_new2 (Extbyte_dynarr_dynarr, + Extbyte_dynarr *); staticpro_nodump (&Vbuffer_alist); Vbuffer_alist = Qnil; @@ -2373,15 +2341,27 @@ /* Renamed from DEFVAR_PER_BUFFER because FSFmacs D_P_B takes a bogus extra arg, which confuses an otherwise identical make-docfile.c */ - -/* Declaring this stuff as const produces 'Cannot reinitialize' messages - from SunPro C's fix-and-continue feature (a way neato feature that - makes debugging unbelievably more bearable) */ #define DEFVAR_BUFFER_LOCAL_1(lname, field_name, forward_type, magicfun) do { \ - static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ - = { { { symbol_value_forward_lheader_initializer, \ - (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 }, \ - forward_type }, magicfun }; \ + static const struct symbol_value_forward I_hate_C = \ + { /* struct symbol_value_forward */ \ + { /* struct symbol_value_magic */ \ + { /* struct lcrecord_header */ \ + { /* struct lrecord_header */ \ + lrecord_type_symbol_value_forward, /* lrecord_type_index */ \ + 1, /* mark bit */ \ + 1, /* c_readonly bit */ \ + 1 /* lisp_readonly bit */ \ + }, \ + 0, /* next */ \ + 0, /* uid */ \ + 0 /* free */ \ + }, \ + &(buffer_local_flags.field_name), \ + forward_type \ + }, \ + magicfun \ + }; \ + \ { \ int offset = ((char *)symbol_value_forward_forward (&I_hate_C) - \ (char *)&buffer_local_flags); \ @@ -2650,31 +2630,31 @@ DEFVAR_BUFFER_LOCAL ("modeline-format", modeline_format /* Template for displaying modeline for current buffer. Each buffer has its own value of this variable. -Value may be a string, a symbol or a list or cons cell. -For a symbol, its value is used (but it is ignored if t or nil). +Value may be a string, symbol, glyph, generic specifier, list or cons cell. +For a symbol, its value is processed (but it is ignored if t or nil). A string appearing directly as the value of a symbol is processed verbatim in that the %-constructs below are not recognized. For a glyph, it is inserted as is. +For a generic specifier (i.e. a specifier of type `generic'), its instance + is computed in the current window using the equivalent of `specifier-instance' + and the value is processed. For a list whose car is a symbol, the symbol's value is taken, and if that is non-nil, the cadr of the list is processed recursively. Otherwise, the caddr of the list (if there is one) is processed. For a list whose car is a string or list, each element is processed recursively and the results are effectively concatenated. For a list whose car is an integer, the cdr of the list is processed - and padded (if the number is positive) or truncated (if negative) - to the width specified by that number. + and padded (if the number is positive) or truncated (if negative) + to the width specified by that number. For a list whose car is an extent, the cdr of the list is processed normally but the results are displayed using the face of the extent, and mouse clicks over this section are processed using the keymap of the extent. (In addition, if the extent has a help-echo property, that string will be echoed when the mouse moves over this - section.) See `generated-modeline-string' for more information. -For a list whose car is a face, the cdr of the list is processed - normally but the results will be displayed using the face in the car. -For a list whose car is a keymap, the cdr of the list is processed - normally but the keymap will apply for mouse clicks over the results, - in addition to `modeline-map'. Nested keymap specifications are - handled properly. + section.) If extents are nested, all keymaps are properly consulted + when processing mouse clicks, but multiple faces are not correctly + merged (only the first face is used), and lists of faces are not + correctly handled. See `generated-modeline-string' for more information. A string is printed verbatim in the modeline except for %-constructs: (%-constructs are processed when the string is the entire modeline-format or when it is found in a cons-cell or a list) @@ -3089,6 +3069,7 @@ } } +#ifndef WIN32_NATIVE /* Is PWD another name for `.' ? */ static int directory_is_current_directory (Extbyte *pwd) @@ -3102,29 +3083,35 @@ Qfile_name); return (IS_DIRECTORY_SEP (*pwd_internal) - && stat ((char *) pwd_internal, &pwdstat) == 0 - && stat (".", &dotstat) == 0 + && xemacs_stat ((char *) pwd_internal, &pwdstat) == 0 + && xemacs_stat (".", &dotstat) == 0 && dotstat.st_ino == pwdstat.st_ino && dotstat.st_dev == pwdstat.st_dev && pwd_internal_len < MAXPATHLEN); } +#endif void init_initial_directory (void) { /* This function can GC */ +#ifndef WIN32_NATIVE Extbyte *pwd; +#endif initial_directory[0] = 0; /* If PWD is accurate, use it instead of calling getcwd. This is faster when PWD is right, and may avoid a fatal error. */ +#ifndef WIN32_NATIVE if ((pwd = (Extbyte *) getenv ("PWD")) != NULL && directory_is_current_directory (pwd)) strcpy (initial_directory, (char *) pwd); - else if (getcwd (initial_directory, MAXPATHLEN) == NULL) - fatal ("`getcwd' failed: %s\n", strerror (errno)); + else +#endif + if (getcwd (initial_directory, MAXPATHLEN) == NULL) + fatal ("`getcwd' failed: %s\n", strerror (errno)); /* Make sure pwd is DIRECTORY_SEP-terminated. Maybe this should really use some standard subroutine @@ -3139,16 +3126,8 @@ } } - /* XEmacs change: store buffer's default directory - using preferred (i.e. as defined at compile-time) - directory separator. --marcpa */ -#ifdef DOS_NT -#define CORRECT_DIR_SEPS(s) \ - do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ - else unixtodos_filename (s); \ - } while (0) - - CORRECT_DIR_SEPS(initial_directory); +#ifdef CORRECT_DIR_SEPS + CORRECT_DIR_SEPS (initial_directory); #endif } diff -r 72a7cfa4a488 -r abe6d1db359e src/buffer.h --- a/src/buffer.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/buffer.h Mon Aug 13 11:35:02 2007 +0200 @@ -198,7 +198,7 @@ int modtime; /* the value of text->modiff at the last auto-save. */ - int auto_save_modified; + long auto_save_modified; /* The time at which we detected a failure to auto-save, Or -1 if we didn't have a failure. */ @@ -427,8 +427,8 @@ } while (0) #define DEC_CHARPTR(ptr) do { \ - CONST Bufbyte *dc_ptr1 = (ptr); \ - CONST Bufbyte *dc_ptr2 = dc_ptr1; \ + const Bufbyte *dc_ptr1 = (ptr); \ + const Bufbyte *dc_ptr2 = dc_ptr1; \ REAL_DEC_CHARPTR (dc_ptr2); \ assert (dc_ptr1 - dc_ptr2 == \ REP_BYTES_BY_FIRST_BYTE (*dc_ptr2)); \ @@ -470,9 +470,10 @@ /* section of internally-formatted text */ /* -------------------------------------------------------------- */ -INLINE CONST Bufbyte *charptr_n_addr (CONST Bufbyte *ptr, Charcount offset); -INLINE CONST Bufbyte * -charptr_n_addr (CONST Bufbyte *ptr, Charcount offset) +INLINE_HEADER const Bufbyte * +charptr_n_addr (const Bufbyte *ptr, Charcount offset); +INLINE_HEADER const Bufbyte * +charptr_n_addr (const Bufbyte *ptr, Charcount offset) { return ptr + charcount_to_bytecount (ptr, offset); } @@ -487,21 +488,21 @@ #ifdef MULE -Emchar non_ascii_charptr_emchar (CONST Bufbyte *ptr); +Emchar non_ascii_charptr_emchar (const Bufbyte *ptr); Bytecount non_ascii_set_charptr_emchar (Bufbyte *ptr, Emchar c); -Bytecount non_ascii_charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2); +Bytecount non_ascii_charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2); -INLINE Emchar charptr_emchar (CONST Bufbyte *ptr); -INLINE Emchar -charptr_emchar (CONST Bufbyte *ptr) +INLINE_HEADER Emchar charptr_emchar (const Bufbyte *ptr); +INLINE_HEADER Emchar +charptr_emchar (const Bufbyte *ptr) { return BYTE_ASCII_P (*ptr) ? simple_charptr_emchar (ptr) : non_ascii_charptr_emchar (ptr); } -INLINE Bytecount set_charptr_emchar (Bufbyte *ptr, Emchar x); -INLINE Bytecount +INLINE_HEADER Bytecount set_charptr_emchar (Bufbyte *ptr, Emchar x); +INLINE_HEADER Bytecount set_charptr_emchar (Bufbyte *ptr, Emchar x) { return !CHAR_MULTIBYTE_P (x) ? @@ -509,9 +510,10 @@ non_ascii_set_charptr_emchar (ptr, x); } -INLINE Bytecount charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2); -INLINE Bytecount -charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2) +INLINE_HEADER Bytecount +charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2); +INLINE_HEADER Bytecount +charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2) { return BYTE_ASCII_P (*ptr) ? simple_charptr_copy_char (ptr, ptr2) : @@ -538,8 +540,8 @@ int non_ascii_valid_char_p (Emchar ch); -INLINE int valid_char_p (Emchar ch); -INLINE int +INLINE_HEADER int valid_char_p (Emchar ch); +INLINE_HEADER int valid_char_p (Emchar ch) { return ((unsigned int) (ch) <= 0xff) || non_ascii_valid_char_p (ch); @@ -557,8 +559,8 @@ #ifdef ERROR_CHECK_TYPECHECK -INLINE Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj); -INLINE Emchar +INLINE_HEADER Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj); +INLINE_HEADER Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj) { assert (CHAR_OR_CHAR_INTP (obj)); @@ -622,8 +624,8 @@ /*----------------------------------------------------------------------*/ /* Convert the address of a byte in the buffer into a position. */ -INLINE Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr); -INLINE Bytind +INLINE_HEADER Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr); +INLINE_HEADER Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr) { return (ptr - buf->text->beg + 1 @@ -635,8 +637,8 @@ bytind_to_bufpos (buf, BI_BUF_PTR_BYTE_POS (buf, ptr)) /* Address of byte at position POS in buffer. */ -INLINE Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos); -INLINE Bufbyte * +INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos); +INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos) { return (buf->text->beg + @@ -648,8 +650,8 @@ BI_BUF_BYTE_ADDRESS (buf, bufpos_to_bytind (buf, pos)) /* Address of byte before position POS in buffer. */ -INLINE Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos); -INLINE Bufbyte * +INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos); +INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos) { return (buf->text->beg + @@ -664,8 +666,8 @@ /* Converting between byte indices and memory indices */ /*----------------------------------------------------------------------*/ -INLINE int valid_memind_p (struct buffer *buf, Memind x); -INLINE int +INLINE_HEADER int valid_memind_p (struct buffer *buf, Memind x); +INLINE_HEADER int valid_memind_p (struct buffer *buf, Memind x) { return ((x >= 1 && x <= (Memind) buf->text->gpt) || @@ -673,16 +675,16 @@ x <= (Memind) (buf->text->z + buf->text->gap_size))); } -INLINE Memind bytind_to_memind (struct buffer *buf, Bytind x); -INLINE Memind +INLINE_HEADER Memind bytind_to_memind (struct buffer *buf, Bytind x); +INLINE_HEADER Memind bytind_to_memind (struct buffer *buf, Bytind x) { return (Memind) ((x > buf->text->gpt) ? (x + buf->text->gap_size) : x); } -INLINE Bytind memind_to_bytind (struct buffer *buf, Memind x); -INLINE Bytind +INLINE_HEADER Bytind memind_to_bytind (struct buffer *buf, Memind x); +INLINE_HEADER Bytind memind_to_bytind (struct buffer *buf, Memind x) { #ifdef ERROR_CHECK_BUFPOS @@ -902,16 +904,16 @@ VALIDATE_BYTIND_BACKWARD (buf, x); \ } while (0) -INLINE Bytind prev_bytind (struct buffer *buf, Bytind x); -INLINE Bytind +INLINE_HEADER Bytind prev_bytind (struct buffer *buf, Bytind x); +INLINE_HEADER Bytind prev_bytind (struct buffer *buf, Bytind x) { DEC_BYTIND (buf, x); return x; } -INLINE Bytind next_bytind (struct buffer *buf, Bytind x); -INLINE Bytind +INLINE_HEADER Bytind next_bytind (struct buffer *buf, Bytind x); +INLINE_HEADER Bytind next_bytind (struct buffer *buf, Bytind x) { INC_BYTIND (buf, x); @@ -973,8 +975,8 @@ extern short three_to_one_table[]; -INLINE int real_bufpos_to_bytind (struct buffer *buf, Bufpos x); -INLINE int +INLINE_HEADER int real_bufpos_to_bytind (struct buffer *buf, Bufpos x); +INLINE_HEADER int real_bufpos_to_bytind (struct buffer *buf, Bufpos x) { if (x >= buf->text->mule_bufmin && x <= buf->text->mule_bufmax) @@ -985,8 +987,8 @@ return bufpos_to_bytind_func (buf, x); } -INLINE int real_bytind_to_bufpos (struct buffer *buf, Bytind x); -INLINE int +INLINE_HEADER int real_bytind_to_bufpos (struct buffer *buf, Bytind x); +INLINE_HEADER int real_bytind_to_bufpos (struct buffer *buf, Bytind x) { if (x >= buf->text->mule_bytmin && x <= buf->text->mule_bytmax) @@ -1188,7 +1190,7 @@ /* WARNING: These use a static buffer. This can lead to disaster if these functions are not used *very* carefully. Another reason to only use - TO_EXTERNAL_FORMATf() and TO_INTERNAL_FORMAT(). */ + TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT(). */ void dfc_convert_to_external_format (dfc_conversion_type source_type, dfc_conversion_data *source, @@ -1267,16 +1269,17 @@ } while (0) /* Assign to the `sink' lvalue(s) using the converted data. */ +typedef union { char c; void *p; } *dfc_aliasing_voidpp; #define DFC_ALLOCA_USE_CONVERTED_DATA(sink) do { \ void * dfc_sink_ret = alloca (dfc_sink.data.len + 1); \ memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 1); \ - (DFC_CPP_CAR sink) = (unsigned char *) dfc_sink_ret; \ + ((dfc_aliasing_voidpp) &(DFC_CPP_CAR sink))->p = dfc_sink_ret; \ (DFC_CPP_CDR sink) = dfc_sink.data.len; \ } while (0) #define DFC_MALLOC_USE_CONVERTED_DATA(sink) do { \ void * dfc_sink_ret = xmalloc (dfc_sink.data.len + 1); \ memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 1); \ - (DFC_CPP_CAR sink) = (unsigned char *) dfc_sink_ret; \ + ((dfc_aliasing_voidpp) &(DFC_CPP_CAR sink))->p = dfc_sink_ret; \ (DFC_CPP_CDR sink) = dfc_sink.data.len; \ } while (0) #define DFC_C_STRING_ALLOCA_USE_CONVERTED_DATA(sink) do { \ @@ -1303,6 +1306,30 @@ argument to TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT(). */ #define Qnative Qfile_name +#if defined (WIN32_NATIVE) || defined (CYGWIN) +/* #### kludge!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + Remove this as soon as my Mule code is integrated. */ +#define Qmswindows_tstr Qnative +#endif + +/* More stand-ins */ +#define Qcommand_argument_encoding Qnative +#define Qenvironment_variable_encoding Qnative + +/* Convenience macros for extremely common invocations */ +#define C_STRING_TO_EXTERNAL(in, out, coding_system) \ + TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, coding_system) +#define C_STRING_TO_EXTERNAL_MALLOC(in, out, coding_system) \ + TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, coding_system) +#define EXTERNAL_TO_C_STRING(in, out, coding_system) \ + TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, coding_system) +#define EXTERNAL_TO_C_STRING_MALLOC(in, out, coding_system) \ + TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, coding_system) +#define LISP_STRING_TO_EXTERNAL(in, out, coding_system) \ + TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_ALLOCA, out, coding_system) +#define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, coding_system) \ + TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_MALLOC, out, coding_system) + /************************************************************************/ /* */ @@ -1568,17 +1595,17 @@ /* from insdel.c */ void set_buffer_point (struct buffer *buf, Bufpos pos, Bytind bipos); void find_charsets_in_bufbyte_string (unsigned char *charsets, - CONST Bufbyte *str, + const Bufbyte *str, Bytecount len); void find_charsets_in_emchar_string (unsigned char *charsets, - CONST Emchar *str, + const Emchar *str, Charcount len); -int bufbyte_string_displayed_columns (CONST Bufbyte *str, Bytecount len); -int emchar_string_displayed_columns (CONST Emchar *str, Charcount len); -void convert_bufbyte_string_into_emchar_dynarr (CONST Bufbyte *str, +int bufbyte_string_displayed_columns (const Bufbyte *str, Bytecount len); +int emchar_string_displayed_columns (const Emchar *str, Charcount len); +void convert_bufbyte_string_into_emchar_dynarr (const Bufbyte *str, Bytecount len, Emchar_dynarr *dyn); -Charcount convert_bufbyte_string_into_emchar_string (CONST Bufbyte *str, +Charcount convert_bufbyte_string_into_emchar_string (const Bufbyte *str, Bytecount len, Emchar *arr); void convert_emchar_string_into_bufbyte_dynarr (Emchar *arr, int nels, @@ -1704,8 +1731,8 @@ TRT_TABLE_AS_STRING (buf->case_eqv_table) #endif -INLINE Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c); -INLINE Emchar +INLINE_HEADER Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c); +INLINE_HEADER Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c) { return IN_TRT_TABLE_DOMAIN (c) ? TRT_TABLE_CHAR_1 (trt, c) : c; @@ -1717,8 +1744,8 @@ /* 1 if CH is upper case. */ -INLINE int UPPERCASEP (struct buffer *buf, Emchar ch); -INLINE int +INLINE_HEADER int UPPERCASEP (struct buffer *buf, Emchar ch); +INLINE_HEADER int UPPERCASEP (struct buffer *buf, Emchar ch) { return DOWNCASE_TABLE_OF (buf, ch) != ch; @@ -1726,8 +1753,8 @@ /* 1 if CH is lower case. */ -INLINE int LOWERCASEP (struct buffer *buf, Emchar ch); -INLINE int +INLINE_HEADER int LOWERCASEP (struct buffer *buf, Emchar ch); +INLINE_HEADER int LOWERCASEP (struct buffer *buf, Emchar ch) { return (UPCASE_TABLE_OF (buf, ch) != ch && @@ -1736,8 +1763,8 @@ /* 1 if CH is neither upper nor lower case. */ -INLINE int NOCASEP (struct buffer *buf, Emchar ch); -INLINE int +INLINE_HEADER int NOCASEP (struct buffer *buf, Emchar ch); +INLINE_HEADER int NOCASEP (struct buffer *buf, Emchar ch) { return UPCASE_TABLE_OF (buf, ch) == ch; @@ -1745,8 +1772,8 @@ /* Upcase a character, or make no change if that cannot be done. */ -INLINE Emchar UPCASE (struct buffer *buf, Emchar ch); -INLINE Emchar +INLINE_HEADER Emchar UPCASE (struct buffer *buf, Emchar ch); +INLINE_HEADER Emchar UPCASE (struct buffer *buf, Emchar ch) { return (DOWNCASE_TABLE_OF (buf, ch) == ch) ? UPCASE_TABLE_OF (buf, ch) : ch; diff -r 72a7cfa4a488 -r abe6d1db359e src/bufslots.h --- a/src/bufslots.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/bufslots.h Mon Aug 13 11:35:02 2007 +0200 @@ -189,9 +189,7 @@ /* FSFmacs has overlay stuff here. We have extent info elsewhere in the struct buffer. */ - /* If dedicated_frame is non-nil, display_buffer tries to use it instead - of the current frame */ - MARKED_SLOT (dedicated_frame); + /* dedicated_frame in lisp */ /* Lisp of symbols naming the file format used for visited file. */ MARKED_SLOT (file_format); diff -r 72a7cfa4a488 -r abe6d1db359e src/bytecode.c --- a/src/bytecode.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/bytecode.c Mon Aug 13 11:35:02 2007 +0200 @@ -56,8 +56,6 @@ #include "opaque.h" #include "syntax.h" -#include - EXFUN (Ffetch_bytecode, 1); Lisp_Object Qbyte_code, Qcompiled_functionp, Qinvalid_byte_code; @@ -216,10 +214,10 @@ static void invalid_byte_code_error (char *error_message, ...); Lisp_Object * execute_rare_opcode (Lisp_Object *stack_ptr, - CONST Opbyte *program_ptr, + const Opbyte *program_ptr, Opcode opcode); -static Lisp_Object execute_optimized_program (CONST Opbyte *program, +static Lisp_Object execute_optimized_program (const Opbyte *program, int stack_depth, Lisp_Object *constants_data); @@ -473,7 +471,6 @@ funcall_compiled_function (Lisp_Object fun, int nargs, Lisp_Object args[]) { /* This function can GC */ - Lisp_Object symbol, tail; int speccount = specpdl_depth(); REGISTER int i = 0; Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun); @@ -488,24 +485,26 @@ and local variables of fun. So just reserve it once. */ SPECPDL_RESERVE (f->specpdl_depth); - /* Fmake_byte_code() guaranteed that f->arglist is a valid list - containing only non-constant symbols. */ - LIST_LOOP_3 (symbol, f->arglist, tail) - { - if (EQ (symbol, Qand_rest)) - { - tail = XCDR (tail); - symbol = XCAR (tail); - SPECBIND_FAST_UNSAFE (symbol, Flist (nargs - i, &args[i])); - goto run_code; - } - else if (EQ (symbol, Qand_optional)) - optional = 1; - else if (i == nargs && !optional) - goto wrong_number_of_arguments; - else - SPECBIND_FAST_UNSAFE (symbol, i < nargs ? args[i++] : Qnil); - } + { + /* Fmake_byte_code() guaranteed that f->arglist is a valid list + containing only non-constant symbols. */ + LIST_LOOP_3 (symbol, f->arglist, tail) + { + if (EQ (symbol, Qand_rest)) + { + tail = XCDR (tail); + symbol = XCAR (tail); + SPECBIND_FAST_UNSAFE (symbol, Flist (nargs - i, &args[i])); + goto run_code; + } + else if (EQ (symbol, Qand_optional)) + optional = 1; + else if (i == nargs && !optional) + goto wrong_number_of_arguments; + else + SPECBIND_FAST_UNSAFE (symbol, i < nargs ? args[i++] : Qnil); + } + } if (i < nargs) goto wrong_number_of_arguments; @@ -596,12 +595,12 @@ static Lisp_Object -execute_optimized_program (CONST Opbyte *program, +execute_optimized_program (const Opbyte *program, int stack_depth, Lisp_Object *constants_data) { /* This function can GC */ - REGISTER CONST Opbyte *program_ptr = (Opbyte *) program; + REGISTER const Opbyte *program_ptr = (Opbyte *) program; REGISTER Lisp_Object *stack_ptr = alloca_array (Lisp_Object, stack_depth + 1); int speccount = specpdl_depth (); @@ -1221,7 +1220,7 @@ Don't make this function static, since then the compiler might inline it. */ Lisp_Object * execute_rare_opcode (Lisp_Object *stack_ptr, - CONST Opbyte *program_ptr, + const Opbyte *program_ptr, Opcode opcode) { switch (opcode) @@ -1491,7 +1490,7 @@ sprintf (buf, "%s", error_message); va_start (args, error_message); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (buf), Qnil, -1, + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (buf), Qnil, -1, args); va_end (args); @@ -1607,14 +1606,14 @@ Lisp_Object instructions, Lisp_Object constants, /* out */ - Opbyte * CONST program, - int * CONST program_length, - int * CONST varbind_count) + Opbyte * const program, + int * const program_length, + int * const varbind_count) { size_t instructions_length = XSTRING_LENGTH (instructions); size_t comfy_size = 2 * instructions_length; - int * CONST icounts = alloca_array (int, comfy_size); + int * const icounts = alloca_array (int, comfy_size); int * icounts_ptr = icounts; /* We maintain a table of jumps in the source code. */ @@ -1623,13 +1622,13 @@ int from; int to; }; - struct jump * CONST jumps = alloca_array (struct jump, comfy_size); + struct jump * const jumps = alloca_array (struct jump, comfy_size); struct jump *jumps_ptr = jumps; Opbyte *program_ptr = program; - CONST Bufbyte *ptr = XSTRING_DATA (instructions); - CONST Bufbyte * CONST end = ptr + instructions_length; + const Bufbyte *ptr = XSTRING_DATA (instructions); + const Bufbyte * const end = ptr + instructions_length; *varbind_count = 0; @@ -2069,13 +2068,13 @@ /* Invert action performed by optimize_byte_code() */ Lisp_Opaque *opaque = XOPAQUE (f->instructions); - Bufbyte * CONST buffer = + Bufbyte * const buffer = alloca_array (Bufbyte, OPAQUE_SIZE (opaque) * MAX_EMCHAR_LEN); Bufbyte *bp = buffer; - CONST Opbyte * CONST program = (CONST Opbyte *) OPAQUE_DATA (opaque); - CONST Opbyte *program_ptr = program; - CONST Opbyte * CONST program_end = program_ptr + OPAQUE_SIZE (opaque); + const Opbyte * const program = (const Opbyte *) OPAQUE_DATA (opaque); + const Opbyte *program_ptr = program; + const Opbyte * const program_end = program_ptr + OPAQUE_SIZE (opaque); while (program_ptr < program_end) { @@ -2410,8 +2409,9 @@ void syms_of_bytecode (void) { - deferror (&Qinvalid_byte_code, "invalid-byte-code", - "Invalid byte code", Qerror); + INIT_LRECORD_IMPLEMENTATION (compiled_function); + + DEFERROR_STANDARD (Qinvalid_byte_code, Qinvalid_state); defsymbol (&Qbyte_code, "byte-code"); defsymbol (&Qcompiled_functionp, "compiled-function-p"); diff -r 72a7cfa4a488 -r abe6d1db359e src/callint.c --- a/src/callint.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/callint.c Mon Aug 13 11:35:02 2007 +0200 @@ -56,7 +56,7 @@ Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; #endif -Lisp_Object Qlet, QletX, Qsave_excursion; +Lisp_Object QletX, Qsave_excursion; Lisp_Object Qread_from_minibuffer; Lisp_Object Qread_file_name; @@ -193,8 +193,8 @@ } static Lisp_Object -callint_prompt (CONST Bufbyte *prompt_start, Bytecount prompt_length, - CONST Lisp_Object *args, int nargs) +callint_prompt (const Bufbyte *prompt_start, Bytecount prompt_length, + const Lisp_Object *args, int nargs) { Lisp_Object s = make_string (prompt_start, prompt_length); struct gcpro gcpro1; @@ -241,7 +241,7 @@ #endif /* If SPECS is a string, we reset prompt_data to string_data * (XSTRING (specs)) every time a GC might have occurred */ - CONST char *prompt_data = 0; + const char *prompt_data = 0; int prompt_index = 0; int argcount; int set_zmacs_region_stays = 0; @@ -425,7 +425,7 @@ for (;;) { if (STRINGP (specs)) - prompt_data = (CONST char *) XSTRING_DATA (specs); + prompt_data = (const char *) XSTRING_DATA (specs); if (prompt_data[prompt_index] == '+') error ("`+' is not used in `interactive' for ordinary commands"); @@ -486,7 +486,7 @@ us give to the function. */ argcount = 0; { - CONST char *tem; + const char *tem; for (tem = prompt_data + prompt_index; *tem; ) { /* 'r' specifications ("point and mark as 2 numeric args") @@ -495,7 +495,7 @@ argcount += 2; else argcount += 1; - tem = (CONST char *) strchr (tem + 1, '\n'); + tem = (const char *) strchr (tem + 1, '\n'); if (!tem) break; tem++; @@ -565,8 +565,8 @@ for (argnum = 0; ; argnum++) { - CONST char *prompt_start = prompt_data + prompt_index + 1; - CONST char *prompt_limit = (CONST char *) strchr (prompt_start, '\n'); + const char *prompt_start = prompt_data + prompt_index + 1; + const char *prompt_limit = (const char *) strchr (prompt_start, '\n'); int prompt_length; prompt_length = ((prompt_limit) ? (prompt_limit - prompt_start) @@ -580,7 +580,7 @@ prompts with "Set key C-x C-f to command: "instead of printing event objects in there. */ -#define PROMPT() callint_prompt ((CONST Bufbyte *) prompt_start, prompt_length, visargs, argnum) +#define PROMPT() callint_prompt ((const Bufbyte *) prompt_start, prompt_length, visargs, argnum) switch (prompt_data[prompt_index]) { case 'a': /* Symbol defined as a function */ @@ -909,7 +909,7 @@ if (!prompt_limit) break; if (STRINGP (specs)) - prompt_data = (CONST char *) XSTRING_DATA (specs); + prompt_data = (const char *) XSTRING_DATA (specs); prompt_index += prompt_length + 1 + 1; /* +1 to skip spec, +1 for \n */ } unbind_to (speccount, Qnil); @@ -993,7 +993,6 @@ defsymbol (&Qcommand_debug_status, "command-debug-status"); defsymbol (&Qenable_recursive_minibuffers, "enable-recursive-minibuffers"); - defsymbol (&Qlet, "let"); defsymbol (&QletX, "let*"); defsymbol (&Qsave_excursion, "save-excursion"); #if 0 /* ill-conceived */ diff -r 72a7cfa4a488 -r abe6d1db359e src/callproc.c --- a/src/callproc.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/callproc.c Mon Aug 13 11:35:02 2007 +0200 @@ -41,19 +41,19 @@ #include "syssignal.h" /* Always include before systty.h */ #include "systty.h" -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE #define _P_NOWAIT 1 /* from process.h */ #include "nt.h" #endif -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* When we are starting external processes we need to know whether they take binary input (no conversion) or text input (\n is converted to \r\n). Similarly for output: if newlines are written as \r\n then it's text process output, otherwise it's binary. */ Lisp_Object Vbinary_process_input; Lisp_Object Vbinary_process_output; -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ Lisp_Object Vshell_file_name; @@ -67,14 +67,14 @@ volatile int synch_process_alive; /* Nonzero => this is a string explaining death of synchronous subprocess. */ -CONST char *synch_process_death; +const char *synch_process_death; /* If synch_process_death is zero, this is exit code of synchronous subprocess. */ int synch_process_retcode; /* Clean up when exiting Fcall_process_internal. - On MSDOS, delete the temporary file on any kind of termination. + On Windows, delete the temporary file on any kind of termination. On Unix, kill the process and any children on termination by signal. */ /* Nonzero if this is termination due to exit. */ @@ -113,7 +113,7 @@ /* #### "c-G" -- need non-consing Single-key-description */ message ("Waiting for process to die...(type C-g again to kill it instantly)"); -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE { HANDLE pHandle = OpenProcess (PROCESS_ALL_ACCESS, 0, pid); if (pHandle == NULL) @@ -152,7 +152,7 @@ } #endif /* unused */ -DEFUN ("call-process-internal", Fcall_process_internal, 1, MANY, 0, /* +DEFUN ("old-call-process-internal", Fold_call_process_internal, 1, MANY, 0, /* Call PROGRAM synchronously in separate process, with coding-system specified. Arguments are (PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS). @@ -180,7 +180,7 @@ Lisp_Object infile, buffer, current_dir, display, path; int fd[2]; int filefd; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE HANDLE pHandle; #endif int pid; @@ -188,7 +188,7 @@ char *bufptr = buf; int bufsize = 16384; int speccount = specpdl_depth (); - struct gcpro gcpro1, gcpro2; + struct gcpro gcpro1, gcpro2, gcpro3; char **new_argv = alloca_array (char *, max (2, nargs - 2)); /* File to use for stderr in the child. @@ -235,7 +235,7 @@ NUNGCPRO; } - GCPRO1 (current_dir); + GCPRO2 (current_dir, path); if (nargs >= 2 && ! NILP (args[1])) { @@ -250,7 +250,7 @@ UNGCPRO; - GCPRO2 (infile, current_dir); /* Fexpand_file_name might trash it */ + GCPRO3 (infile, current_dir, path); /* Fexpand_file_name might trash it */ if (nargs >= 3) { @@ -348,28 +348,30 @@ fd_error = open (NULL_DEVICE, O_WRONLY | OPEN_BINARY); else if (STRINGP (error_file)) { - fd_error = open ((CONST char *) XSTRING_DATA (error_file), -#ifdef DOS_NT + fd_error = open ((const char *) XSTRING_DATA (error_file), +#ifdef WIN32_NATIVE O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, S_IREAD | S_IWRITE -#else /* not DOS_NT */ +#else /* not WIN32_NATIVE */ O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, CREAT_MODE -#endif /* not DOS_NT */ +#endif /* not WIN32_NATIVE */ ); } if (fd_error < 0) { + int save_errno = errno; close (filefd); close (fd[0]); if (fd1 >= 0) close (fd1); + errno = save_errno; report_file_error ("Cannot open", Fcons(error_file, Qnil)); } fork_error = Qnil; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE pid = child_setup (filefd, fd1, fd_error, new_argv, (char *) XSTRING_DATA (current_dir)); if (!INTP (buffer)) @@ -389,7 +391,7 @@ /* Close STDERR into the parent process. We no longer need it. */ if (fd_error >= 0) close (fd_error); -#else /* not WINDOWSNT */ +#else /* not WIN32_NATIVE */ pid = fork (); if (pid == 0) @@ -410,7 +412,7 @@ if (fd_error >= 0) close (fd_error); -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ environ = save_environ; @@ -424,11 +426,13 @@ if (!NILP (fork_error)) signal_error (Qfile_error, fork_error); -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE if (pid < 0) { + int save_errno = errno; if (fd[0] >= 0) close (fd[0]); + errno = save_errno; report_file_error ("Doing fork", Qnil); } #endif @@ -502,7 +506,7 @@ break; #if 0 -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Until we pull out of MULE things like make_decoding_input_stream(), we do the following which is less elegant. --marcpa */ @@ -542,7 +546,7 @@ QUIT; /* Wait for it to terminate, unless it already has. */ -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE wait_for_termination (pHandle); #else wait_for_termination (pid); @@ -602,31 +606,48 @@ a decent error from within the child, this should be verified as an executable directory by the parent. */ -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE int #else void #endif child_setup (int in, int out, int err, char **new_argv, - CONST char *current_dir) + const char *current_dir) { char **env; char *pwd; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE int cpid; HANDLE handles[4]; -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ #ifdef SET_EMACS_PRIORITY if (emacs_priority != 0) nice (- emacs_priority); #endif -#if !defined (NO_SUBPROCESSES) && !defined (WINDOWSNT) + /* Under Windows, we are not in a child process at all, so we should + not close handles inherited from the parent -- we are the parent + and doing so will screw up all manner of things! Similarly, most + of the rest of the cleanup done in this function is not done + under Windows. + + #### This entire child_setup() function is an utter and complete + piece of shit. I would rewrite it, at the very least splitting + out the Windows and non-Windows stuff into two completely + different functions; but instead I'm trying to make it go away + entirely, using the Lisp definition in process.el. What's left + is to fix up the routines in event-msw.c (and in event-Xt.c and + event-tty.c) to allow for stream devices to be handled correctly. + There isn't much to do, in fact, and I'll fix it shortly. That + way, the Lisp definition can be used non-interactively too. */ +#if !defined (NO_SUBPROCESSES) && !defined (WIN32_NATIVE) /* Close Emacs's descriptors that this process should not have. */ close_process_descs (); #endif /* not NO_SUBPROCESSES */ +#ifndef WIN32_NATIVE close_load_descs (); +#endif /* Note that use of alloca is always safe here. It's obvious for systems that do not have true vfork or that have true (stack) alloca. @@ -721,10 +742,10 @@ *new_env = 0; } -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE prepare_standard_handles (in, out, err, handles); set_process_dir (current_dir); -#else /* not WINDOWSNT */ +#else /* not WIN32_NATIVE */ /* Make sure that in, out, and err are not actually already in descriptors zero, one, or two; this could happen if Emacs is started with its standard in, out, or error closed, as might @@ -755,22 +776,22 @@ for (fd=3; fd<=64; fd++) close (fd); } -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ #ifdef vipc something missing here; #endif /* vipc */ -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* Spawn the child. (See ntproc.c:Spawnve). */ - cpid = spawnve (_P_NOWAIT, new_argv[0], (CONST char* CONST*)new_argv, - (CONST char* CONST*)env); + cpid = spawnve (_P_NOWAIT, new_argv[0], (const char* const*)new_argv, + (const char* const*)env); if (cpid == -1) /* An error occurred while trying to spawn the process. */ report_file_error ("Spawning child process", Qnil); reset_standard_handles (in, out, err, handles); return cpid; -#else /* not WINDOWSNT */ +#else /* not WIN32_NATIVE */ /* execvp does not accept an environment arg so the only way to pass this environment is to set environ. Our caller is responsible for restoring the ambient value of environ. */ @@ -779,11 +800,11 @@ stdout_out ("Can't exec program %s\n", new_argv[0]); _exit (1); -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ } static int -getenv_internal (CONST Bufbyte *var, +getenv_internal (const Bufbyte *var, Bytecount varlen, Bufbyte **value, Bytecount *valuelen) @@ -797,12 +818,12 @@ if (STRINGP (entry) && XSTRING_LENGTH (entry) > varlen && XSTRING_BYTE (entry, varlen) == '=' -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* NT environment variables are case insensitive. */ && ! memicmp (XSTRING_DATA (entry), var, varlen) -#else /* not WINDOWSNT */ +#else /* not WIN32_NATIVE */ && ! memcmp (XSTRING_DATA (entry), var, varlen) -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ ) { *value = XSTRING_DATA (entry) + (varlen + 1); @@ -846,12 +867,13 @@ /* A version of getenv that consults process_environment, easily callable from C. */ char * -egetenv (CONST char *var) +egetenv (const char *var) { + /* This cannot GC -- 7-28-00 ben */ Bufbyte *value; Bytecount valuelen; - if (getenv_internal ((CONST Bufbyte *) var, strlen (var), &value, &valuelen)) + if (getenv_internal ((const Bufbyte *) var, strlen (var), &value, &valuelen)) return (char *) value; else return 0; @@ -875,11 +897,11 @@ { /* Initialize shell-file-name from environment variables or best guess. */ -#ifdef WINDOWSNT - CONST char *shell = egetenv ("COMSPEC"); +#ifdef WIN32_NATIVE + const char *shell = egetenv ("COMSPEC"); if (!shell) shell = "\\WINNT\\system32\\cmd.exe"; -#else /* not WINDOWSNT */ - CONST char *shell = egetenv ("SHELL"); +#else /* not WIN32_NATIVE */ + const char *shell = egetenv ("SHELL"); if (!shell) shell = "/bin/sh"; #endif @@ -906,7 +928,7 @@ void syms_of_callproc (void) { - DEFSUBR (Fcall_process_internal); + DEFSUBR (Fold_call_process_internal); DEFSUBR (Fgetenv); } @@ -914,7 +936,7 @@ vars_of_callproc (void) { /* This function can GC */ -#ifdef DOS_NT +#ifdef WIN32_NATIVE DEFVAR_LISP ("binary-process-input", &Vbinary_process_input /* *If non-nil then new subprocesses are assumed to take binary input. */ ); @@ -924,7 +946,7 @@ *If non-nil then new subprocesses are assumed to produce binary output. */ ); Vbinary_process_output = Qnil; -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ DEFVAR_LISP ("shell-file-name", &Vshell_file_name /* *File name to load inferior shells from. diff -r 72a7cfa4a488 -r abe6d1db359e src/casetab.c --- a/src/casetab.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/casetab.c Mon Aug 13 11:35:02 2007 +0200 @@ -189,7 +189,8 @@ set_case_table (Lisp_Object table, int standard) { Lisp_Object down, up, canon, eqv, tail = table; - struct buffer *buf = current_buffer; + struct buffer *buf = + standard ? XBUFFER(Vbuffer_defaults) : current_buffer; check_case_table (table); @@ -242,19 +243,17 @@ Vmirror_ascii_eqv_table = make_mirror_trt_table (eqv); #endif } - else - { - buf->downcase_table = down; - buf->upcase_table = up; - buf->case_canon_table = canon; - buf->case_eqv_table = eqv; + buf->downcase_table = down; + buf->upcase_table = up; + buf->case_canon_table = canon; + buf->case_eqv_table = eqv; #ifdef MULE - buf->mirror_downcase_table = make_mirror_trt_table (down); - buf->mirror_upcase_table = make_mirror_trt_table (up); - buf->mirror_case_canon_table = make_mirror_trt_table (canon); - buf->mirror_case_eqv_table = make_mirror_trt_table (eqv); + buf->mirror_downcase_table = make_mirror_trt_table (down); + buf->mirror_upcase_table = make_mirror_trt_table (up); + buf->mirror_case_canon_table = make_mirror_trt_table (canon); + buf->mirror_case_eqv_table = make_mirror_trt_table (eqv); #endif - } + return table; } diff -r 72a7cfa4a488 -r abe6d1db359e src/chartab.c --- a/src/chartab.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/chartab.c Mon Aug 13 11:35:02 2007 +0200 @@ -1804,7 +1804,11 @@ void syms_of_chartab (void) { + INIT_LRECORD_IMPLEMENTATION (char_table); + #ifdef MULE + INIT_LRECORD_IMPLEMENTATION (char_table_entry); + defsymbol (&Qcategory_table_p, "category-table-p"); defsymbol (&Qcategory_designator_p, "category-designator-p"); defsymbol (&Qcategory_table_value_p, "category-table-value-p"); diff -r 72a7cfa4a488 -r abe6d1db359e src/chartab.h --- a/src/chartab.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/chartab.h Mon Aug 13 11:35:02 2007 +0200 @@ -135,9 +135,9 @@ int leading_byte, Emchar c); -INLINE Lisp_Object +INLINE_HEADER Lisp_Object CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (Lisp_Char_Table *ct, Emchar ch); -INLINE Lisp_Object +INLINE_HEADER Lisp_Object CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (Lisp_Char_Table *ct, Emchar ch) { unsigned char lb = CHAR_LEADING_BYTE (ch); @@ -158,6 +158,9 @@ #endif /* not MULE */ +#define XCHAR_TABLE_VALUE_UNSAFE(ct, ch) \ + CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE (ct), ch) + enum chartab_range_type { CHARTAB_RANGE_ALL, diff -r 72a7cfa4a488 -r abe6d1db359e src/cm.c --- a/src/cm.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/cm.c Mon Aug 13 11:35:02 2007 +0200 @@ -33,14 +33,8 @@ #define EXPENSIVE 2000 -#ifdef __cplusplus -extern "C" { -#endif -extern char *tgoto (CONST char *cm, int hpos, int vpos); -extern void tputs (CONST char *, int, void (*)(int)); -#ifdef __cplusplus -} -#endif +EXTERN_C char *tgoto (const char *cm, int hpos, int vpos); +EXTERN_C int tputs (const char *, int, void (*)(int)); static void cmgoto_for_real (struct console *c, int row, int col); diff -r 72a7cfa4a488 -r abe6d1db359e src/cm.h --- a/src/cm.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/cm.h Mon Aug 13 11:35:02 2007 +0200 @@ -46,25 +46,25 @@ int cm_curX; /* Current column */ /* Capabilities from termcap */ - CONST char *cm_up; /* up (up) */ - CONST char *cm_down; /* down (do) */ - CONST char *cm_left; /* left (le) */ - CONST char *cm_right; /* right (nd) */ - CONST char *cm_home; /* home (ho) */ - CONST char *cm_cr; /* carriage return (cr) */ - CONST char *cm_ll; /* last line (ll) */ + const char *cm_up; /* up (up) */ + const char *cm_down; /* down (do) */ + const char *cm_left; /* left (le) */ + const char *cm_right; /* right (nd) */ + const char *cm_home; /* home (ho) */ + const char *cm_cr; /* carriage return (cr) */ + const char *cm_ll; /* last line (ll) */ #endif /* 0 */ - CONST char *cm_tab; /* tab (ta) */ - CONST char *cm_backtab; /* backtab (bt) */ + const char *cm_tab; /* tab (ta) */ + const char *cm_backtab; /* backtab (bt) */ #if 0 - CONST char *cm_abs; /* absolute (cm) */ - CONST char *cm_habs; /* horizontal absolute (ch) */ - CONST char *cm_vabs; /* vertical absolute (cv) */ - CONST char *cm_ds; /* "don't send" string (ds) */ - CONST char *cm_multiup; /* multiple up (UP) */ - CONST char *cm_multidown; /* multiple down (DO) */ - CONST char *cm_multileft; /* multiple left (LE) */ - CONST char *cm_multiright; /* multiple right (RI) */ + const char *cm_abs; /* absolute (cm) */ + const char *cm_habs; /* horizontal absolute (ch) */ + const char *cm_vabs; /* vertical absolute (cv) */ + const char *cm_ds; /* "don't send" string (ds) */ + const char *cm_multiup; /* multiple up (UP) */ + const char *cm_multidown; /* multiple down (DO) */ + const char *cm_multileft; /* multiple left (LE) */ + const char *cm_multiright; /* multiple right (RI) */ int cm_cols; /* number of cols on frame (co) */ int cm_rows; /* number of rows on frame (li) */ int cm_tabwidth; /* tab width (it) */ diff -r 72a7cfa4a488 -r abe6d1db359e src/cmdloop.c --- a/src/cmdloop.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/cmdloop.c Mon Aug 13 11:35:02 2007 +0200 @@ -121,6 +121,10 @@ stderr_out ("*** Backtrace\n"); Fbacktrace (Qexternal_debugging_output, Qt); stderr_out ("*** Killing XEmacs\n"); +#ifdef HAVE_MS_WINDOWS + Fmswindows_message_box (build_string ("Initialization error"), + Qnil, Qnil); +#endif return Fkill_emacs (make_int (-1)); } diff -r 72a7cfa4a488 -r abe6d1db359e src/cmds.c --- a/src/cmds.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/cmds.c Mon Aug 13 11:35:02 2007 +0200 @@ -41,6 +41,9 @@ /* This is the command that set up Vself_insert_face. */ Lisp_Object Vself_insert_face_command; + +/* A char-table for characters which may invoke auto-filling. */ +Lisp_Object Vauto_fill_chars; DEFUN ("forward-char", Fforward_char, 0, 2, "_p", /* Move point right N characters (left if N negative). @@ -396,7 +399,9 @@ #endif /* FSFmacs */ } } - if ((c1 == ' ' || c1 == '\n') + if ((CHAR_TABLEP (Vauto_fill_chars) + ? !NILP (XCHAR_TABLE_VALUE_UNSAFE (Vauto_fill_chars, c1)) + : (c1 == ' ' || c1 == '\n')) && !noautofill && !NILP (buf->auto_fill_function)) { @@ -498,4 +503,12 @@ More precisely, a char with closeparen syntax is self-inserted. */ ); Vblink_paren_function = Qnil; + + DEFVAR_LISP ("auto-fill-chars", &Vauto_fill_chars /* +A char-table for characters which invoke auto-filling. +Such characters has value t in this table. +*/); + Vauto_fill_chars = Fmake_char_table (Qgeneric); + XCHAR_TABLE (Vauto_fill_chars)->ascii[' '] = Qt; + XCHAR_TABLE (Vauto_fill_chars)->ascii['\n'] = Qt; } diff -r 72a7cfa4a488 -r abe6d1db359e src/config.h.in --- a/src/config.h.in Mon Aug 13 11:33:40 2007 +0200 +++ b/src/config.h.in Mon Aug 13 11:35:02 2007 +0200 @@ -26,6 +26,7 @@ #ifndef _SRC_CONFIG_H_ #define _SRC_CONFIG_H_ + /* alloca twiddling belongs in one place, not the s&m headers AIX requires this to be the first thing in the file. */ #undef HAVE_ALLOCA_H @@ -38,15 +39,17 @@ #elif defined(_AIX) #pragma alloca #elif ! defined (alloca) -char *alloca(); +char *alloca (); #endif #endif /* C code */ - /* Use this to add code in a structured way to FSF-maintained source files so as to make it obvious where XEmacs changes are. */ #define XEMACS 1 +/* Program name */ +#undef EMACS_PROGNAME + /* Allow s&m files to differentiate OS versions without having multiple files to maintain. */ #undef OS_RELEASE @@ -70,12 +73,24 @@ #undef INFODOCK_MINOR_VERSION #undef INFODOCK_BUILD_VERSION +/* Make functions from IEEE Stds 1003.[123] available. */ +#undef _POSIX_C_SOURCE + +/* Make some functions from Unix98 available. */ +#undef _XOPEN_SOURCE + +/* Make "extensions" from Unix98 available. */ +#undef _XOPEN_SOURCE_EXTENDED + /* Make all functions available on AIX. See AC_AIX. */ #undef _ALL_SOURCE /* Make all functions available on GNU libc systems. See features.h. */ #undef _GNU_SOURCE +/* Make all functions available on Solaris 2 systems. */ +#undef __EXTENSIONS__ + /* Used to identify the XEmacs version in stack traces. */ #undef STACK_TRACE_EYE_CATCHER @@ -164,6 +179,10 @@ #undef THIS_IS_X11R5 #undef THIS_IS_X11R6 +#undef HAVE_XCONVERTCASE + +#undef HAVE_BALLOON_HELP + /* Where do we find bitmaps? */ #undef BITMAPDIR @@ -184,30 +203,29 @@ /* Some things figured out by the configure script, grouped as they are in configure.in. */ #undef HAVE_MCHECK_H +#undef HAVE_A_OUT_H +#undef HAVE_CYGWIN_VERSION_H +#undef HAVE_FCNTL_H +#undef HAVE_INTTYPES_H +#undef HAVE_LIBGEN_H +#undef HAVE_LOCALE_H #undef HAVE_MACH_MACH_H -#undef HAVE_SYS_STROPTS_H +#undef HAVE_SYS_PARAM_H +#undef HAVE_SYS_PSTAT_H +#undef HAVE_SYS_TIME_H #undef HAVE_SYS_TIMEB_H -#undef HAVE_SYS_TIME_H +#undef HAVE_SYS_UN_H +#undef HAVE_ULIMIT_H #undef HAVE_UNISTD_H #undef HAVE_UTIME_H + #undef HAVE_SYS_WAIT_H #undef HAVE_LIBINTL_H -#undef HAVE_LIBGEN_H -#undef HAVE_LOCALE_H -#undef HAVE_FCNTL_H -#undef HAVE_ULIMIT_H #undef HAVE_X11_XLOCALE_H -#undef HAVE_LINUX_VERSION_H -#undef HAVE_CYGWIN_VERSION_H -#undef HAVE_INTTYPES_H -#undef HAVE_SYS_UN_H -#undef HAVE_A_OUT_H #undef STDC_HEADERS #undef TIME_WITH_SYS_TIME #undef WORDS_BIGENDIAN #undef HAVE_VFORK_H -#undef HAVE_KSTAT_H -#undef HAVE_SYS_PSTAT_H #undef vfork #undef HAVE_LONG_FILE_NAMES @@ -224,7 +242,6 @@ #undef HAVE_SHLIB #undef HAVE_DLFCN_H -#undef HAVE_LIBKSTAT #undef HAVE_LIBINTL #undef HAVE_LIBDNET #undef HAVE_LIBRESOLV @@ -243,6 +260,13 @@ #undef HAVE_TM_ZONE #undef HAVE_TZNAME +/* For `getloadavg' provided by system */ +#undef HAVE_GETLOADAVG +#undef HAVE_SYS_LOADAVG_H +/* For implementing `getloadavg' ourselves */ +#undef HAVE_LIBKSTAT +#undef HAVE_KSTAT_H + /* Is `h_errno' declared by ? */ #undef HAVE_H_ERRNO @@ -274,7 +298,6 @@ #undef HAVE_GETTIMEOFDAY #undef HAVE_GETWD #undef HAVE_GETCWD -#undef HAVE_GETPT #undef HAVE_LOGB #undef HAVE_LRAND48 #undef HAVE_MATHERR @@ -298,7 +321,6 @@ #undef HAVE_SIGSETJMP #undef HAVE_SNPRINTF #undef HAVE_STPCPY -#undef HAVE_STRCASECMP #undef HAVE_STRERROR #undef HAVE_TZSET #undef HAVE_ULIMIT @@ -306,6 +328,22 @@ #undef HAVE_UTIMES #undef HAVE_WAITPID #undef HAVE_VSNPRINTF + +/* PTY support functions */ +#undef HAVE_GETPT /* glibc's easy pty allocation function */ +#undef HAVE__GETPT /* SGI's easy pty allocation function */ +#undef HAVE_OPENPTY /* BSD's easy pty allocation function */ +#undef HAVE_GRANTPT /* Unix98 */ +#undef HAVE_UNLOCKPT /* Unix98 */ +#undef HAVE_PTSNAME /* Unix98 */ +#undef HAVE_KILLPG /* BSD */ +#undef HAVE_TCGETPGRP /* Posix 1 */ +#undef HAVE_ISASTREAM /* SysV streams */ +#undef HAVE_PTY_H /* Linux, Tru64 openpty */ +#undef HAVE_LIBUTIL_H /* BSD openpty */ +#undef HAVE_SYS_STROPTS_H /* SysV streams */ +#undef HAVE_SYS_STRTIO_H /* SysV streams TIOCSIGNAL */ + #undef HAVE_SOCKETS #undef HAVE_SOCKADDR_SUN_LEN #undef HAVE_MULTICAST @@ -359,7 +397,7 @@ /* Compile in support for Berkeley DB style databases? May require libdb. */ #undef HAVE_BERKELEY_DB /* Full #include file path for Berkeley DB's db.h */ -#undef DB_H_PATH +#undef DB_H_FILE /* Do we have either DBM or Berkeley DB database support? */ #undef HAVE_DATABASE @@ -375,6 +413,11 @@ /* Does the library define ldap_parse_result () ? */ #undef HAVE_LDAP_PARSE_RESULT +/* Do we have PostgreSQL RDBMS support? */ +#undef HAVE_POSTGRESQL +#undef HAVE_POSTGRESQLV7 +#undef LIBPQ_FE_H_FILE /* main PostgreSQL header file */ + /* Do you have the Xauth library present? This will add some extra functionality to gnuserv. */ #undef HAVE_XAUTH @@ -385,8 +428,8 @@ /* Compile in support for ncurses? */ #undef HAVE_NCURSES /* Full #include file paths for ncurses' curses.h and term.h. */ -#undef CURSES_H_PATH -#undef TERM_H_PATH +#undef CURSES_H_FILE +#undef TERM_H_FILE /* Define USE_ASSERTIONS if you want the abort() to be changed to assert(). If the assertion fails, assert_failed() will be called. This is @@ -424,6 +467,11 @@ /* Attempt to catch bugs related to garbage collection (e.g. not GCPRO'ing). */ #undef ERROR_CHECK_GC +#ifdef ERROR_CHECK_GC +#define gc_checking_assert(assertion) assert (assertion) +#else +#define gc_checking_assert(assertion) +#endif /* Attempt to catch freeing of a non-malloc()ed block, heap corruption, etc. */ #undef ERROR_CHECK_MALLOC @@ -432,6 +480,10 @@ debugging the byte compiler. */ #undef ERROR_CHECK_BYTE_CODE +/* Minor sanity checking of glyphs, especially subwindows and + widgets. */ +#undef ERROR_CHECK_GLYPHS + /* Define DEBUG_XEMACS if you want extra debugging code compiled in. This is mainly intended for use by developers. */ #undef DEBUG_XEMACS @@ -511,16 +563,18 @@ /* Enable special GNU Make features in the Makefiles. */ #undef USE_GNU_MAKE -/* Debugging option: Don't automatically rebuild the DOC file. - This saves a lot of time when you're repeatedly - compiling-running-crashing. */ -#undef NO_DOC_FILE +/* Debugging development option: Remove inessential but time consuming + actions from happening during build. This saves a lot of time when + you're repeatedly compiling-running-crashing. 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.) + */ +#undef QUICK_BUILD /* Defined by AC_C_CONST in configure.in */ #undef const -#define CONST const - /* Allow the source to use standard types. Include these before the s&m files so that they can use them. */ #undef ssize_t @@ -530,37 +584,35 @@ #undef off_t #undef uid_t #undef gid_t +#undef socklen_t /* If defined, use unions instead of ints. A few systems (DEC Alpha) seem to require this, probably because something with the int definitions isn't right with 64-bit systems. */ #undef USE_UNION_TYPE -/* The configuration script defines opsysfile to be the name of the - s/...h file that describes the system type you are using. - The file is chosen based on the configuration name you give. - - See the file ../etc/MACHINES for a list of systems and the - configuration names to use for them. - - See s/template.h for documentation on writing s/...h files. */ +/* The configuration script may define `opsysfile' to be the name of + the s/...h file that describes your operating system. + The file name is chosen based on the configuration name. */ #if defined (__cplusplus) && !defined (NOT_C_CODE) extern "C" { #endif + #undef config_opsysfile +#ifdef config_opsysfile #include config_opsysfile - -/* The configuration script defines machfile to be the name of the - m/...h file that describes the machine you are using. The file is - chosen based on the configuration name you give. +#endif - See the file ../etc/MACHINES for a list of machines and the - configuration names to use for them. +/* The configuration script may define `machfile' to be the name of + the m/...h file that describes the machine you are using. + The file name is chosen based on the configuration name. */ - See m/template.h for documentation on writing m/...h files. */ #undef config_machfile +#ifdef config_machfile #include config_machfile +#endif + #if defined (__cplusplus) && !defined (NOT_C_CODE) } #endif @@ -595,7 +647,7 @@ "SUNWaudmo" package.) */ #undef HAVE_NATIVE_SOUND /* Native sound may be provided via soundcard.h, in various directories */ -#undef SOUNDCARD_H_PATH +#undef SOUNDCARD_H_FILE /* Compile in support for NAS (Network Audio System)? NAS_NO_ERROR_JUMP means that the NAS libraries don't include some @@ -612,7 +664,7 @@ /* Compile in support for Tooltalk? */ #undef TOOLTALK /* tt_c.h might be in "Tt" or "desktop" subdirectories */ -#undef TT_C_H_PATH +#undef TT_C_H_FILE /* Toolkits used by lwlib for various widgets... */ #undef LWLIB_USES_MOTIF @@ -730,10 +782,6 @@ # define CANNA_PURESIZE 0 #endif /* not CANNA */ -#if (defined (MSDOS) && defined (FEPCTRL)) || (defined (WIN32) && defined (USE_IME)) -#define HAVE_FEP -#endif - #if defined (HAVE_SOCKS) && !defined (DO_NOT_SOCKSIFY) #define accept Raccept #define bind Rbind @@ -757,38 +805,35 @@ #define LONG_LONG_BITS (SIZEOF_LONG_LONG * BITS_PER_CHAR) #define VOID_P_BITS (SIZEOF_VOID_P * BITS_PER_CHAR) -#ifndef NOT_C_CODE -#ifdef __cplusplus -#define HAVE_INLINE 1 -#define INLINE inline -#else /* not C++ */ +/* Use `INLINE_HEADER' to define inline functions in .h files. + Use `inline static' to define inline functions in .c files. + See the Internals manual for examples and more information. */ + /* Does the keyword `inline' exist? */ -#undef HAVE_INLINE #undef inline -# ifdef HAVE_INLINE -# ifdef __GNUC__ -# ifdef DONT_EXTERN_INLINE_FUNCTIONS -# define INLINE inline -# else -# define INLINE extern inline -# endif -# else -# define INLINE static inline -# endif /* __GNUC__ */ -# else -# define INLINE static -# endif /* HAVE_INLINE */ -#endif /* not C++ */ -#endif /* C code */ +#if defined (__cplusplus) || ! defined (__GNUC__) +# define INLINE_HEADER inline static +#elif defined (DONT_EXTERN_INLINE_HEADER_FUNCTIONS) +# define INLINE_HEADER inline +#else +# define INLINE_HEADER inline extern +#endif -#if defined (__cplusplus) && !defined (NOT_C_CODE) +#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 -#endif /* C++ */ +# define class c_class +# define new c_new +# define this c_this +# define catch c_catch +# define not c_not + +# define EXTERN_C extern "C" +# else /* C code */ +# define EXTERN_C extern +# endif +#endif /* C or C++ */ /* Strictly speaking, only int or unsigned int are valid types in a bitfield. In practice, we would like to use enums as bitfields. @@ -836,7 +881,6 @@ #undef SITELISPDIR_USER_DEFINED #undef ARCHLIBDIR_USER_DEFINED #undef ETCDIR_USER_DEFINED -#undef LOCKDIR_USER_DEFINED #undef INFODIR_USER_DEFINED #undef INFOPATH_USER_DEFINED diff -r 72a7cfa4a488 -r abe6d1db359e src/console-msw.c --- a/src/console-msw.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/console-msw.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,5 +1,5 @@ /* Console functions for mswindows. - Copyright (C) 1996 Ben Wing. + Copyright (C) 1996, 2000 Ben Wing. This file is part of XEmacs. @@ -29,11 +29,50 @@ #include #include "lisp.h" +#include "buffer.h" #include "console-msw.h" +#include "events.h" +#include "opaque.h" DEFINE_CONSOLE_TYPE (mswindows); DEFINE_CONSOLE_TYPE (msprinter); +Lisp_Object Qabortretryignore; +Lisp_Object Qapplmodal; +Lisp_Object Qdefault_desktop_only; +Lisp_Object Qdefbutton1; +Lisp_Object Qdefbutton2; +Lisp_Object Qdefbutton3; +Lisp_Object Qdefbutton4; +/* Lisp_Object Qhelp; */ +Lisp_Object Qiconasterisk; +Lisp_Object Qiconexclamation; +Lisp_Object Qiconhand; +Lisp_Object Qiconinformation; +Lisp_Object Qiconquestion; +Lisp_Object Qiconstop; +/* Lisp_Object Qok; */ +Lisp_Object Qokcancel; +Lisp_Object Qretrycancel; +/* Lisp_Object Qright; */ +Lisp_Object Qrtlreading; +Lisp_Object Qservice_notification; +Lisp_Object Qsetforeground; +Lisp_Object Qsystemmodal; +Lisp_Object Qtaskmodal; +Lisp_Object Qtopmost; +Lisp_Object Qyesno; +Lisp_Object Qyesnocancel; + +/* Lisp_Object Qabort; */ +/* Lisp_Object Qcancel; */ +/* Lisp_Object Qignore; */ +/* Lisp_Object Qno; */ +/* Lisp_Object Qok; */ +/* Lisp_Object Qretry; */ +/* Lisp_Object Qyes; */ + + /************************************************************************/ /* mswindows console methods */ /************************************************************************/ @@ -44,6 +83,69 @@ return 1; } +static HWND mswindows_console_hwnd = 0; + +#define KLUDGE_BUFSIZE 1024 /* buffer size for console window titles */ + +/* Direct from the horse's mouth: Microsoft KB article Q124103 */ +static HWND +GetConsoleHwnd (void) +{ + HWND hwndFound; /* this is what is returned to the caller */ + char pszNewWindowTitle[KLUDGE_BUFSIZE]; /* contains fabricated WindowTitle */ + char pszOldWindowTitle[KLUDGE_BUFSIZE]; /* contains original WindowTitle */ + + /* fetch current window title */ + + GetConsoleTitle(pszOldWindowTitle, KLUDGE_BUFSIZE); + + /* format a "unique" NewWindowTitle */ + + wsprintf(pszNewWindowTitle,"%d/%d", + GetTickCount(), + GetCurrentProcessId()); + + /* change current window title */ + + SetConsoleTitle(pszNewWindowTitle); + + /* ensure window title has been updated */ + + Sleep(40); + + /* look for NewWindowTitle */ + + hwndFound=FindWindow(NULL, pszNewWindowTitle); + + /* restore original window title */ + + SetConsoleTitle(pszOldWindowTitle); + + return(hwndFound); +} + +HWND +mswindows_get_console_hwnd (void) +{ + if (!mswindows_console_hwnd) + mswindows_console_hwnd = GetConsoleHwnd (); + return mswindows_console_hwnd; +} + +static int +mswindows_ensure_console_allocated (void) +{ + HWND fgwin = GetForegroundWindow (); + /* stupid mswin api won't let you create the console window + hidden! creating it changes the focus! fuck me! */ + if (AllocConsole ()) + { + SetForegroundWindow (fgwin); + return 1; + } + return 0; +} + static Lisp_Object mswindows_canonicalize_console_connection (Lisp_Object connection, Error_behavior errb) @@ -71,6 +173,435 @@ return mswindows_canonicalize_console_connection (connection, errb); } +void +mswindows_hide_console (void) +{ + ShowWindow (mswindows_get_console_hwnd (), SW_HIDE); +} + +void +mswindows_show_console (void) +{ + /* What I really want is for the console window to appear on top of other + windows, but NOT get the focus. This seems hard-to-impossible under + Windows. The following sequence seems to do the best possible, along + with keeping the console window on top when xemacs --help is used. */ + HWND hwnd = mswindows_get_console_hwnd (); + HWND hwndf = GetFocus (); + ShowWindow (hwnd, SW_SHOW); + BringWindowToTop (hwnd); + SetFocus (hwndf); +} + +static int mswindows_console_buffered = 0; +HANDLE mswindows_console_buffer; + +static void +mswindows_ensure_console_buffered (void) +{ + if (!mswindows_console_buffered) + { + COORD new_size; + + new_size.X = 80; + new_size.Y = 1000; + mswindows_ensure_console_allocated (); + mswindows_console_buffer = + CreateConsoleScreenBuffer (GENERIC_WRITE, 0, NULL, + CONSOLE_TEXTMODE_BUFFER, NULL); + SetConsoleScreenBufferSize (mswindows_console_buffer, new_size); + SetConsoleActiveScreenBuffer (mswindows_console_buffer); + mswindows_console_buffered = 1; + } +} + +int mswindows_message_outputted; + +int +mswindows_output_console_string (CONST Extbyte *str, Extcount len) +{ + DWORD num_written; + + mswindows_message_outputted = 1; + mswindows_ensure_console_buffered (); + mswindows_show_console (); + return WriteConsole (mswindows_console_buffer, str, len, &num_written, NULL); +} + +/* Determine if running on Windows 9x and not NT */ +int +mswindows_windows9x_p (void) +{ + return GetVersion () & 0x80000000; +} + +DEFUN ("mswindows-debugging-output", Fmswindows_debugging_output, 1, 1, 0, /* +Write CHAR-OR-STRING to the Windows debugger, using OutputDebugString(). +This function can be used as the STREAM argument of Fprint() or the like. +*/ + (char_or_string)) +{ + Extbyte *extstr; + + if (STRINGP (char_or_string)) + { + TO_EXTERNAL_FORMAT (LISP_STRING, char_or_string, + C_STRING_ALLOCA, extstr, + Qmswindows_tstr); + OutputDebugString (extstr); + } + else + { + Bufbyte str[MAX_EMCHAR_LEN + 1]; + Bytecount len; + + CHECK_CHAR_COERCE_INT (char_or_string); + len = set_charptr_emchar (str, XCHAR (char_or_string)); + str[len] = '\0'; + TO_EXTERNAL_FORMAT (C_STRING, str, + C_STRING_ALLOCA, extstr, + Qmswindows_tstr); + OutputDebugString (extstr); + } + + return char_or_string; +} + +#ifdef DEBUG_XEMACS + +/* + * Random helper functions for debugging. + * Intended for use in the MSVC "Watch" window which doesn't like + * the aborts that the error_check_foo() functions can make. + */ +struct lrecord_header *DHEADER (Lisp_Object obj); +struct lrecord_header * +DHEADER (Lisp_Object obj) +{ + return LRECORDP (obj) ? XRECORD_LHEADER (obj) : NULL; +} + +void *DOPAQUE_DATA (Lisp_Object obj); +void * +DOPAQUE_DATA (Lisp_Object obj) +{ + return OPAQUEP (obj) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL; +} + +Lisp_Event *DEVENT (Lisp_Object obj); +Lisp_Event * +DEVENT (Lisp_Object obj) +{ + return EVENTP (obj) ? XEVENT (obj) : NULL; +} + +Lisp_Cons *DCONS (Lisp_Object obj); +Lisp_Cons * +DCONS (Lisp_Object obj) +{ + return CONSP (obj) ? XCONS (obj) : NULL; +} + +Lisp_Cons *DCONSCDR (Lisp_Object obj); +Lisp_Cons * +DCONSCDR (Lisp_Object obj) +{ + return (CONSP (obj) && CONSP (XCDR (obj))) ? XCONS (XCDR (obj)) : 0; +} + +Bufbyte *DSTRING (Lisp_Object obj); +Bufbyte * +DSTRING (Lisp_Object obj) +{ + return STRINGP (obj) ? XSTRING_DATA (obj) : NULL; +} + +Lisp_Vector *DVECTOR (Lisp_Object obj); +Lisp_Vector * +DVECTOR (Lisp_Object obj) +{ + return VECTORP (obj) ? XVECTOR (obj) : NULL; +} + +Lisp_Symbol *DSYMBOL (Lisp_Object obj); +Lisp_Symbol * +DSYMBOL (Lisp_Object obj) +{ + return SYMBOLP (obj) ? XSYMBOL (obj) : NULL; +} + +Bufbyte *DSYMNAME (Lisp_Object obj); +Bufbyte * +DSYMNAME (Lisp_Object obj) +{ + return SYMBOLP (obj) ? string_data (XSYMBOL (obj)->name) : NULL; +} + +#endif /* DEBUG_XEMACS */ + +DEFUN ("mswindows-message-box", Fmswindows_message_box, 1, 3, 0, /* +Pop up an MS Windows message box. +MESSAGE is the string to display. Optional argument FLAG controls +what appears in the box and how it behaves; it is a symbol or list of +symbols, described below. Second optional argument TITLE controls the +title bar; if omitted, a standard title bar will be used, probably +displaying "XEmacs". + +Possible flags are + + +-- To specify the buttons in the message box: + +abortretryignore + The message box contains three push buttons: Abort, Retry, and Ignore. +ok + The message box contains one push button: OK. This is the default. +okcancel + The message box contains two push buttons: OK and Cancel. +retrycancel + The message box contains two push buttons: Retry and Cancel. +yesno + The message box contains two push buttons: Yes and No. +yesnocancel + The message box contains three push buttons: Yes, No, and Cancel. + + +-- To display an icon in the message box: + +iconexclamation, iconwarning + An exclamation-point icon appears in the message box. +iconinformation, iconasterisk + An icon consisting of a lowercase letter i in a circle appears in + the message box. +iconquestion + A question-mark icon appears in the message box. +iconstop, iconerror, iconhand + A stop-sign icon appears in the message box. + + +-- To indicate the default button: + +defbutton1 + The first button is the default button. This is the default. +defbutton2 + The second button is the default button. +defbutton3 + The third button is the default button. +defbutton4 + The fourth button is the default button. + + +-- To indicate the modality of the dialog box: + +applmodal + The user must respond to the message box before continuing work in + the window identified by the hWnd parameter. However, the user can + move to the windows of other applications and work in those windows. + Depending on the hierarchy of windows in the application, the user + may be able to move to other windows within the application. All + child windows of the parent of the message box are automatically + disabled, but popup windows are not. This is the default. +systemmodal + Same as applmodal except that the message box has the WS_EX_TOPMOST + style. Use system-modal message boxes to notify the user of serious, + potentially damaging errors that require immediate attention (for + example, running out of memory). This flag has no effect on the + user's ability to interact with windows other than those associated + with hWnd. +taskmodal + Same as applmodal except that all the top-level windows belonging to + the current task are disabled if the hWnd parameter is NULL. Use + this flag when the calling application or library does not have a + window handle available but still needs to prevent input to other + windows in the current application without suspending other + applications. + + +In addition, you can specify the following flags: + +default-desktop-only + The desktop currently receiving input must be a default desktop; + otherwise, the function fails. A default desktop is one an + application runs on after the user has logged on. +help + Adds a Help button to the message box. Choosing the Help button or + pressing F1 generates a Help event. +right + The text is right-justified. +rtlreading + Displays message and caption text using right-to-left reading order + on Hebrew and Arabic systems. +setforeground + The message box becomes the foreground window. Internally, Windows + calls the SetForegroundWindow function for the message box. +topmost + The message box is created with the WS_EX_TOPMOST window style. +service-notification + Windows NT only: The caller is a service notifying the user of an + event. The function displays a message box on the current active + desktop, even if there is no user logged on to the computer. If + this flag is set, the hWnd parameter must be NULL. This is so the + message box can appear on a desktop other than the desktop + corresponding to the hWnd. + + + +The return value is one of the following menu-item values returned by +the dialog box: + +abort + Abort button was selected. +cancel + Cancel button was selected. +ignore + Ignore button was selected. +no + No button was selected. +ok + OK button was selected. +retry + Retry button was selected. +yes + Yes button was selected. + +If a message box has a Cancel button, the function returns the +`cancel' value if either the ESC key is pressed or the Cancel button +is selected. If the message box has no Cancel button, pressing ESC has +no effect. */ + (message_, flags, title)) +{ + Lisp_Object tail; + Extbyte *msgout; + Extbyte *titleout = 0; + UINT sty = 0; + + if (!LISTP (flags)) + { + CHECK_SYMBOL (flags); + flags = list1 (flags); + } + + CHECK_STRING (message_); + TO_EXTERNAL_FORMAT (LISP_STRING, message_, + C_STRING_ALLOCA, msgout, + Qmswindows_tstr); + + if (!NILP (title)) + { + CHECK_STRING (title); + TO_EXTERNAL_FORMAT (LISP_STRING, title, + C_STRING_ALLOCA, titleout, + Qmswindows_tstr); + } + + EXTERNAL_LIST_LOOP (tail, flags) + { + Lisp_Object st = XCAR (tail); + CHECK_SYMBOL (st); + if (0) + ; +#define FROB(sym, val) else if (EQ (st, sym)) sty |= val + FROB (Qabortretryignore, MB_ABORTRETRYIGNORE); + FROB (Qapplmodal, MB_APPLMODAL); + FROB (Qdefault_desktop_only, MB_DEFAULT_DESKTOP_ONLY); + FROB (Qdefbutton1, MB_DEFBUTTON1); + FROB (Qdefbutton2, MB_DEFBUTTON2); + FROB (Qdefbutton3, MB_DEFBUTTON3); + FROB (Qdefbutton4, MB_DEFBUTTON4); + FROB (Qhelp, MB_HELP); + FROB (Qiconasterisk, MB_ICONASTERISK); + FROB (Qiconexclamation, MB_ICONEXCLAMATION); + FROB (Qiconhand, MB_ICONHAND); + FROB (Qiconinformation, MB_ICONINFORMATION); + FROB (Qiconquestion, MB_ICONQUESTION); + FROB (Qiconstop, MB_ICONSTOP); + FROB (Qok, MB_OK); + FROB (Qokcancel, MB_OKCANCEL); + FROB (Qretrycancel, MB_RETRYCANCEL); + FROB (Qright, MB_RIGHT); + FROB (Qrtlreading, MB_RTLREADING); + FROB (Qservice_notification, MB_SERVICE_NOTIFICATION); + FROB (Qsetforeground, MB_SETFOREGROUND); + FROB (Qsystemmodal, MB_SYSTEMMODAL); + FROB (Qtaskmodal, MB_TASKMODAL); + FROB (Qtopmost, MB_TOPMOST); + FROB (Qyesno, MB_YESNO); + FROB (Qyesnocancel, MB_YESNOCANCEL); +#undef FROB + + else + signal_simple_error ("Unrecognized flag", st); + } + + { + int retval = MessageBox (NULL, msgout, titleout, sty); + + if (retval == 0) + error ("Out of memory when calling `mswindows-message-box'"); + +#define FROB(sym, val) if (retval == val) return sym + FROB (Qabort, IDABORT); + FROB (Qcancel, IDCANCEL); + FROB (Qignore, IDIGNORE); + FROB (Qno, IDNO); + FROB (Qok, IDOK); + FROB (Qretry, IDRETRY); + FROB (Qyes, IDYES); +#undef FROB + + signal_simple_error ("Unknown return value from MessageBox()", + make_int (retval)); + } + + return Qnil; +} + +void +mswindows_output_last_error (char *frob) +{ + LPVOID lpMsgBuf; + int errval = GetLastError(); + + FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER + | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, errval, + MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, + NULL); + stderr_out ("last error during %s is %d: %s\n", + frob, errval, (char*)lpMsgBuf); +} + +static Lisp_Object +msprinter_canonicalize_console_connection (Lisp_Object connection, + Error_behavior errb) +{ + /* If nil connection is specified, transform it into the name + of the default printer */ + if (NILP (connection)) + { + connection = msprinter_default_printer (); + if (NILP (connection)) + { + if (ERRB_EQ (errb, ERROR_ME)) + error ("There is no default printer in the system"); + else + return Qunbound; + } + } + + CHECK_STRING (connection); + return connection; +} + +static Lisp_Object +msprinter_canonicalize_device_connection (Lisp_Object connection, + Error_behavior errb) +{ + return msprinter_canonicalize_console_connection (connection, errb); +} + /************************************************************************/ /* initialization */ @@ -79,6 +610,44 @@ void syms_of_console_mswindows (void) { + DEFSUBR (Fmswindows_debugging_output); + + defsymbol (&Qabortretryignore, "abortretryignore"); + defsymbol (&Qapplmodal, "applmodal"); + defsymbol (&Qdefault_desktop_only, "default-desktop-only"); + defsymbol (&Qdefbutton1, "defbutton1"); + defsymbol (&Qdefbutton2, "defbutton2"); + defsymbol (&Qdefbutton3, "defbutton3"); + defsymbol (&Qdefbutton4, "defbutton4"); + /* defsymbol (&Qhelp, "help"); */ + defsymbol (&Qiconasterisk, "iconasterisk"); + defsymbol (&Qiconexclamation, "iconexclamation"); + defsymbol (&Qiconhand, "iconhand"); + defsymbol (&Qiconinformation, "iconinformation"); + defsymbol (&Qiconquestion, "iconquestion"); + defsymbol (&Qiconstop, "iconstop"); + /* defsymbol (&Qok, "ok"); */ + defsymbol (&Qokcancel, "okcancel"); + defsymbol (&Qretrycancel, "retrycancel"); + /* defsymbol (&Qright, "right"); */ + defsymbol (&Qrtlreading, "rtlreading"); + defsymbol (&Qservice_notification, "service-notification"); + defsymbol (&Qsetforeground, "setforeground"); + defsymbol (&Qsystemmodal, "systemmodal"); + defsymbol (&Qtaskmodal, "taskmodal"); + defsymbol (&Qtopmost, "topmost"); + defsymbol (&Qyesno, "yesno"); + defsymbol (&Qyesnocancel, "yesnocancel"); + + /* defsymbol (&Qabort, "abort"); */ + /* defsymbol (&Qcancel, "cancel"); */ + /* defsymbol (&Qignore, "ignore"); */ + /* defsymbol (&Qno, "no"); */ + /* defsymbol (&Qok, "ok"); */ + /* defsymbol (&Qretry, "retry"); */ + /* defsymbol (&Qyes, "yes"); */ + + DEFSUBR (Fmswindows_message_box); } void @@ -97,6 +666,8 @@ /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */ INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p"); + CONSOLE_HAS_METHOD (msprinter, canonicalize_console_connection); + CONSOLE_HAS_METHOD (msprinter, canonicalize_device_connection); } void @@ -111,68 +682,3 @@ { Fprovide (Qmswindows); } - - -#ifdef DEBUG_XEMACS -#include "events.h" -#include "opaque.h" -/* - * Random helper functions for debugging. - * Intended for use in the MSVC "Watch" window which doesn't like - * the aborts that the error_check_foo() functions can make. - */ -struct lrecord_header * -DHEADER (Lisp_Object obj) -{ - return LRECORDP (obj) ? XRECORD_LHEADER (obj) : NULL; -} - -void * -DOPAQUE_DATA (Lisp_Object obj) -{ - return OPAQUEP (obj) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL; -} - -Lisp_Event * -DEVENT (Lisp_Object obj) -{ - return EVENTP (obj) ? XEVENT (obj) : NULL; -} - -Lisp_Cons * -DCONS (Lisp_Object obj) -{ - return CONSP (obj) ? XCONS (obj) : NULL; -} - -Lisp_Cons * -DCONSCDR (Lisp_Object obj) -{ - return (CONSP (obj) && CONSP (XCDR (obj))) ? XCONS (XCDR (obj)) : 0; -} - -Bufbyte * -DSTRING (Lisp_Object obj) -{ - return STRINGP (obj) ? XSTRING_DATA (obj) : NULL; -} - -Lisp_Vector * -DVECTOR (Lisp_Object obj) -{ - return VECTORP (obj) ? XVECTOR (obj) : NULL; -} - -Lisp_Symbol * -DSYMBOL (Lisp_Object obj) -{ - return SYMBOLP (obj) ? XSYMBOL (obj) : NULL; -} - -Bufbyte * -DSYMNAME (Lisp_Object obj) -{ - return SYMBOLP (obj) ? string_data (XSYMBOL (obj)->name) : NULL; -} - -#endif /* DEBUG_XEMACS */ diff -r 72a7cfa4a488 -r abe6d1db359e src/console-msw.h --- a/src/console-msw.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/console-msw.h Mon Aug 13 11:35:02 2007 +0200 @@ -33,44 +33,20 @@ #define INCLUDED_console_msw_h_ #include "console.h" -#ifdef CONST /* I suspect this is safe */ -#undef CONST -#endif -#include -#include /* DDE management library */ -#if !defined(__CYGWIN32__) && !defined(__MINGW32__) \ - || CYGWIN_VERSION_DLL_MAJOR > 20 -#include /* FileManager/Explorer drag and drop */ -#include -#endif +#include "syswindows.h" +#include "syscommctrl.h" #ifdef HAVE_XPM #include #endif -/* - * XXX FIXME: The following X modifier defs in events-mod.h clash with win32 - * hotkey defs in winuser.h. For the moment lose the win32 versions. - * Maybe we should rename all of MOD_* to something that doesn't clash. - */ -#ifdef MOD_CONTROL -# undef MOD_CONTROL -#endif -#ifdef MOD_ALT -# undef MOD_ALT -#endif -#ifdef MOD_SHIFT -# undef MOD_SHIFT -#endif - - /* The name of the main window class */ #define XEMACS_CLASS "XEmacs" #define XEMACS_CONTROL_CLASS "XEmacsControl" /* - * Console + * Consoles */ DECLARE_CONSOLE_TYPE (mswindows); @@ -83,65 +59,102 @@ DECLARE_CONSOLE_TYPE (msprinter); /* - * Device + * Printer settings, aka devmode + */ + +typedef struct Lisp_Devmode +{ + struct lcrecord_header header; + + /* Pointer to the DEVMODE structure */ + DEVMODE* devmode; + + /* Full printer name. It can be longer than devmode->dmDeviceName + can accommodate, so need to keep it separately */ + char* printer_name; + + /* Printer device this object is currently selected in, or Qnil + if not selected */ + Lisp_Object device; + +} Lisp_Devmode; + + +DECLARE_LRECORD (devmode, Lisp_Devmode); +#define XDEVMODE(x) XRECORD (x, devmode, Lisp_Devmode) +#define XSETDEVMODE(x, p) XSETRECORD (x, p, devmode) +#define DEVMODEP(x) RECORDP (x, devmode) +#define CHECK_DEVMODE(x) CHECK_RECORD (x, devmode) +#define CONCHECK_DEVMODE(x) CONCHECK_RECORD (x, devmode) + +#define DEVMODE_SIZE(dm) ((dm)->dmSize + (dm)->dmDriverExtra) +#define XDEVMODE_SIZE(x) ((x)->devmode ? DEVMODE_SIZE((x)->devmode) : 0) + +/* + * Devices */ #define MSW_FONTSIZE (LF_FACESIZE*4+12) struct mswindows_device { - int logpixelsx, logpixelsy; - int planes, cells; - int horzres, vertres; /* Size in pixels */ - int horzsize, vertsize; /* Size in mm */ - int bitspixel; Lisp_Object fontlist; /* List of strings, device fonts */ + HDC hcdc; /* Compatible DC */ + DWORD update_tick; /* Used when device is modified through + Windows messages, see WM_DISPLAYCHANGE + in event-msw.c */ }; #define DEVICE_MSWINDOWS_DATA(d) DEVICE_TYPE_DATA (d, mswindows) -#define DEVICE_MSWINDOWS_LOGPIXELSX(d) (DEVICE_MSWINDOWS_DATA (d)->logpixelsx) -#define DEVICE_MSWINDOWS_LOGPIXELSY(d) (DEVICE_MSWINDOWS_DATA (d)->logpixelsy) -#define DEVICE_MSWINDOWS_PLANES(d) (DEVICE_MSWINDOWS_DATA (d)->planes) -#define DEVICE_MSWINDOWS_CELLS(d) (DEVICE_MSWINDOWS_DATA (d)->cells) -#define DEVICE_MSWINDOWS_HORZRES(d) (DEVICE_MSWINDOWS_DATA (d)->horzres) -#define DEVICE_MSWINDOWS_VERTRES(d) (DEVICE_MSWINDOWS_DATA (d)->vertres) -#define DEVICE_MSWINDOWS_HORZSIZE(d) (DEVICE_MSWINDOWS_DATA (d)->horzsize) -#define DEVICE_MSWINDOWS_VERTSIZE(d) (DEVICE_MSWINDOWS_DATA (d)->vertsize) -#define DEVICE_MSWINDOWS_BITSPIXEL(d) (DEVICE_MSWINDOWS_DATA (d)->bitspixel) -#define DEVICE_MSWINDOWS_FONTLIST(d) (DEVICE_MSWINDOWS_DATA (d)->fontlist) +#define DEVICE_MSWINDOWS_FONTLIST(d) (DEVICE_MSWINDOWS_DATA (d)->fontlist) +#define DEVICE_MSWINDOWS_HCDC(d) (DEVICE_MSWINDOWS_DATA (d)->hcdc) +#define DEVICE_MSWINDOWS_UPDATE_TICK(d) (DEVICE_MSWINDOWS_DATA (d)->update_tick) struct msprinter_device { - HDC hdc; + HDC hdc, hcdc; /* Printer and the comp. DCs */ HANDLE hprinter; + char* name; + Lisp_Object devmode; Lisp_Object fontlist; - char* name; - DEVMODE *devmode, *devmode_mirror; - size_t devmode_size; }; #define DEVICE_MSPRINTER_DATA(d) DEVICE_TYPE_DATA (d, msprinter) #define DEVICE_MSPRINTER_HDC(d) (DEVICE_MSPRINTER_DATA (d)->hdc) +#define DEVICE_MSPRINTER_HCDC(d) (DEVICE_MSPRINTER_DATA (d)->hcdc) #define DEVICE_MSPRINTER_HPRINTER(d) (DEVICE_MSPRINTER_DATA (d)->hprinter) #define DEVICE_MSPRINTER_FONTLIST(d) (DEVICE_MSPRINTER_DATA (d)->fontlist) #define DEVICE_MSPRINTER_NAME(d) (DEVICE_MSPRINTER_DATA (d)->name) #define DEVICE_MSPRINTER_DEVMODE(d) (DEVICE_MSPRINTER_DATA (d)->devmode) -#define DEVICE_MSPRINTER_DEVMODE_MIRROR(d) \ - (DEVICE_MSPRINTER_DATA (d)->devmode_mirror) -#define DEVICE_MSPRINTER_DEVMODE_SIZE(d) \ - (DEVICE_MSPRINTER_DATA (d)->devmode_size) #define CONSOLE_TYPESYM_MSPRINTER_P(typesym) EQ (typesym, Qmsprinter) #define DEVICE_MSPRINTER_P(dev) CONSOLE_TYPESYM_MSPRINTER_P (DEVICE_TYPE (dev)) #define CHECK_MSPRINTER_DEVICE(z) CHECK_DEVICE_TYPE (z, msprinter) #define CONCHECK_MSPRINTER_DEVICE(z) CONCHECK_DEVICE_TYPE (z, msprinter) -/* Printer functions */ -DEVMODE* msprinter_get_devmode_copy (struct device *d); -void msprinter_apply_devmode (struct device *d, DEVMODE *devmode); +/* Printer functions in frame-msw.c */ +void msprinter_start_page (struct frame *f); + +/* Common checks */ + +#define DEVICE_MSGDI_P(dev) (DEVICE_MSWINDOWS_P(dev) || DEVICE_MSPRINTER_P(dev)) +#define CHECK_MSGDI_DEVICE(d) \ + do { \ + CHECK_DEVICE (d); \ + if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \ + dead_wrong_type_argument \ + (list3 (Qor, Qmswindows, Qmsprinter), d); \ + } while (0) +#define CONCHECK_MSGDI_DEVICE(d) \ + do { \ + CHECK_DEVICE (d); \ + if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \ + wrong_type_argument \ + (list3 (Qor, Qmswindows, Qmsprinter), d); \ + } while (0) /* - * Frame + * Frames */ typedef struct { @@ -159,12 +172,15 @@ /* DC for this win32 window */ HDC hdc; - /* compatible DC for bitmap operations */ - HDC cdc; + /* Used with DeferWindowPos */ + HDWP hdwp; /* Time of last click event, for button 2 emul */ DWORD last_click_time; + /* Mods of last click event */ + DWORD last_click_mods; + /* Coordinates of last click event, screen-relative */ POINTS last_click_point; #ifdef HAVE_TOOLBARS @@ -180,7 +196,7 @@ unsigned int menu_checksum; /* Widget glyphs attached to this frame. See glyphs-msw.c */ - Lisp_Object widget_hash_table; + Lisp_Object widget_hash_table1, widget_hash_table2, widget_hash_table3; /* Frame title hash value. See frame-msw.c */ unsigned int title_checksum; @@ -196,9 +212,11 @@ int ignore_next_lbutton_up : 1; int ignore_next_rbutton_up : 1; int sizing : 1; + int paint_pending : 1; /* Whether a WM_PAINT magic event has been queued */ + int popup : 1; /* frame is a popup frame */ /* Geometry, in characters, as specified by proplist during frame - creation. Memebers are set to -1 for unspecified */ + creation. Members are set to -1 for unspecified */ XEMACS_RECT_WH* target_rect; }; @@ -206,12 +224,15 @@ #define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd) #define FRAME_MSWINDOWS_DC(f) (FRAME_MSWINDOWS_DATA (f)->hdc) -#define FRAME_MSWINDOWS_CDC(f) (FRAME_MSWINDOWS_DATA (f)->cdc) #define FRAME_MSWINDOWS_MENU_HASH_TABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hash_table) #define FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) \ (FRAME_MSWINDOWS_DATA (f)->toolbar_hash_table) -#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE(f) \ - (FRAME_MSWINDOWS_DATA (f)->widget_hash_table) +#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE1(f) \ + (FRAME_MSWINDOWS_DATA (f)->widget_hash_table1) +#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE2(f) \ + (FRAME_MSWINDOWS_DATA (f)->widget_hash_table2) +#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE3(f) \ + (FRAME_MSWINDOWS_DATA (f)->widget_hash_table3) #define FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos) \ (FRAME_MSWINDOWS_DATA (f)->toolbar_checksum[pos]) #define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum) @@ -219,6 +240,7 @@ #define FRAME_MSWINDOWS_CHARWIDTH(f) (FRAME_MSWINDOWS_DATA (f)->charwidth) #define FRAME_MSWINDOWS_CHARHEIGHT(f) (FRAME_MSWINDOWS_DATA (f)->charheight) #define FRAME_MSWINDOWS_TARGET_RECT(f) (FRAME_MSWINDOWS_DATA (f)->target_rect) +#define FRAME_MSWINDOWS_POPUP(f) (FRAME_MSWINDOWS_DATA (f)->popup) /* Frame check and validation macros */ #define FRAME_MSWINDOWS_P(frm) CONSOLE_TYPESYM_MSWINDOWS_P (FRAME_TYPE (frm)) @@ -236,12 +258,12 @@ struct msprinter_frame { - HDC hcdc; /* Compatoble DC */ int left_margin, top_margin, /* All in twips */ right_margin, bottom_margin; - int charheight, charwidth; /* As per proplist or -1 if not gven */ - Lisp_Object orientation, duplex; /* nil for printer's default */ + int charheight, charwidth; /* As per proplist or -1 if not given */ + int pix_left, pix_top; /* Calculated in init_frame_*, VP offset */ int job_started : 1; + int page_started : 1; }; #define FRAME_MSPRINTER_DATA(f) FRAME_TYPE_DATA (f, msprinter) @@ -249,12 +271,12 @@ #define FRAME_MSPRINTER_RIGHT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->top_margin) #define FRAME_MSPRINTER_TOP_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->right_margin) #define FRAME_MSPRINTER_BOTTOM_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->bottom_margin) -#define FRAME_MSPRINTER_CDC(f) (FRAME_MSPRINTER_DATA (f)->hcdc) #define FRAME_MSPRINTER_JOB_STARTED(f) (FRAME_MSPRINTER_DATA (f)->job_started) -#define FRAME_MSPRINTER_ORIENTATION(f) (FRAME_MSPRINTER_DATA (f)->orientation) -#define FRAME_MSPRINTER_DUPLEX(f) (FRAME_MSPRINTER_DATA (f)->duplex) +#define FRAME_MSPRINTER_PAGE_STARTED(f) (FRAME_MSPRINTER_DATA (f)->page_started) #define FRAME_MSPRINTER_CHARWIDTH(f) (FRAME_MSPRINTER_DATA (f)->charheight) #define FRAME_MSPRINTER_CHARHEIGHT(f) (FRAME_MSPRINTER_DATA (f)->charwidth) +#define FRAME_MSPRINTER_PIXLEFT(f) (FRAME_MSPRINTER_DATA (f)->pix_left) +#define FRAME_MSPRINTER_PIXTOP(f) (FRAME_MSPRINTER_DATA (f)->pix_top) /* * Events @@ -279,10 +301,12 @@ UINT msg, WPARAM wParam, LPARAM lParam); -void mswindows_redraw_exposed_area (struct frame *f, int x, int y, +void mswindows_redraw_exposed_area (struct frame *f, int x, int y, int width, int height); void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest); +HWND mswindows_get_selected_frame_hwnd (void); void mswindows_enqueue_magic_event (HWND hwnd, UINT msg); +int mswindows_is_dialog_msg (MSG *msg); /* win32 DDE management library */ #define MSWINDOWS_DDE_ITEM_OPEN "Open" @@ -291,27 +315,22 @@ extern HSZ mswindows_dde_topic_system; extern HSZ mswindows_dde_item_open; HDDEDATA CALLBACK mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, - HSZ hszTopic, HSZ hszItem, HDDEDATA hdata, + HSZ hszTopic, HSZ hszItem, + HDDEDATA hdata, DWORD dwData1, DWORD dwData2); +void mswindows_enqueue_dispatch_event (Lisp_Object event); void mswindows_enqueue_misc_user_event (Lisp_Object channel, Lisp_Object function, 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 (Lisp_Object (*bfun) (Lisp_Object barg), +Lisp_Object mswindows_protect_modal_loop (Lisp_Object (*bfun) + (Lisp_Object barg), Lisp_Object barg); void mswindows_unmodalize_signal_maybe (void); -#ifdef HAVE_TOOLBARS -Lisp_Object -mswindows_get_toolbar_button_text ( struct frame* f, int command_id ); -Lisp_Object -mswindows_handle_toolbar_wm_command (struct frame* f, HWND ctrl, WORD id); -#endif -Lisp_Object -mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, DWORD id); -COLORREF mswindows_string_to_color (CONST char *name); +COLORREF mswindows_string_to_color (const char *name); USID emacs_mswindows_create_stream_pair (void* inhandle, void* outhandle, Lisp_Object* instream, Lisp_Object* outstream, @@ -326,13 +345,61 @@ extern Lisp_Object Vmswindows_frame_being_created; extern Lisp_Object mswindows_frame_being_created; +void mswindows_get_workspace_coords (RECT *rc); + +HWND mswindows_get_console_hwnd (void); +void mswindows_hide_console (void); +void mswindows_show_console (void); +int mswindows_output_console_string (CONST Extbyte *str, Extcount len); + Lisp_Object mswindows_enumerate_fonts (HDC hdc); +int mswindows_char_is_accelerator (struct frame *f, Emchar ch); +Bytecount mswindows_translate_menu_or_dialog_item (Bufbyte *item, Bytecount len, + Bytecount maxlen, Emchar *accel, + Lisp_Object error_name); + +#ifdef HAVE_TOOLBARS Lisp_Object mswindows_get_toolbar_button_text (struct frame* f, int command_id); Lisp_Object mswindows_handle_toolbar_wm_command (struct frame* f, HWND ctrl, WORD id); +#endif Lisp_Object mswindows_handle_gui_wm_command (struct frame* f, - HWND ctrl, DWORD id); + HWND ctrl, LPARAM id); + +int mswindows_windows9x_p (void); + +void mswindows_output_last_error (char *frob); + +Lisp_Object mswindows_handle_print_dialog_box (struct frame *f, + Lisp_Object keys); +Lisp_Object mswindows_handle_page_setup_dialog_box (struct frame *f, + Lisp_Object keys); +Lisp_Object mswindows_handle_print_setup_dialog_box (struct frame *f, + Lisp_Object keys); + +void mswindows_register_popup_frame (Lisp_Object frame); +void mswindows_unregister_popup_frame (Lisp_Object frame); + +void mswindows_destroy_selection (Lisp_Object selection); + +Lisp_Object msprinter_default_printer (void); + +struct mswindows_dialog_id +{ + struct lcrecord_header header; + + Lisp_Object frame; + Lisp_Object callbacks; + HWND hwnd; +}; + +DECLARE_LRECORD (mswindows_dialog_id, struct mswindows_dialog_id); +#define XMSWINDOWS_DIALOG_ID(x) XRECORD (x, mswindows_dialog_id, struct mswindows_dialog_id) +#define XSETMSWINDOWS_DIALOG_ID(x, p) XSETRECORD (x, p, mswindows_dialog_id) +#define MSWINDOWS_DIALOG_IDP(x) RECORDP (x, mswindows_dialog_id) +#define CHECK_MSWINDOWS_DIALOG_ID(x) CHECK_RECORD (x, mswindows_dialog_id) +#define CONCHECK_MSWINDOWS_DIALOG_ID(x) CONCHECK_RECORD (x, mswindows_dialog_id) #endif /* INCLUDED_console_msw_h_ */ diff -r 72a7cfa4a488 -r abe6d1db359e src/console-stream.c --- a/src/console-stream.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/console-stream.c Mon Aug 13 11:35:02 2007 +0200 @@ -69,7 +69,9 @@ { CHECK_STRING (tty); stream_con->in = stream_con->out = stream_con->err = - fopen ((char *) XSTRING_DATA (tty), "r+"); + /* #### We don't currently do coding-system translation on + this descriptor. */ + fopen ((char *) XSTRING_DATA (tty), READ_PLUS_TEXT); if (!stream_con->in) error ("Unable to open tty %s", XSTRING_DATA (tty)); } @@ -171,7 +173,7 @@ static int stream_text_width (struct frame *f, struct face_cachel *cachel, - CONST Emchar *str, Charcount len) + const Emchar *str, Charcount len) { return len; } @@ -201,16 +203,6 @@ } static void -stream_output_begin (struct device *d) -{ -} - -static void -stream_output_end (struct device *d) -{ -} - -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, @@ -219,16 +211,6 @@ } static void -stream_output_vertical_divider (struct window *w, int clear) -{ -} - -static void -stream_clear_to_window_end (struct window *w, int ypos1, int ypos2) -{ -} - -static void stream_clear_region (Lisp_Object window, struct device* d, struct frame * f, face_index findex, int x, int y, int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, @@ -236,11 +218,6 @@ { } -static void -stream_clear_frame (struct frame *f) -{ -} - static int stream_flash (struct device *d) { @@ -285,14 +262,9 @@ CONSOLE_HAS_METHOD (stream, right_margin_width); CONSOLE_HAS_METHOD (stream, text_width); CONSOLE_HAS_METHOD (stream, output_display_block); - CONSOLE_HAS_METHOD (stream, output_vertical_divider); CONSOLE_HAS_METHOD (stream, divider_height); CONSOLE_HAS_METHOD (stream, eol_cursor_width); - CONSOLE_HAS_METHOD (stream, clear_to_window_end); CONSOLE_HAS_METHOD (stream, clear_region); - CONSOLE_HAS_METHOD (stream, clear_frame); - CONSOLE_HAS_METHOD (stream, output_begin); - CONSOLE_HAS_METHOD (stream, output_end); CONSOLE_HAS_METHOD (stream, flash); CONSOLE_HAS_METHOD (stream, ring_bell); } @@ -328,7 +300,7 @@ #ifndef PDUMP void -init_console_stream (void) +init_console_stream (int reinit) { /* This function can GC */ if (!initialized) @@ -350,13 +322,16 @@ #else void -init_console_stream (void) +init_console_stream (int reinit) { /* This function can GC */ - Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); - Vterminal_console = Fdevice_console (Vterminal_device); - Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); - minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; + if (!reinit) + { + Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); + Vterminal_console = Fdevice_console (Vterminal_device); + Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); + minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; + } if (initialized) { stream_init_console (XCONSOLE (Vterminal_console), Qnil); diff -r 72a7cfa4a488 -r abe6d1db359e src/console-tty.c --- a/src/console-tty.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/console-tty.c Mon Aug 13 11:35:02 2007 +0200 @@ -115,23 +115,23 @@ tty_con->instream = make_filedesc_input_stream (tty_con->infd, 0, -1, 0); tty_con->outstream = make_filedesc_output_stream (tty_con->outfd, 0, -1, 0); -#ifdef MULE +#ifdef FILE_CODING tty_con->instream = make_decoding_input_stream (XLSTREAM (tty_con->instream), - Fget_coding_system (Vkeyboard_coding_system)); + Fget_coding_system (Qkeyboard)); Lstream_set_character_mode (XLSTREAM (tty_con->instream)); tty_con->outstream = make_encoding_output_stream (XLSTREAM (tty_con->outstream), - Fget_coding_system (Vterminal_coding_system)); -#endif /* MULE */ + Fget_coding_system (Qterminal)); +#endif /* FILE_CODING */ tty_con->terminal_type = terminal_type; tty_con->controlling_process = controlling_process; if (NILP (CONSOLE_NAME (con))) CONSOLE_NAME (con) = Ffile_name_nondirectory (tty); { - int tty_pg; - int controlling_tty_pg; + pid_t tty_pg; + pid_t controlling_tty_pg; int cfd; /* OK, the only sure-fire way I can think of to determine @@ -253,7 +253,7 @@ { set_decoding_stream_coding_system (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->instream), - Fget_coding_system (NILP (codesys) ? Vkeyboard_coding_system : codesys)); + Fget_coding_system (NILP (codesys) ? Qkeyboard : codesys)); return Qnil; } @@ -277,7 +277,7 @@ { set_encoding_stream_coding_system (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream), - Fget_coding_system (NILP (codesys) ? Vterminal_coding_system : codesys)); + Fget_coding_system (NILP (codesys) ? Qterminal : codesys)); /* Redraw tty */ face_property_was_changed (Vdefault_face, Qfont, Qtty); return Qnil; diff -r 72a7cfa4a488 -r abe6d1db359e src/console-tty.h --- a/src/console-tty.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/console-tty.h Mon Aug 13 11:35:02 2007 +0200 @@ -93,31 +93,31 @@ struct { /* local cursor movement */ - CONST char *up; /* cuu1, up */ - CONST char *down; /* cud1, do */ - CONST char *left; /* cub1, le */ - CONST char *right; /* cuf1, nd */ - CONST char *home; /* home, ho */ - CONST char *low_left; /* ll, ll */ - CONST char *car_return; /* cr, cr */ + const char *up; /* cuu1, up */ + const char *down; /* cud1, do */ + const char *left; /* cub1, le */ + const char *right; /* cuf1, nd */ + const char *home; /* home, ho */ + const char *low_left; /* ll, ll */ + const char *car_return; /* cr, cr */ /* parameterized local cursor movement */ - CONST char *multi_up; /* cuu, UP */ - CONST char *multi_down; /* cud, DO */ - CONST char *multi_left; /* cub, LE */ - CONST char *multi_right; /* cuf, RI */ + const char *multi_up; /* cuu, UP */ + const char *multi_down; /* cud, DO */ + const char *multi_left; /* cub, LE */ + const char *multi_right; /* cuf, RI */ /* absolute cursor motion */ - CONST char *abs; /* cup, cm */ - CONST char *hor_abs; /* hpa, ch */ - CONST char *ver_abs; /* vpa, cv */ + const char *abs; /* cup, cm */ + const char *hor_abs; /* hpa, ch */ + const char *ver_abs; /* vpa, cv */ /* scrolling */ - CONST char *scroll_forw; /* ind, sf */ - CONST char *scroll_back; /* ri, sr */ - CONST char *multi_scroll_forw; /* indn, SF */ - CONST char *multi_scroll_back; /* rin, SR */ - CONST char *set_scroll_region; /* csr, cs */ + const char *scroll_forw; /* ind, sf */ + const char *scroll_back; /* ri, sr */ + const char *multi_scroll_forw; /* indn, SF */ + const char *multi_scroll_back; /* rin, SR */ + const char *set_scroll_region; /* csr, cs */ } cm; /* screen editing entries - each entry is commented with the @@ -125,56 +125,56 @@ struct { /* adding to the screen */ - CONST char *ins_line; /* il1, al */ - CONST char *multi_ins_line; /* il, AL */ - CONST char *repeat; /* rep, rp */ - CONST char *begin_ins_mode; /* smir, im */ - CONST char *end_ins_mode; /* rmir, ei */ - CONST char *ins_char; /* ich1, ic */ - CONST char *multi_ins_char; /* ich, IC */ - CONST char *insert_pad; /* ip, ip */ + const char *ins_line; /* il1, al */ + const char *multi_ins_line; /* il, AL */ + const char *repeat; /* rep, rp */ + const char *begin_ins_mode; /* smir, im */ + const char *end_ins_mode; /* rmir, ei */ + const char *ins_char; /* ich1, ic */ + const char *multi_ins_char; /* ich, IC */ + const char *insert_pad; /* ip, ip */ /* deleting from the screen */ - CONST char *clr_frame; /* clear, cl */ - CONST char *clr_from_cursor; /* ed, cd */ - CONST char *clr_to_eol; /* el, ce */ - CONST char *del_line; /* dl1, dl */ - CONST char *multi_del_line; /* dl, DL */ - CONST char *del_char; /* dch1, dc */ - CONST char *multi_del_char; /* dch, DC */ - CONST char *begin_del_mode; /* smdc, dm */ - CONST char *end_del_mode; /* rmdc, ed */ - CONST char *erase_at_cursor; /* ech, ec */ + const char *clr_frame; /* clear, cl */ + const char *clr_from_cursor; /* ed, cd */ + const char *clr_to_eol; /* el, ce */ + const char *del_line; /* dl1, dl */ + const char *multi_del_line; /* dl, DL */ + const char *del_char; /* dch1, dc */ + const char *multi_del_char; /* dch, DC */ + const char *begin_del_mode; /* smdc, dm */ + const char *end_del_mode; /* rmdc, ed */ + const char *erase_at_cursor; /* ech, ec */ } se; /* screen display entries - each entry is commented with the terminfo and termcap entry */ struct { - CONST char *begin_standout; /* smso, so */ - CONST char *end_standout; /* rmso, se */ - CONST char *begin_underline; /* smul, us */ - CONST char *end_underline; /* rmul, ue */ - CONST char *begin_alternate; /* smacs, as */ - CONST char *end_alternate; /* rmacs, ae */ + const char *begin_standout; /* smso, so */ + const char *end_standout; /* rmso, se */ + const char *begin_underline; /* smul, us */ + const char *end_underline; /* rmul, ue */ + const char *begin_alternate; /* smacs, as */ + const char *end_alternate; /* rmacs, ae */ - CONST char *turn_on_reverse; /* rev, mr */ - CONST char *turn_on_blinking; /* blink, mb */ - CONST char *turn_on_bold; /* bold, md */ - CONST char *turn_on_dim; /* dim, mh */ - CONST char *turn_off_attributes; /* sgr0, me */ + const char *turn_on_reverse; /* rev, mr */ + const char *turn_on_blinking; /* blink, mb */ + const char *turn_on_bold; /* bold, md */ + const char *turn_on_dim; /* dim, mh */ + const char *turn_off_attributes; /* sgr0, me */ - CONST char *visual_bell; /* flash, vb */ - CONST char *audio_bell; /* bel, bl */ + const char *visual_bell; /* flash, vb */ + const char *audio_bell; /* bel, bl */ - CONST char *cursor_visible; /* cvvis, vs */ - CONST char *cursor_normal; /* cnorm, ve */ - CONST char *init_motion; /* smcup, ti */ - CONST char *end_motion; /* rmcup, te */ - CONST char *keypad_on; /* smkx, ks */ - CONST char *keypad_off; /* rmkx, ke */ + const char *cursor_visible; /* cvvis, vs */ + const char *cursor_normal; /* cnorm, ve */ + const char *init_motion; /* smcup, ti */ + const char *end_motion; /* rmcup, te */ + const char *keypad_on; /* smkx, ks */ + const char *keypad_off; /* rmkx, ke */ - CONST char *orig_pair; /* op, op */ + const char *orig_pair; /* op, op */ } sd; /* costs of various operations */ diff -r 72a7cfa4a488 -r abe6d1db359e src/console-x.c --- a/src/console-x.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/console-x.c Mon Aug 13 11:35:02 2007 +0200 @@ -20,6 +20,8 @@ /* Synched up with: Not in FSF. */ +/* This file Mule-ized by Ben Wing, 7-10-00. */ + /* Authorship: Ben Wing: January 1996, for 19.14. @@ -29,6 +31,7 @@ #include "lisp.h" #include "console-x.h" +#include "buffer.h" #include "process.h" /* canonicalize_host_name */ #include "redisplay.h" /* for display_arg */ @@ -44,7 +47,7 @@ split_up_display_spec (Lisp_Object display, int *hostname_length, int *display_length, int *screen_length) { - char *dotptr; + Bufbyte *dotptr; dotptr = strrchr ((char *) XSTRING_DATA (display), ':'); if (!dotptr) @@ -54,12 +57,11 @@ } else { - *hostname_length = dotptr - (char *) XSTRING_DATA (display); + *hostname_length = dotptr - XSTRING_DATA (display); - dotptr = strchr (dotptr, '.'); + dotptr = strchr ((char *) dotptr, '.'); if (dotptr) - *display_length = (dotptr - (char *) XSTRING_DATA (display) - - *hostname_length); + *display_length = (dotptr - XSTRING_DATA (display) - *hostname_length); else *display_length = XSTRING_LENGTH (display) - *hostname_length; } @@ -102,7 +104,7 @@ static Lisp_Object get_display_arg_connection (void) { - CONST char *disp_name; + const Extbyte *disp_name; /* If the user didn't explicitly specify a display to use when they called make-x-device, then we first check to see if a @@ -114,7 +116,7 @@ { int elt; int argc; - char **argv; + Extbyte **argv; Lisp_Object conn; make_argc_argv (Vx_initial_argv_list, &argc, &argv); @@ -127,7 +129,8 @@ if (elt + 1 == argc) { suppress_early_error_handler_backtrace = 1; - error ("-display specified with no arg"); + type_error (Qinvalid_argument, + "-display specified with no arg"); } else { @@ -140,12 +143,12 @@ /* assert: display_arg is only set if we found the display arg earlier so we can't fail to find it now. */ assert (disp_name != NULL); - conn = build_ext_string (disp_name, Qctext); + conn = build_ext_string (disp_name, Qcommand_argument_encoding); free_argc_argv (argv); return conn; } else - return build_ext_string (XDisplayName (0), Qctext); + return build_ext_string (XDisplayName (0), Qx_display_name_encoding); } /* "semi-canonicalize" means convert to a nicer form for printing, but @@ -181,8 +184,7 @@ /* Check for a couple of standard special cases */ if (string_byte (XSTRING (connection), 0) == ':') connection = concat2 (build_string ("localhost"), connection); - else if (!strncmp ((CONST char *) XSTRING_DATA (connection), - "unix:", 5)) + else if (!strncmp (XSTRING_DATA (connection), "unix:", 5)) connection = concat2 (build_string ("localhost:"), Fsubstring (connection, make_int (5), Qnil)); @@ -260,7 +262,7 @@ split_up_display_spec (connection, &hostname_length, &display_length, &screen_length); - screen_str = build_string ((CONST char *) XSTRING_DATA (connection) + screen_str = build_string (XSTRING_DATA (connection) + hostname_length + display_length); connection = x_canonicalize_console_connection (connection, errb); diff -r 72a7cfa4a488 -r abe6d1db359e src/console-x.h --- a/src/console-x.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/console-x.h Mon Aug 13 11:35:02 2007 +0200 @@ -88,14 +88,14 @@ Pixmap gray_pixmap; /* Atoms associated with this device. */ - /* allocated in Xatoms_of_xfns in xfns.c */ + /* allocated in Xatoms_of_device_x */ Atom Xatom_WM_PROTOCOLS; Atom Xatom_WM_DELETE_WINDOW; Atom Xatom_WM_SAVE_YOURSELF; Atom Xatom_WM_TAKE_FOCUS; Atom Xatom_WM_STATE; - /* allocated in Xatoms_of_select_x in xselect.c */ + /* allocated in Xatoms_of_select_x */ Atom Xatom_CLIPBOARD; Atom Xatom_TIMESTAMP; Atom Xatom_TEXT; @@ -108,7 +108,7 @@ Atom Xatom_ATOM_PAIR; Atom Xatom_COMPOUND_TEXT; - /* allocated in Xatoms_of_objects_x in objects-x.c */ + /* allocated in Xatoms_of_objects_x */ Atom Xatom_FOUNDRY; Atom Xatom_FAMILY_NAME; Atom Xatom_WEIGHT_NAME; @@ -206,14 +206,14 @@ #define DEVICE_X_FONTSET(d) (DEVICE_X_DATA (d)->fontset) #endif /* HAVE_XIM */ -/* allocated in Xatoms_of_xfns in xfns.c */ +/* allocated in Xatoms_of_device_x */ #define DEVICE_XATOM_WM_PROTOCOLS(d) (DEVICE_X_DATA (d)->Xatom_WM_PROTOCOLS) #define DEVICE_XATOM_WM_DELETE_WINDOW(d) (DEVICE_X_DATA (d)->Xatom_WM_DELETE_WINDOW) #define DEVICE_XATOM_WM_SAVE_YOURSELF(d) (DEVICE_X_DATA (d)->Xatom_WM_SAVE_YOURSELF) #define DEVICE_XATOM_WM_TAKE_FOCUS(d) (DEVICE_X_DATA (d)->Xatom_WM_TAKE_FOCUS) #define DEVICE_XATOM_WM_STATE(d) (DEVICE_X_DATA (d)->Xatom_WM_STATE) -/* allocated in Xatoms_of_select_x in xselect.c */ +/* allocated in Xatoms_of_select_x */ #define DEVICE_XATOM_CLIPBOARD(d) (DEVICE_X_DATA (d)->Xatom_CLIPBOARD) #define DEVICE_XATOM_TIMESTAMP(d) (DEVICE_X_DATA (d)->Xatom_TIMESTAMP) #define DEVICE_XATOM_TEXT(d) (DEVICE_X_DATA (d)->Xatom_TEXT) @@ -226,7 +226,7 @@ #define DEVICE_XATOM_ATOM_PAIR(d) (DEVICE_X_DATA (d)->Xatom_ATOM_PAIR) #define DEVICE_XATOM_COMPOUND_TEXT(d) (DEVICE_X_DATA (d)->Xatom_COMPOUND_TEXT) -/* allocated in Xatoms_of_objects_x in objects-x.c */ +/* allocated in Xatoms_of_objects_x */ #define DEVICE_XATOM_FOUNDRY(d) (DEVICE_X_DATA (d)->Xatom_FOUNDRY) #define DEVICE_XATOM_FAMILY_NAME(d) (DEVICE_X_DATA (d)->Xatom_FAMILY_NAME) #define DEVICE_XATOM_WEIGHT_NAME(d) (DEVICE_X_DATA (d)->Xatom_WEIGHT_NAME) @@ -405,7 +405,7 @@ void x_wm_set_cell_size (Widget wmshell, int cw, int ch); void x_wm_set_variable_size (Widget wmshell, int width, int height); -CONST char *x_event_name (int event_type); +const char *x_event_name (int event_type); int x_error_handler (Display *disp, XErrorEvent *event); void expect_x_error (Display *dpy); int x_error_occurred_p (Display *dpy); @@ -491,6 +491,23 @@ extern Lisp_Object Vx_initial_argv_list; /* #### ugh! */ +/* Standins for various X encodings, until we know them better */ + +/* !!#### Need to verify the encoding used in lwlib -- Qnative or Qctext? + Almost certainly the former. Use a standin for now. */ +#define Qlwlib_encoding Qnative + +#define Qx_atom_name_encoding Qctext +/* font names are often stored in atoms, so it gets sticky if we set this + to something different from atom-name encoding */ +#define Qx_font_name_encoding Qctext + +#define Qx_color_name_encoding Qctext + +/* the following probably must agree with Qcommand_argument_encoding and + Qenvironment_variable_encoding */ +#define Qx_display_name_encoding Qnative + #endif /* HAVE_X_WINDOWS */ #endif /* INCLUDED_console_x_h_ */ diff -r 72a7cfa4a488 -r abe6d1db359e src/console.c --- a/src/console.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/console.c Mon Aug 13 11:35:02 2007 +0200 @@ -1073,6 +1073,8 @@ void syms_of_console (void) { + INIT_LRECORD_IMPLEMENTATION (console); + DEFSUBR (Fvalid_console_type_p); DEFSUBR (Fconsole_type_list); DEFSUBR (Fcdfw_console); @@ -1195,15 +1197,27 @@ } /* The docstrings for DEFVAR_* are recorded externally by make-docfile. */ - -/* Declaring this stuff as const produces 'Cannot reinitialize' messages - from SunPro C's fix-and-continue feature (a way neato feature that - makes debugging unbelievably more bearable) */ #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magicfun) do { \ - static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ - = { { { symbol_value_forward_lheader_initializer, \ - (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ - forward_type }, magicfun }; \ + static const struct symbol_value_forward I_hate_C = \ + { /* struct symbol_value_forward */ \ + { /* struct symbol_value_magic */ \ + { /* struct lcrecord_header */ \ + { /* struct lrecord_header */ \ + lrecord_type_symbol_value_forward, /* lrecord_type_index */ \ + 1, /* mark bit */ \ + 1, /* c_readonly bit */ \ + 1 /* lisp_readonly bit */ \ + }, \ + 0, /* next */ \ + 0, /* uid */ \ + 0 /* free */ \ + }, \ + &(console_local_flags.field_name), \ + forward_type \ + }, \ + magicfun \ + }; \ + \ { \ int offset = ((char *)symbol_value_forward_forward (&I_hate_C) \ - (char *)&console_local_flags); \ @@ -1393,14 +1407,14 @@ */ ); #endif - /* While this should be CONST it can't be because some things + /* While this should be const it can't be because some things (i.e. edebug) do manipulate it. */ DEFVAR_CONSOLE_LOCAL ("defining-kbd-macro", defining_kbd_macro /* -Non-nil while a console macro is being defined. Don't set this! +Non-nil while a keyboard macro is being defined. Don't set this! */ ); DEFVAR_CONSOLE_LOCAL ("last-kbd-macro", last_kbd_macro /* -Last kbd macro defined, as a vector of events; nil if none defined. +Last keyboard macro defined, as a vector of events; nil if none defined. */ ); DEFVAR_CONSOLE_LOCAL ("prefix-arg", prefix_arg /* diff -r 72a7cfa4a488 -r abe6d1db359e src/console.h --- a/src/console.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/console.h Mon Aug 13 11:35:02 2007 +0200 @@ -65,7 +65,7 @@ struct console_methods { - CONST char *name; /* Used by print_console, print_device, print_frame */ + const char *name; /* Used by print_console, print_device, print_frame */ Lisp_Object symbol; Lisp_Object predicate_symbol; @@ -91,13 +91,22 @@ void (*delete_device_method) (struct device *); void (*mark_device_method) (struct device *); void (*asynch_device_change_method) (void); - Lisp_Object (*device_system_metrics_method) (struct device *, enum device_metrics); + Lisp_Object (*device_system_metrics_method) (struct device *, + enum device_metrics); unsigned int (*device_implementation_flags_method) (void); - Lisp_Object (*own_selection_method)(Lisp_Object selection_name, Lisp_Object selection_value); - void (*disown_selection_method)(Lisp_Object selection_name, Lisp_Object timeval); - Lisp_Object (*get_foreign_selection_method) (Lisp_Object selection_symbol, - Lisp_Object target_type); - Lisp_Object (*selection_exists_p_method)(Lisp_Object selection_name); + Lisp_Object (*own_selection_method)(Lisp_Object selection_name, + Lisp_Object selection_value, + Lisp_Object how_to_add, + Lisp_Object selection_type); + void (*disown_selection_method)(Lisp_Object selection_name, + Lisp_Object timeval); + Lisp_Object (*get_foreign_selection_method) (Lisp_Object selection_symbol, + Lisp_Object target_type); + Lisp_Object (*selection_exists_p_method)(Lisp_Object selection_name, + Lisp_Object selection_type); + Lisp_Object (*available_selection_types_method)(Lisp_Object selection_name); + Lisp_Object (*register_selection_data_type_method)(Lisp_Object type_name); + Lisp_Object (*selection_data_type_name_method)(Lisp_Object type); /* frame methods */ Lisp_Object *device_specific_frame_props; @@ -111,6 +120,8 @@ void (*focus_on_frame_method) (struct frame *); void (*raise_frame_method) (struct frame *); void (*lower_frame_method) (struct frame *); + void (*enable_frame_method) (struct frame *); + void (*disable_frame_method) (struct frame *); int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame, int *x, int *y); void (*set_mouse_position_method) (struct window *w, int x, int y); @@ -135,12 +146,13 @@ Lisp_Object (*get_frame_parent_method) (struct frame *f); void (*update_frame_external_traits_method) (struct frame *f, Lisp_Object name); int (*frame_size_fixed_p_method) (struct frame *f); + void (*eject_page_method) (struct frame *f); /* redisplay methods */ int (*left_margin_width_method) (struct window *); int (*right_margin_width_method) (struct window *); int (*text_width_method) (struct frame *f, struct face_cachel *cachel, - CONST Emchar *str, Charcount len); + const Emchar *str, Charcount len); void (*output_display_block_method) (struct window *, struct display_line *, int, int, int, int, int, int, int); int (*divider_height_method) (void); @@ -151,8 +163,10 @@ int, int, int, int, Lisp_Object, Lisp_Object, Lisp_Object); void (*clear_frame_method) (struct frame *); - void (*output_begin_method) (struct device *); - void (*output_end_method) (struct device *); + void (*window_output_begin_method) (struct window *); + void (*frame_output_begin_method) (struct frame *); + void (*window_output_end_method) (struct window *); + void (*frame_output_end_method) (struct frame *); int (*flash_method) (struct device *); void (*ring_bell_method) (struct device *, int volume, int pitch, int duration); @@ -207,7 +221,7 @@ Lisp_Object charset); int (*font_spec_matches_charset_method) (struct device *d, Lisp_Object charset, - CONST Bufbyte *nonreloc, + const Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length); @@ -222,7 +236,8 @@ void (*map_subwindow_method) (Lisp_Image_Instance *, int x, int y, struct display_glyph_area* dga); void (*resize_subwindow_method) (Lisp_Image_Instance *, int w, int h); - void (*update_subwindow_method) (Lisp_Image_Instance *); + void (*redisplay_subwindow_method) (Lisp_Image_Instance *); + void (*redisplay_widget_method) (Lisp_Image_Instance *); int (*image_instance_equal_method) (Lisp_Image_Instance *, Lisp_Image_Instance *, int depth); @@ -281,7 +296,9 @@ #ifdef HAVE_DIALOGS /* dialog methods */ - void (*popup_dialog_box_method) (struct frame *, Lisp_Object dbox_desc); + Lisp_Object (*make_dialog_box_internal_method) (struct frame *, + Lisp_Object type, + Lisp_Object keys); #endif }; @@ -451,9 +468,9 @@ #define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE struct console * +INLINE_HEADER struct console * error_check_console_type (struct console *con, Lisp_Object sym); -INLINE struct console * +INLINE_HEADER struct console * error_check_console_type (struct console *con, Lisp_Object sym) { assert (EQ (CONSOLE_TYPE (con), sym)); diff -r 72a7cfa4a488 -r abe6d1db359e src/data.c --- a/src/data.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/data.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,7 @@ /* Primitive operations on Lisp data types for XEmacs Lisp interpreter. Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 2000 Ben Wing. This file is part of XEmacs. @@ -39,17 +40,22 @@ Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; Lisp_Object Qerror_conditions, Qerror_message; -Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range; +Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax; +Lisp_Object Qlist_formation_error; +Lisp_Object Qmalformed_list, Qmalformed_property_list; +Lisp_Object Qcircular_list, Qcircular_property_list; +Lisp_Object Qinvalid_argument, Qwrong_type_argument, Qargs_out_of_range; +Lisp_Object Qwrong_number_of_arguments, Qinvalid_function, Qno_catch; +Lisp_Object Qinternal_error, Qinvalid_state; Lisp_Object Qvoid_variable, Qcyclic_variable_indirection; Lisp_Object Qvoid_function, Qcyclic_function_indirection; -Lisp_Object Qsetting_constant, Qinvalid_read_syntax; -Lisp_Object Qmalformed_list, Qmalformed_property_list; -Lisp_Object Qcircular_list, Qcircular_property_list; -Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch; +Lisp_Object Qinvalid_operation, Qinvalid_change; +Lisp_Object Qsetting_constant; +Lisp_Object Qediting_error; +Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; Lisp_Object Qio_error, Qend_of_file; Lisp_Object Qarith_error, Qrange_error, Qdomain_error; Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error; -Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; Lisp_Object Qintegerp, Qnatnump, Qsymbolp; Lisp_Object Qlistp, Qtrue_list_p, Qweak_listp; Lisp_Object Qconsp, Qsubrp; @@ -357,7 +363,7 @@ */ (subr)) { - CONST char *prompt; + const char *prompt; CHECK_SUBR (subr); prompt = XSUBR (subr)->prompt; return prompt ? list2 (Qinteractive, build_string (prompt)) : Qnil; @@ -638,10 +644,11 @@ return it. If there is a cycle in the function chain, signal a cyclic-function-indirection error. - This is like Findirect_function, except that it doesn't signal an - error if the chain ends up unbound. */ + This is like Findirect_function when VOID_FUNCTION_ERRORP is true. + When VOID_FUNCTION_ERRORP is false, no error is signaled if the end + of the chain ends up being Qunbound. */ Lisp_Object -indirect_function (Lisp_Object object, int errorp) +indirect_function (Lisp_Object object, int void_function_errorp) { #define FUNCTION_INDIRECTION_SUSPICION_LENGTH 16 Lisp_Object tortoise, hare; @@ -659,7 +666,7 @@ return Fsignal (Qcyclic_function_indirection, list1 (object)); } - if (errorp && UNBOUNDP (hare)) + if (void_function_errorp && UNBOUNDP (hare)) return signal_void_function_error (object); return hare; @@ -1064,7 +1071,7 @@ p++; #ifdef LISP_FLOAT_TYPE - if (isfloat_string (p)) + if (isfloat_string (p) && b == 10) return make_float (atof (p)); #endif /* LISP_FLOAT_TYPE */ @@ -1744,6 +1751,23 @@ } break; + case WEAK_LIST_FULL_ASSOC: + if (!CONSP (elem)) + { + /* just leave bogus elements there */ + need_to_mark_cons = 1; + need_to_mark_elem = 1; + } + else if (marked_p (XCAR (elem)) || + marked_p (XCDR (elem))) + { + need_to_mark_cons = 1; + /* We still need to mark elem and XCAR (elem); + marking elem does both */ + need_to_mark_elem = 1; + } + break; + default: abort (); } @@ -1884,6 +1908,7 @@ if (EQ (symbol, Qold_assoc)) return WEAK_LIST_ASSOC; /* EBOLA ALERT! */ if (EQ (symbol, Qkey_assoc)) return WEAK_LIST_KEY_ASSOC; if (EQ (symbol, Qvalue_assoc)) return WEAK_LIST_VALUE_ASSOC; + if (EQ (symbol, Qfull_assoc)) return WEAK_LIST_FULL_ASSOC; signal_simple_error ("Invalid weak list type", symbol); return WEAK_LIST_SIMPLE; /* not reached */ @@ -1898,6 +1923,7 @@ case WEAK_LIST_ASSOC: return Qassoc; case WEAK_LIST_KEY_ASSOC: return Qkey_assoc; case WEAK_LIST_VALUE_ASSOC: return Qvalue_assoc; + case WEAK_LIST_FULL_ASSOC: return Qfull_assoc; default: abort (); } @@ -1936,6 +1962,8 @@ and the car is not pointed to. `value-assoc' Objects in the list disappear if they are conses and the cdr is not pointed to. +`full-assoc' Objects in the list disappear if they are conses + and neither the car nor the cdr is pointed to. */ (type)) { @@ -2006,8 +2034,8 @@ void init_errors_once_early (void) { - defsymbol (&Qerror_conditions, "error-conditions"); - defsymbol (&Qerror_message, "error-message"); + DEFSYMBOL (Qerror_conditions); + DEFSYMBOL (Qerror_message); /* We declare the errors here because some other deferrors depend on some of the errors below. */ @@ -2015,96 +2043,100 @@ /* ERROR is used as a signaler for random errors for which nothing else is right */ - deferror (&Qerror, "error", "error", Qnil); - deferror (&Qquit, "quit", "Quit", Qnil); + DEFERROR (Qerror, "error", Qnil); + DEFERROR_STANDARD (Qquit, Qnil); - deferror (&Qwrong_type_argument, "wrong-type-argument", - "Wrong type argument", Qerror); - deferror (&Qargs_out_of_range, "args-out-of-range", "Args out of range", - Qerror); - deferror (&Qvoid_function, "void-function", - "Symbol's function definition is void", Qerror); - deferror (&Qcyclic_function_indirection, "cyclic-function-indirection", - "Symbol's chain of function indirections contains a loop", Qerror); - deferror (&Qvoid_variable, "void-variable", - "Symbol's value as variable is void", Qerror); - deferror (&Qcyclic_variable_indirection, "cyclic-variable-indirection", - "Symbol's chain of variable indirections contains a loop", Qerror); - deferror (&Qsetting_constant, "setting-constant", - "Attempt to set a constant symbol", Qerror); - deferror (&Qinvalid_read_syntax, "invalid-read-syntax", - "Invalid read syntax", Qerror); + DEFERROR (Qunimplemented, "Feature not yet implemented", Qerror); + DEFERROR_STANDARD (Qsyntax_error, Qerror); + DEFERROR_STANDARD (Qinvalid_read_syntax, Qsyntax_error); + DEFERROR_STANDARD (Qlist_formation_error, Qsyntax_error); /* Generated by list traversal macros */ - deferror (&Qmalformed_list, "malformed-list", - "Malformed list", Qerror); - deferror (&Qmalformed_property_list, "malformed-property-list", - "Malformed property list", Qmalformed_list); - deferror (&Qcircular_list, "circular-list", - "Circular list", Qerror); - deferror (&Qcircular_property_list, "circular-property-list", - "Circular property list", Qcircular_list); + DEFERROR_STANDARD (Qmalformed_list, Qlist_formation_error); + DEFERROR_STANDARD (Qmalformed_property_list, Qmalformed_list); + DEFERROR_STANDARD (Qcircular_list, Qlist_formation_error); + DEFERROR_STANDARD (Qcircular_property_list, Qcircular_list); - deferror (&Qinvalid_function, "invalid-function", "Invalid function", - Qerror); - deferror (&Qwrong_number_of_arguments, "wrong-number-of-arguments", - "Wrong number of arguments", Qerror); - deferror (&Qno_catch, "no-catch", "No catch for tag", + DEFERROR_STANDARD (Qinvalid_argument, Qerror); + DEFERROR_STANDARD (Qwrong_type_argument, Qinvalid_argument); + DEFERROR_STANDARD (Qargs_out_of_range, Qinvalid_argument); + DEFERROR_STANDARD (Qwrong_number_of_arguments, Qinvalid_argument); + DEFERROR_STANDARD (Qinvalid_function, Qinvalid_argument); + DEFERROR (Qno_catch, "No catch for tag", Qinvalid_argument); + + DEFERROR_STANDARD (Qinternal_error, Qerror); + + DEFERROR (Qinvalid_state, "Properties or values have been set incorrectly", Qerror); - deferror (&Qbeginning_of_buffer, "beginning-of-buffer", - "Beginning of buffer", Qerror); - deferror (&Qend_of_buffer, "end-of-buffer", "End of buffer", Qerror); - deferror (&Qbuffer_read_only, "buffer-read-only", "Buffer is read-only", - Qerror); - - deferror (&Qio_error, "io-error", "IO Error", Qerror); - deferror (&Qend_of_file, "end-of-file", "End of stream", Qio_error); + DEFERROR (Qvoid_function, "Symbol's function definition is void", + Qinvalid_state); + DEFERROR (Qcyclic_function_indirection, + "Symbol's chain of function indirections contains a loop", + Qinvalid_state); + DEFERROR (Qvoid_variable, "Symbol's value as variable is void", + Qinvalid_state); + DEFERROR (Qcyclic_variable_indirection, + "Symbol's chain of variable indirections contains a loop", + Qinvalid_state); - deferror (&Qarith_error, "arith-error", "Arithmetic error", Qerror); - deferror (&Qrange_error, "range-error", "Arithmetic range error", - Qarith_error); - deferror (&Qdomain_error, "domain-error", "Arithmetic domain error", - Qarith_error); - deferror (&Qsingularity_error, "singularity-error", - "Arithmetic singularity error", Qdomain_error); - deferror (&Qoverflow_error, "overflow-error", - "Arithmetic overflow error", Qdomain_error); - deferror (&Qunderflow_error, "underflow-error", - "Arithmetic underflow error", Qdomain_error); + DEFERROR (Qinvalid_operation, + "Operation not allowed or error during operation", Qerror); + DEFERROR (Qinvalid_change, "Attempt to set properties or values incorrectly", + Qinvalid_operation); + DEFERROR (Qsetting_constant, "Attempt to set a constant symbol", + Qinvalid_change); + + DEFERROR (Qediting_error, "Invalid operation during editing", + Qinvalid_operation); + DEFERROR_STANDARD (Qbeginning_of_buffer, Qediting_error); + DEFERROR_STANDARD (Qend_of_buffer, Qediting_error); + DEFERROR (Qbuffer_read_only, "Buffer is read-only", Qediting_error); + + DEFERROR (Qio_error, "IO Error", Qinvalid_operation); + DEFERROR (Qend_of_file, "End of file or stream", Qio_error); + + DEFERROR (Qarith_error, "Arithmetic error", Qinvalid_operation); + DEFERROR (Qrange_error, "Arithmetic range error", Qarith_error); + DEFERROR (Qdomain_error, "Arithmetic domain error", Qarith_error); + DEFERROR (Qsingularity_error, "Arithmetic singularity error", Qdomain_error); + DEFERROR (Qoverflow_error, "Arithmetic overflow error", Qdomain_error); + DEFERROR (Qunderflow_error, "Arithmetic underflow error", Qdomain_error); } void syms_of_data (void) { - defsymbol (&Qquote, "quote"); - defsymbol (&Qlambda, "lambda"); - defsymbol (&Qlistp, "listp"); - defsymbol (&Qtrue_list_p, "true-list-p"); - defsymbol (&Qconsp, "consp"); - defsymbol (&Qsubrp, "subrp"); - defsymbol (&Qsymbolp, "symbolp"); - defsymbol (&Qintegerp, "integerp"); - defsymbol (&Qcharacterp, "characterp"); - defsymbol (&Qnatnump, "natnump"); - defsymbol (&Qstringp, "stringp"); - defsymbol (&Qarrayp, "arrayp"); - defsymbol (&Qsequencep, "sequencep"); - defsymbol (&Qbufferp, "bufferp"); - defsymbol (&Qbitp, "bitp"); - defsymbol (&Qbit_vectorp, "bit-vector-p"); - defsymbol (&Qvectorp, "vectorp"); - defsymbol (&Qchar_or_string_p, "char-or-string-p"); - defsymbol (&Qmarkerp, "markerp"); - defsymbol (&Qinteger_or_marker_p, "integer-or-marker-p"); - defsymbol (&Qinteger_or_char_p, "integer-or-char-p"); - defsymbol (&Qinteger_char_or_marker_p, "integer-char-or-marker-p"); - defsymbol (&Qnumberp, "numberp"); - defsymbol (&Qnumber_char_or_marker_p, "number-char-or-marker-p"); - defsymbol (&Qcdr, "cdr"); - defsymbol (&Qweak_listp, "weak-list-p"); + INIT_LRECORD_IMPLEMENTATION (weak_list); + + DEFSYMBOL (Qquote); + DEFSYMBOL (Qlambda); + DEFSYMBOL (Qlistp); + DEFSYMBOL (Qtrue_list_p); + DEFSYMBOL (Qconsp); + DEFSYMBOL (Qsubrp); + DEFSYMBOL (Qsymbolp); + DEFSYMBOL (Qintegerp); + DEFSYMBOL (Qcharacterp); + DEFSYMBOL (Qnatnump); + DEFSYMBOL (Qstringp); + DEFSYMBOL (Qarrayp); + DEFSYMBOL (Qsequencep); + DEFSYMBOL (Qbufferp); + DEFSYMBOL (Qbitp); + DEFSYMBOL_MULTIWORD_PREDICATE (Qbit_vectorp); + DEFSYMBOL (Qvectorp); + DEFSYMBOL (Qchar_or_string_p); + DEFSYMBOL (Qmarkerp); + DEFSYMBOL (Qinteger_or_marker_p); + DEFSYMBOL (Qinteger_or_char_p); + DEFSYMBOL (Qinteger_char_or_marker_p); + DEFSYMBOL (Qnumberp); + DEFSYMBOL (Qnumber_char_or_marker_p); + DEFSYMBOL (Qcdr); + DEFSYMBOL_MULTIWORD_PREDICATE (Qweak_listp); #ifdef LISP_FLOAT_TYPE - defsymbol (&Qfloatp, "floatp"); + DEFSYMBOL (Qfloatp); #endif /* LISP_FLOAT_TYPE */ DEFSUBR (Fwrong_type_argument); diff -r 72a7cfa4a488 -r abe6d1db359e src/database.c --- a/src/database.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/database.c Mon Aug 13 11:35:02 2007 +0200 @@ -53,7 +53,7 @@ #endif /* WE_DONT_NEED_QUADS */ #endif /* HAVE_INTTYPES_H */ #endif /* !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) */ -#include DB_H_PATH /* Berkeley db's header file */ +#include DB_H_FILE /* Berkeley db's header file */ #ifndef DB_VERSION_MAJOR # define DB_VERSION_MAJOR 1 #endif /* DB_VERSION_MAJOR */ @@ -759,6 +759,8 @@ void syms_of_database (void) { + INIT_LRECORD_IMPLEMENTATION (database); + defsymbol (&Qdatabasep, "databasep"); #ifdef HAVE_DBM defsymbol (&Qdbm, "dbm"); diff -r 72a7cfa4a488 -r abe6d1db359e src/database.h --- a/src/database.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/database.h Mon Aug 13 11:35:02 2007 +0200 @@ -18,7 +18,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* This file is only necessary to get INLINE handling correct. +/* This file is only necessary to get inline handling correct. See inline.c */ #ifndef INCLUDED_database_h_ diff -r 72a7cfa4a488 -r abe6d1db359e src/depend --- a/src/depend Mon Aug 13 11:33:40 2007 +0200 +++ b/src/depend Mon Aug 13 11:35:02 2007 +0200 @@ -1,216 +1,220 @@ -## This file automatically generated by make-src-depend. Do not modify. +## This file is automatically generated by `make-src-depend'. Do not modify. -#ifdef USE_UNION_TYPE +#if defined(USE_UNION_TYPE) LISP_UNION_H=lisp-union.h #else LISP_UNION_H=lisp-disunion.h #endif -LISP_H = lisp.h config.h $(LISP_UNION_H) -#ifdef HAVE_MS_WINDOWS -console-msw.o: $(LISP_H) conslots.h console-msw.h console.h events.h lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h systime.h -device-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h -dialog-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h -dired-msw.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h nt.h regex.h symeval.h symsinit.h sysdir.h sysfile.h sysproc.h systime.h -event-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-tty.h console.h device.h dragdrop.h events-mod.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h menubar-msw.h mule-charset.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h select.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h -frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h -glyphs-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h window.h winslots.h -gui-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h elhash.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h -menubar-msw.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h -objects-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-msw.h objects.h specifier.h symeval.h symsinit.h -redisplay-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h window.h winslots.h -scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h -select-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h select.h specifier.h symeval.h symsinit.h toolbar.h -toolbar-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h +LISP_H=lisp.h lrecord.h config.h general-slots.h symsinit.h symeval.h $(LISP_UNION_H) +#if defined(HAVE_MS_WINDOWS) +console-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h events.h mule-charset.h opaque.h syscommctrl.h systime.h syswindows.h +device-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h +dialog-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h +dired-msw.o: $(LISP_H) buffer.h bufslots.h mule-charset.h ndir.h nt.h regex.h sysdir.h sysfile.h sysproc.h systime.h syswindows.h +event-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-tty.h console.h device.h dragdrop.h events-mod.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h menubar-msw.h menubar.h mule-charset.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h select.h specifier.h syscommctrl.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h +frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h +glyphs-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h lstream.h mule-charset.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syswindows.h toolbar.h window.h winslots.h +gui-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h +menubar-msw.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h +objects-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h hash.h insdel.h mule-charset.h objects-msw.h objects.h specifier.h syscommctrl.h syswindows.h +redisplay-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h gutter.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h +scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h +select-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h file-coding.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h select.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h +toolbar-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h #endif -#ifdef HAVE_X_WINDOWS -balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h xintrinsic.h -console-x.o: $(LISP_H) conslots.h console-x.h console.h lisp-disunion.h lisp-union.h lrecord.h process.h redisplay.h symeval.h symsinit.h xintrinsic.h -device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h toolbar.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 commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h -frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.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 conslots.h console-x.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h window.h winslots.h xintrinsic.h xmu.h -gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h -input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h -input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h -menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h -objects-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h specifier.h symeval.h symsinit.h xintrinsic.h -redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h systime.h toolbar.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-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h -select-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h symeval.h symsinit.h systime.h toolbar.h xintrinsic.h -toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h +#if defined(HAVE_X_WINDOWS) +balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h xintrinsic.h +console-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h mule-charset.h process.h redisplay.h xintrinsic.h +device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mule-charset.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 toolbar.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 commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h toolbar.h window.h 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 conslots.h console-x.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lstream.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h xintrinsic.h xmu.h +gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h keymap.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +objects-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h insdel.h mule-charset.h objects-x.h objects.h specifier.h xintrinsic.h +redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h +scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h redisplay.h scrollbar-x.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h +select-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h #endif -#ifdef HAVE_DATABASE -database.o: $(LISP_H) buffer.h bufslots.h database.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h +#if defined(HAVE_TTY) +console-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h +device-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h +event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h +frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h +objects-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h insdel.h mule-charset.h objects-tty.h objects.h specifier.h syssignal.h systty.h +redisplay-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h #endif -#ifdef MULE -mule-canna.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h -mule-ccl.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h symeval.h symsinit.h -mule-charset.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-ccl.h mule-charset.h symeval.h symsinit.h -mule-mcpath.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h -mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h window.h winslots.h -mule.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h regex.h symeval.h symsinit.h +#if defined(HAVE_DATABASE) +database.o: $(LISP_H) buffer.h bufslots.h database.h mule-charset.h sysfile.h #endif -#ifdef EXTERNAL_WIDGET +#if defined(MULE) +mule-canna.o: $(LISP_H) buffer.h bufslots.h file-coding.h mule-charset.h +mule-ccl.o: $(LISP_H) buffer.h bufslots.h file-coding.h mule-ccl.h mule-charset.h +mule-charset.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h lstream.h mule-ccl.h mule-charset.h +mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h mule-charset.h redisplay.h scrollbar.h sysdep.h window.h winslots.h +mule.o: $(LISP_H) regex.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 #endif -EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h +EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.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 chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h window.h winslots.h -alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console-stream.h console.h device.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h systime.h toolbar.h window.h winslots.h +abbrev.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h redisplay.h scrollbar.h syntax.h window.h winslots.h +alloc.o: $(LISP_H) alloc.h backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console-stream.h console.h device.h dumper.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h alloca.o: config.h balloon_help.o: balloon_help.h config.h xintrinsic.h -blocktype.o: $(LISP_H) blocktype.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h -bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h syntax.h -callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h events.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h systime.h window.h winslots.h -callproc.o: $(LISP_H) buffer.h bufslots.h commands.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h nt.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h window.h winslots.h -casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h -casetab.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h -chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h -cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h -cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h -cmds.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h -console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h -console-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h -console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h -data.o: $(LISP_H) buffer.h bufslots.h bytecode.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfloat.h syssignal.h -debug.o: $(LISP_H) bytecode.h debug.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -device-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h -device.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h -dgif_lib.o: gifrlib.h -dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h -dired.o: $(LISP_H) buffer.h bufslots.h commands.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h opaque.h regex.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h -doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h -doprnt.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h -dragdrop.o: $(LISP_H) dragdrop.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -dynarr.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +blocktype.o: $(LISP_H) blocktype.h +buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h process.h redisplay.h scrollbar.h select.h specifier.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h +bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h mule-charset.h opaque.h syntax.h +callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h events.h insdel.h mule-charset.h redisplay.h scrollbar.h systime.h window.h winslots.h +callproc.o: $(LISP_H) buffer.h bufslots.h commands.h file-coding.h insdel.h lstream.h mule-charset.h nt.h process.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h window.h winslots.h +casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h mule-charset.h syntax.h +casetab.o: $(LISP_H) buffer.h bufslots.h mule-charset.h opaque.h +chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h syntax.h +cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systty.h toolbar.h window.h winslots.h +cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +cmds.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h syntax.h +console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h +console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h +data.o: $(LISP_H) buffer.h bufslots.h bytecode.h mule-charset.h sysfloat.h syssignal.h +debug.o: $(LISP_H) bytecode.h debug.h +device.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs.h gui.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h +dgif_lib.o: $(LISP_H) gifrlib.h sysfile.h +dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +dired.o: $(LISP_H) buffer.h bufslots.h commands.h elhash.h mule-charset.h ndir.h opaque.h regex.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h +doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h insdel.h keymap.h mule-charset.h sysfile.h +doprnt.o: $(LISP_H) buffer.h bufslots.h lstream.h mule-charset.h +dragdrop.o: $(LISP_H) dragdrop.h +dumper.o: $(LISP_H) alloc.h conslots.h console-stream.h console.h dump-id.h dumper.h elhash.h nt.h specifier.h sysfile.h syswindows.h +dynarr.o: $(LISP_H) ecrt0.o: config.h -editfns.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syspwd.h systime.h toolbar.h window.h winslots.h -eldap.o: $(LISP_H) buffer.h bufslots.h eldap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h sysdep.h -elhash.o: $(LISP_H) bytecode.h elhash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h paths.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h toolbar.h -emodules.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h emodules.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h toolbar.h window.h winslots.h -esd.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h miscplay.h symeval.h symsinit.h -eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h commands.h conslots.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h -event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h blocktype.h buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h toolbar.h xintrinsic.h xintrinsicp.h -event-stream.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui-x.h gui.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h macros.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h xintrinsic.h -event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h -event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h -events.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h -extents.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h -faces.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h -file-coding.o: $(LISP_H) buffer.h bufslots.h chartab.h elhash.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-ccl.h mule-charset.h opaque.h symeval.h symsinit.h -fileio.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h ndir.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h -filelock.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h paths.h symeval.h symsinit.h sysdir.h sysfile.h syspwd.h syssignal.h -filemode.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h -floatfns.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfloat.h syssignal.h -fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h -font-lock.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h -frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h -frame.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h -free-hook.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -general.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -getloadavg.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h -gif_io.o: gifrlib.h sysfile.h -glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h file-coding.h frame.h frameslots.h gifrlib.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h -glyphs-widget.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h -glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h +editfns.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syspwd.h systime.h toolbar.h window.h winslots.h +eldap.o: $(LISP_H) buffer.h bufslots.h eldap.h mule-charset.h opaque.h sysdep.h +elhash.o: $(LISP_H) bytecode.h elhash.h +emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h device.h dump-id.h dumper.h frame.h frameslots.h glyphs.h gui.h mule-charset.h nt.h paths.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h syswindows.h toolbar.h window.h winslots.h +emodules.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h emodules.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h toolbar.h window.h winslots.h +esd.o: $(LISP_H) miscplay.h +eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h commands.h conslots.h console.h mule-charset.h opaque.h +event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h +event-stream.o: $(LISP_H) blocktype.h buffer.h bufslots.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lstream.h macros.h menubar.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h +event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h lstream.h mule-charset.h process.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h +events.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h gui.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h +extents.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h keymap.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +faces.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +file-coding.o: $(LISP_H) buffer.h bufslots.h chartab.h elhash.h file-coding.h insdel.h lstream.h mule-ccl.h mule-charset.h opaque.h +fileio.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h ndir.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h +filelock.o: $(LISP_H) buffer.h bufslots.h mule-charset.h ndir.h paths.h sysdir.h sysfile.h syspwd.h syssignal.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 conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h toolbar.h window.h winslots.h +font-lock.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h mule-charset.h syntax.h +frame.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +free-hook.o: $(LISP_H) hash.h +general.o: $(LISP_H) +getloadavg.o: $(LISP_H) sysfile.h +gif_io.o: config.h gifrlib.h sysfile.h +glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h file-coding.h frame.h frameslots.h gifrlib.h glyphs.h gui.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h +glyphs-widget.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h gmalloc.o: config.h getpagesize.h -gpmevent.o: $(LISP_H) commands.h conslots.h console-tty.h console.h device.h events-mod.h events.h gpmevent.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h systty.h -gui.o: $(LISP_H) bytecode.h elhash.h gui.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -gutter.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h -hash.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -hftctl.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -hpplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -imgproc.o: $(LISP_H) imgproc.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h -inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h systime.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h -input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h -insdel.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h -intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h -libsst.o: $(LISP_H) libsst.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -line-number.o: $(LISP_H) buffer.h bufslots.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h -linuxplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h miscplay.h symeval.h symsinit.h sysfile.h syssignal.h -lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h elhash.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h symeval.h symsinit.h sysfile.h sysfloat.h -lstream.o: $(LISP_H) buffer.h bufslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h sysfile.h -macros.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h +gpmevent.o: $(LISP_H) commands.h conslots.h console-tty.h console.h device.h events-mod.h events.h gpmevent.h lstream.h mule-charset.h process.h sysdep.h sysproc.h syssignal.h systime.h systty.h +gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h elhash.h gui.h mule-charset.h +gutter.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +hash.o: $(LISP_H) hash.h +hftctl.o: $(LISP_H) +hpplay.o: $(LISP_H) nativesound.h +imgproc.o: $(LISP_H) imgproc.h +indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console-msw.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lstream.h mule-charset.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h syscommctrl.h systime.h syswindows.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h +input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h +input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +insdel.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h +keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +libsst.o: $(LISP_H) libsst.h +line-number.o: $(LISP_H) buffer.h bufslots.h line-number.h mule-charset.h +linuxplay.o: $(LISP_H) miscplay.h nativesound.h sysfile.h syssignal.h +lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h elhash.h file-coding.h lstream.h mule-charset.h opaque.h sysfile.h sysfloat.h +lstream.o: $(LISP_H) buffer.h bufslots.h insdel.h lstream.h mule-charset.h sysfile.h +macros.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h keymap.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h malloc.o: config.h getpagesize.h -marker.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h -md5.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h -menubar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h -minibuf.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h -miscplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h miscplay.h symeval.h symsinit.h sysfile.h syssignal.h -nas.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysdep.h syssignal.h -nt.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nt.h ntheap.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h -ntheap.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h ntheap.h symeval.h symsinit.h -ntplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h -ntproc.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h nt.h ntheap.h process.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswait.h -objects-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-tty.h objects.h specifier.h symeval.h symsinit.h syssignal.h systty.h -objects.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h +marker.o: $(LISP_H) buffer.h bufslots.h mule-charset.h +md5.o: $(LISP_H) buffer.h bufslots.h file-coding.h lstream.h mule-charset.h +menubar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h keymap.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +minibuf.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +miscplay.o: $(LISP_H) miscplay.h sysfile.h syssignal.h +nas.o: $(LISP_H) sysdep.h syssignal.h +nt.o: $(LISP_H) ndir.h nt.h ntheap.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h +ntheap.o: $(LISP_H) ntheap.h syswindows.h +ntplay.o: $(LISP_H) nativesound.h nt.h sysfile.h syswindows.h +ntproc.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h mule-charset.h nt.h ntheap.h process.h syscommctrl.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h +objects.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h -opaque.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h -print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h syssignal.h systty.h toolbar.h -process-nt.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h procimpl.h symeval.h symsinit.h sysdep.h -process-unix.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h -process.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h -profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h syssignal.h systime.h -ralloc.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -rangetab.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h rangetab.h symeval.h symsinit.h +opaque.o: $(LISP_H) opaque.h +postgresql.o: $(LISP_H) buffer.h bufslots.h mule-charset.h postgresql.h sysdep.h +print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-msw.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syssignal.h systty.h syswindows.h toolbar.h window.h winslots.h +process-nt.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h hash.h lstream.h mule-charset.h nt.h process.h procimpl.h syscommctrl.h sysdep.h syswindows.h +process-unix.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h +process.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h insdel.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.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: config.h -redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h -redisplay-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h -redisplay.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-tty.h console.h debug.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h window.h winslots.h -regex.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h regex.h symeval.h symsinit.h syntax.h -scrollbar.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h -search.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h regex.h symeval.h symsinit.h syntax.h -select.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h symeval.h symsinit.h toolbar.h -sgiplay.o: $(LISP_H) libst.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -sheap.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h sheap-adjust.h symeval.h symsinit.h -signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h -sound.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h symeval.h symsinit.h sysdep.h xintrinsic.h -specifier.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h +redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +redisplay.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-tty.h console.h debug.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h +regex.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h regex.h syntax.h +scrollbar.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +search.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h mule-charset.h opaque.h regex.h syntax.h +select.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h toolbar.h window.h winslots.h +sgiplay.o: $(LISP_H) libst.h +sheap.o: $(LISP_H) sheap-adjust.h +signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h +sound.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h mule-charset.h nativesound.h redisplay.h sysdep.h sysfile.h sysproc.h systime.h xintrinsic.h +specifier.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h strcat.o: config.h strcmp.o: config.h strcpy.o: config.h -strftime.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +strftime.o: $(LISP_H) sunOS-fix.o: config.h -sunplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysdep.h syssignal.h -sunpro.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h -symbols.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h -syntax.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h -sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h ntheap.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h +sunplay.o: $(LISP_H) nativesound.h sysdep.h syssignal.h +sunpro.o: $(LISP_H) +symbols.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h elhash.h mule-charset.h +syntax.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h syntax.h +sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h ndir.h nt.h ntheap.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h sysdll.o: config.h sysdll.h -termcap.o: $(LISP_H) conslots.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +termcap.o: $(LISP_H) conslots.h console.h device.h terminfo.o: config.h -tests.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h symeval.h symsinit.h -toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h -tooltalk.o: $(LISP_H) buffer.h bufslots.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h process.h symeval.h symsinit.h tooltalk.h +tests.o: $(LISP_H) buffer.h bufslots.h lstream.h mule-charset.h opaque.h +toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +tooltalk.o: $(LISP_H) buffer.h bufslots.h elhash.h mule-charset.h process.h syssignal.h tooltalk.h tparam.o: config.h -undo.o: $(LISP_H) buffer.h bufslots.h extents.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h -unexaix.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +undo.o: $(LISP_H) buffer.h bufslots.h extents.h mule-charset.h +unexaix.o: $(LISP_H) getpagesize.h unexalpha.o: config.h unexapollo.o: config.h unexconvex.o: config.h getpagesize.h unexcw.o: config.h sysfile.h -unexec.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +unexec.o: $(LISP_H) getpagesize.h unexelf.o: config.h -unexelfsgi.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +unexelfsgi.o: $(LISP_H) unexenix.o: config.h unexfreebsd.o: config.h unexhp9k3.o: config.h sysdep.h -unexhp9k800.o: config.h +unexhp9k800.o: $(LISP_H) unexmips.o: config.h getpagesize.h -unexnt.o: config.h ntheap.h +unexnt.o: $(LISP_H) nt.h ntheap.h syswindows.h unexsunos4.o: config.h -vm-limit.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h mem-limits.h symeval.h symsinit.h -widget.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h -window.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h -xgccache.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h xgccache.h +vm-limit.o: $(LISP_H) mem-limits.h +widget.o: $(LISP_H) buffer.h bufslots.h mule-charset.h +win32.o: $(LISP_H) buffer.h bufslots.h mule-charset.h syswindows.h +window.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +xgccache.o: $(LISP_H) hash.h xgccache.h xmu.o: config.h diff -r 72a7cfa4a488 -r abe6d1db359e src/device-msw.c --- a/src/device-msw.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/device-msw.c Mon Aug 13 11:35:02 2007 +0200 @@ -34,12 +34,17 @@ #include "console-msw.h" #include "console-stream.h" +#include "objects-msw.h" #include "events.h" #include "faces.h" #include "frame.h" #include "sysdep.h" -#include +#include + +#if !(defined (CYGWIN) || defined(MINGW)) +#include /* For CoInitialize */ +#endif /* win32 DDE management library globals */ #ifdef HAVE_DRAGNDROP @@ -53,13 +58,16 @@ nil means no, t means yes. */ Lisp_Object Vmswindows_downcase_file_names; -/* Control whether stat() attempts to determine file type and link count +/* Control whether xemacs_stat() attempts to determine file type and link count exactly, at the expense of slower operation. Since true hard links are supported on NTFS volumes, this is only relevant on NT. */ Lisp_Object Vmswindows_get_true_file_attributes; Lisp_Object Qinit_pre_mswindows_win, Qinit_post_mswindows_win; +Lisp_Object Qdevmodep; +static Lisp_Object allocate_devmode (DEVMODE* src_devmode, int do_copy, + char* src_name, struct device *d); /************************************************************************/ /* helpers */ @@ -68,18 +76,7 @@ static Lisp_Object build_syscolor_string (int idx) { - DWORD clr; - char buf[16]; - - if (idx < 0) - return Qnil; - - clr = GetSysColor (idx); - sprintf (buf, "#%02X%02X%02X", - GetRValue (clr), - GetGValue (clr), - GetBValue (clr)); - return build_string (buf); + return (idx < 0 ? Qnil : mswindows_color_to_string (GetSysColor (idx))); } static Lisp_Object @@ -107,7 +104,6 @@ index2 < 0 ? Qnil : make_int (GetDeviceCaps (hdc, index2))); } - /************************************************************************/ /* display methods */ @@ -127,20 +123,9 @@ d->device_data = xnew_and_zero (struct mswindows_device); hdc = CreateCompatibleDC (NULL); assert (hdc!=NULL); - DEVICE_MSWINDOWS_LOGPIXELSX(d) = GetDeviceCaps(hdc, LOGPIXELSX); - DEVICE_MSWINDOWS_LOGPIXELSY(d) = GetDeviceCaps(hdc, LOGPIXELSY); - DEVICE_MSWINDOWS_PLANES(d) = GetDeviceCaps(hdc, PLANES); - /* #### SIZEPALETTE only valid if RC_PALETTE bit set in RASTERCAPS, - what should we return for a non-palette-based device? */ - DEVICE_MSWINDOWS_CELLS(d) = GetDeviceCaps(hdc, SIZEPALETTE); - DEVICE_MSWINDOWS_HORZRES(d) = GetDeviceCaps(hdc, HORZRES); - DEVICE_MSWINDOWS_VERTRES(d) = GetDeviceCaps(hdc, VERTRES); - DEVICE_MSWINDOWS_HORZSIZE(d) = GetDeviceCaps(hdc, HORZSIZE); - DEVICE_MSWINDOWS_VERTSIZE(d) = GetDeviceCaps(hdc, VERTSIZE); - DEVICE_MSWINDOWS_BITSPIXEL(d) = GetDeviceCaps(hdc, BITSPIXEL); + DEVICE_MSWINDOWS_HCDC(d) = hdc; DEVICE_MSWINDOWS_FONTLIST (d) = mswindows_enumerate_fonts (hdc); - - DeleteDC (hdc); + DEVICE_MSWINDOWS_UPDATE_TICK (d) = GetTickCount (); /* Register the main window class */ wc.cbSize = sizeof (WNDCLASSEX); @@ -150,7 +135,7 @@ wc.cbWndExtra = MSWINDOWS_WINDOW_EXTRA_BYTES; /* This must match whatever is passed to CreateWIndowEx, NULL is ok for this. */ - wc.hInstance = NULL; + wc.hInstance = NULL; wc.hIcon = LoadIcon (GetModuleHandle(NULL), XEMACS_CLASS); wc.hCursor = LoadCursor (NULL, IDC_ARROW); /* Background brush is only used during sizing, when XEmacs cannot @@ -159,9 +144,16 @@ wc.lpszMenuName = NULL; wc.lpszClassName = XEMACS_CLASS; - wc.hIconSm = LoadImage (GetModuleHandle (NULL), XEMACS_CLASS, - IMAGE_ICON, 16, 16, 0); - RegisterClassEx (&wc); + if (xLoadImageA) /* not in NT 3.5 */ + wc.hIconSm = (HICON) xLoadImageA (GetModuleHandle (NULL), XEMACS_CLASS, + IMAGE_ICON, 16, 16, 0); + else + wc.hIconSm = 0; + + if (xRegisterClassExA) /* not in NT 3.5 */ + xRegisterClassExA (&wc); + else + RegisterClassA ((WNDCLASS *) &wc.style); #ifdef HAVE_WIDGETS xzero (wc); @@ -170,7 +162,10 @@ wc.lpfnWndProc = (WNDPROC) mswindows_control_wnd_proc; wc.lpszClassName = XEMACS_CONTROL_CLASS; wc.hInstance = NULL; - RegisterClassEx (&wc); + if (xRegisterClassExA) /* not in NT 3.5 */ + xRegisterClassExA (&wc); + else + RegisterClassA ((WNDCLASS *) &wc.style); #endif #if defined (HAVE_TOOLBARS) || defined (HAVE_WIDGETS) @@ -184,13 +179,20 @@ /* Initialize DDE management library and our related globals. We execute a * dde Open("file") by simulating a drop, so this depends on dnd support. */ #ifdef HAVE_DRAGNDROP +# if !(defined(CYGWIN) || defined(MINGW)) + CoInitialize (NULL); +# endif + mswindows_dde_mlid = 0; DdeInitialize (&mswindows_dde_mlid, (PFNCALLBACK)mswindows_dde_callback, APPCMD_FILTERINITS|CBF_FAIL_SELFCONNECTIONS|CBF_FAIL_ADVISES| - CBF_FAIL_POKES|CBF_FAIL_REQUESTS|CBF_SKIP_ALLNOTIFICATIONS, 0); - - mswindows_dde_service = DdeCreateStringHandle (mswindows_dde_mlid, XEMACS_CLASS, 0); - mswindows_dde_topic_system = DdeCreateStringHandle (mswindows_dde_mlid, SZDDESYS_TOPIC, 0); + CBF_FAIL_POKES|CBF_FAIL_REQUESTS|CBF_SKIP_ALLNOTIFICATIONS, + 0); + + mswindows_dde_service = DdeCreateStringHandle (mswindows_dde_mlid, + XEMACS_CLASS, 0); + mswindows_dde_topic_system = DdeCreateStringHandle (mswindows_dde_mlid, + SZDDESYS_TOPIC, 0); mswindows_dde_item_open = DdeCreateStringHandle (mswindows_dde_mlid, TEXT(MSWINDOWS_DDE_ITEM_OPEN), 0); DdeNameService (mswindows_dde_mlid, mswindows_dde_service, 0L, DNS_REGISTER); @@ -201,11 +203,25 @@ mswindows_delete_device (struct device *d) { #ifdef HAVE_DRAGNDROP - DdeNameService (mswindows_dde_mlid, 0L, 0L, DNS_REGISTER); + DdeNameService (mswindows_dde_mlid, 0L, 0L, DNS_UNREGISTER); + DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_item_open); + DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_topic_system); + DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_service); DdeUninitialize (mswindows_dde_mlid); + +# if !(defined(CYGWIN) || defined(MINGW)) + CoUninitialize (); +# endif #endif - free (d->device_data); + DeleteDC (DEVICE_MSWINDOWS_HCDC(d)); + xfree (d->device_data); +} + +void +mswindows_get_workspace_coords (RECT *rc) +{ + SystemParametersInfo (SPI_GETWORKAREA, 0, rc, 0); } static void @@ -218,47 +234,51 @@ mswindows_device_system_metrics (struct device *d, enum device_metrics m) { + const HDC hdc = DEVICE_MSWINDOWS_HCDC(d); + switch (m) { case DM_size_device: - return Fcons (make_int (DEVICE_MSWINDOWS_HORZRES(d)), - make_int (DEVICE_MSWINDOWS_VERTRES(d))); + return Fcons (make_int (GetDeviceCaps (hdc, HORZRES)), + make_int (GetDeviceCaps (hdc, VERTRES))); break; case DM_device_dpi: - return Fcons (make_int (DEVICE_MSWINDOWS_LOGPIXELSX(d)), - make_int (DEVICE_MSWINDOWS_LOGPIXELSY(d))); + return Fcons (make_int (GetDeviceCaps (hdc, LOGPIXELSX)), + make_int (GetDeviceCaps (hdc, LOGPIXELSY))); break; case DM_size_device_mm: - return Fcons (make_int (DEVICE_MSWINDOWS_HORZSIZE(d)), - make_int (DEVICE_MSWINDOWS_VERTSIZE(d))); + return Fcons (make_int (GetDeviceCaps (hdc, HORZSIZE)), + make_int (GetDeviceCaps (hdc, VERTSIZE))); break; case DM_num_bit_planes: /* this is what X means by bitplanes therefore we ought to be consistent. num planes is always 1 under mswindows and therefore useless */ - return make_int (DEVICE_MSWINDOWS_BITSPIXEL(d)); + return make_int (GetDeviceCaps (hdc, BITSPIXEL)); break; case DM_num_color_cells: - return make_int (DEVICE_MSWINDOWS_CELLS(d)); + /* #### SIZEPALETTE only valid if RC_PALETTE bit set in RASTERCAPS, + what should we return for a non-palette-based device? */ + return make_int (GetDeviceCaps (hdc, SIZEPALETTE)); break; /*** Colors ***/ -#define FROB(met, index1, index2) \ +#define FROB(met, fore, back) \ case DM_##met: \ - return build_syscolor_cons (index1, index2); - - FROB (color_default, COLOR_WINDOW, COLOR_WINDOWTEXT); - FROB (color_select, COLOR_HIGHLIGHT, COLOR_HIGHLIGHTTEXT); - FROB (color_balloon, COLOR_INFOBK, COLOR_INFOTEXT); - FROB (color_3d_face, COLOR_3DFACE, COLOR_BTNTEXT); - FROB (color_3d_light, COLOR_3DLIGHT, COLOR_3DHILIGHT); - FROB (color_3d_dark, COLOR_3DSHADOW, COLOR_3DDKSHADOW); - FROB (color_menu, COLOR_MENU, COLOR_MENUTEXT); - FROB (color_menu_highlight, COLOR_HIGHLIGHT, COLOR_HIGHLIGHTTEXT); - FROB (color_menu_button, COLOR_MENU, COLOR_MENUTEXT); - FROB (color_menu_disabled, COLOR_MENU, COLOR_GRAYTEXT); - FROB (color_toolbar, COLOR_BTNFACE, COLOR_BTNTEXT); - FROB (color_scrollbar, COLOR_SCROLLBAR, COLOR_CAPTIONTEXT); + return build_syscolor_cons (fore, back); + + FROB (color_default, COLOR_WINDOWTEXT, COLOR_WINDOW); + FROB (color_select, COLOR_HIGHLIGHTTEXT, COLOR_HIGHLIGHT); + FROB (color_balloon, COLOR_INFOTEXT, COLOR_INFOBK); + FROB (color_3d_face, COLOR_BTNTEXT, COLOR_BTNFACE); + FROB (color_3d_light, COLOR_3DHILIGHT, COLOR_3DLIGHT); + FROB (color_3d_dark, COLOR_3DDKSHADOW, COLOR_3DSHADOW); + FROB (color_menu, COLOR_MENUTEXT, COLOR_MENU); + FROB (color_menu_highlight, COLOR_HIGHLIGHTTEXT, COLOR_HIGHLIGHT); + FROB (color_menu_button, COLOR_MENUTEXT, COLOR_MENU); + FROB (color_menu_disabled, COLOR_GRAYTEXT, COLOR_MENU); + FROB (color_toolbar, COLOR_BTNTEXT, COLOR_BTNFACE); + FROB (color_scrollbar, COLOR_CAPTIONTEXT, COLOR_SCROLLBAR); FROB (color_desktop, -1, COLOR_DESKTOP); FROB (color_workspace, -1, COLOR_APPWORKSPACE); #undef FROB @@ -278,10 +298,18 @@ case DM_size_workspace: { RECT rc; - SystemParametersInfo (SPI_GETWORKAREA, 0, &rc, 0); + mswindows_get_workspace_coords (&rc); return Fcons (make_int (rc.right - rc.left), make_int (rc.bottom - rc.top)); } + + case DM_offset_workspace: + { + RECT rc; + mswindows_get_workspace_coords (&rc); + return Fcons (make_int (rc.left), make_int (rc.top)); + } + /* case DM_size_toolbar: case DM_size_toolbar_button: @@ -314,63 +342,147 @@ /************************************************************************/ -/* printer methods */ +/* printer helpers */ /************************************************************************/ static void signal_open_printer_error (struct device *d) { - signal_simple_error ("Failed to open printer", DEVICE_CONNECTION (d)); + invalid_operation ("Failed to open printer", DEVICE_CONNECTION (d)); +} + + +/* Helper function */ +static int +msprinter_init_device_internal (struct device *d, char* printer_name) +{ + DEVICE_MSPRINTER_NAME(d) = xstrdup (printer_name); + + if (!OpenPrinter (printer_name, &DEVICE_MSPRINTER_HPRINTER (d), NULL)) + { + DEVICE_MSPRINTER_HPRINTER (d) = NULL; + return 0; + } + + DEVICE_MSPRINTER_HDC (d) = CreateDC ("WINSPOOL", printer_name, + NULL, NULL); + if (DEVICE_MSPRINTER_HDC (d) == NULL) + return 0; + + DEVICE_MSPRINTER_HCDC(d) = + CreateCompatibleDC (DEVICE_MSPRINTER_HDC (d)); + + DEVICE_CLASS (d) = (GetDeviceCaps (DEVICE_MSPRINTER_HDC (d), BITSPIXEL) + * GetDeviceCaps (DEVICE_MSPRINTER_HDC (d), PLANES) + > 1) ? Qcolor : Qmono; + return 1; } static void +msprinter_delete_device_internal (struct device *d) +{ + if (DEVICE_MSPRINTER_HPRINTER (d)) + ClosePrinter (DEVICE_MSPRINTER_HPRINTER (d)); + if (DEVICE_MSPRINTER_HDC (d)) + DeleteDC (DEVICE_MSPRINTER_HDC (d)); + if (DEVICE_MSPRINTER_HCDC (d)) + DeleteDC (DEVICE_MSPRINTER_HCDC (d)); + if (DEVICE_MSPRINTER_NAME (d)) + xfree (DEVICE_MSPRINTER_NAME (d)); + + DEVICE_MSPRINTER_FONTLIST (d) = Qnil; +} + +static int +msprinter_reinit_device (struct device *d, char* devname) +{ + msprinter_delete_device_internal (d); + return msprinter_init_device_internal (d, devname); +} + +Lisp_Object +msprinter_default_printer (void) +{ + Extbyte name[666]; + Bufbyte *nameint; + + if (GetProfileString (XETEXT ("windows"), XETEXT ("device"), NULL, name, + sizeof (name) / XETCHAR_SIZE) <= 0) + return Qnil; + EXTERNAL_TO_C_STRING (name, nameint, Qmswindows_tstr); + + if (name[0] == '\0') + return Qnil; + strtok (name, ","); + + return build_string (name); +} + + +/************************************************************************/ +/* printer methods */ +/************************************************************************/ + +static void msprinter_init_device (struct device *d, Lisp_Object props) { char* printer_name; - - DEVICE_INFD (d) = DEVICE_OUTFD (d) = -1; - - CHECK_STRING (DEVICE_CONNECTION (d)); - - TO_EXTERNAL_FORMAT (LISP_STRING, DEVICE_CONNECTION (d), - C_STRING_ALLOCA, printer_name, - Qctext); + DEVMODE *pdm; + size_t dm_size; d->device_data = xnew_and_zero (struct msprinter_device); - DEVICE_MSPRINTER_NAME(d) = xstrdup (printer_name); - - if (!OpenPrinter (printer_name, &DEVICE_MSPRINTER_HPRINTER (d), NULL)) - { - DEVICE_MSPRINTER_HPRINTER (d) = NULL; - signal_open_printer_error (d); - } - - DEVICE_MSPRINTER_HDC (d) = CreateDC ("WINSPOOL", printer_name, - NULL, NULL); - if (DEVICE_MSPRINTER_HDC (d) == NULL) - signal_open_printer_error (d); - - /* Determinie DEVMODE size and store the default DEVMODE */ - DEVICE_MSPRINTER_DEVMODE_SIZE(d) = - DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d), - printer_name, NULL, NULL, 0); - if (DEVICE_MSPRINTER_DEVMODE_SIZE(d) <= 0) - signal_open_printer_error (d); - - DEVICE_MSPRINTER_DEVMODE(d) = xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d)); - DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d), - printer_name, DEVICE_MSPRINTER_DEVMODE(d), - NULL, DM_OUT_BUFFER); + DEVICE_INFD (d) = DEVICE_OUTFD (d) = -1; + DEVICE_MSPRINTER_DEVMODE(d) = Qnil; /* We do not use printer fon list as we do with the display device. Rather, we allow GDI to pick the closest match to the display font. */ DEVICE_MSPRINTER_FONTLIST (d) = Qnil; - DEVICE_CLASS (d) = (GetDeviceCaps (DEVICE_MSPRINTER_HDC (d), BITSPIXEL) - * GetDeviceCaps (DEVICE_MSPRINTER_HDC (d), PLANES) - > 1) ? Qcolor : Qmono; + CHECK_STRING (DEVICE_CONNECTION (d)); + + TO_EXTERNAL_FORMAT (LISP_STRING, DEVICE_CONNECTION (d), + C_STRING_ALLOCA, printer_name, + Qmswindows_tstr); + + if (!msprinter_init_device_internal (d, printer_name)) + signal_open_printer_error (d); + + /* Determine DEVMODE size and store the default DEVMODE */ + dm_size = DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER (d), + printer_name, NULL, NULL, 0); + if (dm_size <= 0) + signal_open_printer_error (d); + + pdm = (DEVMODE*) xmalloc (dm_size); + DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d), + printer_name, pdm, + NULL, DM_OUT_BUFFER); + + assert (DEVMODE_SIZE (pdm) <= dm_size); + + DEVICE_MSPRINTER_DEVMODE(d) = + allocate_devmode (pdm, 0, printer_name, d); + +} + +static void +msprinter_delete_device (struct device *d) +{ + if (d->device_data) + { + msprinter_delete_device_internal (d); + + /* Disassociate the selected devmode with the device */ + if (!NILP (DEVICE_MSPRINTER_DEVMODE (d))) + { + XDEVMODE (DEVICE_MSPRINTER_DEVMODE (d))->device = Qnil; + DEVICE_MSPRINTER_DEVMODE (d) = Qnil; + } + + xfree (d->device_data); + } } static Lisp_Object @@ -398,7 +510,7 @@ therefore useless */ return make_int (GetDeviceCaps (DEVICE_MSPRINTER_HDC(d), BITSPIXEL)); - case DM_num_color_cells: /* Prnters are non-palette devices */ + case DM_num_color_cells: /* Printers are non-palette devices */ case DM_slow_device: /* Animation would be a really bad idea */ case DM_security: /* Not provided by windows */ return Qzero; @@ -409,29 +521,10 @@ } static void -msprinter_delete_device (struct device *d) -{ - if (d->device_data) - { - if (DEVICE_MSPRINTER_HPRINTER (d)) - ClosePrinter (DEVICE_MSPRINTER_HPRINTER (d)); - if (DEVICE_MSPRINTER_HDC (d)) - DeleteDC (DEVICE_MSPRINTER_HDC (d)); - if (DEVICE_MSPRINTER_NAME (d)) - free (DEVICE_MSPRINTER_NAME (d)); - if (DEVICE_MSPRINTER_DEVMODE (d)) - free (DEVICE_MSPRINTER_DEVMODE (d)); - if (DEVICE_MSPRINTER_DEVMODE_MIRROR (d)) - free (DEVICE_MSPRINTER_DEVMODE_MIRROR (d)); - - free (d->device_data); - } -} - -static void msprinter_mark_device (struct device *d) { mark_object (DEVICE_MSPRINTER_FONTLIST (d)); + mark_object (DEVICE_MSPRINTER_DEVMODE (d)); } static unsigned int @@ -442,52 +535,729 @@ | XDEVIMPF_NO_AUTO_REDISPLAY | XDEVIMPF_FRAMELESS_OK ); } - /************************************************************************/ -/* printer external functions */ +/* printer Lisp subroutines */ /************************************************************************/ -/* - * Return a copy of default DEVMODE. The copy returned is in - * a static buffer which will be overwritten by next call. - */ -DEVMODE* -msprinter_get_devmode_copy (struct device *d) +static void +global_free_2_maybe (HGLOBAL hg1, HGLOBAL hg2) +{ + if (hg1 != NULL) + GlobalFree (hg1); + if (hg2 != NULL) + GlobalFree (hg2); +} + +static HGLOBAL +devmode_to_hglobal (Lisp_Devmode *ldm) +{ + HGLOBAL hg = GlobalAlloc (GHND, XDEVMODE_SIZE (ldm)); + memcpy (GlobalLock (hg), ldm->devmode, XDEVMODE_SIZE (ldm)); + GlobalUnlock (hg); + return hg; +} + +/* Returns 0 if the printer has been deleted due to a fatal I/O error, + 1 otherwise. */ +static int +sync_printer_with_devmode (struct device* d, DEVMODE* devmode_in, + DEVMODE* devmode_out, char* devname) { - assert (DEVICE_MSPRINTER_P (d)); + /* Change connection if the device changed */ + if (devname != NULL + && stricmp (devname, DEVICE_MSPRINTER_NAME(d)) != 0) + { + Lisp_Object new_connection = build_ext_string (devname, Qmswindows_tstr); + struct gcpro gcpro1; + + GCPRO1 (new_connection); + DEVICE_CONNECTION (d) = Qnil; + if (!NILP (Ffind_device (new_connection, Qmsprinter))) + { + /* We are in trouble - second msprinter for the same device. + Nothing wrong on the Windows side, just forge a unique + connection name. Use the memory address of d as a unique + suffix. */ + char* new_connext = alloca (strlen (devname + 11)); + sprintf (new_connext, "%s:%X", devname, d->header.uid); + new_connection = build_ext_string (devname, Qmswindows_tstr); + } + DEVICE_CONNECTION (d) = new_connection; + UNGCPRO; + + /* Reinitialize printer. The device can pop off in process */ + if (!msprinter_reinit_device (d, devname)) + { + /* Kaboom! */ + delete_device_internal (d, 1, 0, 1); + return 0; + } + } + + /* Apply the new devmode to the printer */ + DocumentProperties (NULL, + DEVICE_MSPRINTER_HPRINTER(d), + DEVICE_MSPRINTER_NAME(d), + devmode_out, devmode_in, + DM_IN_BUFFER | DM_OUT_BUFFER); - if (DEVICE_MSPRINTER_DEVMODE_MIRROR(d) == NULL) - DEVICE_MSPRINTER_DEVMODE_MIRROR(d) = - xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d)); + /* #### ResetDC fails sometimes, Bill only knows why. + The solution below looks more like a workaround to me, + although it might be fine. --kkm */ + if (ResetDC (DEVICE_MSPRINTER_HDC (d), devmode_out) == NULL) + { + DeleteDC (DEVICE_MSPRINTER_HDC (d)); + DEVICE_MSPRINTER_HDC (d) = + CreateDC ("WINSPOOL", DEVICE_MSPRINTER_NAME(d), NULL, devmode_out); + } + + return 1; +} + +static void +handle_devmode_changes (Lisp_Devmode *ldm, HGLOBAL hDevNames, HGLOBAL hDevMode) +{ + DEVNAMES* devnames = (DEVNAMES*) GlobalLock (hDevNames); + char *new_name = devnames ? (char*)devnames + devnames->wDeviceOffset : NULL; + DEVMODE* devmode = (DEVMODE*) GlobalLock (hDevMode); + + /* Size and name may have changed */ + ldm->devmode = xrealloc (ldm->devmode, DEVMODE_SIZE (devmode)); + if (new_name) + { + if (ldm->printer_name) + xfree (ldm->printer_name); + ldm->printer_name = xstrdup (new_name); + } - memcpy (DEVICE_MSPRINTER_DEVMODE_MIRROR(d), - DEVICE_MSPRINTER_DEVMODE(d), - DEVICE_MSPRINTER_DEVMODE_SIZE(d)); + if (!NILP (ldm->device)) + { + /* Apply the new devmode to the printer and get a compete one back */ + struct device *d = XDEVICE (ldm->device); + if (!sync_printer_with_devmode (d, devmode, ldm->devmode, new_name)) + { + global_free_2_maybe (hDevNames, hDevMode); + error ("Printer device initialization I/O error, device deleted."); + } + } + else + { + /* Just copy the devmode structure */ + memcpy (ldm->devmode, devmode, DEVMODE_SIZE (devmode)); + } +} - return DEVICE_MSPRINTER_DEVMODE_MIRROR(d); +static void +ensure_not_printing (struct device *d) +{ + if (!NILP (DEVICE_FRAME_LIST (d))) + { + Lisp_Object device; + XSETDEVICE (device, d); + invalid_operation ("Cannot change settings while print job is active", + device); + } +} + +static Lisp_Devmode * +decode_devmode (Lisp_Object dev) +{ + if (DEVMODEP (dev)) + return XDEVMODE (dev); + else + { + ensure_not_printing (XDEVICE (dev)); + return XDEVMODE (DEVICE_MSPRINTER_DEVMODE (XDEVICE (dev))); + } } /* - * Apply settings from the DEVMODE. The settings are considered - * incremental to the default DEVMODE, so that changes in the - * passed structure supercede parameters of the printer. - * - * The passed structure is overwritten by the fuction call; - * complete printer settings are returned. + * DEV can be either a printer or devmode + * PRINT_P is non-zero for the Print dialog, zero for the + * Page Setup dialog */ -void -msprinter_apply_devmode (struct device *d, DEVMODE *devmode) +static Lisp_Object +print_dialog_worker (Lisp_Object dev, int print_p) +{ + Lisp_Devmode *ldm = decode_devmode (dev); + PRINTDLG pd; + + memset (&pd, 0, sizeof (pd)); + pd.lStructSize = sizeof (pd); + pd.hwndOwner = mswindows_get_selected_frame_hwnd (); + pd.hDevMode = devmode_to_hglobal (ldm); + pd.Flags = (PD_NOSELECTION | PD_USEDEVMODECOPIESANDCOLLATE + | (print_p ? 0 : PD_PRINTSETUP)); + pd.nMinPage = 0; + pd.nMaxPage = 0xFFFF; + + if (!PrintDlg (&pd)) + { + global_free_2_maybe (pd.hDevNames, pd.hDevMode); + return Qnil; + } + + handle_devmode_changes (ldm, pd.hDevNames, pd.hDevMode); + + /* Finally, build the resulting plist */ + { + Lisp_Object result = Qnil; + struct gcpro gcpro1; + GCPRO1 (result); + + /* Do consing in reverse order. + Number of copies */ + if (print_p) + result = Fcons (Qcopies, Fcons (make_int (pd.nCopies), result)); + + /* Page range */ + if (print_p && (pd.Flags & PD_PAGENUMS)) + { + result = Fcons (Qto_page, Fcons (make_int (pd.nToPage), result)); + result = Fcons (Qfrom_page, Fcons (make_int (pd.nFromPage), result)); + } + + /* Device name */ + result = Fcons (Qname, + Fcons (build_ext_string (ldm->printer_name, + Qmswindows_tstr), + result)); + UNGCPRO; + + global_free_2_maybe (pd.hDevNames, pd.hDevMode); + return result; + } +} + +Lisp_Object +mswindows_handle_print_setup_dialog_box (struct frame *f, Lisp_Object keys) +{ + Lisp_Object device = Qunbound, settings = Qunbound; + + { + EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) + { + if (EQ (key, Q_device)) + { + device = wrap_device (decode_device (value)); + CHECK_MSPRINTER_DEVICE (device); + } + else if (EQ (key, Q_printer_settings)) + { + CHECK_DEVMODE (value); + settings = value; + } + else + syntax_error ("Unrecognized print-dialog keyword", key); + } + } + + if ((UNBOUNDP (device) && UNBOUNDP (settings)) || + (!UNBOUNDP (device) && !UNBOUNDP (settings))) + syntax_error ("Exactly one of :device and :printer-settings must be given", + keys); + + return print_dialog_worker (!UNBOUNDP (device) ? device : settings, 0); +} + +Lisp_Object +mswindows_handle_print_dialog_box (struct frame *f, Lisp_Object keys) +{ + Lisp_Object device = Qunbound, settings = Qunbound; + + { + EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) + { + if (EQ (key, Q_device)) + { + device = wrap_device (decode_device (value)); + CHECK_MSPRINTER_DEVICE (device); + } + else if (EQ (key, Q_printer_settings)) + { + CHECK_DEVMODE (value); + settings = value; + } + else + syntax_error ("Unrecognized print-dialog keyword", key); + } + } + + if ((UNBOUNDP (device) && UNBOUNDP (settings)) || + (!UNBOUNDP (device) && !UNBOUNDP (settings))) + syntax_error ("Exactly one of :device and :printer-settings must be given", + keys); + + return print_dialog_worker (!UNBOUNDP (device) ? device : settings, 1); +} + +static int +plist_get_margin (Lisp_Object plist, Lisp_Object prop) +{ + Lisp_Object val = Fplist_get (plist, prop, make_int (1440)); + if (!INTP (val)) + invalid_argument ("Margin value must be an integer", val); + + return MulDiv (XINT (val), 100, 144); +} + +static Lisp_Object +plist_set_margin (Lisp_Object plist, Lisp_Object prop, int margin, int mm_p) +{ + Lisp_Object val = make_int (MulDiv (margin, 144, mm_p ? 2450 : 100)); + return Fcons (prop, Fcons (val, plist)); +} + +Lisp_Object +mswindows_handle_page_setup_dialog_box (struct frame *f, Lisp_Object keys) +{ + Lisp_Object device = Qunbound, settings = Qunbound; + Lisp_Object plist = Qnil; + + { + EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) + { + if (EQ (key, Q_device)) + { + device = wrap_device (decode_device (value)); + CHECK_MSPRINTER_DEVICE (device); + } + else if (EQ (key, Q_printer_settings)) + { + CHECK_DEVMODE (value); + settings = value; + } + else if (EQ (key, Q_properties)) + { + CHECK_LIST (value); + plist = value; + } + else + syntax_error ("Unrecognized page-setup dialog keyword", key); + } + } + + if ((UNBOUNDP (device) && UNBOUNDP (settings)) || + (!UNBOUNDP (device) && !UNBOUNDP (settings))) + syntax_error ("Exactly one of :device and :printer-settings must be given", + keys); + + if (UNBOUNDP (device)) + device = settings; + + { + Lisp_Devmode *ldm = decode_devmode (device); + PAGESETUPDLG pd; + + memset (&pd, 0, sizeof (pd)); + pd.lStructSize = sizeof (pd); + pd.hwndOwner = mswindows_get_selected_frame_hwnd (); + pd.Flags = PSD_MARGINS; + pd.rtMargin.left = plist_get_margin (plist, Qleft_margin); + pd.rtMargin.top = plist_get_margin (plist, Qtop_margin); + pd.rtMargin.right = plist_get_margin (plist, Qright_margin); + pd.rtMargin.bottom = plist_get_margin (plist, Qbottom_margin); + pd.hDevMode = devmode_to_hglobal (ldm); + + if (!PageSetupDlg (&pd)) + { + global_free_2_maybe (pd.hDevNames, pd.hDevMode); + return Qnil; + } + + if (pd.hDevMode) + handle_devmode_changes (ldm, pd.hDevNames, pd.hDevMode); + + /* Finally, build the resulting plist */ + { + Lisp_Object result = Qnil; + int mm_p = pd.Flags & PSD_INHUNDREDTHSOFMILLIMETERS; + result = plist_set_margin (result, Qbottom_margin, pd.rtMargin.bottom, + mm_p); + result = plist_set_margin (result, Qright_margin, pd.rtMargin.right, + mm_p); + result = plist_set_margin (result, Qtop_margin, pd.rtMargin.top, mm_p); + result = plist_set_margin (result, Qleft_margin, pd.rtMargin.left, mm_p); + return result; + } + } +} + +DEFUN ("msprinter-get-settings", Fmsprinter_get_settings, 1, 1, 0, /* +Return the settings object currently used by DEVICE. +The object returned is not a copy, but rather a pointer to the +original one. Use `msprinter-settings-copy' to create a copy of it. +*/ + (device)) +{ + struct device *d = decode_device (device); + XSETDEVICE (device, d); + CHECK_MSPRINTER_DEVICE (device); + return DEVICE_MSPRINTER_DEVMODE (d); +} + +DEFUN ("msprinter-select-settings", Fmsprinter_select_settings, 2, 2, 0, /* +Select SETTINGS object into a DEVICE. +The settings from the settings object are immediately applied to the +printer, possibly changing even the target printer itself, and all +future changes are applied synchronously to the printer device and the +selected printer object, until a different settings object is selected +into the same printer. + +A settings object can be selected to no more than one printer at a time. + +If the supplied settings object is not specialized, it is specialized +for the printer immediately upon selection. The object can be +despecialized after it is unselected by calling the function +`msprinter-settings-despecialize'. + +Return value is the previously selected settings object. +*/ + (device, settings)) { - assert (DEVICE_MSPRINTER_P (d)); + Lisp_Devmode *ldm; + struct device *d = decode_device (device); + + struct gcpro gcpro1; + GCPRO1 (settings); + + XSETDEVICE (device, d); + CHECK_MSPRINTER_DEVICE (device); + CHECK_DEVMODE (settings); + ldm = XDEVMODE (settings); + + if (!NILP (ldm->device)) + invalid_operation ("The object is currently selected into a device", + settings); + + /* If the object being selected is de-specialized, then its + size is perhaps not enough to receive the new devmode. We can ask + for printer's devmode size here, because despecialized settings + cannot force switching to a different printer, as they supply no + printer name at all. */ + if (ldm->printer_name == NULL) + { + size_t dm_size = + DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d), + DEVICE_MSPRINTER_NAME(d), NULL, NULL, 0); + if (dm_size <= 0) + invalid_operation ("Unable to specialize settings, printer error", + device); + + assert (XDEVMODE_SIZE (ldm) <= dm_size); + ldm->devmode = xrealloc (ldm->devmode, dm_size); + } + + /* If we bail out on signal here, no damage is done, except that + the storage for the DEVMODE structure might be reallocated to + hold a larger one - not a big deal */ + if (!sync_printer_with_devmode (d, ldm->devmode, ldm->devmode, + ldm->printer_name)) + error ("Printer device initialization I/O error, device deleted."); + + if (ldm->printer_name == NULL) + ldm->printer_name = xstrdup (DEVICE_MSPRINTER_NAME(d)); + + { + Lisp_Object old_mode = DEVICE_MSPRINTER_DEVMODE (d); + ldm->device = device; + XDEVMODE (old_mode)->device = Qnil; + DEVICE_MSPRINTER_DEVMODE (d) = settings; + UNGCPRO; + return old_mode; + } +} + +DEFUN ("msprinter-apply-settings", Fmsprinter_apply_settings, 2, 2, 0, /* +Apply settings from a SETTINGS object to a 'msprinter DEVICE. +The settings from the settings object are immediately applied to the +printer, possibly changing even the target printer itself. The SETTING +object is not modified, unlike `msprinter-select-settings', and the +supplied object is not changed. The changes are immediately recorded +into the settings object which is currently selected into the printer +device. + +Return value is the currently selected settings object. +*/ + (device, settings)) +{ + Lisp_Devmode *ldm_current, *ldm_new; + struct device *d = decode_device (device); + + struct gcpro gcpro1; + GCPRO1 (settings); + + XSETDEVICE (device, d); + CHECK_MSPRINTER_DEVICE (device); + CHECK_DEVMODE (settings); + ldm_new = XDEVMODE (settings); + ldm_current = XDEVMODE (DEVICE_MSPRINTER_DEVMODE (d)); + + /* If the supplied devmode is not specialized, then the current + devmode size will always be sufficient, as the printer does + not change. If it is specialized, we must reallocate the current + devmode storage to match with the supplied one, as it has the right + size for the new printer, if it is going to change. The correct + way is to use the largest of the two though, to keep the old + contents unchanged in case of preliminary exit. + */ + if (ldm_new->printer_name) + ldm_current->devmode = + (DEVMODE*) xrealloc (ldm_current->devmode, + max (XDEVMODE_SIZE (ldm_new), + XDEVMODE_SIZE (ldm_current))); + + if (!sync_printer_with_devmode (d, ldm_new->devmode, + ldm_current->devmode, + ldm_new->printer_name)) + error ("Printer device initialization I/O error, device deleted."); + + if (ldm_new->printer_name != NULL) + { + xfree (ldm_current->printer_name); + ldm_current->printer_name = xstrdup (ldm_new->printer_name); + } + + return DEVICE_MSPRINTER_DEVMODE (d); +} + +/************************************************************************/ +/* devmode */ +/************************************************************************/ + +static void +print_devmode (Lisp_Object obj, Lisp_Object printcharfun, + int escapeflag) +{ + char buf[100]; + Lisp_Devmode *dm = XDEVMODE (obj); + if (print_readably) + error ("printing unreadable object #", + dm->header.uid); + write_c_string ("#printer_name) + { + write_c_string (" for \"", printcharfun); + write_c_string (dm->printer_name, printcharfun); + write_c_string ("\"", printcharfun); + } + if (!NILP (dm->device)) + { + write_c_string (" (currently on ", printcharfun); + print_internal (dm->device, printcharfun, 0); + write_c_string (")", printcharfun); + } + sprintf (buf, " 0x%x>", dm->header.uid); + write_c_string (buf, printcharfun); +} + +static void +finalize_devmode (void *header, int for_disksave) +{ + Lisp_Devmode *dm = (Lisp_Devmode *) header; + + if (for_disksave) + { + Lisp_Object devmode; + XSETDEVMODE (devmode, dm); + invalid_operation + ("Cannot dump XEmacs containing an msprinter-settings object", + devmode); + } + + assert (NILP (dm->device)); + + if (dm->printer_name) + xfree (dm->printer_name); +} + +static int +equal_devmode (Lisp_Object obj1, Lisp_Object obj2, int depth) +{ + Lisp_Devmode *dm1 = XDEVMODE (obj1); + Lisp_Devmode *dm2 = XDEVMODE (obj2); - DocumentProperties (NULL, - DEVICE_MSPRINTER_HPRINTER(d), - DEVICE_MSPRINTER_NAME(d), - devmode, devmode, - DM_IN_BUFFER | DM_OUT_BUFFER); + if ((dm1->devmode != NULL) != (dm1->devmode != NULL)) + return 0; + if (dm1->devmode == NULL) + return 1; + if (memcmp (dm1->devmode, dm2->devmode, XDEVMODE_SIZE (dm1)) != 0) + return 0; + if (dm1->printer_name == NULL || dm2->printer_name == NULL) + return 1; + return stricmp (dm1->printer_name, dm2->printer_name) == 0; +} + +static unsigned long +hash_devmode (Lisp_Object obj, int depth) +{ + Lisp_Devmode *dm = XDEVMODE (obj); + + return HASH3 (XDEVMODE_SIZE (dm), + dm->devmode ? memory_hash (dm->devmode, XDEVMODE_SIZE (dm)) + : 0, + dm->printer_name ? string_hash (dm->printer_name) : 0); +} + +DEFINE_LRECORD_IMPLEMENTATION ("msprinter-settings", devmode, + 0/*mark*/, print_devmode, finalize_devmode, + equal_devmode, hash_devmode, 0/*description*/, + Lisp_Devmode); +static Lisp_Object +allocate_devmode (DEVMODE* src_devmode, int do_copy, + char* src_name, struct device *d) +{ + Lisp_Devmode *dm; + Lisp_Object ob; + + dm = alloc_lcrecord_type (Lisp_Devmode, &lrecord_devmode); + + if (d) + XSETDEVICE (dm->device, d); + else + dm->device = Qnil; + + dm->printer_name = src_name ? xstrdup (src_name) : NULL; + + if (src_devmode != NULL && do_copy) + { + dm->devmode = (DEVMODE*) xmalloc (DEVMODE_SIZE (src_devmode)); + memcpy (dm->devmode, src_devmode, DEVMODE_SIZE (src_devmode)); + } + else + { + dm->devmode = src_devmode; + } + + XSETDEVMODE (ob, dm); + return ob; +} + +DEFUN ("msprinter-settings-copy", Fmsprinter_settings_copy, 1, 1, 0, /* +Create and returns an exact copy of a printer settings object. +*/ + (settings)) +{ + Lisp_Devmode *dm; + + CHECK_DEVMODE (settings); + dm = XDEVMODE (settings); + + return allocate_devmode (dm->devmode, 1, dm->printer_name, NULL); +} + +DEFUN ("msprinter-settings-despecialize", Fmsprinter_settings_despecialize, 1, 1, 0, /* +Erase printer-specific settings from a printer settings object. +*/ + (settings)) +{ + Lisp_Devmode *ldm; + DEVMODE *dm; + + CHECK_DEVMODE (settings); + ldm = XDEVMODE (settings); + + if (!NILP (ldm->device)) + invalid_operation ("The object is currently selected into a device", + settings); + + dm = ldm->devmode; + + /* #### TODO. Either remove references to device specific bins, + paper sizes etc, or signal an error of they are present. */ - ResetDC (DEVICE_MSPRINTER_HDC (d), devmode); + dm->dmDriverExtra = 0; + dm->dmDeviceName[0] = '\0'; + + if (ldm->printer_name) + xfree (ldm->printer_name); + + return Qnil; +} + +DEFUN ("mswindows-get-default-printer", Fmswindows_get_default_printer, 0, 0, 0, /* +Return name of the default printer, as string, on nil if there is no default. +*/ + ()) +{ + return msprinter_default_printer (); +} + +static void +signal_enum_printer_error (void) +{ + invalid_operation ("Error enumerating printers", make_int (GetLastError ())); +} + +DEFUN ("mswindows-printer-list", Fmswindows_printer_list, 0, 0, 0, /* +Return a list of string names of installed printers. +If there is a default printer, it is returned as the first element of +the list. If there is no default printer, the first element of the +list will be nil. The rest of elements are guaranteed to have string +values. Return value is nil if there are no printers installed. +*/ + ()) +{ + int have_nt, ok; + BYTE *data_buf, dummy_byte; + size_t enum_entry_size; + DWORD enum_flags, enum_level, bytes_needed, num_printers; + struct gcpro gcpro1, gcpro2; + Lisp_Object result = Qnil, def_printer = Qnil; + + /* Determine OS flavor, to use the fastest enumeration method available */ + have_nt = !mswindows_windows9x_p (); + enum_flags = PRINTER_ENUM_LOCAL | (have_nt ? PRINTER_ENUM_CONNECTIONS : 0); + enum_level = have_nt ? 4 : 5; + enum_entry_size = have_nt ? sizeof (PRINTER_INFO_4) : sizeof (PRINTER_INFO_5); + + /* Allocate memory for printer enum structure */ + ok = EnumPrinters (enum_flags, NULL, enum_level, &dummy_byte, 1, + &bytes_needed, &num_printers); + if (ok) + /* No printers, if just 1 byte is enough */ + return Qnil; + + if (GetLastError () != ERROR_INSUFFICIENT_BUFFER) + signal_enum_printer_error (); + + data_buf = alloca (bytes_needed); + ok = EnumPrinters (enum_flags, NULL, enum_level, data_buf, bytes_needed, + &bytes_needed, &num_printers); + if (!ok) + signal_enum_printer_error (); + + if (num_printers == 0) + /* Strange but... */ + return Qnil; + + GCPRO2 (result, def_printer); + + while (num_printers--) + { + LPCTSTR printer_name; + if (have_nt) + { + PRINTER_INFO_4 *info = (PRINTER_INFO_4*) data_buf; + printer_name = info->pPrinterName; + } + else + { + PRINTER_INFO_5 *info = (PRINTER_INFO_5*) data_buf; + printer_name = info->pPrinterName; + } + data_buf += enum_entry_size; + + result = Fcons (build_ext_string (printer_name, Qmswindows_tstr), + result); + } + + def_printer = msprinter_default_printer (); + result = Fdelete (def_printer, result); + result = Fcons (def_printer, result); + + RETURN_UNGCPRO (result); } @@ -498,6 +1268,16 @@ void syms_of_device_mswindows (void) { + INIT_LRECORD_IMPLEMENTATION (devmode); + + DEFSUBR (Fmsprinter_get_settings); + DEFSUBR (Fmsprinter_select_settings); + DEFSUBR (Fmsprinter_apply_settings); + DEFSUBR (Fmsprinter_settings_copy); + DEFSUBR (Fmsprinter_settings_despecialize); + DEFSUBR (Fmswindows_get_default_printer); + DEFSUBR (Fmswindows_printer_list); + defsymbol (&Qinit_pre_mswindows_win, "init-pre-mswindows-win"); defsymbol (&Qinit_post_mswindows_win, "init-post-mswindows-win"); } diff -r 72a7cfa4a488 -r abe6d1db359e src/device-x.c --- a/src/device-x.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/device-x.c Mon Aug 13 11:35:02 2007 +0200 @@ -21,6 +21,8 @@ /* Synched up with: Not in FSF. */ +/* 7-8-00 !!#### This file needs definite Mule review. */ + /* Original authors: Jamie Zawinski and the FSF */ /* Rewritten by Ben Wing and Chuck Thompson. */ @@ -50,9 +52,9 @@ #include "sysfile.h" #include "systime.h" -#if defined(HAVE_DLOPEN) && defined(LWLIB_USES_ATHENA) && !defined(HAVE_ATHENA_3D) +#if defined(HAVE_SHLIB) && defined(LWLIB_USES_ATHENA) && !defined(HAVE_ATHENA_3D) #include "sysdll.h" -#endif /* HAVE_DLOPEN and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */ +#endif /* HAVE_SHLIB and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */ #ifdef HAVE_OFFIX_DND #include "offix.h" @@ -246,11 +248,11 @@ * Finally, if all else fails, return `xemacs', as it is more * appropriate (X11R5 returns `main'). */ -static char * -compute_x_app_name (int argc, char **argv) +static Extbyte * +compute_x_app_name (int argc, Extbyte **argv) { int i; - char *ptr; + Extbyte *ptr; for (i = 1; i < argc - 1; i++) if (!strncmp(argv[i], "-name", max (2, strlen (argv[1])))) @@ -459,10 +461,10 @@ Display *dpy; Widget app_shell; int argc; - char **argv; - CONST char *app_class; - CONST char *app_name; - CONST char *disp_name; + Extbyte **argv; + const char *app_class; + const char *app_name; + const char *disp_name; Visual *visual = NULL; int depth = 8; /* shut up the compiler */ Colormap cmap; @@ -470,7 +472,7 @@ /* */ int best_visual_found = 0; -#if defined(HAVE_DLOPEN) && defined(LWLIB_USES_ATHENA) && !defined(HAVE_ATHENA_3D) +#if defined(HAVE_SHLIB) && defined(LWLIB_USES_ATHENA) && !defined(HAVE_ATHENA_3D) /* * In order to avoid the lossage with flat Athena widgets dynamically * linking to one of the ThreeD variants, using the dynamic symbol helpers @@ -539,7 +541,7 @@ dll_close (xaw_dll_handle); } } -#endif /* HAVE_DLOPEN and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */ +#endif /* HAVE_SHLIB and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */ XSETDEVICE (device, d); @@ -549,9 +551,7 @@ make_argc_argv (Vx_initial_argv_list, &argc, &argv); - TO_EXTERNAL_FORMAT (LISP_STRING, display, - C_STRING_ALLOCA, disp_name, - Qctext); + LISP_STRING_TO_EXTERNAL (display, disp_name, Qctext); /* * Break apart the old XtOpenDisplay call into XOpenDisplay and @@ -573,9 +573,7 @@ if (STRINGP (Vx_emacs_application_class) && XSTRING_LENGTH (Vx_emacs_application_class) > 0) - TO_EXTERNAL_FORMAT (LISP_STRING, Vx_emacs_application_class, - C_STRING_ALLOCA, app_class, - Qctext); + LISP_STRING_TO_EXTERNAL (Vx_emacs_application_class, app_class, Qctext); else { app_class = (NILP (Vx_emacs_application_class) && @@ -595,7 +593,7 @@ Yuck. */ XtDisplayInitialize (Xt_app_con, dpy, compute_x_app_name (argc, argv), app_class, emacs_options, - XtNumber (emacs_options), &argc, argv); + XtNumber (emacs_options), &argc, (char **) argv); speed_up_interrupts (); screen = DefaultScreen (dpy); @@ -609,17 +607,15 @@ data-directory/app-defaults/$LANG/Emacs. This is in addition to the standard app-defaults files, and does not override resources defined elsewhere */ - CONST char *data_dir; + const char *data_dir; char *path; XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */ - CONST char *locale = XrmLocaleOfDatabase (db); + const char *locale = XrmLocaleOfDatabase (db); if (STRINGP (Vx_app_defaults_directory) && XSTRING_LENGTH (Vx_app_defaults_directory) > 0) { - TO_EXTERNAL_FORMAT (LISP_STRING, Vx_app_defaults_directory, - C_STRING_ALLOCA, data_dir, - Qfile_name); + LISP_STRING_TO_EXTERNAL (Vx_app_defaults_directory, data_dir, Qfile_name); path = (char *)alloca (strlen (data_dir) + strlen (locale) + 7); sprintf (path, "%s%s/Emacs", data_dir, locale); if (!access (path, R_OK)) @@ -627,9 +623,7 @@ } else if (STRINGP (Vdata_directory) && XSTRING_LENGTH (Vdata_directory) > 0) { - TO_EXTERNAL_FORMAT (LISP_STRING, Vdata_directory, - C_STRING_ALLOCA, data_dir, - Qfile_name); + LISP_STRING_TO_EXTERNAL (Vdata_directory, data_dir, Qfile_name); path = (char *)alloca (strlen (data_dir) + 13 + strlen (locale) + 7); sprintf (path, "%sapp-defaults/%s/Emacs", data_dir, locale); if (!access (path, R_OK)) @@ -785,9 +779,10 @@ #ifdef HAVE_WMCOMMAND { int new_argc; - char **new_argv; + Extbyte **new_argv; make_argc_argv (Vcommand_line_args, &new_argc, &new_argv); - XSetCommand (XtDisplay (app_shell), XtWindow (app_shell), new_argv, new_argc); + XSetCommand (XtDisplay (app_shell), XtWindow (app_shell), + (char **) new_argv, new_argc); free_argc_argv (new_argv); } #endif /* HAVE_WMCOMMAND */ @@ -913,10 +908,10 @@ /* handle X errors */ /************************************************************************/ -CONST char * +const char * x_event_name (int event_type) { - static CONST char *events[] = + static const char *events[] = { "0: ERROR!", "1: REPLY", @@ -1259,6 +1254,22 @@ #endif /* 0 */ +/* strcasecmp() is not sufficiently portable or standard, + and it's easier just to write our own. */ +static int +ascii_strcasecmp (const char *s1, const char *s2) +{ + while (1) + { + char c1 = *s1++; + char c2 = *s2++; + if (c1 >= 'A' && c1 <= 'Z') c1 += 'a' - 'A'; + if (c2 >= 'A' && c2 <= 'Z') c2 += 'a' - 'A'; + if (c1 != c2) return c1 - c2; + if (c1 == '\0') return 0; + } +} + static char_dynarr *name_char_dynarr; static char_dynarr *class_char_dynarr; @@ -1362,7 +1373,7 @@ The sixth arg NOERROR, if non-nil, means do not signal an error if a bogus resource specification was retrieved (e.g. if a non-integer was given when an integer was requested). In this case, a warning is issued - instead. + instead, unless NOERROR is t, in which case no warning is issued. The resource names passed to this function are looked up relative to the locale. @@ -1485,13 +1496,13 @@ return build_string (raw_result); else if (EQ (type, Qboolean)) { - if (!strcasecmp (raw_result, "off") || - !strcasecmp (raw_result, "false") || - !strcasecmp (raw_result, "no")) + if (!ascii_strcasecmp (raw_result, "off") || + !ascii_strcasecmp (raw_result, "false") || + !ascii_strcasecmp (raw_result, "no")) return Fcons (Qnil, Qnil); - if (!strcasecmp (raw_result, "on") || - !strcasecmp (raw_result, "true") || - !strcasecmp (raw_result, "yes")) + if (!ascii_strcasecmp (raw_result, "on") || + !ascii_strcasecmp (raw_result, "true") || + !ascii_strcasecmp (raw_result, "yes")) return Fcons (Qt, Qnil); return maybe_continuable_error (Qresource, errb, @@ -1684,12 +1695,10 @@ */ (keysym)) { - CONST char *keysym_ext; + const char *keysym_ext; CHECK_STRING (keysym); - TO_EXTERNAL_FORMAT (LISP_STRING, keysym, - C_STRING_ALLOCA, keysym_ext, - Qctext); + LISP_STRING_TO_EXTERNAL (keysym, keysym_ext, Qctext); return XStringToKeysym (keysym_ext) ? Qt : Qnil; } @@ -1890,7 +1899,7 @@ { Display *dpy = get_x_display (device); int ndirs_return; - CONST char **directories = (CONST char **) XGetFontPath (dpy, &ndirs_return); + const char **directories = (const char **) XGetFontPath (dpy, &ndirs_return); Lisp_Object font_path = Qnil; if (!directories) @@ -1922,7 +1931,7 @@ { Display *dpy = get_x_display (device); Lisp_Object path_entry; - CONST char **directories; + const char **directories; int i=0,ndirs=0; EXTERNAL_LIST_LOOP (path_entry, font_path) @@ -1931,13 +1940,11 @@ ndirs++; } - directories = alloca_array (CONST char *, ndirs); + directories = alloca_array (const char *, ndirs); EXTERNAL_LIST_LOOP (path_entry, font_path) { - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (path_entry), - C_STRING_ALLOCA, directories[i++], - Qfile_name); + LISP_STRING_TO_EXTERNAL (XCAR (path_entry), directories[i++], Qfile_name); } expect_x_error (dpy); @@ -1987,7 +1994,7 @@ reinit_console_type_create_device_x (void) { /* Initialize variables to speed up X resource interactions */ - CONST char *valid_resource_chars = + const char *valid_resource_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; while (*valid_resource_chars) valid_resource_char_p[(unsigned int) (*valid_resource_chars++)] = 1; diff -r 72a7cfa4a488 -r abe6d1db359e src/device.c --- a/src/device.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/device.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,4 +1,4 @@ - /* Generic device functions. +/* Generic device functions. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995, 1996 Ben Wing @@ -891,6 +891,7 @@ MARK_FRAME_GLYPHS_CHANGED (f); MARK_FRAME_SUBWINDOWS_CHANGED (f); MARK_FRAME_TOOLBARS_CHANGED (f); + MARK_FRAME_GUTTERS_CHANGED (f); f->menubar_changed = 1; } } @@ -925,9 +926,7 @@ */ (device)) { - return (MAYBE_INT_DEVMETH (decode_device (device), - device_implementation_flags, ()) - & XDEVIMPF_IS_A_PRINTER) ? Qt : Qnil; + return DEVICE_PRINTER_P (decode_device (device)) ? Qt : Qnil; } DEFUN ("device-system-metric", Fdevice_system_metric, 1, 3, 0, /* @@ -987,12 +986,12 @@ size-icon-small Small icon dimensions. size-device Device screen or paper size in pixels. size-workspace Workspace size in pixels. This can be less than or - equal to the above. For diplays, this is the area - available to applications less window manager + equal to the above. For displays, this is the area + available to applications less window manager decorations. For printers, this is the size of printable area. offset-workspace Offset of workspace area from the top left corner - of screen or paper. + of screen or paper, in pixels. size-device-mm Device screen size in millimeters. device-dpi Device resolution, in dots per inch. num-bit-planes Integer, number of device bit planes. @@ -1201,12 +1200,12 @@ /* reset the flag to 0 unless another notification occurred while we were processing this one. Block SIGWINCH during this check to prevent a possible race condition. */ -#ifndef WINDOWSNT +#ifdef SIGWINCH EMACS_BLOCK_SIGNAL (SIGWINCH); #endif if (old_asynch_device_change_pending == asynch_device_change_pending) asynch_device_change_pending = 0; -#ifndef WINDOWSNT +#ifdef SIGWINCH EMACS_UNBLOCK_SIGNAL (SIGWINCH); #endif } @@ -1246,6 +1245,8 @@ void syms_of_device (void) { + INIT_LRECORD_IMPLEMENTATION (device); + DEFSUBR (Fvalid_device_class_p); DEFSUBR (Fdevice_class_list); diff -r 72a7cfa4a488 -r abe6d1db359e src/device.h --- a/src/device.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/device.h Mon Aug 13 11:35:02 2007 +0200 @@ -220,6 +220,7 @@ DECLARE_LRECORD (device, struct device); #define XDEVICE(x) XRECORD (x, device, struct device) #define XSETDEVICE(x, p) XSETRECORD (x, p, device) +#define wrap_device(p) wrap_object (p) #define DEVICEP(x) RECORDP (x, device) #define CHECK_DEVICE(x) CHECK_RECORD (x, device) #define CONCHECK_DEVICE(x) CONCHECK_RECORD (x, device) @@ -238,9 +239,9 @@ #define DEVICE_TYPE_P(d, type) EQ (DEVICE_TYPE (d), Q##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE struct device * +INLINE_HEADER struct device * error_check_device_type (struct device *d, Lisp_Object sym); -INLINE struct device * +INLINE_HEADER struct device * error_check_device_type (struct device *d, Lisp_Object sym) { assert (EQ (DEVICE_TYPE (d), sym)); @@ -270,6 +271,47 @@ (type##_console_methods->predicate_symbol, x); \ } while (0) +#define DEVICE_DISPLAY_P(dev) \ + (DEVICE_LIVE_P (dev) && \ + (MAYBE_INT_DEVMETH (dev, \ + device_implementation_flags, ()) \ + & XDEVIMPF_IS_A_PRINTER) ? 0 : 1) + +#define CHECK_DISPLAY_DEVICE(dev) \ + do { \ + CHECK_DEVICE (dev); \ + if (!(DEVICEP (dev) \ + && DEVICE_DISPLAY_P (XDEVICE (dev)))) \ + dead_wrong_type_argument (Qdisplay, dev); \ + } while (0) + +#define CONCHECK_DISPLAY_DEVICE(dev) \ + do { \ + CONCHECK_DEVICE (dev); \ + if (!(DEVICEP (dev) \ + && DEVICE_DISPLAY_P (XDEVICE (dev)))) \ + wrong_type_argument (Qdisplay, dev); \ + } while (0) + +#define DEVICE_PRINTER_P(dev) \ + (DEVICE_LIVE_P (dev) && !DEVICE_DISPLAY_P (dev)) + +#define CHECK_PRINTER_DEVICE(dev) \ + do { \ + CHECK_DEVICE (dev); \ + if (!(DEVICEP (dev) \ + && DEVICE_PRINTER_P (XDEVICE (dev)))) \ + dead_wrong_type_argument (Qprinter, dev); \ + } while (0) + +#define CONCHECK_PRINTER_DEVICE(dev) \ + do { \ + CONCHECK_DEVICE (dev); \ + if (!(DEVICEP (dev) \ + && DEVICE_PRINTER_P (XDEVICE (dev)))) \ + wrong_type_argument (Qprinter, dev); \ + } while (0) + /* #### These should be in the device-*.h files but there are too many places where the abstraction is broken. Need to fix. */ @@ -294,6 +336,7 @@ EXFUN (Fdevice_console, 1); EXFUN (Fdevice_name, 1); +EXFUN (Ffind_device, 2); EXFUN (Fmake_device, 3); EXFUN (Fselected_device, 1); @@ -385,6 +428,8 @@ #define MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED(d) \ ((void) (windows_structure_changed = (d)->windows_structure_changed = 1)) +/* #### unify this with DOMAIN_DEVICE once the latter has image instances + expunged from it. */ /* This turns out to be used heavily so we make it a macro to make it inline. Also, the majority of the time the object will turn out to be a window so we move it from being checked last to being checked diff -r 72a7cfa4a488 -r abe6d1db359e src/dgif_lib.c --- a/src/dgif_lib.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/dgif_lib.c Mon Aug 13 11:35:02 2007 +0200 @@ -11,23 +11,10 @@ * 19 Feb 98 - Version 1.2 by Jareth Hein (Support for user specified I/O) * ******************************************************************************/ -#ifdef __MSDOS__ -#include -#include -#include -#include -#else -#include -#include -#endif /* __MSDOS__ */ +#include +#include "lisp.h" -#include -#include -#include - -#ifdef HAVE_FCNTL_H -#include -#endif +#include "sysfile.h" #include "gifrlib.h" @@ -52,11 +39,11 @@ FILE *f; if ((f = fopen(FileName, -#ifdef __MSDOS__ +#ifdef WIN32_NATIVE "rb" #else "r" -#endif /* __MSDOS__ */ +#endif /* WIN32_NATIVE */ )) == NULL) GifInternError(GifFile, D_GIF_ERR_OPEN_FAILED); @@ -73,13 +60,13 @@ { FILE *f; -#ifdef __MSDOS__ +#ifdef WIN32_NATIVE setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */ f = fdopen(FileHandle, "rb"); /* Make it into a stream: */ setvbuf(f, NULL, _IOFBF, GIF_FILE_BUFFER_SIZE);/* And inc. stream buffer.*/ #else f = fdopen(FileHandle, "r"); /* Make it into a stream: */ -#endif /* __MSDOS__ */ +#endif /* WIN32_NATIVE */ GifStdIOInit(GifFile, f, -1); DGifInitRead(GifFile); @@ -277,11 +264,11 @@ if (!LineLen) LineLen = GifFile->Image.Width; -#if defined(__MSDOS__) || defined(__GNUC__) +#if defined(WIN32_NATIVE) || defined(__GNUC__) if ((Private->PixelCount -= LineLen) > 0xffff0000UL) #else if ((Private->PixelCount -= LineLen) > 0xffff0000) -#endif /* __MSDOS__ */ +#endif /* WIN32_NATIVE */ { GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG); } @@ -310,11 +297,11 @@ GifInternError(GifFile, D_GIF_ERR_NOT_READABLE); } -#if defined(__MSDOS__) || defined(__GNUC__) +#if defined(WIN32_NATIVE) || defined(__GNUC__) if (--Private->PixelCount > 0xffff0000UL) #else if (--Private->PixelCount > 0xffff0000) -#endif /* __MSDOS__ */ +#endif /* WIN32_NATIVE */ { GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG); } diff -r 72a7cfa4a488 -r abe6d1db359e src/dialog-msw.c --- a/src/dialog-msw.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/dialog-msw.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,5 +1,6 @@ /* Implements elisp-programmable dialog boxes -- MS Windows interface. Copyright (C) 1998 Kirill M. Katsnelson + Copyright (C) 2000 Ben Wing. This file is part of XEmacs. @@ -33,11 +34,31 @@ #include "gui.h" #include "opaque.h" +#include +#include + +Lisp_Object Qdialog_box_error; + +static Lisp_Object Q_initial_directory; +static Lisp_Object Q_initial_filename; +static Lisp_Object Q_filter_list; +static Lisp_Object Q_title; +static Lisp_Object Q_allow_multi_select; +static Lisp_Object Q_create_prompt_on_nonexistent; +static Lisp_Object Q_overwrite_prompt; +static Lisp_Object Q_file_must_exist; +static Lisp_Object Q_no_network_button; +static Lisp_Object Q_no_read_only_return; + /* List containing all dialog data structures of currently popped up - dialogs. Each item is a cons of frame object and a vector of - callbacks for buttons in the dialog, in order */ + dialogs. */ static Lisp_Object Vdialog_data_list; +/* List of popup frames wanting keyboard traversal handled */ +static Lisp_Object Vpopup_frame_list; + +Lisp_Object Vdefault_file_dialog_filter_alist; + /* DLUs per character metrics */ #define X_DLU_PER_CHAR 4 #define Y_DLU_PER_CHAR 8 @@ -110,6 +131,51 @@ #define ID_ITEM_BIAS 32 +void +mswindows_register_popup_frame (Lisp_Object frame) +{ + Vpopup_frame_list = Fcons (frame, Vpopup_frame_list); +} + +void +mswindows_unregister_popup_frame (Lisp_Object frame) +{ + Vpopup_frame_list = delq_no_quit (frame, Vpopup_frame_list); +} + +/* Dispatch message to any dialog boxes. Return non-zero if dispatched. */ +int +mswindows_is_dialog_msg (MSG *msg) +{ + LIST_LOOP_2 (data, Vdialog_data_list) + { + if (IsDialogMessage (XMSWINDOWS_DIALOG_ID (data)->hwnd, msg)) + return 1; + } + + { + LIST_LOOP_2 (popup, Vpopup_frame_list) + { + HWND hwnd = FRAME_MSWINDOWS_HANDLE (XFRAME (popup)); + if (IsDialogMessage (hwnd, msg)) + return 1; + } + } + return 0; +} + +static Lisp_Object +mark_mswindows_dialog_id (Lisp_Object obj) +{ + struct mswindows_dialog_id *data = XMSWINDOWS_DIALOG_ID (obj); + mark_object (data->frame); + return data->callbacks; +} + +DEFINE_LRECORD_IMPLEMENTATION ("mswindows-dialog-id", mswindows_dialog_id, + mark_mswindows_dialog_id, 0, 0, 0, 0, 0, + struct mswindows_dialog_id); + /* Dialog procedure */ static BOOL CALLBACK dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param) @@ -131,14 +197,27 @@ case WM_COMMAND: { Lisp_Object fn, arg, data; + struct mswindows_dialog_id *did; + VOID_TO_LISP (data, GetWindowLong (hwnd, DWL_USER)); - - assert (w_param >= ID_ITEM_BIAS - && w_param < XVECTOR_LENGTH (XCDR (data)) + ID_ITEM_BIAS); - - get_gui_callback (XVECTOR_DATA (XCDR (data)) [w_param - ID_ITEM_BIAS], - &fn, &arg); - mswindows_enqueue_misc_user_event (XCAR (data), fn, arg); + did = XMSWINDOWS_DIALOG_ID (data); + if (w_param != IDCANCEL) /* user pressed escape */ + { + assert (w_param >= ID_ITEM_BIAS + && w_param + < XVECTOR_LENGTH (did->callbacks) + ID_ITEM_BIAS); + + get_gui_callback (XVECTOR_DATA (did->callbacks) + [w_param - ID_ITEM_BIAS], + &fn, &arg); + mswindows_enqueue_misc_user_event (did->frame, fn, arg); + } + else + mswindows_enqueue_misc_user_event (did->frame, Qrun_hooks, + Qmenu_no_selection_hook); + /* #### need to error-protect! will do so when i merge in + my working ws */ + va_run_hook_with_args (Qdelete_dialog_box_hook, 1, data); DestroyWindow (hwnd); } @@ -168,6 +247,25 @@ Dynarr_add_many (dynarr, uni_string, sizeof(WCHAR) * length); } +/* Helper function which converts the supplied string STRING into Unicode and + pushes it at the end of DYNARR */ +static void +push_bufbyte_string_as_unicode (unsigned_char_dynarr* dynarr, Bufbyte *string, + Bytecount len) +{ + Extbyte *mbcs_string; + Charcount length = bytecount_to_charcount (string, len); + LPWSTR uni_string; + + TO_EXTERNAL_FORMAT (C_STRING, string, + C_STRING_ALLOCA, mbcs_string, + Qnative); + uni_string = alloca_array (WCHAR, length + 1); + length = MultiByteToWideChar (CP_ACP, 0, mbcs_string, -1, + uni_string, sizeof(WCHAR) * (length + 1)); + Dynarr_add_many (dynarr, uni_string, sizeof(WCHAR) * length); +} + /* Given button TEXT, return button width in DLU */ static unsigned int button_width (Lisp_Object text) @@ -192,13 +290,130 @@ Dynarr_add_many (template, &zeroes, slippage); \ } -static void -mswindows_popup_dialog_box (struct frame* f, Lisp_Object desc) +static struct +{ + int errmess; + char *errname; +} common_dialog_errors[] = +{ + { CDERR_DIALOGFAILURE, "CDERR_DIALOGFAILURE" }, + { CDERR_FINDRESFAILURE, "CDERR_FINDRESFAILURE" }, + { CDERR_INITIALIZATION, "CDERR_INITIALIZATION" }, + { CDERR_LOADRESFAILURE, "CDERR_LOADRESFAILURE" }, + { CDERR_LOADSTRFAILURE, "CDERR_LOADSTRFAILURE" }, + { CDERR_LOCKRESFAILURE, "CDERR_LOCKRESFAILURE" }, + { CDERR_MEMALLOCFAILURE, "CDERR_MEMALLOCFAILURE" }, + { CDERR_MEMLOCKFAILURE, "CDERR_MEMLOCKFAILURE" }, + { CDERR_NOHINSTANCE, "CDERR_NOHINSTANCE" }, + { CDERR_NOHOOK, "CDERR_NOHOOK" }, + { CDERR_NOTEMPLATE, "CDERR_NOTEMPLATE" }, + { CDERR_REGISTERMSGFAIL, "CDERR_REGISTERMSGFAIL" }, + { CDERR_STRUCTSIZE, "CDERR_STRUCTSIZE" }, + { PDERR_CREATEICFAILURE, "PDERR_CREATEICFAILURE" }, + { PDERR_DEFAULTDIFFERENT, "PDERR_DEFAULTDIFFERENT" }, + { PDERR_DNDMMISMATCH, "PDERR_DNDMMISMATCH" }, + { PDERR_GETDEVMODEFAIL, "PDERR_GETDEVMODEFAIL" }, + { PDERR_INITFAILURE, "PDERR_INITFAILURE" }, + { PDERR_LOADDRVFAILURE, "PDERR_LOADDRVFAILURE" }, + { PDERR_NODEFAULTPRN, "PDERR_NODEFAULTPRN" }, + { PDERR_NODEVICES, "PDERR_NODEVICES" }, + { PDERR_PARSEFAILURE, "PDERR_PARSEFAILURE" }, + { PDERR_PRINTERNOTFOUND, "PDERR_PRINTERNOTFOUND" }, + { PDERR_RETDEFFAILURE, "PDERR_RETDEFFAILURE" }, + { PDERR_SETUPFAILURE, "PDERR_SETUPFAILURE" }, + { CFERR_MAXLESSTHANMIN, "CFERR_MAXLESSTHANMIN" }, + { CFERR_NOFONTS, "CFERR_NOFONTS" }, + { FNERR_BUFFERTOOSMALL, "FNERR_BUFFERTOOSMALL" }, + { FNERR_INVALIDFILENAME, "FNERR_INVALIDFILENAME" }, + { FNERR_SUBCLASSFAILURE, "FNERR_SUBCLASSFAILURE" }, + { FRERR_BUFFERLENGTHZERO, "FRERR_BUFFERLENGTHZERO" }, +}; + +static Lisp_Object +handle_file_dialog_box (struct frame *f, Lisp_Object keys) +{ + OPENFILENAME ofn; + char fnbuf[8000]; + + xzero (ofn); + ofn.lStructSize = sizeof (ofn); + ofn.hwndOwner = FRAME_MSWINDOWS_HANDLE (f); + ofn.lpstrFile = fnbuf; + ofn.nMaxFile = sizeof (fnbuf) / XETCHAR_SIZE; + xetcscpy (fnbuf, XETEXT ("")); + + LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil), + ofn.lpstrInitialDir); + + { + EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) + { + if (EQ (key, Q_initial_filename)) + { + Extbyte *fnout; + + CHECK_STRING (value); + LOCAL_FILE_FORMAT_TO_TSTR (value, fnout); + xetcscpy (fnbuf, fnout); + } + else if (EQ (key, Q_title)) + { + CHECK_STRING (value); + LISP_STRING_TO_EXTERNAL (value, ofn.lpstrTitle, Qmswindows_tstr); + } + else if (EQ (key, Q_initial_directory)) + LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (value, Qnil), + ofn.lpstrInitialDir); + else if (EQ (key, Q_file_must_exist)) + { + if (!NILP (value)) + ofn.Flags |= OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; + else + ofn.Flags &= ~(OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST); + } + else + syntax_error ("Unrecognized file-dialog keyword", key); + } + } + + if (!GetOpenFileName (&ofn)) + { + DWORD err = CommDlgExtendedError (); + if (!err) + { + while (1) + signal_quit (); + } + else + { + int i; + + for (i = 0; i < countof (common_dialog_errors); i++) + { + if (common_dialog_errors[i].errmess == err) + signal_type_error (Qdialog_box_error, + "Creating file-dialog-box", + build_string + (common_dialog_errors[i].errname)); + } + + signal_type_error (Qdialog_box_error, + "Unknown common dialog box error???", + make_int (err)); + } + } + + return tstr_to_local_file_format (ofn.lpstrFile); +} + +static Lisp_Object +handle_question_dialog_box (struct frame *f, Lisp_Object keys) { Lisp_Object_dynarr *dialog_items = Dynarr_new (Lisp_Object); unsigned_char_dynarr *template = Dynarr_new (unsigned_char); unsigned int button_row_width = 0; unsigned int text_width, text_height; + Lisp_Object question = Qnil, title = Qnil; int unbind_count = specpdl_depth (); record_unwind_protect (free_dynarr_opaque_ptr, @@ -207,31 +422,56 @@ make_opaque_ptr (template)); /* A big NO NEED to GCPRO gui_items stored in the array: they are just - pointers into DESC list, which is GC-protected by the caller */ + pointers into KEYS list, which is GC-protected by the caller */ - /* Parse each item in the dialog into gui_item structs, and stuff a dynarr - of these. Calculate button row width in this loop too */ { - Lisp_Object item_cons; - - EXTERNAL_LIST_LOOP (item_cons, XCDR (desc)) + EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) { - if (!NILP (XCAR (item_cons))) + if (EQ (key, Q_question)) + { + CHECK_STRING (value); + question = value; + } + else if (EQ (key, Q_title)) + { + CHECK_STRING (value); + title = value; + } + else if (EQ (key, Q_buttons)) { - Lisp_Object gitem = gui_parse_item_keywords (XCAR (item_cons)); - Dynarr_add (dialog_items, gitem); - button_row_width += button_width (XGUI_ITEM (gitem)->name) - + X_BUTTON_MARGIN; + Lisp_Object item_cons; + + /* Parse each item in the dialog into gui_item structs, + and stuff a dynarr of these. Calculate button row width + in this loop too */ + EXTERNAL_LIST_LOOP (item_cons, value) + { + if (!NILP (XCAR (item_cons))) + { + Lisp_Object gitem = + gui_parse_item_keywords (XCAR (item_cons)); + Dynarr_add (dialog_items, gitem); + button_row_width += button_width (XGUI_ITEM (gitem)->name) + + X_BUTTON_MARGIN; + } + } + + button_row_width -= X_BUTTON_MARGIN; } + else + syntax_error ("Unrecognized question-dialog keyword", key); } - if (Dynarr_length (dialog_items) == 0) - signal_simple_error ("Dialog descriptor provides no active items", desc); - button_row_width -= X_BUTTON_MARGIN; } + if (Dynarr_length (dialog_items) == 0) + syntax_error ("Dialog descriptor provides no buttons", keys); + + if (NILP (question)) + syntax_error ("Dialog descriptor provides no question", keys); + /* Determine the final width layout */ { - Bufbyte *p = XSTRING_DATA (XCAR (desc)); + Bufbyte *p = XSTRING_DATA (question); Charcount string_max = 0, this_length = 0; while (1) { @@ -261,17 +501,17 @@ /* Now calculate the height for the text control */ { - Bufbyte *p = XSTRING_DATA (XCAR (desc)); + Bufbyte *p = XSTRING_DATA (question); Charcount break_at = text_width / X_DLU_PER_CHAR; Charcount char_pos = 0; int num_lines = 1; Emchar ch; - while ((ch = charptr_emchar (p)) != (Emchar)'\0') + while ((ch = charptr_emchar (p)) != (Emchar) '\0') { INC_CHARPTR (p); - char_pos += ch != (Emchar)'\n'; - if (ch == (Emchar)'\n' || char_pos == break_at) + char_pos += ch != (Emchar) '\n'; + if (ch == (Emchar) '\n' || char_pos == break_at) { ++num_lines; char_pos = 0; @@ -305,9 +545,12 @@ /* We want no menu and standard class */ Dynarr_add_many (template, &zeroes, 4); - /* And the third is the dialog title. "XEmacs" as long as we do not supply - one in descriptor. Note that the string must be in Unicode. */ - Dynarr_add_many (template, L"XEmacs", 14); + /* And the third is the dialog title. "XEmacs" unless one is supplied. + Note that the string must be in Unicode. */ + if (NILP (title)) + Dynarr_add_many (template, L"XEmacs", 14); + else + push_lisp_string_as_unicode (template, title); /* We want standard dialog font */ Dynarr_add_many (template, L"\x08MS Shell Dlg", 28); @@ -329,7 +572,7 @@ Dynarr_add_many (template, &static_class_id, sizeof (static_class_id)); /* Next thing to add is control text, as Unicode string */ - push_lisp_string_as_unicode (template, XCAR (desc)); + push_lisp_string_as_unicode (template, question); /* Specify 0 length creation data */ Dynarr_add_many (template, &zeroes, 2); @@ -362,7 +605,21 @@ Dynarr_add_many (template, &button_class_id, sizeof (button_class_id)); /* Next thing to add is control text, as Unicode string */ - push_lisp_string_as_unicode (template, pgui_item->name); + { + Lisp_Object ctext = pgui_item->name; + Emchar accel_unused; + Bufbyte *trans = (Bufbyte *) alloca (2 * XSTRING_LENGTH (ctext) + 3); + Bytecount translen; + + memcpy (trans, XSTRING_DATA (ctext), XSTRING_LENGTH (ctext) + 1); + translen = + mswindows_translate_menu_or_dialog_item (trans, + XSTRING_LENGTH (ctext), + 2 * XSTRING_LENGTH (ctext) + 3, + &accel_unused, + ctext); + push_bufbyte_string_as_unicode (template, trans, translen); + } /* Specify 0 length creation data. */ Dynarr_add_many (template, &zeroes, 2); @@ -373,44 +630,103 @@ /* Now the Windows dialog structure is ready. We need to prepare a data structure for the new dialog, which will contain callbacks - and the frame for these callbacks. This structure has to be - GC-protected. The data structure itself is a cons of frame object - and a vector of callbacks; for the protection reasons it is put - into a statically protected list. */ + and the frame for these callbacks. This structure has to be + GC-protected and thus it is put into a statically protected + list. */ { - Lisp_Object frame, vector, dialog_data; + Lisp_Object dialog_data; int i; + struct mswindows_dialog_id *did = + alloc_lcrecord_type (struct mswindows_dialog_id, + &lrecord_mswindows_dialog_id); + + XSETMSWINDOWS_DIALOG_ID (dialog_data, did); + + did->frame = wrap_frame (f); + did->callbacks = make_vector (Dynarr_length (dialog_items), Qunbound); + for (i = 0; i < Dynarr_length (dialog_items); i++) + XVECTOR_DATA (did->callbacks) [i] = + XGUI_ITEM (*Dynarr_atp (dialog_items, i))->callback; - XSETFRAME (frame, f); - vector = make_vector (Dynarr_length (dialog_items), Qunbound); - dialog_data = Fcons (frame, vector); - for (i = 0; i < Dynarr_length (dialog_items); i++) - XVECTOR_DATA (vector) [i] = XGUI_ITEM (*Dynarr_atp (dialog_items, i))->callback; - /* Woof! Everything is ready. Pop pop pop in now! */ - if (!CreateDialogIndirectParam (NULL, - (LPDLGTEMPLATE) Dynarr_atp (template, 0), - FRAME_MSWINDOWS_HANDLE (f), dialog_proc, - (LPARAM) LISP_TO_VOID (dialog_data))) + did->hwnd = + CreateDialogIndirectParam (NULL, + (LPDLGTEMPLATE) Dynarr_atp (template, 0), + FRAME_MSWINDOWS_HANDLE (f), dialog_proc, + (LPARAM) LISP_TO_VOID (dialog_data)); + if (!did->hwnd) /* Something went wrong creating the dialog */ - signal_simple_error ("System error creating dialog", desc); + signal_type_error (Qdialog_box_error, "Creating dialog", keys); Vdialog_data_list = Fcons (dialog_data, Vdialog_data_list); + + /* Cease protection and free dynarrays */ + unbind_to (unbind_count, Qnil); + return dialog_data; } +} - /* Cease protection and free dynarrays */ - unbind_to (unbind_count, Qnil); +static Lisp_Object +mswindows_make_dialog_box_internal (struct frame* f, Lisp_Object type, + Lisp_Object keys) +{ + if (EQ (type, Qfile)) + return handle_file_dialog_box (f, keys); + else if (EQ (type, Qquestion)) + return handle_question_dialog_box (f, keys); + else if (EQ (type, Qprint)) + return mswindows_handle_print_dialog_box (f, keys); + else if (EQ (type, Qpage_setup)) + return mswindows_handle_page_setup_dialog_box (f, keys); + else if (EQ (type, Qprint_setup)) + return mswindows_handle_print_setup_dialog_box (f, keys); + else + signal_type_error (Qunimplemented, "Dialog box type", type); + return Qnil; } void console_type_create_dialog_mswindows (void) { - CONSOLE_HAS_METHOD (mswindows, popup_dialog_box); + CONSOLE_HAS_METHOD (mswindows, make_dialog_box_internal); +} + +void +syms_of_dialog_mswindows (void) +{ + INIT_LRECORD_IMPLEMENTATION (mswindows_dialog_id); + + DEFKEYWORD (Q_initial_directory); + DEFKEYWORD (Q_initial_filename); + DEFKEYWORD (Q_filter_list); + DEFKEYWORD (Q_title); + DEFKEYWORD (Q_allow_multi_select); + DEFKEYWORD (Q_create_prompt_on_nonexistent); + DEFKEYWORD (Q_overwrite_prompt); + DEFKEYWORD (Q_file_must_exist); + DEFKEYWORD (Q_no_network_button); + DEFKEYWORD (Q_no_read_only_return); + + /* Errors */ + DEFERROR_STANDARD (Qdialog_box_error, Qinvalid_operation); } void vars_of_dialog_mswindows (void) { + Vpopup_frame_list = Qnil; + staticpro (&Vpopup_frame_list); + Vdialog_data_list = Qnil; staticpro (&Vdialog_data_list); + + DEFVAR_LISP ("default-file-dialog-filter-alist", + &Vdefault_file_dialog_filter_alist /* +*/ ); + Vdefault_file_dialog_filter_alist = + list5 (Fcons (build_string ("Text Files"), build_string ("*.txt")), + Fcons (build_string ("C Files"), build_string ("*.c;*.h")), + Fcons (build_string ("Elisp Files"), build_string ("*.el")), + Fcons (build_string ("HTML Files"), build_string ("*.html;*.html")), + Fcons (build_string ("All Files"), build_string ("*.*"))); } diff -r 72a7cfa4a488 -r abe6d1db359e src/dialog-x.c --- a/src/dialog-x.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/dialog-x.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,7 @@ /* Implements elisp-programmable dialog boxes -- X interface. Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. + Copyright (C) 2000 Ben Wing. This file is part of XEmacs. @@ -21,6 +22,8 @@ /* Synched up with: Not in FSF. */ +/* This file Mule-ized by Ben Wing, 7-8-00. */ + #include #include "lisp.h" @@ -40,7 +43,6 @@ static void maybe_run_dbox_text_callback (LWLIB_ID id) { - /* !!#### This function has not been Mule-ized */ widget_value *wv; int got_some; wv = xmalloc_widget_value (); @@ -49,17 +51,22 @@ if (got_some) { Lisp_Object text_field_callback; - char *text_field_value = wv->value; + Extbyte *text_field_value = wv->value; VOID_TO_LISP (text_field_callback, wv->call_data); + text_field_callback = XCAR (XCDR (text_field_callback)); if (text_field_value) { - void *tmp = LISP_TO_VOID (list2 (text_field_callback, - build_string (text_field_value))); + void *tmp = + LISP_TO_VOID (cons3 (Qnil, + list2 (text_field_callback, + build_ext_string (text_field_value, + Qlwlib_encoding)), + Qnil)); popup_selection_callback (0, id, (XtPointer) tmp); } } /* This code tried to optimize, newing/freeing. This is generally - unsafe so we will alwats strdup and always use + unsafe so we will always strdup and always use free_widget_value_tree. */ free_widget_value_tree (wv); } @@ -88,6 +95,9 @@ popup_up_p--; maybe_run_dbox_text_callback (id); popup_selection_callback (widget, id, client_data); + /* #### need to error-protect! will do so when i merge in + my working ws */ + va_run_hook_with_args (Qdelete_dialog_box_hook, 1, make_int (id)); lw_destroy_all_widgets (id); /* The Motif dialog box sets the keyboard focus to itself. When it @@ -102,19 +112,14 @@ lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f), FRAME_X_TEXT_WIDGET (f)); } -static CONST char * CONST button_names [] = { +static const Extbyte * const button_names [] = { "button1", "button2", "button3", "button4", "button5", "button6", "button7", "button8", "button9", "button10" }; -/* can't have static frame locals because of some broken compilers */ -static char tmp_dbox_name [255]; - static widget_value * -dbox_descriptor_to_widget_value (Lisp_Object desc) +dbox_descriptor_to_widget_value (Lisp_Object keys) { - /* !!#### This function has not been Mule-ized */ /* This function can GC */ - char *name; int lbuttons = 0, rbuttons = 0; int partition_seen = 0; int text_field_p = 0; @@ -123,13 +128,33 @@ int n = 0; int count = specpdl_depth (); Lisp_Object wv_closure, gui_item; + Lisp_Object question = Qnil, title = Qnil, buttons = Qnil; - CHECK_CONS (desc); - CHECK_STRING (XCAR (desc)); - name = (char *) XSTRING_DATA (LISP_GETTEXT (XCAR (desc))); - desc = XCDR (desc); - if (!CONSP (desc)) - error ("dialog boxes must have some buttons"); + { + EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) + { + if (EQ (key, Q_question)) + { + CHECK_STRING (value); + question = value; + } + else if (EQ (key, Q_title)) + { + CHECK_STRING (value); + title = value; + } + else if (EQ (key, Q_buttons)) + { + CHECK_LIST (value); + buttons = value; + } + else + syntax_error ("Unrecognized question-dialog keyword", key); + } + } + + if (NILP (question)) + syntax_error ("Dialog descriptor provides no question", keys); /* Inhibit GC during this conversion. The reasons for this are the same as in menu_item_descriptor_to_widget_value(); see @@ -147,61 +172,69 @@ wv_closure = make_opaque_ptr (kids); record_unwind_protect (widget_value_unwind, wv_closure); prev->name = xstrdup ("message"); - prev->value = xstrdup (name); + LISP_STRING_TO_EXTERNAL_MALLOC (question, prev->value, Qlwlib_encoding); prev->enabled = 1; - for (; !NILP (desc); desc = Fcdr (desc)) - { - Lisp_Object button = XCAR (desc); - widget_value *wv; + { + EXTERNAL_LIST_LOOP_2 (button, buttons) + { + widget_value *wv; - if (NILP (button)) - { - if (partition_seen) - error ("more than one partition (nil) seen in dbox spec"); - partition_seen = 1; - continue; - } - CHECK_VECTOR (button); - wv = xmalloc_widget_value (); + if (NILP (button)) + { + if (partition_seen) + syntax_error ("More than one partition (nil) seen in dbox spec", + keys); + partition_seen = 1; + continue; + } + CHECK_VECTOR (button); + wv = xmalloc_widget_value (); - gui_item = gui_parse_item_keywords (button); - if (!button_item_to_widget_value (gui_item, wv, allow_text_p, 1)) - { - free_widget_value_tree (wv); - continue; - } + gui_item = gui_parse_item_keywords (button); + if (!button_item_to_widget_value (Qdialog, + gui_item, wv, allow_text_p, 1, 0, 1)) + { + free_widget_value_tree (wv); + continue; + } - if (wv->type == TEXT_TYPE) - { - text_field_p = 1; - allow_text_p = 0; /* only allow one */ - } - else /* it's a button */ - { - allow_text_p = 0; /* only allow text field at the front */ - if (wv->value) xfree (wv->value); - wv->value = wv->name; /* what a mess... */ - wv->name = xstrdup (button_names [n]); + if (wv->type == TEXT_TYPE) + { + text_field_p = 1; + allow_text_p = 0; /* only allow one */ + } + else /* it's a button */ + { + allow_text_p = 0; /* only allow text field at the front */ + if (wv->value) + xfree (wv->value); + wv->value = wv->name; /* what a mess... */ + wv->name = xstrdup (button_names [n]); - if (partition_seen) - rbuttons++; - else - lbuttons++; - n++; + if (partition_seen) + rbuttons++; + else + lbuttons++; + n++; - if (lbuttons > 9 || rbuttons > 9) - error ("too many buttons (9)"); /* #### this leaks */ - } + if (lbuttons > 9 || rbuttons > 9) + syntax_error ("Too many buttons (9)", + keys); /* #### this leaks */ + } - prev->next = wv; - prev = wv; - } + prev->next = wv; + prev = wv; + } + } if (n == 0) - error ("dialog boxes must have some buttons"); + syntax_error ("Dialog boxes must have some buttons", keys); + { - char type = (text_field_p ? 'P' : 'Q'); + Extbyte type = (text_field_p ? 'P' : 'Q'); + static Extbyte tmp_dbox_name [255]; + widget_value *dbox; sprintf (tmp_dbox_name, "%c%dBR%d", type, lbuttons + rbuttons, rbuttons); dbox = xmalloc_widget_value (); @@ -215,14 +248,18 @@ } } -static void -x_popup_dialog_box (struct frame* f, Lisp_Object dbox_desc) +static Lisp_Object +x_make_dialog_box_internal (struct frame* f, Lisp_Object type, + Lisp_Object keys) { int dbox_id; widget_value *data; Widget parent, dbox; - data = dbox_descriptor_to_widget_value (dbox_desc); + if (!EQ (type, Qquestion)) + signal_type_error (Qunimplemented, "Dialog box type", type); + + data = dbox_descriptor_to_widget_value (keys); parent = FRAME_X_SHELL_WIDGET (f); @@ -252,6 +289,10 @@ popup_up_p++; lw_pop_up_all_widgets (dbox_id); + + /* #### this could (theoretically) cause problems if we are up for + a REALLY REALLY long time -- too big to fit into lisp integer. */ + return make_int (dbox_id); } void @@ -262,7 +303,7 @@ void console_type_create_dialog_x (void) { - CONSOLE_HAS_METHOD (x, popup_dialog_box); + CONSOLE_HAS_METHOD (x, make_dialog_box_internal); } void diff -r 72a7cfa4a488 -r abe6d1db359e src/dialog.c --- a/src/dialog.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/dialog.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,7 @@ /* Implements elisp-programmable dialog boxes -- generic. Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. + Copyright (C) 2000 Ben Wing. This file is part of XEmacs. @@ -21,72 +22,51 @@ /* Synched up with: Not in FSF. */ -/* #### There ain't nothin' here because dialog boxes have not been - properly abstracted yet. */ - #include #include "lisp.h" + #include "frame.h" #include "device.h" -DEFUN ("popup-dialog-box", Fpopup_dialog_box, 1, 1, 0, /* -Pop up a dialog box. -A dialog box description is a list. - -The first element of a dialog box must be a string, which is the title or -question. - -The rest of the elements are descriptions of the dialog box's buttons. -Each of these is a vector, the syntax of which is essentially the same as -that of popup menu items. They may have any of the following forms: - - [ "name" callback ] - [ "name" callback "suffix" ] - [ "name" callback : : ... ] +Lisp_Object Vdelete_dialog_box_hook; +Lisp_Object Qdelete_dialog_box_hook; -The name is the string to display on the button; it is filtered through the -resource database, so it is possible for resources to override what string -is actually displayed. - -If the `callback' of a button is a symbol, then it must name a command. -It will be invoked with `call-interactively'. If it is a list, then it is -evaluated with `eval'. - -One (and only one) of the buttons may be `nil'. This marker means that all -following buttons should be flushright instead of flushleft. - -Though the keyword/value syntax is supported for dialog boxes just as in -popup menus, the only keyword which is both meaningful and fully implemented -for dialog box buttons is `:active'. +DEFUN ("make-dialog-box-internal", Fmake_dialog_box_internal, 2, 2, 0, /* +Internal helper function for `make-dialog-box'. +This handles all dialog-box types except `general'. +TYPE is the same as the first argument to `make-dialog-box', and KEYS +a list of the remaining arguments. */ - (dbox_desc)) + (type, keys)) { struct frame *f = selected_frame (); struct device *d = XDEVICE (f->device); - if (!HAS_DEVMETH_P (d, popup_dialog_box)) - signal_simple_error ("Device does not support dialogs", f->device); + CHECK_SYMBOL (type); - if (SYMBOLP (dbox_desc)) - dbox_desc = Fsymbol_value (dbox_desc); - CHECK_CONS (dbox_desc); - CHECK_STRING (XCAR (dbox_desc)); - if (!CONSP (XCDR (dbox_desc))) - signal_simple_error ("Dialog descriptor must supply at least one button", dbox_desc); + if (!HAS_DEVMETH_P (d, make_dialog_box_internal)) + signal_type_error (Qunimplemented, + "Device does not support dialogs", f->device); - DEVMETH (d, popup_dialog_box, (f, dbox_desc)); - - return Qnil; + return DEVMETH (d, make_dialog_box_internal, (f, type, keys)); } void syms_of_dialog (void) { - DEFSUBR (Fpopup_dialog_box); + DEFSUBR (Fmake_dialog_box_internal); + + DEFSYMBOL (Qdelete_dialog_box_hook); } void vars_of_dialog (void) { Fprovide (intern ("dialog")); + + DEFVAR_LISP ("delete-dialog-box-hook", &Vdelete_dialog_box_hook /* +Function or functions to call when a dialog box is about to be deleted. +One arg, the dialog box id. +*/ ); + Vdelete_dialog_box_hook = Qnil; } diff -r 72a7cfa4a488 -r abe6d1db359e src/dired-msw.c --- a/src/dired-msw.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/dired-msw.c Mon Aug 13 11:35:02 2007 +0200 @@ -75,11 +75,10 @@ #include "buffer.h" #include "regex.h" -#include "sysfile.h" #include "sysdir.h" #include "sysproc.h" +#include "sysfile.h" -#include #include #include /* To make nt.h happy */ @@ -209,9 +208,9 @@ /* * Here, we use FindFirstFile()/FindNextFile() instead of opendir(), - * stat(), & friends, because stat() is VERY expensive in terms of - * time. Hence, we take the time to write complicated Win32-specific - * code, instead of simple Unix-style stuff. + * xemacs_stat(), & friends, because xemacs_stat() is VERY expensive in + * terms of time. Hence, we take the time to write complicated + * Win32-specific code, instead of simple Unix-style stuff. */ findex = 0; fh = INVALID_HANDLE_VALUE; diff -r 72a7cfa4a488 -r abe6d1db359e src/dired.c --- a/src/dired.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/dired.c Mon Aug 13 11:35:02 2007 +0200 @@ -23,16 +23,16 @@ #include #include "lisp.h" +#include "sysfile.h" +#include "sysdir.h" +#include "systime.h" +#include "sysdep.h" +#include "syspwd.h" #include "buffer.h" #include "commands.h" #include "elhash.h" #include "regex.h" #include "opaque.h" -#include "sysfile.h" -#include "sysdir.h" -#include "systime.h" -#include "sysdep.h" -#include "syspwd.h" Lisp_Object Vcompletion_ignored_extensions; Lisp_Object Qdirectory_files; @@ -146,7 +146,7 @@ memcpy (statbuf_tail, dp->d_name, len); statbuf_tail[len] = 0; - if (stat (statbuf, &st) == 0 + if (xemacs_stat (statbuf, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) dir_p = 1; @@ -260,9 +260,9 @@ in case it is a directory. */ value = lstat (fullname, st_addr); if (S_ISLNK (st_addr->st_mode)) - stat (fullname, st_addr); + xemacs_stat (fullname, st_addr); #else - value = stat (fullname, st_addr); + value = xemacs_stat (fullname, st_addr); #endif return value; } @@ -303,11 +303,11 @@ CHECK_STRING (file); -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* Filename completion on Windows ignores case, since Windows filesystems do. */ specbind (Qcompletion_ignore_case, Qt); -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ #ifdef FILE_SYSTEM_CASE file = FILE_SYSTEM_CASE (file); @@ -507,8 +507,9 @@ -/* The *pwent() functions do not exist on NT */ -#ifndef WINDOWSNT +/* The *pwent() functions do not exist on NT. #### The NT equivalent + is NetUserEnum(), and rewriting to use it is not hard.*/ +#ifndef WIN32_NATIVE static Lisp_Object user_name_completion (Lisp_Object user, int all_flag, @@ -707,11 +708,11 @@ return Qt; return Fsubstring (bestmatch, Qzero, make_int (bestmatchsize)); } -#endif /* ! defined WINDOWSNT */ +#endif /* ! defined WIN32_NATIVE */ Lisp_Object -make_directory_hash_table (CONST char *path) +make_directory_hash_table (const char *path) { DIR *d; if ((d = opendir (path))) @@ -796,7 +797,7 @@ directory = Ffile_name_directory (filename); #endif -#ifdef MSDOS +#if 0 /* #### shouldn't this apply to WIN32_NATIVE and maybe CYGWIN? */ { char *tmpnam = (char *) XSTRING_DATA (Ffile_name_nondirectory (filename)); int l = strlen (tmpnam); @@ -810,7 +811,7 @@ s.st_mode |= S_IEXEC; } } -#endif /* MSDOS */ +#endif switch (s.st_mode & S_IFMT) { @@ -843,7 +844,7 @@ { struct stat sdir; - if (!NILP (directory) && stat ((char *) XSTRING_DATA (directory), &sdir) == 0) + if (!NILP (directory) && xemacs_stat ((char *) XSTRING_DATA (directory), &sdir) == 0) values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil; else /* if we can't tell, assume worst */ values[9] = Qt; @@ -873,7 +874,7 @@ DEFSUBR (Fdirectory_files); DEFSUBR (Ffile_name_completion); DEFSUBR (Ffile_name_all_completions); -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE DEFSUBR (Fuser_name_completion); DEFSUBR (Fuser_name_completion_1); DEFSUBR (Fuser_name_all_completions); diff -r 72a7cfa4a488 -r abe6d1db359e src/doc.c --- a/src/doc.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/doc.c Mon Aug 13 11:35:02 2007 +0200 @@ -392,7 +392,7 @@ } static void -weird_doc (Lisp_Object sym, CONST char *weirdness, CONST char *type, int pos) +weird_doc (Lisp_Object sym, const char *weirdness, const char *type, int pos) { if (!strcmp (weirdness, GETTEXT ("duplicate"))) return; message ("Note: Strange doc (%s) for %s %s @ %d", diff -r 72a7cfa4a488 -r abe6d1db359e src/doprnt.c --- a/src/doprnt.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/doprnt.c Mon Aug 13 11:35:02 2007 +0200 @@ -31,13 +31,13 @@ #include "buffer.h" #include "lstream.h" -static CONST char *valid_flags = "-+ #0"; +static const char *valid_flags = "-+ #0"; -static CONST char *valid_converters = "diouxXfeEgGcsS"; -static CONST char *int_converters = "dic"; -static CONST char *unsigned_int_converters = "ouxX"; -static CONST char *double_converters = "feEgG"; -static CONST char *string_converters = "sS"; +static const char *valid_converters = "diouxXfeEgGcsS"; +static const char *int_converters = "dic"; +static const char *unsigned_int_converters = "ouxX"; +static const char *double_converters = "feEgG"; +static const char *string_converters = "sS"; typedef struct printf_spec printf_spec; struct printf_spec @@ -99,7 +99,7 @@ Note that MINLEN and MAXLEN are Charcounts but LEN is a Bytecount. */ static void -doprnt_1 (Lisp_Object stream, CONST Bufbyte *string, Bytecount len, +doprnt_1 (Lisp_Object stream, const Bufbyte *string, Bytecount len, Charcount minlen, Charcount maxlen, int minus_flag, int zero_flag) { Charcount cclen; @@ -140,8 +140,8 @@ } } -static CONST Bufbyte * -parse_off_posnum (CONST Bufbyte *start, CONST Bufbyte *end, int *returned_num) +static const Bufbyte * +parse_off_posnum (const Bufbyte *start, const Bufbyte *end, int *returned_num) { Bufbyte arg_convert[100]; REGISTER Bufbyte *arg_ptr = arg_convert; @@ -178,17 +178,17 @@ } while (0) static printf_spec_dynarr * -parse_doprnt_spec (CONST Bufbyte *format, Bytecount format_length) +parse_doprnt_spec (const Bufbyte *format, Bytecount format_length) { - CONST Bufbyte *fmt = format; - CONST Bufbyte *fmt_end = format + format_length; + const Bufbyte *fmt = format; + const Bufbyte *fmt_end = format + format_length; printf_spec_dynarr *specs = Dynarr_new (printf_spec); int prev_argnum = 0; while (1) { struct printf_spec spec; - CONST Bufbyte *text_end; + const Bufbyte *text_end; Bufbyte ch; xzero (spec); @@ -216,7 +216,7 @@ /* Is there a field number specifier? */ { - CONST Bufbyte *ptr; + const Bufbyte *ptr; int fieldspec; ptr = parse_off_posnum (fmt, fmt_end, &fieldspec); @@ -423,11 +423,11 @@ to the arguments. */ static Bytecount -emacs_doprnt_1 (Lisp_Object stream, CONST Bufbyte *format_nonreloc, +emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, int nargs, /* #### Gag me, gag me, gag me */ - CONST Lisp_Object *largs, va_list vargs) + const Lisp_Object *largs, va_list vargs) { printf_spec_dynarr *specs = 0; printf_arg_dynarr *args = 0; @@ -440,7 +440,7 @@ format_length = XSTRING_LENGTH (format_reloc); } if (format_length < 0) - format_length = (Bytecount) strlen ((CONST char *) format_nonreloc); + format_length = (Bytecount) strlen ((const char *) format_nonreloc); specs = parse_doprnt_spec (format_nonreloc, format_length); if (largs) @@ -657,16 +657,21 @@ long_to_string (constructed_spec + strlen (constructed_spec), spec->precision); } - sprintf (constructed_spec + strlen (constructed_spec), "%c", ch); /* sprintf the mofo */ /* we have to use separate calls to sprintf(), rather than a single big conditional, because of the different types of the arguments */ if (strchr (double_converters, ch)) - sprintf (text_to_print, constructed_spec, arg.d); + { + sprintf (constructed_spec + strlen (constructed_spec), + "%c", ch); + sprintf (text_to_print, constructed_spec, arg.d); + } else if (strchr (unsigned_int_converters, ch)) { + sprintf (constructed_spec + strlen (constructed_spec), + "%c", ch); if (spec->l_flag) sprintf (text_to_print, constructed_spec, arg.ul); else @@ -674,6 +679,12 @@ } else { + if (spec->zero_flag && spec->minwidth) + sprintf (constructed_spec + strlen (constructed_spec), + "0%d%c", spec->minwidth, ch); + else + sprintf (constructed_spec + strlen (constructed_spec), + "%c", ch); if (spec->l_flag) sprintf (text_to_print, constructed_spec, arg.l); else @@ -697,9 +708,9 @@ /* You really don't want to know why this is necessary... */ static Bytecount -emacs_doprnt_2 (Lisp_Object stream, CONST Bufbyte *format_nonreloc, +emacs_doprnt_2 (Lisp_Object stream, const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, int nargs, - CONST Lisp_Object *largs, ...) + const Lisp_Object *largs, ...) { va_list vargs; Bytecount val; @@ -732,7 +743,7 @@ parameter, because this function can cause GC. */ Bytecount -emacs_doprnt_c (Lisp_Object stream, CONST Bufbyte *format_nonreloc, +emacs_doprnt_c (Lisp_Object stream, const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, ...) { @@ -749,7 +760,7 @@ /* Like emacs_doprnt_c but the args come in va_list format. */ Bytecount -emacs_doprnt_va (Lisp_Object stream, CONST Bufbyte *format_nonreloc, +emacs_doprnt_va (Lisp_Object stream, const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, va_list vargs) { @@ -763,9 +774,9 @@ See `format' for a description of this behavior. */ Bytecount -emacs_doprnt_lisp (Lisp_Object stream, CONST Bufbyte *format_nonreloc, +emacs_doprnt_lisp (Lisp_Object stream, const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, - int nargs, CONST Lisp_Object *largs) + int nargs, const Lisp_Object *largs) { return emacs_doprnt_2 (stream, format_nonreloc, format_reloc, format_length, nargs, largs); @@ -774,7 +785,7 @@ /* Like the previous function but takes a variable number of arguments. */ Bytecount -emacs_doprnt_lisp_2 (Lisp_Object stream, CONST Bufbyte *format_nonreloc, +emacs_doprnt_lisp_2 (Lisp_Object stream, const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, int nargs, ...) { @@ -796,7 +807,7 @@ to a stream. */ Lisp_Object -emacs_doprnt_string_c (CONST Bufbyte *format_nonreloc, +emacs_doprnt_string_c (const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, ...) { @@ -819,7 +830,7 @@ } Lisp_Object -emacs_doprnt_string_va (CONST Bufbyte *format_nonreloc, +emacs_doprnt_string_va (const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, va_list vargs) { @@ -842,9 +853,9 @@ } Lisp_Object -emacs_doprnt_string_lisp (CONST Bufbyte *format_nonreloc, +emacs_doprnt_string_lisp (const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, - int nargs, CONST Lisp_Object *largs) + int nargs, const Lisp_Object *largs) { Lisp_Object obj; Lisp_Object stream = make_resizing_buffer_output_stream (); @@ -862,7 +873,7 @@ } Lisp_Object -emacs_doprnt_string_lisp_2 (CONST Bufbyte *format_nonreloc, +emacs_doprnt_string_lisp_2 (const Bufbyte *format_nonreloc, Lisp_Object format_reloc, Bytecount format_length, int nargs, ...) { diff -r 72a7cfa4a488 -r abe6d1db359e src/dump-id.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dump-id.h Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,6 @@ +#ifndef INCLUDED_dump_id_h_ +#define INCLUDED_dump_id_h_ + +extern unsigned int dump_id; + +#endif diff -r 72a7cfa4a488 -r abe6d1db359e src/dumper.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dumper.c Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,1375 @@ +/* Portable data dumper for XEmacs. + Copyright (C) 1999-2000 Olivier Galibert + +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. */ + +#include +#include "lisp.h" + +#include "dump-id.h" +#include "specifier.h" +#include "alloc.h" +#include "elhash.h" +#include "sysfile.h" +#include "console-stream.h" +#include "dumper.h" + +#ifdef WIN32_NATIVE +#include "nt.h" +#else +#ifdef HAVE_MMAP +#include +#endif +#endif + +#ifndef SEPCHAR +#define SEPCHAR ':' +#endif + +typedef struct +{ + const struct lrecord_description *desc; + int count; +} pdump_reloc_table; + +static char *pdump_rt_list = 0; + +void +pdump_objects_unmark (void) +{ + int i; + char *p = pdump_rt_list; + if (p) + for (;;) + { + pdump_reloc_table *rt = (pdump_reloc_table *)p; + p += sizeof (pdump_reloc_table); + if (rt->desc) + { + for (i=0; icount; i++) + { + struct lrecord_header *lh = * (struct lrecord_header **) p; + if (! C_READONLY_RECORD_HEADER_P (lh)) + UNMARK_RECORD_HEADER (lh); + p += sizeof (EMACS_INT); + } + } else + break; + } +} + + +/* The structure of the file + * + * 0 - header + * 256 - dumped objects + * stab_offset - nb_staticpro*(Lisp_Object *) from staticvec + * - nb_staticpro*(relocated Lisp_Object) pointed to by staticpro + * - nb_structdmp*pair(void *, adr) for pointers to structures + * - lrecord_implementations_table[] + * - relocation table + * - wired variable address/value couples with the count preceding the list + */ + + +#define DUMP_SIGNATURE "XEmacsDP" +#define DUMP_SIGNATURE_LEN (sizeof (DUMP_SIGNATURE) - 1) + +typedef struct +{ + char signature[DUMP_SIGNATURE_LEN]; + unsigned int id; + EMACS_UINT stab_offset; + EMACS_UINT reloc_address; + int nb_staticpro; + int nb_structdmp; + int nb_opaquedmp; +} dump_header; + +char *pdump_start, *pdump_end; +static size_t pdump_length; + +#ifdef WIN32_NATIVE +// Handle for the dump file +HANDLE pdump_hFile = INVALID_HANDLE_VALUE; +// Handle for the file mapping object for the dump file +HANDLE pdump_hMap = INVALID_HANDLE_VALUE; +#endif + +void (*pdump_free) (void); + +static const unsigned char align_table[256] = +{ + 8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 +}; + +typedef struct pdump_entry_list_elmt +{ + struct pdump_entry_list_elmt *next; + const void *obj; + size_t size; + int count; + int is_lrecord; + EMACS_INT save_offset; +} pdump_entry_list_elmt; + +typedef struct +{ + pdump_entry_list_elmt *first; + int align; + int count; +} pdump_entry_list; + +typedef struct pdump_struct_list_elmt +{ + pdump_entry_list list; + const struct struct_description *sdesc; +} pdump_struct_list_elmt; + +typedef struct +{ + pdump_struct_list_elmt *list; + int count; + int size; +} pdump_struct_list; + +static pdump_entry_list pdump_object_table[256]; +static pdump_entry_list pdump_opaque_data_list; +static pdump_struct_list pdump_struct_table; +static pdump_entry_list_elmt *pdump_qnil; + +static int pdump_alert_undump_object[256]; + +static unsigned long cur_offset; +static size_t max_size; +static int pdump_fd; +static void *pdump_buf; + +#define PDUMP_HASHSIZE 200001 + +static pdump_entry_list_elmt **pdump_hash; + +/* Since most pointers are eight bytes aligned, the >>3 allows for a better hash */ +static int +pdump_make_hash (const void *obj) +{ + return ((unsigned long)(obj)>>3) % PDUMP_HASHSIZE; +} + +static pdump_entry_list_elmt * +pdump_get_entry (const void *obj) +{ + int pos = pdump_make_hash (obj); + pdump_entry_list_elmt *e; + + assert (obj != 0); + + while ((e = pdump_hash[pos]) != 0) + { + if (e->obj == obj) + return e; + + pos++; + if (pos == PDUMP_HASHSIZE) + pos = 0; + } + return 0; +} + +static void +pdump_add_entry (pdump_entry_list *list, const void *obj, size_t size, int count, int is_lrecord) +{ + pdump_entry_list_elmt *e; + int align; + int pos = pdump_make_hash (obj); + + while ((e = pdump_hash[pos]) != 0) + { + if (e->obj == obj) + return; + + pos++; + if (pos == PDUMP_HASHSIZE) + pos = 0; + } + + e = xnew (pdump_entry_list_elmt); + + e->next = list->first; + e->obj = obj; + e->size = size; + e->count = count; + e->is_lrecord = is_lrecord; + list->first = e; + + list->count += count; + pdump_hash[pos] = e; + + align = align_table[size & 255]; + if (align < 2 && is_lrecord) + align = 2; + + if (align < list->align) + list->align = align; +} + +static pdump_entry_list * +pdump_get_entry_list (const struct struct_description *sdesc) +{ + int i; + for (i=0; iname, + backtrace[i].position, + backtrace[i].offset); + } + } +} + +static void pdump_register_object (Lisp_Object obj); +static void pdump_register_struct (const void *data, const struct struct_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_SIZE_T: + count = *(size_t *)irdata; + break; + case XD_INT: + count = *(int *)irdata; + break; + case XD_LONG: + count = *(long *)irdata; + break; + case XD_BYTECOUNT: + count = *(Bytecount *)irdata; + break; + default: + stderr_out ("Unsupported count type : %d (line = %d, code=%ld)\n", idesc[line].type, line, (long)code); + pdump_backtrace (); + abort (); + } + count += delta; + return count; +} + +static void +pdump_register_sub (const void *data, const struct lrecord_description *desc, int me) +{ + int pos; + + restart: + for (pos = 0; desc[pos].type != XD_END; pos++) + { + const void *rdata = (const char *)data + desc[pos].offset; + + backtrace[me].position = pos; + backtrace[me].offset = desc[pos].offset; + + switch (desc[pos].type) + { + case XD_SPECIFIER_END: + pos = 0; + desc = ((const Lisp_Specifier *)data)->methods->extra_description; + goto restart; + case XD_SIZE_T: + case XD_INT: + case XD_LONG: + case XD_BYTECOUNT: + case XD_LO_RESET_NIL: + case XD_INT_RESET: + case XD_LO_LINK: + 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); + + pdump_add_entry (&pdump_opaque_data_list, + *(void **)rdata, + count, + 1, + 0); + break; + } + case XD_C_STRING: + { + const char *str = *(const char **)rdata; + if (str) + pdump_add_entry (&pdump_opaque_data_list, str, strlen (str)+1, 1, 0); + 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, 0); + break; + } + case XD_LISP_OBJECT: + { + const Lisp_Object *pobj = (const Lisp_Object *)rdata; + + assert (desc[pos].data1 == 0); + + 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); + + for (i = 0; i < count; i++) + { + const Lisp_Object *pobj = ((const Lisp_Object *)rdata) + i; + Lisp_Object dobj = *pobj; + + 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; + 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); + } + break; + } + default: + stderr_out ("Unsupported dump type : %d\n", desc[pos].type); + pdump_backtrace (); + abort (); + }; + } +} + +static void +pdump_register_object (Lisp_Object obj) +{ + struct lrecord_header *objh; + + if (!POINTER_TYPE_P (XTYPE (obj))) + return; + + objh = XRECORD_LHEADER (obj); + if (!objh) + return; + + if (pdump_get_entry (objh)) + return; + + if (LHEADER_IMPLEMENTATION (objh)->description) + { + 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_add_entry (pdump_object_table + objh->type, + objh, + LHEADER_IMPLEMENTATION (objh)->static_size ? + LHEADER_IMPLEMENTATION (objh)->static_size : + LHEADER_IMPLEMENTATION (objh)->size_in_bytes_method (objh), + 1, + 1); + pdump_register_sub (objh, + LHEADER_IMPLEMENTATION (objh)->description, + me); + --depth; + } + else + { + pdump_alert_undump_object[objh->type]++; + stderr_out ("Undumpable object type : %s\n", LHEADER_IMPLEMENTATION (objh)->name); + pdump_backtrace (); + } +} + +static void +pdump_register_struct (const void *data, const struct struct_description *sdesc, int count) +{ + if (data && !pdump_get_entry (data)) + { + int me = depth++; + int i; + if (me>65536) + { + stderr_out ("Backtrace overflow, loop ?\n"); + abort (); + } + backtrace[me].obj = 0; + backtrace[me].position = 0; + backtrace[me].offset = 0; + + pdump_add_entry (pdump_get_entry_list (sdesc), + data, + sdesc->size, + count, + 0); + for (i=0; isize*i, + sdesc->description, + me); + } + --depth; + } +} + +static void +pdump_dump_data (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) +{ + size_t size = elmt->size; + int count = elmt->count; + if (desc) + { + int pos, i; + memcpy (pdump_buf, elmt->obj, size*count); + + for (i=0; iobj))->methods->extra_description; + goto restart; + case XD_SIZE_T: + case XD_INT: + case XD_LONG: + case XD_BYTECOUNT: + break; + case XD_LO_RESET_NIL: + { + EMACS_INT num = desc[pos].data1; + int j; + if (XD_IS_INDIRECT (num)) + num = pdump_get_indirect_count (num, desc, elmt->obj); + for (j=0; jsave_offset; + break; + } + case XD_INT_RESET: + { + EMACS_INT val = desc[pos].data1; + if (XD_IS_INDIRECT (val)) + val = pdump_get_indirect_count (val, desc, elmt->obj); + *(int *)rdata = val; + break; + } + case XD_OPAQUE_DATA_PTR: + case XD_C_STRING: + case XD_STRUCT_PTR: + { + void *ptr = *(void **)rdata; + if (ptr) + *(EMACS_INT *)rdata = pdump_get_entry (ptr)->save_offset; + break; + } + case XD_LO_LINK: + { + Lisp_Object obj = *(Lisp_Object *)rdata; + pdump_entry_list_elmt *elmt1; + for (;;) + { + elmt1 = pdump_get_entry (XRECORD_LHEADER (obj)); + if (elmt1) + break; + obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); + } + *(EMACS_INT *)rdata = elmt1->save_offset; + break; + } + case XD_LISP_OBJECT: + { + Lisp_Object *pobj = (Lisp_Object *) rdata; + + assert (desc[pos].data1 == 0); + + if (POINTER_TYPE_P (XTYPE (*pobj)) && XRECORD_LHEADER (*pobj)) + *(EMACS_INT *)pobj = + pdump_get_entry (XRECORD_LHEADER (*pobj))->save_offset; + break; + } + case XD_LISP_OBJECT_ARRAY: + { + EMACS_INT num = desc[pos].data1; + int j; + if (XD_IS_INDIRECT (num)) + num = pdump_get_indirect_count (num, desc, elmt->obj); + + for (j=0; jsave_offset; + } + break; + } + case XD_DOC_STRING: + { + EMACS_INT str = *(EMACS_INT *)rdata; + if (str > 0) + *(EMACS_INT *)rdata = pdump_get_entry ((void *)str)->save_offset; + break; + } + default: + stderr_out ("Unsupported dump type : %d\n", desc[pos].type); + abort (); + }; + } + } + } + write (pdump_fd, desc ? pdump_buf : elmt->obj, size*count); + if (elmt->is_lrecord && ((size*count) & 3)) + write (pdump_fd, "\0\0\0", 4-((size*count) & 3)); +} + +static void +pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_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) + { + case XD_SPECIFIER_END: + pos = 0; + desc = ((const Lisp_Specifier *)data)->methods->extra_description; + goto restart; + case XD_SIZE_T: + case XD_INT: + case XD_LONG: + case XD_BYTECOUNT: + case XD_INT_RESET: + break; + case XD_OPAQUE_DATA_PTR: + case XD_C_STRING: + case XD_STRUCT_PTR: + case XD_LO_LINK: + { + EMACS_INT ptr = *(EMACS_INT *)rdata; + if (ptr) + *(EMACS_INT *)rdata = ptr+delta; + break; + } + case XD_LISP_OBJECT: + { + Lisp_Object *pobj = (Lisp_Object *) rdata; + + assert (desc[pos].data1 == 0); + + if (POINTER_TYPE_P (XTYPE (*pobj)) + && ! EQ (*pobj, Qnull_pointer)) + XSETOBJ (*pobj, (char *) XPNTR (*pobj) + delta); + + break; + } + case XD_LISP_OBJECT_ARRAY: + case XD_LO_RESET_NIL: + { + EMACS_INT num = desc[pos].data1; + int j; + if (XD_IS_INDIRECT (num)) + num = pdump_get_indirect_count (num, desc, data); + + for (j=0; j 0) + *(EMACS_INT *)rdata = str + delta; + break; + } + default: + stderr_out ("Unsupported dump type : %d\n", desc[pos].type); + abort (); + }; + } +} + +static void +pdump_allocate_offset (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) +{ + size_t size = (elmt->is_lrecord ? (elmt->size + 3) & ~3 : elmt->size)*elmt->count; + elmt->save_offset = cur_offset; + if (size>max_size) + max_size = size; + cur_offset += size; +} + +static void +pdump_scan_by_alignment (void (*f)(pdump_entry_list_elmt *, const struct lrecord_description *)) +{ + int align, i; + const struct lrecord_description *idesc; + pdump_entry_list_elmt *elmt; + for (align=8; align>=0; align--) + { + for (i=0; idescription; + while (elmt) + { + f (elmt, idesc); + elmt = elmt->next; + } + } + + for (i=0; idescription; + while (elmt) + { + f (elmt, idesc); + elmt = elmt->next; + } + } + + elmt = pdump_opaque_data_list.first; + while (elmt) + { + if (align_table[elmt->size & 255] == align) + f (elmt, 0); + elmt = elmt->next; + } + } +} + +static void +pdump_dump_staticvec (void) +{ + EMACS_INT *reloc = xnew_array (EMACS_INT, staticidx); + int i; + write (pdump_fd, staticvec, staticidx*sizeof (Lisp_Object *)); + + for (i=0; isave_offset; + else + reloc[i] = *(EMACS_INT *)(staticvec[i]); + } + write (pdump_fd, reloc, staticidx*sizeof (Lisp_Object)); + free (reloc); +} + +static void +pdump_dump_structvec (void) +{ + int i; + for (i=0; isave_offset; + write (pdump_fd, &adr, sizeof (adr)); + } +} + +static void +pdump_dump_opaquevec (void) +{ + int i; + for (i=0; idescription; + rt.count = pdump_object_table[i].count; + write (pdump_fd, &rt, sizeof (rt)); + while (elmt) + { + EMACS_INT rdata = pdump_get_entry (elmt->obj)->save_offset; + write (pdump_fd, &rdata, sizeof (rdata)); + elmt = elmt->next; + } + } + + rt.desc = 0; + rt.count = 0; + write (pdump_fd, &rt, sizeof (rt)); + + for (i=0; idescription; + rt.count = pdump_struct_table.list[i].list.count; + write (pdump_fd, &rt, sizeof (rt)); + while (elmt) + { + EMACS_INT rdata = pdump_get_entry (elmt->obj)->save_offset; + for (j=0; jcount; j++) + { + write (pdump_fd, &rdata, sizeof (rdata)); + rdata += elmt->size; + } + elmt = elmt->next; + } + } + rt.desc = 0; + rt.count = 0; + write (pdump_fd, &rt, sizeof (rt)); +} + +static void +pdump_dump_wired (void) +{ + EMACS_INT count = pdump_wireidx + pdump_wireidx_list; + int i; + + write (pdump_fd, &count, sizeof (count)); + + for (i=0; isave_offset; + write (pdump_fd, &pdump_wirevec[i], sizeof (pdump_wirevec[i])); + write (pdump_fd, &obj, sizeof (obj)); + } + + for (i=0; idescription; + for (pos = 0; desc[pos].type != XD_LO_LINK; pos++) + assert (desc[pos].type != XD_END); + + obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); + } + res = elmt->save_offset; + + write (pdump_fd, &pdump_wirevec_list[i], sizeof (pdump_wirevec_list[i])); + write (pdump_fd, &res, sizeof (res)); + } +} + +void +pdump (void) +{ + int i; + Lisp_Object t_console, t_device, t_frame; + int none; + dump_header hd; + + /* These appear in a DEFVAR_LISP, which does a staticpro() */ + t_console = Vterminal_console; + t_frame = Vterminal_frame; + t_device = Vterminal_device; + + Vterminal_console = Qnil; + Vterminal_frame = Qnil; + Vterminal_device = Qnil; + + pdump_hash = xnew_array_and_zero (pdump_entry_list_elmt *, PDUMP_HASHSIZE); + + for (i=0; iname, pdump_alert_undump_object[i]); + } + if (!none) + return; + + for (i=0; isignature, DUMP_SIGNATURE, DUMP_SIGNATURE_LEN) + && ((dump_header *)pdump_start)->id == dump_id); +} + +static int pdump_load_finish (void) +{ + int i; + char *p; + EMACS_INT delta; + EMACS_INT count; + + pdump_end = pdump_start + pdump_length; + +#define PDUMP_READ(p, type) (p = (char*) (((type *) p) + 1), *((type *) p - 1)) + + staticidx = ((dump_header *)(pdump_start))->nb_staticpro; + delta = ((EMACS_INT)pdump_start) - ((dump_header *)pdump_start)->reloc_address; + p = pdump_start + ((dump_header *)pdump_start)->stab_offset; + + /* Put back the staticvec in place */ + memcpy (staticvec, p, staticidx*sizeof (Lisp_Object *)); + p += staticidx*sizeof (Lisp_Object *); + for (i=0; inb_structdmp; i++) + { + void **adr = PDUMP_READ (p, void **); + *adr = (void *) (PDUMP_READ (p, char *) + delta); + } + + /* Put back the opaques */ + for (i=0; i<((dump_header *)pdump_start)->nb_opaquedmp; i++) + { + struct pdump_dumpopaqueinfo di = PDUMP_READ (p, struct pdump_dumpopaqueinfo); + memcpy (di.data, p, di.size); + p += di.size; + } + + /* Put back the lrecord_implementations_table */ + /* The (void *) cast is there to make Ben happy. */ + memcpy ((void *) lrecord_implementations_table, p, lrecord_type_count*sizeof (lrecord_implementations_table[0])); + p += lrecord_type_count*sizeof (lrecord_implementations_table[0]); + + /* Reinitialize lrecord_markers from lrecord_implementations_table */ + for (i=0; i < lrecord_type_count; i++) + if (lrecord_implementations_table[i]) + lrecord_markers[i] = lrecord_implementations_table[i]->marker; + + /* Do the relocations */ + pdump_rt_list = p; + count = 2; + for (;;) + { + pdump_reloc_table rt = PDUMP_READ (p, pdump_reloc_table); + if (rt.desc) + { + for (i=0; i < rt.count; i++) + { + char *adr = delta + *(char **)p; + *(char **)p = adr; + pdump_reloc_one (adr, delta, rt.desc); + p += sizeof (char *); + } + } else + if (!(--count)) + break; + } + + /* Put the pdump_wire variables in place */ + count = PDUMP_READ (p, EMACS_INT); + + for (i=0; iexe_path && !IS_DIRECTORY_SEP (*w) && (*w != '-') && (*w != '.')); + } + while (w>exe_path && !IS_DIRECTORY_SEP (*w)); + return 0; +} + +int pdump_load(const char *argv0) +{ + char exe_path[PATH_MAX]; +#ifdef WIN32_NATIVE + GetModuleFileName (NULL, exe_path, PATH_MAX); +#else /* !WIN32_NATIVE */ + char *w; + const char *dir, *p; + + dir = argv0; + if (dir[0] == '-') + { + /* XEmacs as a login shell, oh goody! */ + dir = getenv("SHELL"); + } + + p = dir + strlen(dir); + while (p != dir && !IS_ANY_SEP (p[-1])) p--; + + if (p != dir) + { + /* invocation-name includes a directory component -- presumably it + is relative to cwd, not $PATH */ + strcpy (exe_path, dir); + } + else + { + const char *path = getenv ("PATH"); + const char *name = p; + for (;;) + { + p = path; + while (*p && *p != SEPCHAR) + p++; + if (p == path) + { + exe_path[0] = '.'; + w = exe_path + 1; + } + else + { + memcpy (exe_path, path, p - path); + w = exe_path + (p - path); + } + if (!IS_DIRECTORY_SEP (w[-1])) + { + *w++ = '/'; + } + strcpy(w, name); + + /* ### #$%$#^$^@%$^#%@$ ! */ +#ifdef access +#undef access +#endif + + if (!access (exe_path, X_OK)) + break; + if (!*p) + { + /* Oh well, let's have some kind of default */ + sprintf (exe_path, "./%s", name); + break; + } + path = p+1; + } + } +#endif /* WIN32_NATIVE */ + + if (pdump_file_try (exe_path)) + { + pdump_load_finish (); + return 1; + } + +#ifdef WIN32_NATIVE + if (pdump_resource_get ()) + { + if (pdump_load_check ()) + { + pdump_load_finish (); + return 1; + } + pdump_free (); + } +#endif + + return 0; +} diff -r 72a7cfa4a488 -r abe6d1db359e src/dumper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dumper.h Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,30 @@ +/* Portable data dumper for XEmacs. + Copyright (C) 1999-2000 Olivier Galibert + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef INCLUDED_dumper_h +#define INCLUDED_dumper_h + +void pdump_objects_unmark (void); +void pdump (void); +int pdump_load (const char *argv0); + +#endif /* INCLUDED_dumper_h */ diff -r 72a7cfa4a488 -r abe6d1db359e src/dynarr.c --- a/src/dynarr.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/dynarr.c Mon Aug 13 11:35:02 2007 +0200 @@ -157,7 +157,7 @@ /* Add a number of contiguous elements to the array starting at START. */ void -Dynarr_insert_many (void *d, CONST void *el, int len, int start) +Dynarr_insert_many (void *d, const void *el, int len, int start) { Dynarr *dy = (Dynarr *) d; diff -r 72a7cfa4a488 -r abe6d1db359e src/editfns.c --- a/src/editfns.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/editfns.c Mon Aug 13 11:35:02 2007 +0200 @@ -28,9 +28,6 @@ #include #include "lisp.h" -#ifdef HAVE_UNISTD_H -#include -#endif #include "buffer.h" #include "commands.h" @@ -603,26 +600,72 @@ return make_char (BUF_FETCH_CHAR (b, n)); } +#if !defined(WINDOWSNT) && !defined(MSDOS) +#include +#include +#include +#include +#endif DEFUN ("temp-directory", Ftemp_directory, 0, 0, 0, /* Return the pathname to the directory to use for temporary files. -On NT/MSDOS, this is obtained from the TEMP or TMP environment variables, +On MS Windows, this is obtained from the TEMP or TMP environment variables, defaulting to / if they are both undefined. On Unix it is obtained from TMPDIR, with /tmp as the default */ ()) { char *tmpdir; -#if defined(WINDOWSNT) || defined(MSDOS) +#if defined(WIN32_NATIVE) tmpdir = getenv ("TEMP"); if (!tmpdir) tmpdir = getenv ("TMP"); if (!tmpdir) tmpdir = "/"; -#else /* WINDOWSNT || MSDOS */ +#else /* WIN32_NATIVE */ tmpdir = getenv ("TMPDIR"); if (!tmpdir) + { + struct stat st; + int myuid = getuid(); + static char path[5 /* strlen ("/tmp/") */ + 1 + _POSIX_PATH_MAX]; + + strcpy (path, "/tmp/"); + strncat (path, user_login_name (NULL), _POSIX_PATH_MAX); + if (lstat(path, &st) < 0 && errno == ENOENT) + { + mkdir(path, 0700); /* ignore retval -- checked next anyway. */ + } + if (lstat(path, &st) == 0 && st.st_uid == myuid && S_ISDIR(st.st_mode)) + { + tmpdir = path; + } + else + { + strcpy(path, getenv("HOME")); strncat(path, "/tmp/", _POSIX_PATH_MAX); + if (stat(path, &st) < 0 && errno == ENOENT) + { + int fd; + char warnpath[1+_POSIX_PATH_MAX]; + mkdir(path, 0700); /* ignore retvals */ + strcpy(warnpath, path); + strncat(warnpath, ".created_by_xemacs", _POSIX_PATH_MAX); + if ((fd = open(warnpath, O_WRONLY|O_CREAT, 0644)) > 0) + { + write(fd, "XEmacs created this directory because /tmp/ was unavailable -- \nPlease check !\n", 89); + close(fd); + } + } + if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) + { + tmpdir = path; + } + else + { tmpdir = "/tmp"; + } + } + } #endif return build_ext_string (tmpdir, Qfile_name); @@ -681,7 +724,7 @@ char *user_name = getenv ("LOGNAME"); if (!user_name) user_name = getenv ( -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE "USERNAME" /* it's USERNAME on NT */ #else "USER" @@ -692,7 +735,7 @@ else { struct passwd *pw = getpwuid (geteuid ()); -#ifdef __CYGWIN32__ +#ifdef CYGWIN /* Since the Cygwin environment may not have an /etc/passwd, return "unknown" instead of the null if the username cannot be determined. @@ -716,14 +759,7 @@ struct passwd *pw = getpwuid (getuid ()); /* #### - I believe this should return nil instead of "unknown" when pw==0 */ -#ifdef MSDOS - /* We let the real user name default to "root" because that's quite - accurate on MSDOG and because it lets Emacs find the init file. - (The DVX libraries override the Djgpp libraries here.) */ - Lisp_Object tem = build_string (pw ? pw->pw_name : "root");/* no gettext */ -#else Lisp_Object tem = build_string (pw ? pw->pw_name : "unknown");/* no gettext */ -#endif return tem; } @@ -764,7 +800,7 @@ user_name = (STRINGP (user) ? user : Fuser_login_name (user)); if (!NILP (user_name)) /* nil when nonexistent UID passed as arg */ { - CONST char *user_name_ext; + const char *user_name_ext; /* Fuck me. getpwnam() can call select() and (under IRIX at least) things get wedged if a SIGIO arrives during this time. */ @@ -779,10 +815,10 @@ /* #### - Stig sez: this should return nil instead of "unknown" when pw==0 */ /* Ben sez: bad idea because it's likely to break something */ #ifndef AMPERSAND_FULL_NAME - p = ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ + p = pw ? USER_FULL_NAME : "unknown"; /* don't gettext */ q = strchr (p, ','); #else - p = ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ + p = pw ? USER_FULL_NAME : "unknown"; /* don't gettext */ q = strchr (p, ','); #endif tem = ((!NILP (user) && !pw) @@ -822,17 +858,25 @@ of a few bytes */ } +/* !!#### not Mule correct. */ + /* Returns the home directory, in external format */ Extbyte * get_home_directory (void) { + /* !!#### this is hopelessly bogus. Rule #1: Do not make any assumptions + about what format an external string is in. Could be Unicode, for all + we know, and then all the operations below are totally bogus. + Instead, convert all data to internal format *right* at the juncture + between XEmacs and the outside world, the very moment we first get + the data. --ben */ int output_home_warning = 0; if (cached_home_directory == NULL) { if ((cached_home_directory = (Extbyte *) getenv("HOME")) == NULL) { -#if defined(WINDOWSNT) && !defined(__CYGWIN32__) +#if defined(WIN32_NATIVE) char *homedrive, *homepath; if ((homedrive = getenv("HOMEDRIVE")) != NULL && @@ -847,7 +891,9 @@ } else { -# if 1 +# if 0 /* changed by ben. This behavior absolutely stinks, and the + possibility being addressed here occurs quite commonly. + Using the current directory makes absolutely no sense. */ /* * Use the current directory. * This preserves the existing XEmacs behavior, but is different @@ -855,12 +901,12 @@ */ if (initial_directory[0] != '\0') { - cached_home_directory = initial_directory; + cached_home_directory = (Extbyte*) initial_directory; } else { /* This will probably give the wrong value */ - cached_home_directory = getcwd (NULL, 0); + cached_home_directory = (Extbyte*) getcwd (NULL, 0); } # else /* @@ -870,7 +916,7 @@ output_home_warning = 1; # endif } -#else /* !WINDOWSNT */ +#else /* !WIN32_NATIVE */ /* * Unix, typically. * Using "/" isn't quite right, but what should we do? @@ -879,7 +925,7 @@ */ cached_home_directory = (Extbyte *) "/"; output_home_warning = 1; -#endif /* !WINDOWSNT */ +#endif /* !WIN32_NATIVE */ } if (initialized && output_home_warning) { @@ -1004,9 +1050,9 @@ return Fcons (make_int (item >> 16), make_int (item & 0xffff)); } -size_t emacs_strftime (char *string, size_t max, CONST char *format, - CONST struct tm *tm); -static long difftm (CONST struct tm *a, CONST struct tm *b); +size_t emacs_strftime (char *string, size_t max, const char *format, + const struct tm *tm); +static long difftm (const struct tm *a, const struct tm *b); DEFUN ("format-time-string", Fformat_time_string, 1, 2, 0, /* @@ -1073,7 +1119,7 @@ char *buf = (char *) alloca (size); *buf = 1; if (emacs_strftime (buf, size, - (CONST char *) XSTRING_DATA (format_string), + (const char *) XSTRING_DATA (format_string), localtime (&value)) || !*buf) return build_ext_string (buf, Qbinary); @@ -1220,24 +1266,26 @@ (specified_time)) { time_t value; - char buf[30]; - char *tem; + char *the_ctime; + size_t len; if (! lisp_to_time (specified_time, &value)) value = -1; - tem = (char *) ctime (&value); + the_ctime = ctime (&value); - strncpy (buf, tem, 24); - buf[24] = 0; + /* ctime is documented as always returning a "\n\0"-terminated + 26-byte American time string, but let's be careful anyways. */ + for (len = 0; the_ctime[len] != '\n' && the_ctime[len] != '\0'; len++) + ; - return build_ext_string (buf, Qbinary); + return make_ext_string ((Extbyte *) the_ctime, len, Qbinary); } #define TM_YEAR_ORIGIN 1900 /* Yield A - B, measured in seconds. */ static long -difftm (CONST struct tm *a, CONST struct tm *b) +difftm (const struct tm *a, const struct tm *b) { int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); int by = b->tm_year + (TM_YEAR_ORIGIN - 1); @@ -2513,6 +2561,8 @@ See the variable `zmacs-regions'. The same effect can be achieved using the `_' interactive specification. + +`zmacs-region-stays' is reset to nil before each command is executed. */ ); zmacs_region_stays = 0; diff -r 72a7cfa4a488 -r abe6d1db359e src/eldap.c --- a/src/eldap.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/eldap.c Mon Aug 13 11:35:02 2007 +0200 @@ -54,6 +54,9 @@ static Lisp_Object Qkrbv41, Qkrbv42; /* Deref policy */ static Lisp_Object Qnever, Qalways, Qfind; +/* Modification types (Qdelete is defined in general.c) */ +static Lisp_Object Qadd, Qreplace; + /************************************************************************/ /* Utility Functions */ @@ -215,77 +218,73 @@ int ldap_sizelimit = 0; int err; - Lisp_Object list, keyword, value; - CHECK_STRING (host); - EXTERNAL_PROPERTY_LIST_LOOP (list, keyword, value, plist) - { - /* TCP Port */ - if (EQ (keyword, Qport)) - { - CHECK_INT (value); - ldap_port = XINT (value); - } - /* Authentication method */ - if (EQ (keyword, Qauth)) - { - if (EQ (value, Qsimple)) - ldap_auth = LDAP_AUTH_SIMPLE; + { + EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, plist) + { + /* TCP Port */ + if (EQ (keyword, Qport)) + { + CHECK_INT (value); + ldap_port = XINT (value); + } + /* Authentication method */ + if (EQ (keyword, Qauth)) + { + if (EQ (value, Qsimple)) + ldap_auth = LDAP_AUTH_SIMPLE; #ifdef LDAP_AUTH_KRBV41 - else if (EQ (value, Qkrbv41)) - ldap_auth = LDAP_AUTH_KRBV41; + else if (EQ (value, Qkrbv41)) + ldap_auth = LDAP_AUTH_KRBV41; #endif #ifdef LDAP_AUTH_KRBV42 - else if (EQ (value, Qkrbv42)) - ldap_auth = LDAP_AUTH_KRBV42; + else if (EQ (value, Qkrbv42)) + ldap_auth = LDAP_AUTH_KRBV42; #endif - else - signal_simple_error ("Invalid authentication method", value); - } - /* Bind DN */ - else if (EQ (keyword, Qbinddn)) - { - CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, - C_STRING_ALLOCA, ldap_binddn, - Qnative); - } - /* Password */ - else if (EQ (keyword, Qpasswd)) - { - CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, - C_STRING_ALLOCA, ldap_passwd, - Qnative); - } - /* Deref */ - else if (EQ (keyword, Qderef)) - { - if (EQ (value, Qnever)) - ldap_deref = LDAP_DEREF_NEVER; - else if (EQ (value, Qsearch)) - ldap_deref = LDAP_DEREF_SEARCHING; - else if (EQ (value, Qfind)) - ldap_deref = LDAP_DEREF_FINDING; - else if (EQ (value, Qalways)) - ldap_deref = LDAP_DEREF_ALWAYS; - else - signal_simple_error ("Invalid deref value", value); - } - /* Timelimit */ - else if (EQ (keyword, Qtimelimit)) - { - CHECK_INT (value); - ldap_timelimit = XINT (value); - } - /* Sizelimit */ - else if (EQ (keyword, Qsizelimit)) - { - CHECK_INT (value); - ldap_sizelimit = XINT (value); - } - } + else + signal_simple_error ("Invalid authentication method", value); + } + /* Bind DN */ + else if (EQ (keyword, Qbinddn)) + { + CHECK_STRING (value); + LISP_STRING_TO_EXTERNAL (value, ldap_binddn, Qnative); + } + /* Password */ + else if (EQ (keyword, Qpasswd)) + { + CHECK_STRING (value); + LISP_STRING_TO_EXTERNAL (value, ldap_passwd, Qnative); + } + /* Deref */ + else if (EQ (keyword, Qderef)) + { + if (EQ (value, Qnever)) + ldap_deref = LDAP_DEREF_NEVER; + else if (EQ (value, Qsearch)) + ldap_deref = LDAP_DEREF_SEARCHING; + else if (EQ (value, Qfind)) + ldap_deref = LDAP_DEREF_FINDING; + else if (EQ (value, Qalways)) + ldap_deref = LDAP_DEREF_ALWAYS; + else + signal_simple_error ("Invalid deref value", value); + } + /* Timelimit */ + else if (EQ (keyword, Qtimelimit)) + { + CHECK_INT (value); + ldap_timelimit = XINT (value); + } + /* Sizelimit */ + else if (EQ (keyword, Qsizelimit)) + { + CHECK_INT (value); + ldap_sizelimit = XINT (value); + } + } + } if (ldap_port == 0) { @@ -294,7 +293,7 @@ /* Connect to the server and bind */ slow_down_interrupts (); - ld = ldap_open ((char *)XSTRING_DATA (host), ldap_port); + ld = ldap_open ((char *) XSTRING_DATA (host), ldap_port); speed_up_interrupts (); if (ld == NULL ) @@ -316,6 +315,9 @@ if ((err = ldap_set_option (ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON)) != LDAP_SUCCESS) signal_ldap_error (ld, NULL, err); + if ((err = ldap_set_option (ld, LDAP_OPT_RESTART, + LDAP_OPT_ON)) != LDAP_SUCCESS) + signal_ldap_error (ld, NULL, err); #else /* not HAVE_LDAP_SET_OPTION */ ld->ld_deref = ldap_deref; ld->ld_timelimit = ldap_timelimit; @@ -325,12 +327,11 @@ #else /* not LDAP_REFERRALS */ ld->ld_options = 0; #endif /* not LDAP_REFERRALS */ + /* XEmacs uses interrupts (SIGIO,SIGALRM), LDAP calls need to ignore them */ + ld->ld_options |= LDAP_OPT_RESTART; #endif /* not HAVE_LDAP_SET_OPTION */ - /* ldap_bind_s calls select and may be wedged by SIGIO. */ - slow_down_interrupts (); err = ldap_bind_s (ld, ldap_binddn, ldap_passwd, ldap_auth); - speed_up_interrupts (); if (err != LDAP_SUCCESS) signal_simple_error ("Failed binding to the server", build_string (ldap_err2string (err))); @@ -368,7 +369,6 @@ struct berval **vals; }; - static Lisp_Object ldap_search_unwind (Lisp_Object unwind_obj) { @@ -381,7 +381,12 @@ return Qnil; } -DEFUN ("ldap-search-internal", Fldap_search_internal, 2, 7, 0, /* +/* The following function is called `ldap-search-basic' instead of */ +/* plain `ldap-search' to maintain compatibility with the XEmacs 21.1 */ +/* API where `ldap-search' was the name of the high-level search */ +/* function */ + +DEFUN ("ldap-search-basic", Fldap_search_basic, 2, 8, 0, /* Perform a search on an open LDAP connection. LDAP is an LDAP connection object created with `ldap-open'. FILTER is a filter string for the search as described in RFC 1558. @@ -392,13 +397,14 @@ for each matching entry. If nil return all available attributes. If ATTRSONLY is non-nil then only the attributes are retrieved, not the associated values. -If WITHDN is non-nil each entry in the result will be prepennded with +If WITHDN is non-nil each entry in the result will be prepended with its distinguished name DN. +If VERBOSE is non-nil progress messages will be echoed. The function returns a list of matching entries. Each entry is itself an alist of attribute/value pairs optionally preceded by the DN of the entry according to the value of WITHDN. */ - (ldap, filter, base, scope, attrs, attrsonly, withdn)) + (ldap, filter, base, scope, attrs, attrsonly, withdn, verbose)) { /* This function can GC */ @@ -407,7 +413,7 @@ LDAPMessage *e; BerElement *ptr; char *a, *dn; - int i, rc, rc2; + int i, rc; int matches; struct ldap_unwind_struct unwind; @@ -416,10 +422,11 @@ int speccount = specpdl_depth (); - Lisp_Object list, entry, result; + Lisp_Object list = Qnil; + Lisp_Object entry = Qnil; + Lisp_Object result = Qnil; struct gcpro gcpro1, gcpro2, gcpro3; - list = entry = result = Qnil; GCPRO3 (list, entry, result); unwind.res = NULL; @@ -466,9 +473,7 @@ { Lisp_Object current = XCAR (attrs); CHECK_STRING (current); - TO_EXTERNAL_FORMAT (LISP_STRING, current, - C_STRING_ALLOCA, ldap_attributes[i], - Qnative); + LISP_STRING_TO_EXTERNAL (current, ldap_attributes[i], Qnative); ++i; } ldap_attributes[i] = NULL; @@ -479,9 +484,9 @@ /* Perform the search */ if (ldap_search (ld, - NILP (base) ? "" : (char *) XSTRING_DATA (base), + NILP (base) ? (char *) "" : (char *) XSTRING_DATA (base), ldap_scope, - NILP (filter) ? "" : (char *) XSTRING_DATA (filter), + NILP (filter) ? (char *) "" : (char *) XSTRING_DATA (filter), ldap_attributes, NILP (attrsonly) ? 0 : 1) == -1) @@ -496,10 +501,8 @@ /* Build the results list */ matches = 0; - /* ldap_result calls select() and can get wedged by EINTR signals */ - slow_down_interrupts (); rc = ldap_result (ld, LDAP_RES_ANY, 0, NULL, &unwind.res); - speed_up_interrupts (); + while (rc == LDAP_RES_SEARCH_ENTRY) { QUIT; @@ -509,7 +512,8 @@ destroys the current echo area contents, even when invoked from Lisp. It should use echo_area_message() instead, and restore the old echo area contents later. */ - message ("Parsing ldap results... %d", matches); + if (! NILP (verbose)) + message ("Parsing ldap results... %d", matches); entry = Qnil; /* Get the DN if required */ if (! NILP (withdn)) @@ -529,7 +533,7 @@ { for (i = 0; unwind.vals[i] != NULL; i++) { - list = Fcons (make_ext_string (unwind.vals[i]->bv_val, + list = Fcons (make_ext_string ((Extbyte *) unwind.vals[i]->bv_val, unwind.vals[i]->bv_len, Qnative), list); @@ -545,43 +549,253 @@ ldap_msgfree (unwind.res); unwind.res = NULL; - slow_down_interrupts (); rc = ldap_result (ld, LDAP_RES_ANY, 0, NULL, &(unwind.res)); - speed_up_interrupts (); } - if (rc == -1) - signal_ldap_error (ld, unwind.res, 0); - +#if defined HAVE_LDAP_PARSE_RESULT + { + int rc2 = ldap_parse_result (ld, unwind.res, + &rc, + NULL, NULL, NULL, NULL, 0); + if (rc2 != LDAP_SUCCESS) + rc = rc2; + } +#else if (rc == 0) signal_ldap_error (ld, NULL, LDAP_TIMELIMIT_EXCEEDED); -#if defined HAVE_LDAP_PARSE_RESULT - rc2 = ldap_parse_result (ld, unwind.res, - &rc, - NULL, NULL, NULL, NULL, 0); - if (rc2 != LDAP_SUCCESS) - rc = rc2; -#elif defined HAVE_LDAP_RESULT2ERROR + if (rc == -1) + signal_ldap_error (ld, unwind.res, (unwind.res==NULL) ? ld->ld_errno : 0); + +#if defined HAVE_LDAP_RESULT2ERROR rc = ldap_result2error (ld, unwind.res, 0); #endif - if ((rc != LDAP_SUCCESS) && (rc != LDAP_SIZELIMIT_EXCEEDED)) +#endif + + if (rc != LDAP_SUCCESS) signal_ldap_error (ld, NULL, rc); ldap_msgfree (unwind.res); unwind.res = (LDAPMessage *)NULL; + /* #### See above for calling message(). */ - message ("Parsing ldap results... done"); + if (! NILP (verbose)) + message ("Parsing ldap results... done"); unbind_to (speccount, Qnil); UNGCPRO; return Fnreverse (result); } +DEFUN ("ldap-add", Fldap_add, 3, 3, 0, /* +Add an entry to an LDAP directory. +LDAP is an LDAP connection object created with `ldap-open'. +DN is the distinguished name of the entry to add. +ENTRY is an entry specification, i.e., a list of cons cells +containing attribute/value string pairs. +*/ + (ldap, dn, entry)) +{ + LDAP *ld; + LDAPMod *ldap_mods, **ldap_mods_ptrs; + struct berval *bervals; + int rc; + int i, j; + size_t len; + + Lisp_Object current = Qnil; + Lisp_Object values = Qnil; + struct gcpro gcpro1, gcpro2; + + GCPRO2 (current, values); + + /* Do all the parameter checking */ + CHECK_LIVE_LDAP (ldap); + ld = XLDAP (ldap)->ld; + + /* Check the DN */ + CHECK_STRING (dn); + + /* Check the entry */ + CHECK_CONS (entry); + if (NILP (entry)) + signal_simple_error ("Cannot add void entry", entry); + + /* Build the ldap_mods array */ + len = XINT (Flength (entry)); + ldap_mods = alloca_array (LDAPMod, len); + ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + len); + i = 0; + EXTERNAL_LIST_LOOP (entry, entry) + { + current = XCAR (entry); + CHECK_CONS (current); + CHECK_STRING (XCAR (current)); + ldap_mods_ptrs[i] = &(ldap_mods[i]); + LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type, Qnative); + ldap_mods[i].mod_op = LDAP_MOD_ADD | LDAP_MOD_BVALUES; + values = XCDR (current); + if (CONSP (values)) + { + len = XINT (Flength (values)); + bervals = alloca_array (struct berval, len); + ldap_mods[i].mod_vals.modv_bvals = + alloca_array (struct berval *, 1 + len); + j = 0; + EXTERNAL_LIST_LOOP (values, values) + { + current = XCAR (values); + CHECK_STRING (current); + ldap_mods[i].mod_vals.modv_bvals[j] = &(bervals[j]); + TO_EXTERNAL_FORMAT (LISP_STRING, current, + ALLOCA, (bervals[j].bv_val, + bervals[j].bv_len), + Qnative); + j++; + } + ldap_mods[i].mod_vals.modv_bvals[j] = NULL; + } + else + { + CHECK_STRING (values); + bervals = alloca_array (struct berval, 1); + ldap_mods[i].mod_vals.modv_bvals = alloca_array (struct berval *, 2); + ldap_mods[i].mod_vals.modv_bvals[0] = &(bervals[0]); + TO_EXTERNAL_FORMAT (LISP_STRING, values, + ALLOCA, (bervals[0].bv_val, + bervals[0].bv_len), + Qnative); + ldap_mods[i].mod_vals.modv_bvals[1] = NULL; + } + i++; + } + ldap_mods_ptrs[i] = NULL; + rc = ldap_add_s (ld, (char *) XSTRING_DATA (dn), ldap_mods_ptrs); + if (rc != LDAP_SUCCESS) + signal_ldap_error (ld, NULL, rc); + + UNGCPRO; + return Qnil; +} + +DEFUN ("ldap-modify", Fldap_modify, 3, 3, 0, /* +Add an entry to an LDAP directory. +LDAP is an LDAP connection object created with `ldap-open'. +DN is the distinguished name of the entry to modify. +MODS is a list of modifications to apply. +A modification is a list of the form (MOD-OP ATTR VALUE1 VALUE2 ...) +MOD-OP and ATTR are mandatory, VALUEs are optional depending on MOD-OP. +MOD-OP is the type of modification, one of the symbols `add', `delete' +or `replace'. ATTR is the LDAP attribute type to modify. +*/ + (ldap, dn, mods)) +{ + LDAP *ld; + LDAPMod *ldap_mods, **ldap_mods_ptrs; + struct berval *bervals; + int i, j, rc; + Lisp_Object mod_op; + size_t len; + + Lisp_Object current = Qnil; + Lisp_Object values = Qnil; + struct gcpro gcpro1, gcpro2; + + GCPRO2 (current, values); + + /* Do all the parameter checking */ + CHECK_LIVE_LDAP (ldap); + ld = XLDAP (ldap)->ld; + + /* Check the DN */ + CHECK_STRING (dn); + + /* Check the entry */ + CHECK_CONS (mods); + if (NILP (mods)) + return Qnil; + + /* Build the ldap_mods array */ + len = XINT (Flength (mods)); + ldap_mods = alloca_array (LDAPMod, len); + ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + len); + i = 0; + EXTERNAL_LIST_LOOP (mods, mods) + { + current = XCAR (mods); + CHECK_CONS (current); + CHECK_SYMBOL (XCAR (current)); + mod_op = XCAR (current); + ldap_mods_ptrs[i] = &(ldap_mods[i]); + ldap_mods[i].mod_op = LDAP_MOD_BVALUES; + if (EQ (mod_op, Qadd)) + ldap_mods[i].mod_op |= LDAP_MOD_ADD; + else if (EQ (mod_op, Qdelete)) + ldap_mods[i].mod_op |= LDAP_MOD_DELETE; + else if (EQ (mod_op, Qreplace)) + ldap_mods[i].mod_op |= LDAP_MOD_REPLACE; + else + signal_simple_error ("Invalid LDAP modification type", mod_op); + current = XCDR (current); + CHECK_STRING (XCAR (current)); + LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type, Qnative); + values = XCDR (current); + len = XINT (Flength (values)); + bervals = alloca_array (struct berval, len); + ldap_mods[i].mod_vals.modv_bvals = + alloca_array (struct berval *, 1 + len); + j = 0; + EXTERNAL_LIST_LOOP (values, values) + { + current = XCAR (values); + CHECK_STRING (current); + ldap_mods[i].mod_vals.modv_bvals[j] = &(bervals[j]); + TO_EXTERNAL_FORMAT (LISP_STRING, current, + ALLOCA, (bervals[j].bv_val, + bervals[j].bv_len), + Qnative); + j++; + } + ldap_mods[i].mod_vals.modv_bvals[j] = NULL; + i++; + } + ldap_mods_ptrs[i] = NULL; + rc = ldap_modify_s (ld, (char *) XSTRING_DATA (dn), ldap_mods_ptrs); + if (rc != LDAP_SUCCESS) + signal_ldap_error (ld, NULL, rc); + + UNGCPRO; + return Qnil; +} + + +DEFUN ("ldap-delete", Fldap_delete, 2, 2, 0, /* +Delete an entry to an LDAP directory. +LDAP is an LDAP connection object created with `ldap-open'. +DN is the distinguished name of the entry to delete. +*/ + (ldap, dn)) +{ + LDAP *ld; + int rc; + + /* Check parameters */ + CHECK_LIVE_LDAP (ldap); + ld = XLDAP (ldap)->ld; + CHECK_STRING (dn); + + rc = ldap_delete_s (ld, (char *) XSTRING_DATA (dn)); + if (rc != LDAP_SUCCESS) + signal_ldap_error (ld, NULL, rc); + + return Qnil; +} void syms_of_eldap (void) { + INIT_LRECORD_IMPLEMENTATION (ldap); + defsymbol (&Qldapp, "ldapp"); defsymbol (&Qport, "port"); defsymbol (&Qauth, "auth"); @@ -598,13 +812,18 @@ defsymbol (&Qnever, "never"); defsymbol (&Qalways, "always"); defsymbol (&Qfind, "find"); + defsymbol (&Qadd, "add"); + defsymbol (&Qreplace, "replace"); DEFSUBR (Fldapp); DEFSUBR (Fldap_host); DEFSUBR (Fldap_status); DEFSUBR (Fldap_open); DEFSUBR (Fldap_close); - DEFSUBR (Fldap_search_internal); + DEFSUBR (Fldap_search_basic); + DEFSUBR (Fldap_add); + DEFSUBR (Fldap_modify); + DEFSUBR (Fldap_delete); } void diff -r 72a7cfa4a488 -r abe6d1db359e src/eldap.h --- a/src/eldap.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/eldap.h Mon Aug 13 11:35:02 2007 +0200 @@ -62,12 +62,21 @@ Lisp_Object Fldap_open (Lisp_Object host, Lisp_Object ldap_plist); Lisp_Object Fldap_close (Lisp_Object ldap); -Lisp_Object Fldap_search_internal (Lisp_Object ldap, - Lisp_Object filter, - Lisp_Object base, - Lisp_Object scope, - Lisp_Object attrs, - Lisp_Object attrsonly, - Lisp_Object withdn); +Lisp_Object Fldap_search_basic (Lisp_Object ldap, + Lisp_Object filter, + Lisp_Object base, + Lisp_Object scope, + Lisp_Object attrs, + Lisp_Object attrsonly, + Lisp_Object withdn, + Lisp_Object verbose); +Lisp_Object Fldap_add (Lisp_Object ldap, + Lisp_Object dn, + Lisp_Object entry); +Lisp_Object Fldap_modify (Lisp_Object ldap, + Lisp_Object dn, + Lisp_Object entry); +Lisp_Object Fldap_delete (Lisp_Object ldap, + Lisp_Object dn); #endif /* INCLUDED_eldap_h_ */ diff -r 72a7cfa4a488 -r abe6d1db359e src/elhash.c --- a/src/elhash.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/elhash.c Mon Aug 13 11:35:02 2007 +0200 @@ -29,13 +29,14 @@ Lisp_Object Qhash_tablep; static Lisp_Object Qhashtable, Qhash_table; -static Lisp_Object Qweakness, Qvalue; +static Lisp_Object Qweakness, Qvalue, Qkey_or_value, Qkey_and_value; static Lisp_Object Vall_weak_hash_tables; static Lisp_Object Qrehash_size, Qrehash_threshold; static Lisp_Object Q_size, Q_test, Q_weakness, Q_rehash_size, Q_rehash_threshold; /* obsolete as of 19990901 in xemacs-21.2 */ -static Lisp_Object Qweak, Qkey_weak, Qvalue_weak, Qnon_weak, Q_type; +static Lisp_Object Qweak, Qkey_weak, Qvalue_weak, Qkey_or_value_weak; +static Lisp_Object Qnon_weak, Q_type; typedef struct hentry { @@ -122,7 +123,7 @@ /* Return some prime near, but greater than or equal to, SIZE. Decades from the time of writing, someone will have a system large enough that the list below will be too short... */ - static CONST size_t primes [] = + static const size_t primes [] = { 19, 29, 41, 59, 79, 107, 149, 197, 263, 347, 457, 599, 787, 1031, 1361, 1777, 2333, 3037, 3967, 5167, 6719, 8737, 11369, 14783, @@ -252,6 +253,16 @@ return 1; } + +/* This is not a great hash function, but it _is_ correct and fast. + Examining all entries is too expensive, and examining a random + subset does not yield a correct hash function. */ +static hashcode_t +hash_table_hash (Lisp_Object hash_table, int depth) +{ + return XHASH_TABLE (hash_table)->count; +} + /* Printing hash tables. @@ -266,7 +277,7 @@ `size' (a natnum or nil) `rehash-size' (a float) `rehash-threshold' (a float) - `weakness' (nil, t, key or value) + `weakness' (nil, key, value, key-and-value, or key-or-value) `data' (a list) If `print-readably' is nil, then a simpler syntax is used, for example @@ -341,9 +352,10 @@ if (ht->weakness != HASH_TABLE_NON_WEAK) { sprintf (buf, " weakness %s", - (ht->weakness == HASH_TABLE_WEAK ? "t" : - ht->weakness == HASH_TABLE_KEY_WEAK ? "key" : - ht->weakness == HASH_TABLE_VALUE_WEAK ? "value" : + (ht->weakness == HASH_TABLE_WEAK ? "key-and-value" : + ht->weakness == HASH_TABLE_KEY_WEAK ? "key" : + ht->weakness == HASH_TABLE_VALUE_WEAK ? "value" : + ht->weakness == HASH_TABLE_KEY_VALUE_WEAK ? "key-or-value" : "you-d-better-not-see-this")); write_c_string (buf, printcharfun); } @@ -393,8 +405,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("hash-table", hash_table, mark_hash_table, print_hash_table, finalize_hash_table, - /* #### Implement hash_table_hash()! */ - hash_table_equal, 0, + hash_table_equal, hash_table_hash, hash_table_description, Lisp_Hash_Table); @@ -530,16 +541,19 @@ hash_table_weakness_validate (Lisp_Object keyword, Lisp_Object value, Error_behavior errb) { - if (EQ (value, Qnil)) return 1; - if (EQ (value, Qt)) return 1; - if (EQ (value, Qkey)) return 1; - if (EQ (value, Qvalue)) return 1; + if (EQ (value, Qnil)) return 1; + if (EQ (value, Qt)) return 1; + if (EQ (value, Qkey)) return 1; + if (EQ (value, Qkey_and_value)) return 1; + if (EQ (value, Qkey_or_value)) return 1; + if (EQ (value, Qvalue)) return 1; /* Following values are obsolete as of 19990901 in xemacs-21.2 */ - if (EQ (value, Qnon_weak)) return 1; - if (EQ (value, Qweak)) return 1; - if (EQ (value, Qkey_weak)) return 1; - if (EQ (value, Qvalue_weak)) return 1; + if (EQ (value, Qnon_weak)) return 1; + if (EQ (value, Qweak)) return 1; + if (EQ (value, Qkey_weak)) return 1; + if (EQ (value, Qkey_or_value_weak)) return 1; + if (EQ (value, Qvalue_weak)) return 1; maybe_signal_simple_error ("Invalid hash table weakness", value, Qhash_table, errb); @@ -549,16 +563,19 @@ static enum hash_table_weakness decode_hash_table_weakness (Lisp_Object obj) { - if (EQ (obj, Qnil)) return HASH_TABLE_NON_WEAK; - if (EQ (obj, Qt)) return HASH_TABLE_WEAK; - if (EQ (obj, Qkey)) return HASH_TABLE_KEY_WEAK; - if (EQ (obj, Qvalue)) return HASH_TABLE_VALUE_WEAK; + if (EQ (obj, Qnil)) return HASH_TABLE_NON_WEAK; + if (EQ (obj, Qt)) return HASH_TABLE_WEAK; + if (EQ (obj, Qkey_and_value)) return HASH_TABLE_WEAK; + if (EQ (obj, Qkey)) return HASH_TABLE_KEY_WEAK; + if (EQ (obj, Qkey_or_value)) return HASH_TABLE_KEY_VALUE_WEAK; + if (EQ (obj, Qvalue)) return HASH_TABLE_VALUE_WEAK; /* Following values are obsolete as of 19990901 in xemacs-21.2 */ - if (EQ (obj, Qnon_weak)) return HASH_TABLE_NON_WEAK; - if (EQ (obj, Qweak)) return HASH_TABLE_WEAK; - if (EQ (obj, Qkey_weak)) return HASH_TABLE_KEY_WEAK; - if (EQ (obj, Qvalue_weak)) return HASH_TABLE_VALUE_WEAK; + if (EQ (obj, Qnon_weak)) return HASH_TABLE_NON_WEAK; + if (EQ (obj, Qweak)) return HASH_TABLE_WEAK; + if (EQ (obj, Qkey_weak)) return HASH_TABLE_KEY_WEAK; + if (EQ (obj, Qkey_or_value_weak)) return HASH_TABLE_KEY_VALUE_WEAK; + if (EQ (obj, Qvalue_weak)) return HASH_TABLE_VALUE_WEAK; signal_simple_error ("Invalid hash table weakness", obj); return HASH_TABLE_NON_WEAK; /* not reached */ @@ -791,14 +808,16 @@ Keyword :rehash-threshold must be a float between 0.0 and 1.0, and specifies the load factor of the hash table which triggers enlarging. -Non-standard keyword :weakness can be `nil' (default), `t', `key' or `value'. +Non-standard keyword :weakness can be `nil' (default), `t', `key-and-value', +`key', `value' or `key-or-value'. `t' is an alias for `key-and-value'. -A weak hash table is one whose pointers do not count as GC referents: -for any key-value pair in the hash table, if the only remaining pointer -to either the key or the value is in a weak hash table, then the pair -will be removed from the hash table, and the key and value collected. -A non-weak hash table (or any other pointer) would prevent the object -from being collected. +A key-and-value-weak hash table, also known as a fully-weak or simply +as a weak hash table, is one whose pointers do not count as GC +referents: for any key-value pair in the hash table, if the only +remaining pointer to either the key or the value is in a weak hash +table, then the pair will be removed from the hash table, and the key +and value collected. A non-weak hash table (or any other pointer) +would prevent the object from being collected. A key-weak hash table is similar to a fully-weak hash table except that a key-value pair will be removed only if the key remains unmarked @@ -811,6 +830,12 @@ unmarked outside of weak hash tables. The pair will remain in the hash table if the value is pointed to by something other than a weak hash table, even if the key is not. + +A key-or-value-weak hash table is similar to a fully-weak hash table except +that a key-value pair will be removed only if the value and the key remain +unmarked outside of weak hash tables. The pair will remain in the +hash table if the value or key are pointed to by something other than a weak +hash table, even if the other is not. */ (int nargs, Lisp_Object *args)) { @@ -861,7 +886,7 @@ */ (hash_table)) { - CONST Lisp_Hash_Table *ht_old = xhash_table (hash_table); + const Lisp_Hash_Table *ht_old = xhash_table (hash_table); Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table); copy_lcrecord (ht, ht_old); @@ -915,7 +940,7 @@ void pdump_reorganize_hash_table (Lisp_Object hash_table) { - CONST Lisp_Hash_Table *ht = xhash_table (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; @@ -942,7 +967,7 @@ } static hentry * -find_hentry (Lisp_Object key, CONST Lisp_Hash_Table *ht) +find_hentry (Lisp_Object key, const Lisp_Hash_Table *ht) { hash_table_test_function_t test_function = ht->test_function; hentry *entries = ht->hentries; @@ -961,7 +986,7 @@ */ (key, hash_table, default_)) { - CONST Lisp_Hash_Table *ht = xhash_table (hash_table); + const Lisp_Hash_Table *ht = xhash_table (hash_table); hentry *e = find_hentry (key, ht); return HENTRY_CLEAR_P (e) ? default_ : e->value; @@ -1100,16 +1125,17 @@ DEFUN ("hash-table-weakness", Fhash_table_weakness, 1, 1, 0, /* Return the weakness of HASH-TABLE. -This can be one of `nil', `t', `key' or `value'. +This can be one of `nil', `key-and-value', `key-or-value', `key' or `value'. */ (hash_table)) { switch (xhash_table (hash_table)->weakness) { - case HASH_TABLE_WEAK: return Qt; - case HASH_TABLE_KEY_WEAK: return Qkey; - case HASH_TABLE_VALUE_WEAK: return Qvalue; - default: return Qnil; + case HASH_TABLE_WEAK: return Qkey_and_value; + case HASH_TABLE_KEY_WEAK: return Qkey; + case HASH_TABLE_KEY_VALUE_WEAK: return Qkey_or_value; + case HASH_TABLE_VALUE_WEAK: return Qvalue; + default: return Qnil; } } @@ -1122,10 +1148,11 @@ { switch (xhash_table (hash_table)->weakness) { - case HASH_TABLE_WEAK: return Qweak; - case HASH_TABLE_KEY_WEAK: return Qkey_weak; - case HASH_TABLE_VALUE_WEAK: return Qvalue_weak; - default: return Qnon_weak; + case HASH_TABLE_WEAK: return Qweak; + case HASH_TABLE_KEY_WEAK: return Qkey_weak; + case HASH_TABLE_KEY_VALUE_WEAK: return Qkey_or_value_weak; + case HASH_TABLE_VALUE_WEAK: return Qvalue_weak; + default: return Qnon_weak; } } @@ -1141,8 +1168,8 @@ */ (function, hash_table)) { - CONST Lisp_Hash_Table *ht = xhash_table (hash_table); - CONST hentry *e, *sentinel; + const Lisp_Hash_Table *ht = xhash_table (hash_table); + const hentry *e, *sentinel; for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) if (!HENTRY_CLEAR_P (e)) @@ -1167,8 +1194,8 @@ elisp_maphash (maphash_function_t function, Lisp_Object hash_table, void *extra_arg) { - CONST Lisp_Hash_Table *ht = XHASH_TABLE (hash_table); - CONST hentry *e, *sentinel; + const Lisp_Hash_Table *ht = XHASH_TABLE (hash_table); + const hentry *e, *sentinel; for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) if (!HENTRY_CLEAR_P (e)) @@ -1209,6 +1236,15 @@ /************************************************************************/ /* garbage collecting weak hash tables */ /************************************************************************/ +#define MARK_OBJ(obj) do { \ + Lisp_Object mo_obj = (obj); \ + if (!marked_p (mo_obj)) \ + { \ + mark_object (mo_obj); \ + did_mark = 1; \ + } \ +} while (0) + /* Complete the marking for semi-weak hash tables. */ int @@ -1221,9 +1257,9 @@ !NILP (hash_table); 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 Lisp_Hash_Table *ht = XHASH_TABLE (hash_table); + const hentry *e = ht->hentries; + const hentry *sentinel = e + ht->size; if (! marked_p (hash_table)) /* The hash table is probably garbage. Ignore it. */ @@ -1232,9 +1268,6 @@ /* Now, scan over all the pairs. For all pairs that are half-marked, we may need to mark the other half if we're keeping this pair. */ -#define MARK_OBJ(obj) \ -do { if (!marked_p (obj)) mark_object (obj), did_mark = 1; } while (0) - switch (ht->weakness) { case HASH_TABLE_KEY_WEAK: @@ -1251,6 +1284,17 @@ MARK_OBJ (e->key); break; + case HASH_TABLE_KEY_VALUE_WEAK: + for (; e < sentinel; e++) + if (!HENTRY_CLEAR_P (e)) + { + if (marked_p (e->value)) + MARK_OBJ (e->key); + else if (marked_p (e->key)) + MARK_OBJ (e->value); + } + break; + case HASH_TABLE_KEY_CAR_WEAK: for (; e < sentinel; e++) if (!HENTRY_CLEAR_P (e)) @@ -1328,12 +1372,13 @@ internal_array_hash (Lisp_Object *arr, int size, int depth) { int i; - unsigned long hash = 0; + hashcode_t hash = 0; + depth++; if (size <= 5) { for (i = 0; i < size; i++) - hash = HASH2 (hash, internal_hash (arr[i], depth + 1)); + hash = HASH2 (hash, internal_hash (arr[i], depth)); return hash; } @@ -1341,7 +1386,7 @@ A slightly better approach would be to offset by some noise factor from the points chosen below. */ for (i = 0; i < 5; i++) - hash = HASH2 (hash, internal_hash (arr[i*size/5], depth + 1)); + hash = HASH2 (hash, internal_hash (arr[i*size/5], depth)); return hash; } @@ -1374,16 +1419,9 @@ { return hash_string (XSTRING_DATA (obj), XSTRING_LENGTH (obj)); } - if (VECTORP (obj)) - { - return HASH2 (XVECTOR_LENGTH (obj), - internal_array_hash (XVECTOR_DATA (obj), - XVECTOR_LENGTH (obj), - depth + 1)); - } if (LRECORDP (obj)) { - CONST struct lrecord_implementation + const struct lrecord_implementation *imp = XRECORD_LHEADER_IMPLEMENTATION (obj); if (imp->hash) return imp->hash (obj, depth); @@ -1409,7 +1447,7 @@ (object)) { /* This function is pretty 32bit-centric. */ - unsigned long hash = internal_hash (object, 0); + hashcode_t hash = internal_hash (object, 0); return Fcons (hash >> 16, hash & 0xffff); } #endif @@ -1422,6 +1460,8 @@ void syms_of_elhash (void) { + INIT_LRECORD_IMPLEMENTATION (hash_table); + DEFSUBR (Fhash_table_p); DEFSUBR (Fmake_hash_table); DEFSUBR (Fcopy_hash_table); @@ -1447,11 +1487,14 @@ defsymbol (&Qhashtable, "hashtable"); defsymbol (&Qweakness, "weakness"); defsymbol (&Qvalue, "value"); + defsymbol (&Qkey_or_value, "key-or-value"); + defsymbol (&Qkey_and_value, "key-and-value"); defsymbol (&Qrehash_size, "rehash-size"); defsymbol (&Qrehash_threshold, "rehash-threshold"); defsymbol (&Qweak, "weak"); /* obsolete */ defsymbol (&Qkey_weak, "key-weak"); /* obsolete */ + defsymbol (&Qkey_or_value_weak, "key-or-value-weak"); /* obsolete */ defsymbol (&Qvalue_weak, "value-weak"); /* obsolete */ defsymbol (&Qnon_weak, "non-weak"); /* obsolete */ diff -r 72a7cfa4a488 -r abe6d1db359e src/elhash.h --- a/src/elhash.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/elhash.h Mon Aug 13 11:35:02 2007 +0200 @@ -38,6 +38,7 @@ HASH_TABLE_NON_WEAK, HASH_TABLE_KEY_WEAK, HASH_TABLE_VALUE_WEAK, + HASH_TABLE_KEY_VALUE_WEAK, HASH_TABLE_KEY_CAR_WEAK, HASH_TABLE_VALUE_CAR_WEAK, HASH_TABLE_WEAK diff -r 72a7cfa4a488 -r abe6d1db359e src/emacs.c --- a/src/emacs.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/emacs.c Mon Aug 13 11:35:02 2007 +0200 @@ -2,6 +2,7 @@ Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. + Copyright (C) 2000 Ben Wing. This file is part of XEmacs. @@ -22,6 +23,141 @@ /* Synched up with: Mule 2.0, FSF 19.28. */ +/* Capsule summary of the various releases of Lucid Emacs/XEmacs and + FSF/GNU Emacs. Provided here for use in cross-referencing version + releases and dates in comments, esp. in the authorship comments at + the beginning of each file. More information about history can be + found in the beginning of the Internals Manual and in the About page. + + +-- A time line for Lucid Emacs/XEmacs is + +version 19.0 shipped with Energize 1.0, April 1992. +version 19.1 released June 4, 1992. +version 19.2 released June 19, 1992. +version 19.3 released September 9, 1992. +version 19.4 released January 21, 1993. +version 19.5 was a repackaging of 19.4 with a few bug fixes and + shipped with Energize 2.0. Never released to the net. +version 19.6 released April 9, 1993. +version 19.7 was a repackaging of 19.6 with a few bug fixes and + shipped with Energize 2.1. Never released to the net. +version 19.8 released September 6, 1993. +version 19.9 released January 12, 1994. +version 19.10 released May 27, 1994. +version 19.11 (first XEmacs) released September 13, 1994. +version 19.12 released June 23, 1995. +version 19.13 released September 1, 1995. +version 19.14 released June 23, 1996. +version 20.0 released February 9, 1997. +version 19.15 released March 28, 1997. +version 20.1 (not released to the net) April 15, 1997. +version 20.2 released May 16, 1997. +version 19.16 released October 31, 1997. +version 20.3 (the first stable version of XEmacs 20.x) released + November 30, 1997. +version 20.4 released February 28, 1998. + + +-- A time line for GNU Emacs version 19 is + +version 19.7 (beta) (first beta release) released ??????; prob. late May 1993. +version 19.8 (beta) released May 27, 1993. +version 19.9 (beta) released May 27, 1993. +version 19.10 (beta) released May 30, 1993. +version 19.11 (beta) released June 1, 1993. +version 19.12 (beta) released June 2, 1993. +version 19.13 (beta) released June 8, 1993. +version 19.14 (beta) released June 17, 1993. +version 19.15 (beta) released June 19, 1993. +version 19.16 (beta) released July 6, 1993. +version 19.17 (beta) released late July, 1993. +version 19.18 (beta) released August 9, 1993. +version 19.19 (beta) released August 15, 1993. +version 19.20 (beta) released November 17, 1993. +version 19.21 (beta) released November 17, 1993. +version 19.22 (beta) released November 28, 1993. +version 19.23 (beta) released May 17, 1994. +version 19.24 (beta) released May 16, 1994. +version 19.25 (beta) released June 3, 1994. +version 19.26 (beta) released September 11, 1994. +version 19.27 (beta) released September 14, 1994. +version 19.28 (first ``official'' release) released November 1, 1994. +version 19.29 released June 21, 1995. +version 19.30 released November 24, 1995. +version 19.31 released May 25, 1996. +version 19.32 released July 31, 1996. +version 19.33 released August 11, 1996. +version 19.34 released August 21, 1996. +version 19.34b released September 6, 1996. + + +-- A time line for GNU Emacs version 20 is + +version 20.1 released September 17, 1997. +version 20.2 released September 20, 1997. +version 20.3 released August 19, 1998. + + +-- A time line for GNU Emacs version 18 and older is + +GNU Emacs version 15 (15.34) was released sometime in 1984 or 1985 and + shared some code with a version of Emacs written by James Gosling (the + same James Gosling who later created the Java language). +GNU Emacs version 16 (first released version was 16.56) was released on + July 15, 1985. All Gosling code was removed due to potential copyright + problems with the code. +version 16.57: released on September 16, 1985. +versions 16.58, 16.59: released on September 17, 1985. +version 16.60: released on September 19, 1985. These later version 16's + incorporated patches from the net, esp. for getting Emacs to work under + System V. +version 17.36 (first official v17 release) released on December 20, 1985. + Included a TeX-able user manual. First official unpatched version that + worked on vanilla System V machines. +version 17.43 (second official v17 release) released on January 25, 1986. +version 17.45 released on January 30, 1986. +version 17.46 released on February 4, 1986. +version 17.48 released on February 10, 1986. +version 17.49 released on February 12, 1986. +version 17.55 released on March 18, 1986. +version 17.57 released on March 27, 1986. +version 17.58 released on April 4, 1986. +version 17.61 released on April 12, 1986. +version 17.63 released on May 7, 1986. +version 17.64 released on May 12, 1986. +version 18.24 (a beta version) released on October 2, 1986. +version 18.30 (a beta version) released on November 15, 1986. +version 18.31 (a beta version) released on November 23, 1986. +version 18.32 (a beta version) released on December 7, 1986. +version 18.33 (a beta version) released on December 12, 1986. +version 18.35 (a beta version) released on January 5, 1987. +version 18.36 (a beta version) released on January 21, 1987. +January 27, 1987: The Great Usenet Renaming. net.emacs is now comp.emacs. +version 18.37 (a beta version) released on February 12, 1987. +version 18.38 (a beta version) released on March 3, 1987. +version 18.39 (a beta version) released on March 14, 1987. +version 18.40 (a beta version) released on March 18, 1987. +version 18.41 (the first ``official'' release) released on March 22, 1987. +version 18.45 released on June 2, 1987. +version 18.46 released on June 9, 1987. +version 18.47 released on June 18, 1987. +version 18.48 released on September 3, 1987. +version 18.49 released on September 18, 1987. +version 18.50 released on February 13, 1988. +version 18.51 released on May 7, 1988. +version 18.52 released on September 1, 1988. +version 18.53 released on February 24, 1989. +version 18.54 released on April 26, 1989. +version 18.55 released on August 23, 1989. This is the earliest version + that is still available by FTP. +version 18.56 released on January 17, 1991. +version 18.57 released late January, 1991. +version 18.58 released ?????. +version 18.59 released October 31, 1992. + +*/ + /* Note: It is necessary to specify and not "config.h" in order for the --srcdir type of compilation to work properly. Otherwise the config.h from the srcdir, rather than the one from @@ -44,6 +180,15 @@ #include "sysfile.h" #include "systime.h" +#ifdef PDUMP +#include "dump-id.h" +#include "dumper.h" +#endif + +#ifndef SEPCHAR +#define SEPCHAR ':' +#endif + #ifdef QUANTIFY #include #endif @@ -58,17 +203,17 @@ #endif #ifdef TOOLTALK -#include TT_C_H_PATH +#include TT_C_H_FILE #endif -#if defined (WINDOWSNT) -#include +#if defined (WIN32_NATIVE) +#include "nt.h" #endif /* For PATH_EXEC */ #include -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) void report_sheap_usage (int die_if_pure_storage_exceeded); #endif @@ -161,8 +306,10 @@ priority. */ int emacs_priority; -/* If non-zero a filter or a sentinel is running. Tested to save the match - data on the first attempt to change it inside asynchronous code. */ +/* Some FSF junk with running_asynch_code, to preserve the match + data. Not necessary because we don't call process filters + asynchronously (i.e. from within QUIT). */ +/* #### Delete this when merging the rest of my code */ int running_asynch_code; /* If non-zero, a window-system was specified on the command line. */ @@ -171,7 +318,7 @@ /* Type of display specified. We cannot use a Lisp symbol here because Lisp symbols may not initialized at the time that we set this variable. */ -CONST char *display_use; +const char *display_use; /* If non-zero, then the early error handler will only print the error message and exit. */ @@ -191,13 +338,30 @@ /* Number of bytes of writable memory we can expect to be able to get */ unsigned int lim_data; +/* WARNING! + + Some LISP-visible command-line options are set by XEmacs _before_ the + data is dumped in building a --pdump XEmacs, but used _after_ it is + restored in normal operation. Thus the restored values overwrite the + values XEmacs is getting at run-time. Such variables must be saved + before loading the dumpfile, and restored afterward. + + This is done immediately before and after pdump_load() in main_1(). + See that function for the current list of protected variables. + + Note that if the variable is never DEFVAR'd, saving/restoring is not + needed. +*/ + /* Nonzero means running XEmacs without interactive terminal. */ int noninteractive; /* Value of Lisp variable `noninteractive'. Normally same as C variable `noninteractive' - but nothing terrible happens if user sets this one. */ + but nothing terrible happens if user sets this one. + + Shadowed from the pdumper by `noninteractive'. */ int noninteractive1; @@ -213,11 +377,15 @@ /* Nonzero means don't load package autoloads at startup */ int inhibit_autoloads; +/* Nonzero means don't load the dump file (ignored if not PDUMP) */ + +int nodumpfile; + /* Nonzero means print debug information about path searching */ int debug_paths; /* Save argv and argc. */ -static char **initial_argv; +static Extbyte **initial_argv; static int initial_argc; static void sort_args (int argc, char **argv); @@ -228,35 +396,126 @@ extern Lisp_Object Vlisp_EXEC_SUFFIXES; -/* Signal code for the fatal signal that was received */ -static int fatal_error_code; - -/* Nonzero if handling a fatal error already */ -static int fatal_error_in_progress; - -static void shut_down_emacs (int sig, Lisp_Object stuff); + +/* Ben's capsule summary about expected and unexpected exits from XEmacs. + + Expected exits occur when the user directs XEmacs to exit, for example + by pressing the close button on the only frame in XEmacs, or by typing + C-x C-c. This runs `save-buffers-kill-emacs', which saves any necessary + buffers, and then exits using the primitive `kill-emacs'. + + However, unexpected exits occur in a few different ways: + + -- a memory access violation or other hardware-generated exception + occurs. This is the worst possible problem to deal with, because + the fault can occur while XEmacs is in any state whatsoever, even + quite unstable ones. As a result, we need to be *extremely* careful + what we do. + -- we are using one X display (or if we've used more, we've closed the + others already), and some hardware or other problem happens and + suddenly we've lost our connection to the display. In this situation, + things are not so dire as in the last one; our code itself isn't + trashed, so we can continue execution as normal, after having set + things up so that we can exit at the appropriate time. Our exit + still needs to be of the emergency nature; we have no displays, so + any attempts to use them will fail. We simply want to auto-save + (the single most important thing to do during shut-down), do minimal + cleanup of stuff that has an independent existence outside of XEmacs, + and exit. + + Currently, both unexpected exit scenarios described above set + preparing_for_armageddon to indicate that nonessential and possibly + dangerous things should not be done, specifically: + + -- no garbage collection. + -- no hooks are run. + -- no messages of any sort from autosaving. + -- autosaving tries harder, ignoring certain failures. + -- existing frames are not deleted. + + (Also, all places that set preparing_for_armageddon also + set dont_check_for_quit. This happens separately because it's + also necessary to set other variables to make absolutely sure + no quitting happens.) + + In the first scenario above (the access violation), we also set + fatal_error_in_progress. This causes more things to not happen: + + -- assertion failures do not abort. + -- printing code does not do code conversion or gettext when + printing to stdout/stderr. +*/ + +/* Nonzero if handling a fatal error already. */ +int fatal_error_in_progress; + +/* Non-nil means we're going down, so we better not run any hooks + or do other non-essential stuff. */ +int preparing_for_armageddon; + + +static JMP_BUF run_temacs_catch; + +static int run_temacs_argc; +static char **run_temacs_argv; +static char *run_temacs_args; +static size_t run_temacs_argv_size; +static size_t run_temacs_args_size; + +static void shut_down_emacs (int sig, Lisp_Object stuff, int no_auto_save); + +static void +ensure_no_quitting_from_now_on (void) +{ + /* make sure no quitting from now on!! */ + dont_check_for_quit = 1; + Vinhibit_quit = Qt; + Vquit_flag = Qnil; +} /* Handle bus errors, illegal instruction, etc. */ SIGTYPE fatal_error_signal (int sig) { - fatal_error_code = sig; - signal (sig, SIG_DFL); + fatal_error_in_progress++; + preparing_for_armageddon = 1; + + ensure_no_quitting_from_now_on (); + /* Unblock the signal so that if the same signal gets sent in the code below, we avoid a deadlock. */ - EMACS_UNBLOCK_SIGNAL (fatal_error_code); - + EMACS_UNBLOCK_SIGNAL (sig); + + /* Only try auto-saving first time through. If we crash in auto-saving, + don't do it again. */ + if (fatal_error_in_progress == 1) + { + Fdo_auto_save (Qt, Qnil); /* do this before anything hazardous */ + /* Do this so that the variable has the same value of 2 regardless of + whether we made it through auto-saving correctly. */ + fatal_error_in_progress++; + } + else if (fatal_error_in_progress == 2) + stderr_out ("WARNING: Unable to auto-save your files properly.\n" + "Some or all may in fact have been auto-saved.\n" + "\n"); + + /* Now, reset our signal handler, so the next time, we just die. + Don't do this before auto-saving. */ + signal (sig, SIG_DFL); + + /* Keep in mind that there's more than one signal that we can crash + on. */ /* If fatal error occurs in code below, avoid infinite recursion. */ - if (! fatal_error_in_progress) + if (fatal_error_in_progress <= 2) { - fatal_error_in_progress = dont_check_for_quit = 1; - shut_down_emacs (sig, Qnil); + shut_down_emacs (sig, Qnil, 1); stderr_out ("\nLisp backtrace follows:\n\n"); Fbacktrace (Qexternal_debugging_output, Qt); # if 0 /* This is evil, rarely useful, and causes grief in some cases. */ /* Check for Sun-style stack printing via /proc */ { - CONST char *pstack = "/usr/proc/bin/pstack"; + const char *pstack = "/usr/proc/bin/pstack"; if (access (pstack, X_OK) == 0) { char buf[100]; @@ -269,65 +528,96 @@ # endif } /* Signal the same code; this time it will really be fatal. */ - kill (getpid (), fatal_error_code); + kill (getpid (), sig); SIGRETURN; } - - -DOESNT_RETURN -fatal (CONST char *fmt, ...) + +#ifdef _MSC_VER + +static DWORD +mswindows_handle_hardware_exceptions (DWORD code) { - va_list args; - va_start (args, fmt); - - fprintf (stderr, "\nXEmacs: "); - vfprintf (stderr, GETTEXT (fmt), args); - fprintf (stderr, "\n"); - - va_end (args); - fflush (stderr); - exit (1); + if (code != STATUS_ACCESS_VIOLATION && code != STATUS_ILLEGAL_INSTRUCTION + && code != STATUS_PRIVILEGED_INSTRUCTION + && code != STATUS_DATATYPE_MISALIGNMENT) + return EXCEPTION_CONTINUE_SEARCH; + + /* I don't know if this filter is still wrapped in the outer __try, but + it doesn't hurt to have another one. --ben + And it lets us control more exactly what we really want to do in such + a situation. */ + __try + { + fatal_error_in_progress++; + preparing_for_armageddon = 1; + + ensure_no_quitting_from_now_on (); + + /* Only try auto-saving first time through. If we crash in auto-saving, + don't do it again. */ + if (fatal_error_in_progress == 1) + { + Fdo_auto_save (Qt, Qnil); /* do this before anything hazardous */ + /* Do this so that the variable has the same value of 2 regardless of + whether we made it through auto-saving correctly. */ + fatal_error_in_progress++; + } + else if (fatal_error_in_progress == 2) + stderr_out ("WARNING: Unable to auto-save your files properly.\n" + "Some or all may in fact have been auto-saved.\n" + "\n"); + + /* If fatal error occurs in code below, avoid infinite recursion. */ + if (fatal_error_in_progress <= 2) + { + shut_down_emacs (-1, Qnil, 1); + stderr_out ("\nLisp backtrace follows:\n\n"); + Fbacktrace (Qexternal_debugging_output, Qt); + } + } + /* VC++ documentation says that + GetExceptionCode() cannot be called inside the filter itself. */ + + /* __except (mswindows_handle_hardware_exceptions (GetExceptionCode ())) {} + + The line above is original. Unfortunately, when an error is tripped + inside of the handler (e.g. during Fbacktrace()), and the handler for + the handler is invoked, it correctly notices that something is amiss + and it should just return -- but it returns EXCEPTION_CONTINUE_SEARCH, + which causes the debugger to be invoked debugging the handler code in + this function -- and WITH THE STACK UNWOUND so that you see main() + calling mswindows_handle_hardware_exceptions(), calling Fbacktrace(), + and a crash a couple of frames in -- AND NO SIGN OF THE ORIGINAL CRASH! + + There's some real weirdness going on in the stack handling -- unlike + in Unix, where further crashes just keep adding to the stack, it seems + that under the structured-exception-handling, the stack can actually + bounce back and forth between the full stack at the location of the + exception and the unwound stack at the place where the __try clause was + established. I don't completely understand it. What I do know is that + returning EXCEPTION_EXECUTE_HANDLER on nested crash has the effect of + aborting execution of the handler and going back to the outer filter + function, which returns EXCEPTION_CONTINUE_SEARCH and everything is + hunky-dorey -- your debugger sees a crash at the right location with + the right stack. + + I'm leaving in the trickier Unix-like code in the handler; someone who + understands better than me how the stack works in these handlers could + fix it up more. As it is, it works pretty well, so I'm not likely to + touch it more. --ben + */ + + __except (EXCEPTION_EXECUTE_HANDLER) {} + + + /* pretend we didn't handle this, so that the debugger is invoked and/or + the normal GPF box appears. */ + return EXCEPTION_CONTINUE_SEARCH; } -/* #### The following two functions should be replaced with - calls to emacs_doprnt_*() functions, with STREAM set to send out - to stdout or stderr. This is the only way to ensure that - I18N3 works properly (many implementations of the *printf() - functions, including the ones included in glibc, do not implement - the %###$ argument-positioning syntax). */ - -/* exactly equivalent to fprintf (stderr, fmt, ...) except that it calls - GETTEXT on the format string. */ - -int -stderr_out (CONST char *fmt, ...) -{ - int retval; - va_list args; - va_start (args, fmt); - - retval = vfprintf (stderr, GETTEXT (fmt), args); - - va_end (args); - /* fflush (stderr); */ - return retval; -} - -/* exactly equivalent to fprintf (stdout, fmt, ...) except that it calls - GETTEXT on the format string. */ - -int -stdout_out (CONST char *fmt, ...) -{ - int retval; - va_list args; - va_start (args, fmt); - - retval = vfprintf (stdout, GETTEXT (fmt), args); - - va_end (args); - return retval; -} +#endif /* _MSC_VER */ + + #ifdef SIGDANGER @@ -350,7 +640,7 @@ /* Code for dealing with Lisp access to the Unix command line */ static Lisp_Object -make_arg_list_1 (int argc, char **argv, int skip_args) +make_arg_list_1 (int argc, Extbyte **argv, int skip_args) { Lisp_Object result = Qnil; REGISTER int i; @@ -359,21 +649,30 @@ { if (i == 0 || i > skip_args) { -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE if (i == 0) { /* Do not trust to what crt0 has stuffed into argv[0] */ - char full_exe_path [MAX_PATH]; + char full_exe_path[MAX_PATH]; + Lisp_Object fullpath; + GetModuleFileName (NULL, full_exe_path, MAX_PATH); - result = Fcons (build_ext_string (full_exe_path, Qfile_name), - result); + fullpath = build_ext_string (full_exe_path, Qmswindows_tstr); + result = Fcons (fullpath, result); #if defined(HAVE_SHLIB) - (void)dll_init(full_exe_path); + { + Extbyte *fullpathext; + + LISP_STRING_TO_EXTERNAL (fullpath, fullpathext, + Qdll_filename_encoding); + (void) dll_init (fullpathext); + } #endif } else #endif - result = Fcons (build_ext_string (argv [i], Qfile_name), + result = Fcons (build_ext_string (argv[i], + Qcommand_argument_encoding), result); } } @@ -381,7 +680,7 @@ } Lisp_Object -make_arg_list (int argc, char **argv) +make_arg_list (int argc, Extbyte **argv) { return make_arg_list_1 (argc, argv, 0); } @@ -389,21 +688,19 @@ /* Calling functions are also responsible for calling free_argc_argv when they are done with the generated list. */ void -make_argc_argv (Lisp_Object argv_list, int *argc, char ***argv) +make_argc_argv (Lisp_Object argv_list, int *argc, Extbyte ***argv) { Lisp_Object next; int n = XINT (Flength (argv_list)); REGISTER int i; - *argv = (char**) xmalloc ((n+1) * sizeof (char*)); + *argv = (Extbyte**) xmalloc ((n+1) * sizeof (Extbyte*)); for (i = 0, next = argv_list; i < n; i++, next = XCDR (next)) { - CONST char *temp; + const Extbyte *temp; CHECK_STRING (XCAR (next)); - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (next), - C_STRING_ALLOCA, temp, - Qnative); + LISP_STRING_TO_EXTERNAL (XCAR (next), temp, Qcommand_argument_encoding); (*argv) [i] = xstrdup (temp); } (*argv) [n] = 0; @@ -411,7 +708,7 @@ } void -free_argc_argv (char **argv) +free_argc_argv (Extbyte **argv) { int elt = 0; @@ -424,7 +721,7 @@ } static void -init_cmdargs (int argc, char **argv, int skip_args) +init_cmdargs (int argc, Extbyte **argv, int skip_args) { initial_argv = argv; initial_argc = argc; @@ -457,15 +754,6 @@ # undef RUN_TIME_REMAP #endif -#if defined (MULE) && defined (MSDOS) && defined (EMX) -/* Setup all of files be input/output'ed with binary translation mode. */ -asm (" .text"); -asm ("L_setbinmode:"); -asm (" movl $1, __fmode_bin"); -asm (" ret"); -asm (" .stabs \"___CTOR_LIST__\", 23, 0, 0, L_setbinmode"); -#endif - /* Test whether the next argument in ARGV matches SSTR or a prefix of LSTR (at least MINLEN characters). If so, then if VALPTR is non-null (the argument is supposed to have a value) store in *VALPTR either @@ -569,7 +857,7 @@ * But hey, it solves all NS related memory problems, so who's * complaining? */ if (initialized && malloc_jumpstart (malloc_cookie) != 0) - fprintf (stderr, "malloc jumpstart failed!\n"); + stderr_out ("malloc jumpstart failed!\n"); #endif /* NeXT */ /* @@ -587,23 +875,7 @@ sort_args (argc, argv); - /* Map in shared memory, if we are using that. */ -#ifdef HAVE_SHM - if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args)) - { - map_in_data (0); - /* The shared memory was just restored, which clobbered this. */ - skip_args = 1; - } - else - { - map_in_data (1); - /* The shared memory was just restored, which clobbered this. */ - skip_args = 0; - } -#endif /* HAVE_SHM */ - -#if (defined (MSDOS) && defined (EMX)) || defined (WIN32) || defined (_SCO_DS) +#if defined (WIN32_NATIVE) || defined (_SCO_DS) environ = envp; #endif @@ -636,15 +908,6 @@ memory_warnings (0, malloc_warning); #endif /* not SYSTEM_MALLOC */ -#ifdef MSDOS - /* We do all file input/output as binary files. When we need to translate - newlines, we do that manually. */ - _fmode = O_BINARY; - (stdin) ->_flag &= ~_IOTEXT; - (stdout)->_flag &= ~_IOTEXT; - (stderr)->_flag &= ~_IOTEXT; -#endif /* MSDOS */ - #ifdef SET_EMACS_PRIORITY if (emacs_priority != 0) nice (-emacs_priority); @@ -661,6 +924,17 @@ inhibit_window_system = 1; #endif + /* Handle the -sd/--show-dump-id switch, which means show the hex dump_id and quit */ + if (argmatch (argv, argc, "-sd", "--show-dump-id", 9, NULL, &skip_args)) + { +#ifdef PDUMP + printf ("%08x\n", dump_id); +#else + printf ("*ERROR**\n"); +#endif + exit (0); + } + /* Handle the -t switch, which specifies filename to use as terminal */ { char *term; @@ -682,6 +956,12 @@ } } + /* Handle the --no-dump-file/-nd switch, which means don't load the dump file (ignored when not using pdump) */ + if (argmatch (argv, argc, "-nd", "--no-dump-file", 7, NULL, &skip_args)) + { + nodumpfile = 1; + } + /* Handle -nw switch */ if (argmatch (argv, argc, "-nw", "--no-windows", 6, NULL, &skip_args)) inhibit_window_system = 1; @@ -853,9 +1133,52 @@ #ifdef PDUMP if (restart) initialized = 1; - else { - initialized = pdump_load (); - purify_flag = !initialized; + else if (nodumpfile) { + initialized = 0; + purify_flag = 1; + } else { + + /* Keep command options from getting stomped. + + Some LISP-visible options are changed by XEmacs _after_ the data is + dumped in building a --pdump XEmacs, but _before_ it is restored in + normal operation. Thus the restored values overwrite the values + XEmacs is getting at run-time. Such variables must be saved here, + and restored after loading the dumped data. + + Boy, this is ugly, but how else to do it? + */ + + /* noninteractive1 is protected by noninteractive, which is not + LISP-visible */ + int inhibit_early_packages_save = inhibit_early_packages; + int inhibit_autoloads_save = inhibit_autoloads; + int debug_paths_save = debug_paths; +#ifdef INHIBIT_SITE_LISP + int inhibit_site_lisp_save = inhibit_site_lisp; +#endif +#ifdef INHIBIT_SITE_MODULES + int inhibit_site_modules_save = inhibit_site_modules; +#endif + + initialized = pdump_load (argv[0]); + + /* Now unstomp everything */ + noninteractive1 = noninteractive; + inhibit_early_packages = inhibit_early_packages_save; + inhibit_autoloads = inhibit_autoloads_save; + debug_paths = debug_paths_save; +#ifdef INHIBIT_SITE_LISP + inhibit_site_lisp = inhibit_site_lisp_save; +#endif +#ifdef INHIBIT_SITE_MODULES + inhibit_site_modules = inhibit_site_modules_save; +#endif + + if (initialized) + run_temacs_argc = -1; + else + purify_flag = 1; } #else if (!initialized) @@ -873,11 +1196,11 @@ /* Initialize Qnil, Qt, Qunbound, and the obarray. After this, symbols can be - interned. This depends on init_alloc_once(). */ + interned. This depends on init_alloc_once_early(). */ init_symbols_once_early (); /* Declare the basic symbols pertaining to errors, - So that deferror() can be called. */ + So that DEFERROR*() can be called. */ init_errors_once_early (); /* Make sure that opaque pointers can be created. */ @@ -886,12 +1209,13 @@ /* Now declare all the symbols and define all the Lisp primitives. The *only* thing that the syms_of_*() functions are allowed to do - is call one of the following three functions: - - defsymbol() + is call one of the following: + + INIT_LRECORD_IMPLEMENTATION() + defsymbol(), DEFSYMBOL(), or DEFSYMBOL_MULTIWORD_PREDICATE() defsubr() (i.e. DEFSUBR) - deferror() - defkeyword() + deferror(), DEFERROR(), or DEFERROR_STANDARD() + defkeyword() or DEFKEYWORD() Order does not matter in these functions. */ @@ -945,9 +1269,7 @@ syms_of_glyphs (); syms_of_glyphs_eimage (); syms_of_glyphs_widget (); -#if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) syms_of_gui (); -#endif syms_of_gutter (); syms_of_indent (); syms_of_intl (); @@ -1004,7 +1326,9 @@ #endif #ifdef HAVE_X_WINDOWS +#ifdef HAVE_BALLOON_HELP syms_of_balloon_x (); +#endif syms_of_device_x (); #ifdef HAVE_DIALOGS syms_of_dialog_x (); @@ -1029,6 +1353,7 @@ #ifdef HAVE_MS_WINDOWS syms_of_console_mswindows (); syms_of_device_mswindows (); + syms_of_dialog_mswindows (); syms_of_frame_mswindows (); syms_of_objects_mswindows (); syms_of_select_mswindows (); @@ -1040,13 +1365,16 @@ #ifdef HAVE_SCROLLBARS syms_of_scrollbar_mswindows (); #endif +#endif /* HAVE_MS_WINDOWS */ #ifdef HAVE_MSW_C_DIRED syms_of_dired_mswindows (); #endif -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE syms_of_ntproc (); #endif -#endif /* HAVE_MS_WINDOWS */ +#if defined (WIN32_NATIVE) || defined (CYGWIN) + syms_of_win32 (); +#endif #ifdef MULE syms_of_mule (); @@ -1096,7 +1424,11 @@ #endif #ifdef HAVE_GPM - syms_of_gpmevent (); + syms_of_gpmevent (); +#endif + +#ifdef HAVE_POSTGRESQL + syms_of_postgresql (); #endif /* Now create the subtypes for the types that have them. @@ -1279,7 +1611,7 @@ using a global variable that has been initialized earlier on in the same function - Any of the object-creating functions on alloc.c: e.g. + Any of the object-creating functions in alloc.c: e.g. make_pure_*() make_string() @@ -1352,9 +1684,7 @@ vars_of_glyphs (); vars_of_glyphs_eimage (); vars_of_glyphs_widget (); -#if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) vars_of_gui (); -#endif vars_of_gutter (); vars_of_indent (); vars_of_insdel (); @@ -1381,7 +1711,7 @@ #ifdef HAVE_SHLIB vars_of_module (); #endif -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE vars_of_nt (); vars_of_ntproc (); #endif @@ -1424,7 +1754,9 @@ #endif #ifdef HAVE_X_WINDOWS +#ifdef HAVE_BALLOON_HELP vars_of_balloon_x (); +#endif vars_of_device_x (); #ifdef HAVE_DIALOGS vars_of_dialog_x (); @@ -1494,8 +1826,12 @@ vars_of_eldap (); #endif +#ifdef HAVE_POSTGRESQL + vars_of_postgresql(); +#endif + #ifdef HAVE_GPM - vars_of_gpmevent (); + vars_of_gpmevent (); #endif /* Now initialize any specifier variables. We do this later @@ -1695,6 +2031,7 @@ reinit_vars_of_event_stream (); reinit_vars_of_events (); reinit_vars_of_extents (); + reinit_vars_of_fileio (); reinit_vars_of_font_lock (); reinit_vars_of_glyphs (); reinit_vars_of_glyphs_widget (); @@ -1707,7 +2044,6 @@ #endif reinit_vars_of_objects (); reinit_vars_of_print (); - reinit_vars_of_redisplay (); reinit_vars_of_search (); reinit_vars_of_undo (); reinit_vars_of_window (); @@ -1765,7 +2101,7 @@ init_initial_directory(); /* get the directory to use for the "*scratch*" buffer, etc. */ -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* * For Win32, call init_environment() now, so that environment/registry * variables will be properly entered into Vprocess_environment. @@ -1780,16 +2116,11 @@ first because many of the functions below call egetenv() to get environment variables. */ init_lread (); /* Set up the Lisp reader. */ -#ifdef MSDOS - /* Call early 'cause init_environment needs it. */ - init_dosfns (); - /* Set defaults for several environment variables. */ - init_environment (argc, argv, skip_args); -#endif - init_cmdargs (argc, argv, skip_args); /* Create list Vcommand_line_args */ + init_cmdargs (argc, (Extbyte **) argv, + skip_args); /* Create list Vcommand_line_args */ init_buffer (); /* Set default directory of *scratch* buffer */ -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE init_ntproc(); #endif @@ -1803,13 +2134,16 @@ #ifdef SUNPRO init_sunpro (); /* Set up Sunpro usage tracking */ #endif +#if defined (WIN32_NATIVE) || defined (CYGWIN) + init_win32 (); +#endif #if defined (HAVE_NATIVE_SOUND) && defined (hp9000s800) init_hpplay (); #endif #ifdef HAVE_TTY init_device_tty (); #endif - init_console_stream (); /* Create the first console */ + init_console_stream (restart); /* Create the first console */ /* try to get the actual pathname of the exec file we are running */ if (!restart) @@ -1845,7 +2179,7 @@ Vinvocation_directory = Ffile_name_directory (Vinvocation_directory); } -#if defined(HAVE_SHLIB) && !defined(WINDOWSNT) +#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. */ @@ -1903,17 +2237,18 @@ struct standard_args { - CONST char * CONST name; - CONST char * CONST longname; + const char *name; + const char *longname; int priority; int nargs; }; -static struct standard_args standard_args[] = +static const struct standard_args standard_args[] = { /* Handled by main_1 above: */ - { "-nl", "--no-shared-memory", 100, 0 }, - { "-t", "--terminal", 95, 1 }, + { "-sd", "--show-dump-id", 105, 0 }, + { "-t", "--terminal", 100, 1 }, + { "-nd", "--no-dump-file", 95, 0 }, { "-nw", "--no-windows", 90, 0 }, { "-batch", "--batch", 85, 0 }, { "-debug-paths", "--debug-paths", 82, 0 }, @@ -2108,14 +2443,6 @@ xfree (priority); } -static JMP_BUF run_temacs_catch; - -static int run_temacs_argc; -static char **run_temacs_argv; -static char *run_temacs_args; -static size_t run_temacs_argv_size; -static size_t run_temacs_args_size; - DEFUN ("running-temacs-p", Frunning_temacs_p, 0, 0, 0, /* True if running temacs. This means we are in the dumping stage. This is false during normal execution of the `xemacs' program, and @@ -2143,11 +2470,11 @@ (int nargs, Lisp_Object *args)) { int ac; - CONST Extbyte *wampum; + const Extbyte *wampum; int namesize; int total_len; Lisp_Object orig_invoc_name = Fcar (Vcommand_line_args); - CONST Extbyte **wampum_all = alloca_array (CONST Extbyte *, nargs); + const Extbyte **wampum_all = alloca_array (const Extbyte *, nargs); int *wampum_all_len = alloca_array (int, nargs); assert (!gc_in_progress); @@ -2190,7 +2517,7 @@ unbind_to (0, Qnil); /* this closes loadup.el */ purify_flag = 0; run_temacs_argc = nargs + 1; -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) report_sheap_usage (0); #endif LONGJMP (run_temacs_catch, 1); @@ -2201,6 +2528,16 @@ int main (int argc, char **argv, char **envp) { + +#ifdef _MSC_VER + /* Under VC++, access violations and the like are not sent through + the standard signal() mechanism. Rather, they need to be handled + using the Microsoft "structured exception handling" mechanism, + which vaguely resembles the C++ mechanisms. */ + __try + { +#endif + int volatile vol_argc = argc; char ** volatile vol_argv = argv; char ** volatile vol_envp = envp; @@ -2276,7 +2613,7 @@ 06/20/96 robertl@dgii.com */ { - extern char *_environ; + extern char **_environ; if ((unsigned) environ == 0) environ=_environ; } @@ -2296,7 +2633,7 @@ int rc = malloc_set_state (malloc_state_ptr); if (rc != 0) { - fprintf (stderr, "malloc_set_state failed, rc = %d\n", rc); + stderr_out ("malloc_set_state failed, rc = %d\n", rc); abort (); } #if 0 @@ -2318,6 +2655,14 @@ run_temacs_argc = -1; main_1 (vol_argc, vol_argv, vol_envp, restarted); + +#ifdef _MSC_VER + } + /* VC++ documentation says that + GetExceptionCode() cannot be called inside the filter itself. */ + __except (mswindows_handle_hardware_exceptions (GetExceptionCode ())) {} +#endif + return 0; /* unreached */ } @@ -2362,9 +2707,7 @@ if (!preparing_for_armageddon && !noninteractive) run_hook (Qkill_emacs_hook); - /* make sure no quitting from now on!! */ - dont_check_for_quit = 1; - Vinhibit_quit = Qt; + ensure_no_quitting_from_now_on (); if (!preparing_for_armageddon) { @@ -2378,7 +2721,7 @@ be too dangerous), and if we get a crash somewhere within this loop, we'll still autosave and won't try this again. */ - LIST_LOOP_DELETING(concons, nextcons, Vconsole_list) + LIST_LOOP_DELETING (concons, nextcons, Vconsole_list) { /* There is very little point in deleting the stream console. It uses stdio, which should flush any buffered output and @@ -2392,7 +2735,17 @@ UNGCPRO; - shut_down_emacs (0, STRINGP (arg) ? arg : Qnil); +#ifdef HAVE_MS_WINDOWS + /* If we displayed a message on the console, then we must allow the + user to see this message. This may be unnecessary, but can't hurt, + and we can't necessarily check arg; e.g. xemacs --help kills with + argument 0. */ + if (mswindows_message_outputted) + Fmswindows_message_box (build_string ("Messages outputted. XEmacs is exiting."), + Qnil, Qnil); +#endif + + shut_down_emacs (0, STRINGP (arg) ? arg : Qnil, 0); #if defined(GNU_MALLOC) __free_hook = @@ -2415,45 +2768,54 @@ If SIG is a signal number, print a message for it. - This is called by fatal signal handlers, X protocol error handlers, - and Fkill_emacs. */ + This is called by fatal signal handlers and Fkill_emacs. It used to + be called by X protocol error handlers, but instead they now call + Fkill_emacs. */ static void -shut_down_emacs (int sig, Lisp_Object stuff) +shut_down_emacs (int sig, Lisp_Object stuff, int no_auto_save) { /* This function can GC */ /* Prevent running of hooks and other non-essential stuff from now on. */ preparing_for_armageddon = 1; - /* In case frames or windows are screwed up, avoid assertion - failures here */ - Vinhibit_quit = Qt; + ensure_no_quitting_from_now_on (); #ifdef QUANTIFY quantify_stop_recording_data (); #endif /* QUANTIFY */ -#if 0 /* This is absolutely the most important thing to do, so make sure we do it now, before anything else. We might have crashed and be in a weird inconsistent state, and potentially anything could set off another protection fault and cause us to bail out immediately. */ - /* I'm not removing the code entirely, yet. We have run up against + /* Steve writes the following: + + [[I'm not removing the code entirely, yet. We have run up against a spate of problems in diagnosing crashes due to crashes within crashes. It has very definitely been determined that code called during auto-saving cannot work if XEmacs crashed inside of GC. We already auto-save on an itimer so there cannot be too much unsaved stuff around, and if we get better crash reports we might - be able to get more problems fixed so I'm disabling this. -slb */ - Fdo_auto_save (Qt, Qnil); /* do this before anything hazardous */ -#endif + be able to get more problems fixed so I'm disabling this. -slb]] + + and DISABLES AUTO-SAVING ENTIRELY during crashes! Way way bad idea. + + Instead let's just be more intelligent about avoiding crashing + when possible, esp. nested crashes. + */ + if (!no_auto_save) + Fdo_auto_save (Qt, Qnil); /* do this before anything hazardous */ fflush (stdout); reset_all_consoles (); if (sig && sig != SIGTERM) { - stderr_out ("\nFatal error (%d).\n", sig); + if (sig == -1) + stderr_out ("\nFatal error.\n\n"); + else + 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" @@ -2472,6 +2834,7 @@ #endif "*MAKE SURE* to include the information in the command\n" "M-x describe-installation.\n" +#ifndef _MSC_VER "\n" "If at all possible, *please* try to obtain a C stack backtrace;\n" "it will help us immensely in determining what went wrong.\n" @@ -2480,9 +2843,12 @@ "directory in which you started the editor, or maybe in your home\n" "directory), and type\n" "\n" - " gdb "); + " gdb " +#endif + ); +#ifndef _MSC_VER { - CONST char *name; + const char *name; char *dir = 0; /* Now try to determine the actual path to the executable, @@ -2507,6 +2873,7 @@ "(If you don't have GDB on your system, you might have DBX,\n" "or XDB, or SDB. A similar procedure should work for all of\n" "these. Ask your system administrator if you need more help.)\n"); +#endif /* _MSC_VER */ } stuff_buffered_input (stuff); @@ -2534,45 +2901,6 @@ extern char my_edata[]; #endif -#ifdef HAVE_SHM - -DEFUN ("dump-emacs-data", Fdump_emacs_data, 1, 1, 0, /* -Dump current state of XEmacs into data file FILENAME. -This function exists on systems that use HAVE_SHM. -*/ - (intoname)) -{ - /* This function can GC */ - int opurify; - struct gcpro gcpro1; - GCPRO1 (intoname); - - CHECK_STRING (intoname); - intoname = Fexpand_file_name (intoname, Qnil); - - opurify = purify_flag; - purify_flag = 0; - - fflush (stderr); - fflush (stdout); - - disksave_object_finalization (); - release_breathing_space (); - - /* Tell malloc where start of impure now is */ - /* Also arrange for warnings when nearly out of space. */ -#ifndef SYSTEM_MALLOC - memory_warnings (my_edata, malloc_warning); -#endif - UNGCPRO; - map_out_data (XSTRING_DATA (intoname)); - - purify_flag = opurify; - - return Qnil; -} - -#else /* not HAVE_SHM */ extern void disable_free_hook (void); DEFUN ("dump-emacs", Fdump_emacs, 2, 2, 0, /* @@ -2613,7 +2941,7 @@ opurify = purify_flag; purify_flag = 0; -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) report_sheap_usage (1); #endif @@ -2633,30 +2961,14 @@ UNGCPRO; -#if defined (MSDOS) && defined (EMX) - { - int fd = open ((char *) XSTRING_DATA (intoname), - O_WRONLY|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE); - if (!fd) { - error ("Failure operating on %s", XSTRING_DATA (intoname)); - } else { - _core (fd); - close (fd); - } - } -#else /* not MSDOS and EMX */ { char *intoname_ext; char *symname_ext; - TO_EXTERNAL_FORMAT (LISP_STRING, intoname, - C_STRING_ALLOCA, intoname_ext, - Qfile_name); + LISP_STRING_TO_EXTERNAL (intoname, intoname_ext, Qfile_name); if (STRINGP (symname)) - TO_EXTERNAL_FORMAT (LISP_STRING, symname, - C_STRING_ALLOCA, symname_ext, - Qfile_name); + LISP_STRING_TO_EXTERNAL (symname, symname_ext, Qfile_name); else symname_ext = 0; @@ -2681,33 +2993,27 @@ #endif #endif /* not PDUMP */ } -#endif /* not MSDOS and EMX */ purify_flag = opurify; return Qnil; } -#endif /* not HAVE_SHM */ - #endif /* not CANNOT_DUMP */ -#ifndef SEPCHAR -#define SEPCHAR ':' -#endif /* Split STRING into a list of substrings. The substrings are the parts of original STRING separated by SEPCHAR. */ static Lisp_Object -split_string_by_emchar_1 (CONST Bufbyte *string, Bytecount size, +split_string_by_emchar_1 (const Bufbyte *string, Bytecount size, Emchar sepchar) { Lisp_Object result = Qnil; - CONST Bufbyte *end = string + size; + const Bufbyte *end = string + size; while (1) { - CONST Bufbyte *p = string; + const Bufbyte *p = string; while (p < end) { if (charptr_emchar (p) == sepchar) @@ -2730,7 +3036,7 @@ converted using Qfile_name), and sepchar is hardcoded to SEPCHAR (':' or whatever). */ Lisp_Object -decode_path (CONST char *path) +decode_path (const char *path) { Bytecount newlen; Bufbyte *newpath; @@ -2750,9 +3056,9 @@ } Lisp_Object -decode_env_path (CONST char *evarname, CONST char *default_) +decode_env_path (const char *evarname, const char *default_) { - CONST char *path = 0; + const char *path = 0; if (evarname) path = egetenv (evarname); if (!path) @@ -2814,17 +3120,75 @@ #ifdef USE_ASSERTIONS /* This highly dubious kludge ... shut up Jamie, I'm tired of your slagging. */ -DOESNT_RETURN -assert_failed (CONST char *file, int line, CONST char *expr) +static int in_assert_failed; +static const char *assert_failed_file; +static int assert_failed_line; +static const char *assert_failed_expr; + +#ifdef fprintf +#undef fprintf +#endif + +#undef abort /* avoid infinite #define loop... */ + +#if defined (WIN32_NATIVE) && defined (DEBUG_XEMACS) +#define enter_debugger() DebugBreak () +#else +#define enter_debugger() +#endif + +void +assert_failed (const char *file, int line, const char *expr) { - stderr_out ("Fatal error: assertion failed, file %s, line %d, %s\n", - file, line, expr); -#undef abort /* avoid infinite #define loop... */ -#if defined (WINDOWSNT) && defined (DEBUG_XEMACS) - DebugBreak (); -#elif !defined (ASSERTIONS_DONT_ABORT) + /* If we're already crashing, let's not crash again. This might be + critical to getting auto-saving working properly. */ + if (fatal_error_in_progress) + return; + + /* We are extremely paranoid so we sensibly deal with recursive + assertion failures. */ + in_assert_failed++; + + if (in_assert_failed >= 4) + _exit (-1); + else if (in_assert_failed == 3) + { + enter_debugger (); + _exit (-1); + } + else if (in_assert_failed == 2) + { + /* Not stderr_out(), which does additional things and may trigger + a recursive assertion failure. fprintf was undeffed above, in + case it was encapsulated. */ + fprintf (stderr, + "Fatal error: recursive assertion failure, " + "file %s, line %d, %s\n", + file, line, expr); + fprintf (stderr, + "Original assertion failure: file %s, line %d, %s\n", + assert_failed_file, assert_failed_line, assert_failed_expr); + } + else + { + assert_failed_file = file; + assert_failed_line = line; + assert_failed_expr = expr; + + if (!initialized) + fprintf (stderr, + "Fatal error: assertion failed, file %s, line %d, %s\n", + file, line, expr); + else + stderr_out ("Fatal error: assertion failed, file %s, line %d, %s\n", + file, line, expr); + } + + enter_debugger (); +#if !defined (ASSERTIONS_DONT_ABORT) abort (); #endif + in_assert_failed = 0; } #endif /* USE_ASSERTIONS */ @@ -2863,11 +3227,7 @@ syms_of_emacs (void) { #ifndef CANNOT_DUMP -#ifdef HAVE_SHM - DEFSUBR (Fdump_emacs_data); -#else DEFSUBR (Fdump_emacs); -#endif #endif /* !CANNOT_DUMP */ DEFSUBR (Frun_emacs_from_temacs); @@ -3014,6 +3374,11 @@ #endif Vxemacs_codename = build_string (XEMACS_CODENAME); + /* Lisp variables which contain command line flags. + + The portable dumper stomps on these; they must be saved and restored + if they are processed before the call to pdump_load() in main_1(). + */ DEFVAR_BOOL ("noninteractive", &noninteractive1 /* Non-nil means XEmacs is running without interactive terminal. */ ); @@ -3064,6 +3429,8 @@ malloc - check operation of malloc; gc - check garbage collection; bufpos - check buffer positions. + +quick-build - user has requested the "quick-build" configure option. */ ); Vinternal_error_checking = Qnil; #ifdef ERROR_CHECK_EXTENTS @@ -3086,6 +3453,10 @@ Vinternal_error_checking = Fcons (intern ("bufpos"), Vinternal_error_checking); #endif +#ifdef QUICK_BUILD + Vinternal_error_checking = Fcons (intern ("quick-build"), + Vinternal_error_checking); +#endif DEFVAR_CONST_LISP ("mail-lock-methods", &Vmail_lock_methods /* Mail spool locking methods supported by this instance of XEmacs. @@ -3108,7 +3479,7 @@ Vmail_lock_methods = Fcons (intern ("locking"), Vmail_lock_methods); #endif } - + DEFVAR_CONST_LISP ("configure-mail-lock-method", &Vconfigure_mail_lock_method /* Mail spool locking method suggested by configure. This is one of the symbols in MAIL-LOCK-METHODS. @@ -3224,7 +3595,8 @@ *Directory of architecture-independent files that come with XEmacs, intended for XEmacs to use. Use of this variable in new code is almost never correct. See the -function `locate-data-directory' and the variable `data-directory-list'. +functions `locate-data-file' and `locate-data-directory' and the variable +`data-directory-list'. */ ); Vdata_directory = Qnil; @@ -3245,19 +3617,6 @@ */ ); Vdata_directory_list = Qnil; -#ifdef CLASH_DETECTION - DEFVAR_LISP ("configure-lock-directory", &Vconfigure_lock_directory /* -For internal use by the build procedure only. -configure's idea of what LOCK-DIRECTORY will be. -*/ ); -#ifdef PATH_LOCK - Vconfigure_lock_directory = Ffile_name_as_directory - (build_string ((char *) PATH_LOCK)); -#else - Vconfigure_lock_directory = Qnil; -#endif -#endif /* CLASH_DETECTION */ - DEFVAR_LISP ("site-directory", &Vsite_directory /* *Directory of site-specific Lisp files that come with XEmacs. */ ); @@ -3355,7 +3714,7 @@ #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 maskerading as libz, and + * libiflPNG.so library which is masquerading as libz, and * cores on us when re-started from the dumped executable. * This will have to go for 21.1 -- OG. */ diff -r 72a7cfa4a488 -r abe6d1db359e src/emodules.c --- a/src/emodules.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/emodules.c Mon Aug 13 11:35:02 2007 +0200 @@ -49,7 +49,7 @@ static emodules_list *modules; static int modnum; -static int find_make_module (CONST char *mod, CONST char *name, CONST char *ver, int make_or_find); +static int find_make_module (const char *mod, const char *name, const char *ver, int make_or_find); static Lisp_Object module_load_unwind (Lisp_Object); static void attempt_module_delete (int mod); @@ -73,7 +73,7 @@ return value of the function `list-modules'. It is possible, although unwise, to unload modules using `unload-module'. -The prefered mechanism for unloading or reloading modules is to quit +The preferred mechanism for unloading or reloading modules is to quit XEmacs, and then reload those new or changed modules that are required. Messages informing you of the progress of the load are displayed unless @@ -114,7 +114,7 @@ As with load-module, this function requires at least the module FILE, and optionally the module NAME and VERSION to unload. It may not be possible for the module to be unloaded from memory, as there may be Lisp objects -refering to variables inside the module code. However, once you have +referring to variables inside the module code. However, once you have requested a module to be unloaded, it will be unloaded from memory as soon as the last reference to symbols within the module is destroyed. */ @@ -184,7 +184,7 @@ } static int -find_make_module (CONST char *mod, CONST char *name, CONST char *ver, int mof) +find_make_module (const char *mod, const char *name, const char *ver, int mof) { int i, fs = -1; @@ -209,7 +209,7 @@ return fs; /* First free slot */ /* - * We only get here if we havent found a free slot and the module was + * We only get here if we haven't found a free slot and the module was * not previously loaded. */ if (modules == (emodules_list *)0) @@ -278,7 +278,7 @@ * Do the actual grunt-work of loading in a module. We first try and * dlopen() the module. If that fails, we have an error and we bail * out immediately. If the dlopen() succeeds, we need to check for the - * existance of certain special symbols. + * existence of certain special symbols. * * All modules will have complete access to the variables and functions * defined within XEmacs itself. It is up to the module to declare any @@ -288,30 +288,30 @@ * * We need to be very careful with how we load modules. If we encounter an * error along the way, we need to back out completely to the point at - * which the user started. Since we can be called resursively, we need to + * which the user started. Since we can be called recursively, we need to * take care with marking modules as loaded. When we first start loading * modules, we set the counter to zero. As we enter the function each time, - * we incremement the counter, and before we leave we decrement it. When + * we increment the counter, and before we leave we decrement it. When * we get back down to 0, we know we are at the end of the chain and we * can mark all the modules in the list as loaded. * * When we signal an error, we need to be sure to unwind all modules loaded * thus far (but only for this module chain). It is assumed that if any * modules in a chain fail, then they all do. This is logical, considering - * that the only time we recurse is when we have dependant modules. So in + * that the only time we recurse is when we have dependent modules. So in * the error handler we take great care to close off the module chain before * we call "error" and let the Fmodule_load unwind_protect() function handle * the cleaning up. */ void -emodules_load(CONST char *module, CONST char *modname, CONST char *modver) +emodules_load(const char *module, const char *modname, const char *modver) { Lisp_Object filename; Lisp_Object foundname; int fd, x, mpx; char *soname, *tmod; - CONST char **f; - CONST long *ellcc_rev; + const char **f; + const long *ellcc_rev; char *mver, *mname, *mtitle, *symname; void (*modload)(void) = 0; void (*modsyms)(void) = 0; @@ -326,7 +326,7 @@ emodules_depth++; dlhandle = 0; - if ((module == (CONST char *)0) || (module[0] == '\0')) + if ((module == (const char *)0) || (module[0] == '\0')) error ("Empty module name"); /* This is to get around the fact that build_string() is not declared @@ -350,15 +350,15 @@ if (dlhandle == (dll_handle)0) error ("Opening dynamic module: %s", dll_error (dlhandle)); - ellcc_rev = (CONST long *)dll_variable (dlhandle, "emodule_compiler"); - if ((ellcc_rev == (CONST long *)0) || (*ellcc_rev <= 0)) + ellcc_rev = (const long *)dll_variable (dlhandle, "emodule_compiler"); + if ((ellcc_rev == (const long *)0) || (*ellcc_rev <= 0)) error ("Missing symbol `emodule_compiler': Invalid dynamic module"); if (*ellcc_rev > EMODULES_REVISION) error ("Unsupported version `%ld(%ld)': Invalid dynamic module", *ellcc_rev, EMODULES_REVISION); - f = (CONST char **)dll_variable (dlhandle, "emodule_name"); - if ((f == (CONST char **)0) || (*f == (CONST char *)0)) + f = (const char **)dll_variable (dlhandle, "emodule_name"); + if ((f == (const char **)0) || (*f == (const char *)0)) error ("Missing symbol `emodule_name': Invalid dynamic module"); mname = (char *)alloca (strlen (*f) + 1); @@ -366,15 +366,15 @@ if (mname[0] == '\0') error ("Empty value for `emodule_name': Invalid dynamic module"); - f = (CONST char **)dll_variable (dlhandle, "emodule_version"); - if ((f == (CONST char **)0) || (*f == (CONST char *)0)) + f = (const char **)dll_variable (dlhandle, "emodule_version"); + if ((f == (const char **)0) || (*f == (const char *)0)) error ("Missing symbol `emodule_version': Invalid dynamic module"); mver = (char *)alloca (strlen (*f) + 1); strcpy (mver, *f); - f = (CONST char **)dll_variable (dlhandle, "emodule_title"); - if ((f == (CONST char **)0) || (*f == (CONST char *)0)) + f = (const char **)dll_variable (dlhandle, "emodule_title"); + if ((f == (const char **)0) || (*f == (const char *)0)) error ("Missing symbol `emodule_title': Invalid dynamic module"); mtitle = (char *)alloca (strlen (*f) + 1); @@ -386,7 +386,7 @@ strcat (symname, mname); modload = (void (*)(void))dll_function (dlhandle, symname); /* - * modload is optional. If the module doesnt require other modules it can + * modload is optional. If the module doesn't require other modules it can * be left out. */ @@ -418,7 +418,7 @@ * Attempt to make a new slot for this module. If this really is the * first time we are loading this module, the used member will be 0. * If that is non-zero, we know that we have a previously loaded module - * of the same name and version, and we dont need to go any further. + * of the same name and version, and we don't need to go any further. */ mpx = find_make_module (soname, mname, mver, 0); mp = &modules[mpx]; @@ -478,10 +478,10 @@ } void -emodules_doc_subr(CONST char *symname, CONST char *doc) +emodules_doc_subr(const char *symname, const char *doc) { Bytecount len = strlen (symname); - Lisp_Object sym = oblookup (Vobarray, (CONST Bufbyte *)symname, len); + Lisp_Object sym = oblookup (Vobarray, (const Bufbyte *)symname, len); Lisp_Subr *subr; if (SYMBOLP(sym)) @@ -498,10 +498,10 @@ } void -emodules_doc_sym (CONST char *symname, CONST char *doc) +emodules_doc_sym (const char *symname, const char *doc) { Bytecount len = strlen (symname); - Lisp_Object sym = oblookup (Vobarray, (CONST Bufbyte *)symname, len); + Lisp_Object sym = oblookup (Vobarray, (const Bufbyte *)symname, len); Lisp_Object docstr; struct gcpro gcpro1; @@ -543,7 +543,7 @@ This string is in the form XX.YY.ppp, where XX is the major version number, YY is the minor version number, and ppp is the patch level. -This variable can be used to distinquish between different versions of +This variable can be used to distinguish between different versions of the dynamic loading technology used in Emacs, if required. It is not a given that this value will be the same as the Emacs version number. */ ); @@ -564,7 +564,7 @@ Each element is a string (directory name) or nil (try default directory). Note that elements of this list *may not* begin with "~", so you must -call `expland-file-name' on them before adding them to this list. +call `expand-file-name' on them before adding them to this list. Initialized based on EMACSMODULEPATH environment variable, if any, otherwise to default specified the file `paths.h' when XEmacs was built. If there @@ -573,8 +573,8 @@ directory in which the XEmacs executable resides. Due to the nature of dynamic modules, the path names should almost always -refer to architecture-dependant directories. It is unwise to attempt to -store dynamic modules in a hetrogenous environment. Some environments +refer to architecture-dependent directories. It is unwise to attempt to +store dynamic modules in a heterogenous environment. Some environments are similar enough to each other that XEmacs will be unable to determine the correctness of a dynamic module, which can have unpredictable results when a dynamic module is loaded. diff -r 72a7cfa4a488 -r abe6d1db359e src/emodules.h --- a/src/emodules.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/emodules.h Mon Aug 13 11:35:02 2007 +0200 @@ -60,23 +60,23 @@ * second is the name of the module, and the third is the module version. * If the module name is NULL, we will always reload the .so. If it is not * NULL, we check to make sure we haven't loaded it before. If the version - * is specified, we check to make sure we didnt load the module of the + * is specified, we check to make sure we didn't load the module of the * specified version before. We also use these as checks when we open the * module to make sure we have the right module. */ -extern void emodules_load (CONST char *module, CONST char *name, CONST char *version); +extern void emodules_load (const char *module, const char *name, const char *version); /* * Because subrs and symbols added by a dynamic module are not part of * the make-docfile process, we need a clean way to get the variables - * and functions documented. Since people dont like the idea of making + * and functions documented. Since people don't like the idea of making * shared modules use different versions of DEFSUBR() and DEFVAR_LISP() * and friends, we need these two functions to insert the documentation * into the right place. These functions will be called by the module * init code, generated by ellcc during initialization mode. */ -extern void emodules_doc_subr (CONST char *objname, CONST char *docstr); -extern void emodules_doc_sym (CONST char *objname, CONST char *docstr); +extern void emodules_doc_subr (const char *objname, const char *docstr); +extern void emodules_doc_sym (const char *objname, const char *docstr); #define CDOCSUBR(Fname, DOC) emodules_doc_subr (Fname, DOC) #define CDOCSYM(Sname, DOC) emodules_doc_sym (Sname, DOC) diff -r 72a7cfa4a488 -r abe6d1db359e src/eval.c --- a/src/eval.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/eval.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +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 Ben Wing. This file is part of XEmacs. @@ -143,10 +144,6 @@ /* Special catch tag used in call_with_suspended_errors(). */ Lisp_Object Qunbound_suspended_errors_tag; -/* Non-nil means we're going down, so we better not run any hooks - or do other non-essential stuff. */ -int preparing_for_armageddon; - /* Non-nil means record all fset's and provide's, to be undone if the file being autoloaded is not fully loaded. They are recorded by being consed onto the front of Vautoload_queue: @@ -267,10 +264,16 @@ static Lisp_Object Vcondition_handlers; -#if 0 /* no longer used */ +#define DEFEND_AGAINST_THROW_RECURSION + +#ifdef DEFEND_AGAINST_THROW_RECURSION /* Used for error catching purposes by throw_or_bomb_out */ static int throw_level; -#endif /* unused */ +#endif + +#ifdef ERROR_CHECK_TYPECHECK +void check_error_state_sanity (void); +#endif /************************************************************************/ @@ -281,10 +284,10 @@ print_subr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { Lisp_Subr *subr = XSUBR (obj); - CONST char *header = + const char *header = (subr->max_args == UNEVALLED) ? "#prompt ? " (interactive)>" : ">"; + const char *name = subr_name (subr); + const char *trailer = subr->prompt ? " (interactive)>" : ">"; if (print_readably) error ("printing unreadable object %s%s%s", header, name, trailer); @@ -300,7 +303,7 @@ }; DEFINE_BASIC_LRECORD_IMPLEMENTATION ("subr", subr, - this_one_is_unmarkable, print_subr, 0, 0, 0, + 0, print_subr, 0, 0, 0, subr_description, Lisp_Subr); @@ -559,10 +562,13 @@ specbind (Qdebug_on_signal, Qnil); specbind (Qstack_trace_on_signal, Qnil); - internal_with_output_to_temp_buffer (build_string ("*Backtrace*"), - backtrace_259, - Qnil, - Qnil); + if (!noninteractive) + internal_with_output_to_temp_buffer (build_string ("*Backtrace*"), + backtrace_259, + Qnil, + Qnil); + else /* in batch mode, we want this going to stderr. */ + backtrace_259 (Qnil); unbind_to (speccount, Qnil); *stack_trace_displayed = 1; } @@ -591,10 +597,13 @@ specbind (Qdebug_on_signal, Qnil); specbind (Qstack_trace_on_signal, Qnil); - internal_with_output_to_temp_buffer (build_string ("*Backtrace*"), - backtrace_259, - Qnil, - Qnil); + if (!noninteractive) + internal_with_output_to_temp_buffer (build_string ("*Backtrace*"), + backtrace_259, + Qnil, + Qnil); + else /* in batch mode, we want this going to stderr. */ + backtrace_259 (Qnil); unbind_to (speccount, Qnil); *stack_trace_displayed = 1; } @@ -635,7 +644,7 @@ (args)) { /* This function can GC */ - REGISTER Lisp_Object arg, val; + REGISTER Lisp_Object val; LIST_LOOP_2 (arg, args) { @@ -654,7 +663,7 @@ (args)) { /* This function can GC */ - REGISTER Lisp_Object arg, val = Qt; + REGISTER Lisp_Object val = Qt; LIST_LOOP_2 (arg, args) { @@ -730,7 +739,7 @@ (args)) { /* This function can GC */ - REGISTER Lisp_Object val, clause; + REGISTER Lisp_Object val; LIST_LOOP_2 (clause, args) { @@ -756,7 +765,7 @@ { /* This function can GC */ /* Caller must provide a true list in ARGS */ - REGISTER Lisp_Object form, val = Qnil; + REGISTER Lisp_Object val = Qnil; struct gcpro gcpro1; GCPRO1 (args); @@ -782,7 +791,7 @@ (args)) { /* This function can GC */ - REGISTER Lisp_Object val, form; + REGISTER Lisp_Object val; struct gcpro gcpro1; val = Feval (XCAR (args)); @@ -807,7 +816,7 @@ (args)) { /* This function can GC */ - REGISTER Lisp_Object val, form, tail; + REGISTER Lisp_Object val; struct gcpro gcpro1; Feval (XCAR (args)); @@ -817,8 +826,10 @@ GCPRO1 (val); - LIST_LOOP_3 (form, args, tail) - Feval (form); + { + LIST_LOOP_2 (form, args) + Feval (form); + } UNGCPRO; return val; @@ -834,7 +845,6 @@ (args)) { /* This function can GC */ - Lisp_Object var, tail; Lisp_Object varlist = XCAR (args); Lisp_Object body = XCDR (args); int speccount = specpdl_depth(); @@ -875,7 +885,6 @@ (args)) { /* This function can GC */ - Lisp_Object var, tail; Lisp_Object varlist = XCAR (args); Lisp_Object body = XCDR (args); int speccount = specpdl_depth(); @@ -895,36 +904,40 @@ gcpro1.nvars = 0; idx = 0; - LIST_LOOP_3 (var, varlist, tail) - { - Lisp_Object *value = &temps[idx++]; - if (SYMBOLP (var)) - *value = Qnil; - else - { - Lisp_Object tem; - CHECK_CONS (var); - tem = XCDR (var); - if (NILP (tem)) - *value = Qnil; - else - { - CHECK_CONS (tem); - *value = Feval (XCAR (tem)); - gcpro1.nvars = idx; - - if (!NILP (XCDR (tem))) - signal_simple_error - ("`let' bindings can have only one value-form", var); - } - } - } + { + LIST_LOOP_2 (var, varlist) + { + Lisp_Object *value = &temps[idx++]; + if (SYMBOLP (var)) + *value = Qnil; + else + { + Lisp_Object tem; + CHECK_CONS (var); + tem = XCDR (var); + if (NILP (tem)) + *value = Qnil; + else + { + CHECK_CONS (tem); + *value = Feval (XCAR (tem)); + gcpro1.nvars = idx; + + if (!NILP (XCDR (tem))) + signal_simple_error + ("`let' bindings can have only one value-form", var); + } + } + } + } idx = 0; - LIST_LOOP_3 (var, varlist, tail) - { - specbind (SYMBOLP (var) ? var : XCAR (var), temps[idx++]); - } + { + LIST_LOOP_2 (var, varlist) + { + specbind (SYMBOLP (var) ? var : XCAR (var), temps[idx++]); + } + } UNGCPRO; @@ -1055,7 +1068,7 @@ buffer-local values are not affected. INITVALUE and DOCSTRING are optional. If DOCSTRING starts with *, this variable is identified as a user option. - This means that M-x set-variable and M-x edit-options recognize it. + This means that M-x set-variable recognizes it. If INITVALUE is missing, SYMBOL's value is not set. In lisp-interaction-mode defvar is treated as defconst. @@ -1105,7 +1118,7 @@ buffer-local values are not affected. DOCSTRING is optional. If DOCSTRING starts with *, this variable is identified as a user option. - This means that M-x set-variable and M-x edit-options recognize it. + This means that M-x set-variable recognizes it. Note: do not use `defconst' for user options in libraries that are not normally loaded, since it is useful for users to be able to specify @@ -1173,10 +1186,10 @@ Otherwise, the macro is expanded and the expansion is considered in place of FORM. When a non-macro-call results, it is returned. -The second optional arg ENVIRONMENT species an environment of macro +The second optional arg ENVIRONMENT specifies an environment of macro definitions to shadow the loaded ones for use in file byte-compilation. */ - (form, env)) + (form, environment)) { /* This function can GC */ /* With cleanups from Hallvard Furuseth. */ @@ -1197,7 +1210,7 @@ { QUIT; sym = def; - tem = Fassq (sym, env); + tem = Fassq (sym, environment); if (NILP (tem)) { def = XSYMBOL (sym)->function; @@ -1206,11 +1219,11 @@ } break; } - /* Right now TEM is the result from SYM in ENV, + /* Right now TEM is the result from SYM in ENVIRONMENT, and if TEM is nil then DEF is SYM's function definition. */ if (NILP (tem)) { - /* SYM is not mentioned in ENV. + /* SYM is not mentioned in ENVIRONMENT. Look at its function definition. */ if (UNBOUNDP (def) || !CONSP (def)) @@ -1304,6 +1317,9 @@ c.val = (*func) (arg); if (threw) *threw = 0; catchlist = c.next; +#ifdef ERROR_CHECK_TYPECHECK + check_error_state_sanity (); +#endif return c.val; } @@ -1360,19 +1376,25 @@ unbind_to (catchlist->pdlcount, Qnil); handlerlist = catchlist->handlerlist; catchlist = catchlist->next; +#ifdef ERROR_CHECK_TYPECHECK + check_error_state_sanity (); +#endif } while (! last_time); #else /* Actual XEmacs code */ /* Unwind the specpdl stack */ unbind_to (c->pdlcount, Qnil); catchlist = c->next; +#ifdef ERROR_CHECK_TYPECHECK + check_error_state_sanity (); +#endif #endif gcprolist = c->gcpro; backtrace_list = c->backlist; lisp_eval_depth = c->lisp_eval_depth; -#if 0 /* no longer used */ +#ifdef DEFEND_AGAINST_THROW_RECURSION throw_level = 0; #endif LONGJMP (c->jmp, 1); @@ -1382,7 +1404,7 @@ throw_or_bomb_out (Lisp_Object tag, Lisp_Object val, int bomb_out_p, Lisp_Object sig, Lisp_Object data) { -#if 0 +#ifdef DEFEND_AGAINST_THROW_RECURSION /* die if we recurse more than is reasonable */ if (++throw_level > 20) abort(); @@ -1635,6 +1657,9 @@ have this code here, and it doesn't cost anything, so I'm leaving it.*/ UNGCPRO; catchlist = c.next; +#ifdef ERROR_CHECK_TYPECHECK + check_error_state_sanity (); +#endif Vcondition_handlers = XCDR (c.tag); return unbind_to (speccount, c.val); @@ -1675,8 +1700,6 @@ condition_case_3 (Lisp_Object bodyform, Lisp_Object var, Lisp_Object handlers) { /* This function can GC */ - Lisp_Object handler; - EXTERNAL_LIST_LOOP_2 (handler, handlers) { if (NILP (handler)) @@ -1689,7 +1712,6 @@ ; else { - Lisp_Object condition; EXTERNAL_LIST_LOOP_2 (condition, conditions) if (!SYMBOLP (condition)) goto invalid_condition_handler; @@ -1851,6 +1873,8 @@ { /* who knows how much has been initialized? Safest bet is just to bomb out immediately. */ + /* let's not use stderr_out() here, because that does a bunch of + things that might not be safe yet. */ fprintf (stderr, "Error before initialization is complete!\n"); abort (); } @@ -2036,16 +2060,25 @@ for (;;) Fsignal (sig, data); } - -static Lisp_Object -call_with_suspended_errors_1 (Lisp_Object opaque_arg) -{ - Lisp_Object val; - Lisp_Object *kludgy_args = (Lisp_Object *) get_opaque_ptr (opaque_arg); - PRIMITIVE_FUNCALL (val, get_opaque_ptr (kludgy_args[0]), - kludgy_args + 2, XINT (kludgy_args[1])); - return val; -} +#ifdef ERROR_CHECK_TYPECHECK +void +check_error_state_sanity (void) +{ + struct catchtag *c; + int found_error_tag = 0; + + for (c = catchlist; c; c = c->next) + { + if (EQ (c->tag, Qunbound_suspended_errors_tag)) + { + found_error_tag = 1; + break; + } + } + + assert (found_error_tag || NILP (Vcurrent_error_state)); +} +#endif static Lisp_Object restore_current_warning_class (Lisp_Object warning_class) @@ -2061,6 +2094,25 @@ return Qnil; } +static Lisp_Object +call_with_suspended_errors_1 (Lisp_Object opaque_arg) +{ + Lisp_Object val; + Lisp_Object *kludgy_args = (Lisp_Object *) get_opaque_ptr (opaque_arg); + Lisp_Object no_error = kludgy_args[2]; + int speccount = specpdl_depth (); + + if (!EQ (Vcurrent_error_state, no_error)) + { + record_unwind_protect (restore_current_error_state, + Vcurrent_error_state); + Vcurrent_error_state = no_error; + } + PRIMITIVE_FUNCALL (val, get_opaque_ptr (kludgy_args[0]), + kludgy_args + 3, XINT (kludgy_args[1])); + return unbind_to (speccount, val); +} + /* Many functions would like to do one of three things if an error occurs: @@ -2083,8 +2135,8 @@ { va_list vargs; int speccount; - Lisp_Object kludgy_args[22]; - Lisp_Object *args = kludgy_args + 2; + Lisp_Object kludgy_args[23]; + Lisp_Object *args = kludgy_args + 3; int i; Lisp_Object no_error; @@ -2126,7 +2178,7 @@ return val; } - speccount = specpdl_depth(); + speccount = specpdl_depth (); if (NILP (class) || NILP (Vcurrent_warning_class)) { /* If we're currently calling for no warnings, then make it so. @@ -2137,12 +2189,6 @@ Vcurrent_warning_class); Vcurrent_warning_class = class; } - if (!EQ (Vcurrent_error_state, no_error)) - { - record_unwind_protect (restore_current_error_state, - Vcurrent_error_state); - Vcurrent_error_state = no_error; - } { int threw; @@ -2154,6 +2200,7 @@ GCPRO2 (opaque1, opaque2); kludgy_args[0] = opaque2; kludgy_args[1] = make_int (nargs); + kludgy_args[2] = no_error; the_retval = internal_catch (Qunbound_suspended_errors_tag, call_with_suspended_errors_1, opaque1, &threw); @@ -2208,28 +2255,158 @@ /****************** Error functions class 2 ******************/ /* Class 2: Printf-like functions that signal an error. - These functions signal an error of type Qerror, whose data + These functions signal an error of a specified type, whose data is a single string, created using the arguments. */ /* dump an error message; called like printf */ DOESNT_RETURN -error (CONST char *fmt, ...) +type_error (Lisp_Object type, const char *fmt, ...) +{ + Lisp_Object obj; + va_list args; + + va_start (args, fmt); + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, + args); + va_end (args); + + /* Fsignal GC-protects its args */ + signal_error (type, list1 (obj)); +} + +void +maybe_type_error (Lisp_Object type, Lisp_Object class, Error_behavior errb, + const char *fmt, ...) +{ + Lisp_Object obj; + va_list args; + + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return; + + va_start (args, fmt); + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, + args); + va_end (args); + + /* Fsignal GC-protects its args */ + maybe_signal_error (type, list1 (obj), class, errb); +} + +Lisp_Object +continuable_type_error (Lisp_Object type, const char *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (fmt), Qnil, -1, + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, + args); + va_end (args); + + /* Fsignal GC-protects its args */ + return Fsignal (type, list1 (obj)); +} + +Lisp_Object +maybe_continuable_type_error (Lisp_Object type, Lisp_Object class, + Error_behavior errb, const char *fmt, ...) +{ + Lisp_Object obj; + va_list args; + + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return Qnil; + + va_start (args, fmt); + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, args); va_end (args); /* Fsignal GC-protects its args */ - signal_error (Qerror, list1 (obj)); + return maybe_signal_continuable_error (type, list1 (obj), class, errb); +} + + +/****************** Error functions class 3 ******************/ + +/* Class 3: Signal an error with a string and an associated object. + These functions signal an error of a specified type, whose data + is two objects, a string and a related Lisp object (usually the object + where the error is occurring). */ + +DOESNT_RETURN +signal_type_error (Lisp_Object type, const char *reason, Lisp_Object frob) +{ + if (UNBOUNDP (frob)) + signal_error (type, list1 (build_translated_string (reason))); + else + signal_error (type, list2 (build_translated_string (reason), frob)); } void -maybe_error (Lisp_Object class, Error_behavior errb, CONST char *fmt, ...) +maybe_signal_type_error (Lisp_Object type, const char *reason, + Lisp_Object frob, Lisp_Object class, + Error_behavior errb) +{ + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return; + maybe_signal_error (type, list2 (build_translated_string (reason), frob), + class, errb); +} + +Lisp_Object +signal_type_continuable_error (Lisp_Object type, const char *reason, + Lisp_Object frob) +{ + return Fsignal (type, list2 (build_translated_string (reason), frob)); +} + +Lisp_Object +maybe_signal_type_continuable_error (Lisp_Object type, const char *reason, + Lisp_Object frob, Lisp_Object class, + Error_behavior errb) +{ + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return Qnil; + return maybe_signal_continuable_error + (type, list2 (build_translated_string (reason), + frob), class, errb); +} + + +/****************** Error functions class 4 ******************/ + +/* Class 4: Printf-like functions that signal an error. + These functions signal an error of a specified type, whose data + is a two objects, a string (created using the arguments) and a + Lisp object. +*/ + +DOESNT_RETURN +type_error_with_frob (Lisp_Object type, Lisp_Object frob, const char *fmt, ...) +{ + Lisp_Object obj; + va_list args; + + va_start (args, fmt); + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, + args); + va_end (args); + + /* Fsignal GC-protects its args */ + signal_error (type, list2 (obj, frob)); +} + +void +maybe_type_error_with_frob (Lisp_Object type, Lisp_Object frob, + Lisp_Object class, Error_behavior errb, + const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2239,7 +2416,138 @@ return; va_start (args, fmt); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (fmt), Qnil, -1, + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, + args); + va_end (args); + + /* Fsignal GC-protects its args */ + maybe_signal_error (type, list2 (obj, frob), class, errb); +} + +Lisp_Object +continuable_type_error_with_frob (Lisp_Object type, Lisp_Object frob, + const char *fmt, ...) +{ + Lisp_Object obj; + va_list args; + + va_start (args, fmt); + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, + args); + va_end (args); + + /* Fsignal GC-protects its args */ + return Fsignal (type, list2 (obj, frob)); +} + +Lisp_Object +maybe_continuable_type_error_with_frob (Lisp_Object type, Lisp_Object frob, + Lisp_Object class, Error_behavior errb, + const char *fmt, ...) +{ + Lisp_Object obj; + va_list args; + + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return Qnil; + + va_start (args, fmt); + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, + args); + va_end (args); + + /* Fsignal GC-protects its args */ + return maybe_signal_continuable_error (type, list2 (obj, frob), + class, errb); +} + + +/****************** Error functions class 5 ******************/ + +/* Class 5: Signal an error with a string and two associated objects. + These functions signal an error of a specified type, whose data + is three objects, a string and two related Lisp objects. */ + +DOESNT_RETURN +signal_type_error_2 (Lisp_Object type, const char *reason, + Lisp_Object frob0, Lisp_Object frob1) +{ + signal_error (type, list3 (build_translated_string (reason), frob0, + frob1)); +} + +void +maybe_signal_type_error_2 (Lisp_Object type, const char *reason, + Lisp_Object frob0, Lisp_Object frob1, + Lisp_Object class, Error_behavior errb) +{ + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return; + maybe_signal_error (type, list3 (build_translated_string (reason), frob0, + frob1), class, errb); +} + + +Lisp_Object +signal_type_continuable_error_2 (Lisp_Object type, const char *reason, + Lisp_Object frob0, Lisp_Object frob1) +{ + return Fsignal (type, list3 (build_translated_string (reason), frob0, + frob1)); +} + +Lisp_Object +maybe_signal_type_continuable_error_2 (Lisp_Object type, const char *reason, + Lisp_Object frob0, Lisp_Object frob1, + Lisp_Object class, Error_behavior errb) +{ + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return Qnil; + return maybe_signal_continuable_error + (type, list3 (build_translated_string (reason), frob0, + frob1), + class, errb); +} + + +/****************** Simple error functions class 2 ******************/ + +/* Simple class 2: Printf-like functions that signal an error. + These functions signal an error of type Qerror, whose data + is a single string, created using the arguments. */ + +/* dump an error message; called like printf */ + +DOESNT_RETURN +error (const char *fmt, ...) +{ + Lisp_Object obj; + va_list args; + + va_start (args, fmt); + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, + args); + va_end (args); + + /* Fsignal GC-protects its args */ + signal_error (Qerror, list1 (obj)); +} + +void +maybe_error (Lisp_Object class, Error_behavior errb, const char *fmt, ...) +{ + Lisp_Object obj; + va_list args; + + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return; + + va_start (args, fmt); + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, args); va_end (args); @@ -2248,13 +2556,13 @@ } Lisp_Object -continuable_error (CONST char *fmt, ...) +continuable_error (const char *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (fmt), Qnil, -1, + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, args); va_end (args); @@ -2264,7 +2572,7 @@ Lisp_Object maybe_continuable_error (Lisp_Object class, Error_behavior errb, - CONST char *fmt, ...) + const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2274,7 +2582,7 @@ return Qnil; va_start (args, fmt); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (fmt), Qnil, -1, + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, args); va_end (args); @@ -2283,21 +2591,21 @@ } -/****************** Error functions class 3 ******************/ - -/* Class 3: Signal an error with a string and an associated object. +/****************** Simple error functions class 3 ******************/ + +/* Simple class 3: Signal an error with a string and an associated object. These functions signal an error of type Qerror, whose data is two objects, a string and a related Lisp object (usually the object where the error is occurring). */ DOESNT_RETURN -signal_simple_error (CONST char *reason, Lisp_Object frob) +signal_simple_error (const char *reason, Lisp_Object frob) { signal_error (Qerror, list2 (build_translated_string (reason), frob)); } void -maybe_signal_simple_error (CONST char *reason, Lisp_Object frob, +maybe_signal_simple_error (const char *reason, Lisp_Object frob, Lisp_Object class, Error_behavior errb) { /* Optimization: */ @@ -2308,13 +2616,13 @@ } Lisp_Object -signal_simple_continuable_error (CONST char *reason, Lisp_Object frob) +signal_simple_continuable_error (const char *reason, Lisp_Object frob) { return Fsignal (Qerror, list2 (build_translated_string (reason), frob)); } Lisp_Object -maybe_signal_simple_continuable_error (CONST char *reason, Lisp_Object frob, +maybe_signal_simple_continuable_error (const char *reason, Lisp_Object frob, Lisp_Object class, Error_behavior errb) { /* Optimization: */ @@ -2326,22 +2634,22 @@ } -/****************** Error functions class 4 ******************/ - -/* Class 4: Printf-like functions that signal an error. +/****************** Simple error functions class 4 ******************/ + +/* Simple class 4: Printf-like functions that signal an error. These functions signal an error of type Qerror, whose data is a two objects, a string (created using the arguments) and a Lisp object. */ DOESNT_RETURN -error_with_frob (Lisp_Object frob, CONST char *fmt, ...) +error_with_frob (Lisp_Object frob, const char *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (fmt), Qnil, -1, + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, args); va_end (args); @@ -2351,7 +2659,7 @@ void maybe_error_with_frob (Lisp_Object frob, Lisp_Object class, - Error_behavior errb, CONST char *fmt, ...) + Error_behavior errb, const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2361,7 +2669,7 @@ return; va_start (args, fmt); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (fmt), Qnil, -1, + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, args); va_end (args); @@ -2370,13 +2678,13 @@ } Lisp_Object -continuable_error_with_frob (Lisp_Object frob, CONST char *fmt, ...) +continuable_error_with_frob (Lisp_Object frob, const char *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (fmt), Qnil, -1, + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, args); va_end (args); @@ -2386,7 +2694,7 @@ Lisp_Object maybe_continuable_error_with_frob (Lisp_Object frob, Lisp_Object class, - Error_behavior errb, CONST char *fmt, ...) + Error_behavior errb, const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2396,7 +2704,7 @@ return Qnil; va_start (args, fmt); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (fmt), Qnil, -1, + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, args); va_end (args); @@ -2406,14 +2714,14 @@ } -/****************** Error functions class 5 ******************/ - -/* Class 5: Signal an error with a string and two associated objects. +/****************** Simple error functions class 5 ******************/ + +/* Simple class 5: Signal an error with a string and two associated objects. These functions signal an error of type Qerror, whose data is three objects, a string and two related Lisp objects. */ DOESNT_RETURN -signal_simple_error_2 (CONST char *reason, +signal_simple_error_2 (const char *reason, Lisp_Object frob0, Lisp_Object frob1) { signal_error (Qerror, list3 (build_translated_string (reason), frob0, @@ -2421,7 +2729,7 @@ } void -maybe_signal_simple_error_2 (CONST char *reason, Lisp_Object frob0, +maybe_signal_simple_error_2 (const char *reason, Lisp_Object frob0, Lisp_Object frob1, Lisp_Object class, Error_behavior errb) { @@ -2434,7 +2742,7 @@ Lisp_Object -signal_simple_continuable_error_2 (CONST char *reason, Lisp_Object frob0, +signal_simple_continuable_error_2 (const char *reason, Lisp_Object frob0, Lisp_Object frob1) { return Fsignal (Qerror, list3 (build_translated_string (reason), frob0, @@ -2442,7 +2750,7 @@ } Lisp_Object -maybe_signal_simple_continuable_error_2 (CONST char *reason, Lisp_Object frob0, +maybe_signal_simple_continuable_error_2 (const char *reason, Lisp_Object frob0, Lisp_Object frob1, Lisp_Object class, Error_behavior errb) { @@ -2513,6 +2821,55 @@ { signal_error (Qcircular_property_list, list1 (list)); } + +DOESNT_RETURN +syntax_error (const char *reason, Lisp_Object frob) +{ + signal_type_error (Qsyntax_error, reason, frob); +} + +DOESNT_RETURN +syntax_error_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) +{ + signal_type_error_2 (Qsyntax_error, reason, frob1, frob2); +} + +DOESNT_RETURN +invalid_argument (const char *reason, Lisp_Object frob) +{ + signal_type_error (Qinvalid_argument, reason, frob); +} + +DOESNT_RETURN +invalid_argument_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) +{ + signal_type_error_2 (Qinvalid_argument, reason, frob1, frob2); +} + +DOESNT_RETURN +invalid_operation (const char *reason, Lisp_Object frob) +{ + signal_type_error (Qinvalid_operation, reason, frob); +} + +DOESNT_RETURN +invalid_operation_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) +{ + signal_type_error_2 (Qinvalid_operation, reason, frob1, frob2); +} + +DOESNT_RETURN +invalid_change (const char *reason, Lisp_Object frob) +{ + signal_type_error (Qinvalid_change, reason, frob); +} + +DOESNT_RETURN +invalid_change_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) +{ + signal_type_error_2 (Qinvalid_change, reason, frob1, frob2); +} + /************************************************************************/ /* User commands */ @@ -2831,7 +3188,7 @@ /************************************************************************/ static Lisp_Object funcall_lambda (Lisp_Object fun, - int nargs, Lisp_Object args[]); + int nargs, Lisp_Object args[]); static int in_warnings; static Lisp_Object @@ -2957,7 +3314,6 @@ gcpro1.nvars = 0; { - REGISTER Lisp_Object arg; LIST_LOOP_2 (arg, original_args) { *p++ = Feval (arg); @@ -2987,7 +3343,6 @@ gcpro1.nvars = 0; { - REGISTER Lisp_Object arg; LIST_LOOP_2 (arg, original_args) { *p++ = Feval (arg); @@ -3019,7 +3374,6 @@ gcpro1.nvars = 0; { - REGISTER Lisp_Object arg; LIST_LOOP_2 (arg, original_args) { *p++ = Feval (arg); @@ -3064,7 +3418,6 @@ gcpro1.nvars = 0; { - REGISTER Lisp_Object arg; LIST_LOOP_2 (arg, original_args) { *p++ = Feval (arg); @@ -3276,9 +3629,11 @@ if (SUBRP (function)) { - return function_min_args_p ? - Fsubr_min_args (function): - Fsubr_max_args (function); + /* Using return with the ?: operator tickles a DEC CC compiler bug. */ + if (function_min_args_p) + return Fsubr_min_args (function); + else + return Fsubr_max_args (function); } else if (COMPILED_FUNCTIONP (function)) { @@ -3295,7 +3650,12 @@ } else if (EQ (funcar, Qautoload)) { + struct gcpro gcpro1; + + GCPRO1 (function); do_autoload (function, orig_function); + UNGCPRO; + function = orig_function; goto retry; } else if (EQ (funcar, Qlambda)) @@ -3310,12 +3670,11 @@ else { invalid_function: - return signal_invalid_function_error (function); + return signal_invalid_function_error (orig_function); } { int argcount = 0; - Lisp_Object arg; EXTERNAL_LIST_LOOP_2 (arg, arglist) { @@ -3454,7 +3813,7 @@ funcall_lambda (Lisp_Object fun, int nargs, Lisp_Object args[]) { /* This function can GC */ - Lisp_Object symbol, arglist, body, tail; + Lisp_Object arglist, body, tail; int speccount = specpdl_depth(); REGISTER int i = 0; @@ -3469,7 +3828,7 @@ { int optional = 0, rest = 0; - EXTERNAL_LIST_LOOP_3 (symbol, arglist, tail) + EXTERNAL_LIST_LOOP_2 (symbol, arglist) { if (!SYMBOLP (symbol)) goto invalid_function; @@ -4138,7 +4497,7 @@ args[1] = errordata; warn_when_safe_lispobj (Qerror, Qwarning, - emacs_doprnt_string_lisp ((CONST Bufbyte *) "%s: %s", + emacs_doprnt_string_lisp ((const Bufbyte *) "%s: %s", Qnil, -1, 2, args)); } return Qunbound; @@ -4181,7 +4540,7 @@ } Lisp_Object -eval_in_buffer_trapping_errors (CONST char *warning_string, +eval_in_buffer_trapping_errors (const char *warning_string, struct buffer *buf, Lisp_Object form) { int speccount = specpdl_depth(); @@ -4221,7 +4580,7 @@ } Lisp_Object -run_hook_trapping_errors (CONST char *warning_string, Lisp_Object hook_symbol) +run_hook_trapping_errors (const char *warning_string, Lisp_Object hook_symbol) { int speccount; Lisp_Object tem; @@ -4254,7 +4613,7 @@ if an error occurs. */ Lisp_Object -safe_run_hook_trapping_errors (CONST char *warning_string, +safe_run_hook_trapping_errors (const char *warning_string, Lisp_Object hook_symbol, int allow_quit) { @@ -4300,7 +4659,7 @@ } Lisp_Object -call0_trapping_errors (CONST char *warning_string, Lisp_Object function) +call0_trapping_errors (const char *warning_string, Lisp_Object function) { int speccount; Lisp_Object tem; @@ -4347,7 +4706,7 @@ } Lisp_Object -call1_trapping_errors (CONST char *warning_string, Lisp_Object function, +call1_trapping_errors (const char *warning_string, Lisp_Object function, Lisp_Object object) { int speccount = specpdl_depth(); @@ -4384,7 +4743,7 @@ } Lisp_Object -call2_trapping_errors (CONST char *warning_string, Lisp_Object function, +call2_trapping_errors (const char *warning_string, Lisp_Object function, Lisp_Object object1, Lisp_Object object2) { int speccount = specpdl_depth(); @@ -4598,13 +4957,13 @@ { int quitf; + ++specpdl_ptr; + ++specpdl_depth_counter; + check_quit (); /* make Vquit_flag accurate */ quitf = !NILP (Vquit_flag); Vquit_flag = Qnil; - ++specpdl_ptr; - ++specpdl_depth_counter; - while (specpdl_depth_counter != count) { --specpdl_ptr; @@ -4858,8 +5217,8 @@ Fprin1 (backlist->args[i], stream); } } + write_c_string (")\n", stream); } - write_c_string (")\n", stream); backlist = backlist->next; } } @@ -4937,13 +5296,13 @@ automatically be called when it is safe to do so. */ void -warn_when_safe (Lisp_Object class, Lisp_Object level, CONST char *fmt, ...) +warn_when_safe (Lisp_Object class, Lisp_Object level, const char *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_doprnt_string_va ((CONST Bufbyte *) GETTEXT (fmt), + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, args); va_end (args); @@ -4960,6 +5319,8 @@ void syms_of_eval (void) { + INIT_LRECORD_IMPLEMENTATION (subr); + defsymbol (&Qinhibit_quit, "inhibit-quit"); defsymbol (&Qautoload, "autoload"); defsymbol (&Qdebug_on_error, "debug-on-error"); @@ -5054,8 +5415,8 @@ specpdl = xnew_array (struct specbinding, specpdl_size); /* XEmacs change: increase these values. */ max_specpdl_size = 3000; - max_lisp_eval_depth = 500; -#if 0 /* no longer used */ + max_lisp_eval_depth = 1000; +#ifdef DEFEND_AGAINST_THROW_RECURSION throw_level = 0; #endif } diff -r 72a7cfa4a488 -r abe6d1db359e src/event-Xt.c --- a/src/event-Xt.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/event-Xt.c Mon Aug 13 11:35:02 2007 +0200 @@ -65,19 +65,8 @@ #include "offix.h" #endif -#ifdef WINDOWSNT -/* Hmm, under unix we want X modifiers, under NT we want X modifiers if - we are running X and Windows modifiers otherwise. - gak. This is a kludge until we support multiple native GUIs! -*/ -#undef MOD_ALT -#undef MOD_CONTROL -#undef MOD_SHIFT -#endif - #include "events-mod.h" -static void enqueue_Xt_dispatch_event (Lisp_Object event); static void handle_focus_event_1 (struct frame *f, int in_p); static struct event_stream *Xt_event_stream; @@ -97,10 +86,8 @@ /* Do we accept events sent by other clients? */ int x_allow_sendevents; -int modifier_keys_are_sticky; - #ifdef DEBUG_XEMACS -int x_debug_events; +int debug_x_events; #endif static int process_events_occurred; @@ -109,7 +96,7 @@ /* Mask of bits indicating the descriptors that we wait for input on */ extern SELECT_TYPE input_wait_mask, process_only_mask, tty_only_mask; -static CONST String x_fallback_resources[] = +static const String x_fallback_resources[] = { /* This file is automatically generated from the app-defaults file in ../etc/Emacs.ad. These resources are consulted only if no @@ -336,11 +323,17 @@ if (keysym < 0x80) /* Optimize for ASCII keysyms */ return; - /* If you do: xmodmap -e 'keysym NN = scaron' + + /* If you execute: + xmodmap -e 'keysym NN = scaron' and then press (Shift scaron), X11 will return the different - keysym Scaron, but xmodmap -pke might not even mention Scaron. - So we `register' both scaron and Scaron. */ + keysym `Scaron', but `xmodmap -pke' might not even mention `Scaron'. + So we "register" both `scaron' and `Scaron'. */ +#ifdef HAVE_XCONVERTCASE XConvertCase (keysym, &upper_lower[0], &upper_lower[1]); +#else + upper_lower[0] = upper_lower[1] = keysym; +#endif for (j = 0; j < (upper_lower[0] == upper_lower[1] ? 1 : 2); j++) { @@ -415,7 +408,7 @@ } } -static CONST char * +static const char * index_to_name (int indice) { switch (indice) @@ -570,7 +563,7 @@ be totally wrong. */ if (mode_bit) { - CONST char *warn = 0; + const char *warn = 0; if (mode_bit == meta_bit) warn = "Meta", meta_bit = 0; else if (mode_bit == hyper_bit) warn = "Hyper", hyper_bit = 0; else if (mode_bit == super_bit) warn = "Super", super_bit = 0; @@ -951,7 +944,11 @@ #ifdef HAVE_XIM int len; - char buffer[64]; + /* Some implementations of XmbLookupString don't return + XBufferOverflow correctly, so increase the size of the xim input + buffer from 64 to the more reasonable size 513, as Emacs has done. + From Kenichi Handa. */ + char buffer[513]; char *bufptr = buffer; int bufsiz = sizeof (buffer); Status status; @@ -989,7 +986,7 @@ #endif /* HAVE_XIM */ #ifdef DEBUG_XEMACS - if (x_debug_events > 0) + if (debug_x_events > 0) { stderr_out (" status="); #define print_status_when(S) if (status == S) stderr_out (#S) @@ -1118,7 +1115,7 @@ case ButtonPress: case ButtonRelease: { - unsigned int modifiers = 0; + int modifiers = 0; int shift_p, lock_p; Bool key_event_p = (x_event->type == KeyPress); unsigned int *state = @@ -1145,11 +1142,30 @@ x_handle_sticky_modifiers (x_event, d); - if (*state & ControlMask) modifiers |= MOD_CONTROL; - if (*state & xd->MetaMask) modifiers |= MOD_META; - if (*state & xd->SuperMask) modifiers |= MOD_SUPER; - if (*state & xd->HyperMask) modifiers |= MOD_HYPER; - if (*state & xd->AltMask) modifiers |= MOD_ALT; + if (*state & ControlMask) modifiers |= XEMACS_MOD_CONTROL; + if (*state & xd->MetaMask) modifiers |= XEMACS_MOD_META; + if (*state & xd->SuperMask) modifiers |= XEMACS_MOD_SUPER; + if (*state & xd->HyperMask) modifiers |= XEMACS_MOD_HYPER; + if (*state & xd->AltMask) modifiers |= XEMACS_MOD_ALT; + { + int numero_de_botao = -1; + + if (!key_event_p) + numero_de_botao = x_event->xbutton.button; + + /* the button gets noted either in the button or the modifiers + field, but not both. */ + if (numero_de_botao != 1 && (*state & Button1Mask)) + modifiers |= XEMACS_MOD_BUTTON1; + if (numero_de_botao != 2 && (*state & Button2Mask)) + modifiers |= XEMACS_MOD_BUTTON2; + if (numero_de_botao != 3 && (*state & Button3Mask)) + modifiers |= XEMACS_MOD_BUTTON3; + if (numero_de_botao != 4 && (*state & Button4Mask)) + modifiers |= XEMACS_MOD_BUTTON4; + if (numero_de_botao != 5 && (*state & Button5Mask)) + modifiers |= XEMACS_MOD_BUTTON5; + } /* Ignore the Caps_Lock key if: - any other modifiers are down, so that Caps_Lock doesn't @@ -1162,7 +1178,7 @@ lock_p = *state & LockMask; if (shift_p || lock_p) - modifiers |= MOD_SHIFT; + modifiers |= XEMACS_MOD_SHIFT; if (key_event_p) { @@ -1194,7 +1210,7 @@ ! (CHAR_OR_CHAR_INTP (keysym) && keysym_obeys_caps_lock_p ((KeySym) XCHAR_OR_CHAR_INT (keysym), d))) - modifiers &= (~MOD_SHIFT); + modifiers &= (~XEMACS_MOD_SHIFT); /* If this key contains two distinct keysyms, that is, "shift" generates a different keysym than the @@ -1206,13 +1222,13 @@ in the modifiers slot. Neither the characters "a", "A", "2", nor "@" normally have the shift bit set. However, "F1" normally does. */ - if (modifiers & MOD_SHIFT) + if (modifiers & XEMACS_MOD_SHIFT) { int Mode_switch_p = *state & xd->ModeMask; KeySym bot = XLookupKeysym (ev, Mode_switch_p ? 2 : 0); KeySym top = XLookupKeysym (ev, Mode_switch_p ? 3 : 1); if (top && bot && top != bot) - modifiers &= ~MOD_SHIFT; + modifiers &= ~XEMACS_MOD_SHIFT; } emacs_event->event_type = key_press_event; emacs_event->timestamp = ev->time; @@ -1249,7 +1265,7 @@ { XMotionEvent *ev = &x_event->xmotion; struct frame *frame = x_window_to_frame (d, ev->window); - unsigned int modifiers = 0; + int modifiers = 0; XMotionEvent event2; if (! frame) @@ -1278,12 +1294,17 @@ emacs_event->timestamp = ev->time; emacs_event->event.motion.x = ev->x; emacs_event->event.motion.y = ev->y; - if (ev->state & ShiftMask) modifiers |= MOD_SHIFT; - if (ev->state & ControlMask) modifiers |= MOD_CONTROL; - if (ev->state & xd->MetaMask) modifiers |= MOD_META; - if (ev->state & xd->SuperMask) modifiers |= MOD_SUPER; - if (ev->state & xd->HyperMask) modifiers |= MOD_HYPER; - if (ev->state & xd->AltMask) modifiers |= MOD_ALT; + 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; + if (ev->state & xd->SuperMask) modifiers |= XEMACS_MOD_SUPER; + if (ev->state & xd->HyperMask) modifiers |= XEMACS_MOD_HYPER; + if (ev->state & xd->AltMask) modifiers |= XEMACS_MOD_ALT; + if (ev->state & Button1Mask) modifiers |= XEMACS_MOD_BUTTON1; + if (ev->state & Button2Mask) modifiers |= XEMACS_MOD_BUTTON2; + if (ev->state & Button3Mask) modifiers |= XEMACS_MOD_BUTTON3; + if (ev->state & Button4Mask) modifiers |= XEMACS_MOD_BUTTON4; + if (ev->state & Button5Mask) modifiers |= XEMACS_MOD_BUTTON5; /* Currently ignores Shift_Lock but probably shouldn't (but it definitely should ignore Caps_Lock). */ emacs_event->event.motion.modifiers = modifiers; @@ -1299,7 +1320,9 @@ #ifdef HAVE_OFFIX_DND if (DndIsDropMessage(x_event)) { - unsigned int state, modifiers = 0, button=0; + unsigned int state; + int modifiers = 0; + unsigned int button=0; struct frame *frame = x_any_window_to_frame (d, ev->window); Extbyte *data; unsigned long size, dtype; @@ -1318,12 +1341,17 @@ state=DndDragButtons(x_event); - if (state & ShiftMask) modifiers |= MOD_SHIFT; - if (state & ControlMask) modifiers |= MOD_CONTROL; - if (state & xd->MetaMask) modifiers |= MOD_META; - if (state & xd->SuperMask) modifiers |= MOD_SUPER; - if (state & xd->HyperMask) modifiers |= MOD_HYPER; - if (state & xd->AltMask) modifiers |= MOD_ALT; + if (state & ShiftMask) modifiers |= XEMACS_MOD_SHIFT; + if (state & ControlMask) modifiers |= XEMACS_MOD_CONTROL; + if (state & xd->MetaMask) modifiers |= XEMACS_MOD_META; + if (state & xd->SuperMask) modifiers |= XEMACS_MOD_SUPER; + if (state & xd->HyperMask) modifiers |= XEMACS_MOD_HYPER; + if (state & xd->AltMask) modifiers |= XEMACS_MOD_ALT; + if (state & Button1Mask) modifiers |= XEMACS_MOD_BUTTON1; + if (state & Button2Mask) modifiers |= XEMACS_MOD_BUTTON2; + if (state & Button3Mask) modifiers |= XEMACS_MOD_BUTTON3; + if (state & Button4Mask) modifiers |= XEMACS_MOD_BUTTON4; + if (state & Button5Mask) modifiers |= XEMACS_MOD_BUTTON5; if (state & Button5Mask) button = Button5; if (state & Button4Mask) button = Button4; @@ -1457,6 +1485,7 @@ case FocusIn: case FocusOut: FROB(xfocus, window); break; case VisibilityNotify: FROB(xvisibility, window); break; + case CreateNotify: FROB(xcreatewindow, window); break; default: w = x_event->xany.window; *x_event_copy = *x_event; @@ -1492,7 +1521,6 @@ #ifdef HAVE_XIM XIM_focus_event (f, in_p); #endif /* HAVE_XIM */ - /* On focus change, clear all memory of sticky modifiers to avoid non-intuitive behavior. */ clear_sticky_modifiers (XDEVICE (FRAME_DEVICE (f))); @@ -1512,7 +1540,7 @@ do this in their selection callback, but we don't want that since a button having focus is legitimate. An edit field having focus is mandatory. Weirdly you get a FocusOut event when you click in - a widget-glyph but you don't get a correspondng FocusIn when you + a widget-glyph but you don't get a corresponding FocusIn when you click in the frame. Why is this? */ if (in_p #if XtSpecificationRelease > 5 @@ -1716,6 +1744,25 @@ } static void +emacs_Xt_force_event_pending (struct frame* f) +{ + XEvent event; + + Display* dpy = DEVICE_X_DISPLAY (XDEVICE (FRAME_DEVICE (f))); + event.xclient.type = ClientMessage; + event.xclient.display = dpy; + event.xclient.message_type = XInternAtom (dpy, "BumpQueue", False); + event.xclient.format = 32; + event.xclient.window = 0; + + /* Send the drop message */ + XSendEvent(dpy, XtWindow (FRAME_X_SHELL_WIDGET (f)), + True, NoEventMask, &event); + /* Force event pending to check the X queue. */ + quit_check_signal_tick_count++; +} + +static void emacs_Xt_handle_magic_event (Lisp_Event *emacs_event) { /* This function can GC */ @@ -1828,6 +1875,9 @@ #endif break; + case CreateNotify: + break; + default: break; } @@ -2289,12 +2339,12 @@ char *buf = alloca_array (char, XSTRING_LENGTH (f->name) + 4); sprintf (buf, " \"%s\"", XSTRING_DATA (f->name)); write_string_to_stdio_stream (stderr, 0, (Bufbyte *) buf, 0, - strlen (buf), Qterminal); + strlen (buf), Qterminal, 1); } stderr_out ("\n"); } -static CONST char * +static const char * XEvent_mode_to_string (int mode) { switch (mode) @@ -2307,7 +2357,7 @@ } } -static CONST char * +static const char * XEvent_detail_to_string (int detail) { switch (detail) @@ -2323,7 +2373,7 @@ } } -static CONST char * +static const char * XEvent_visibility_to_string (int state) { switch (state) @@ -2385,7 +2435,7 @@ break; case Expose: - if (x_debug_events > 1) + if (debug_x_events > 1) { XExposeEvent *ev = &event->xexpose; describe_event_window (ev->window, ev->display); @@ -2398,7 +2448,7 @@ break; case GraphicsExpose: - if (x_debug_events > 1) + if (debug_x_events > 1) { XGraphicsExposeEvent *ev = &event->xgraphicsexpose; describe_event_window (ev->drawable, ev->display); @@ -2415,7 +2465,7 @@ case EnterNotify: case LeaveNotify: - if (x_debug_events > 1) + if (debug_x_events > 1) { XCrossingEvent *ev = &event->xcrossing; describe_event_window (ev->window, ev->display); @@ -2436,7 +2486,7 @@ break; case ConfigureNotify: - if (x_debug_events > 1) + if (debug_x_events > 1) { XConfigureEvent *ev = &event->xconfigure; describe_event_window (ev->window, ev->display); @@ -2450,7 +2500,7 @@ break; case VisibilityNotify: - if (x_debug_events > 1) + if (debug_x_events > 1) { XVisibilityEvent *ev = &event->xvisibility; describe_event_window (ev->window, ev->display); @@ -2492,7 +2542,7 @@ static Lisp_Object dispatch_event_queue, dispatch_event_queue_tail; -static void +void enqueue_Xt_dispatch_event (Lisp_Object event) { enqueue_event (event, &dispatch_event_queue, &dispatch_event_queue_tail); @@ -2613,7 +2663,7 @@ Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); #ifdef DEBUG_XEMACS - if (x_debug_events > 0) + if (debug_x_events > 0) { describe_event (event); } @@ -2897,6 +2947,21 @@ return 0; } +static int +emacs_Xt_current_event_timestamp (struct console *c) +{ + /* semi-yuck. */ + Lisp_Object devs = CONSOLE_DEVICE_LIST (c); + + if (NILP (devs)) + return 0; + else + { + struct device *d = XDEVICE (XCAR (devs)); + return DEVICE_X_LAST_SERVER_TIMESTAMP (d); + } +} + /************************************************************************/ /* replacement for standard string-to-pixel converter */ @@ -2994,9 +3059,9 @@ if ((d = get_device_from_display_1(dpy))) { visual = DEVICE_X_VISUAL(d); if (colormap != DEVICE_X_COLORMAP(d)) { - XtAppWarningMsg(the_app_con, "wierdColormap", "cvtStringToPixel", + XtAppWarningMsg(the_app_con, "weirdColormap", "cvtStringToPixel", "XtToolkitWarning", - "The colormap passed to cvtStringToPixel doesn't match the one registerd to the device.\n", + "The colormap passed to cvtStringToPixel doesn't match the one registered to the device.\n", NULL, 0); status = XAllocNamedColor(dpy, colormap, (char*)str, &screenColor, &exactColor); } else { @@ -3058,6 +3123,42 @@ /************************************************************************/ +/* handle focus changes for native widgets */ +/************************************************************************/ +static void +emacs_Xt_event_widget_focus_in (Widget w, + XEvent *event, + String *params, + Cardinal *num_params) +{ + struct frame* f = + x_any_widget_or_parent_to_frame (get_device_from_display (event->xany.display), w); + + XtSetKeyboardFocus (FRAME_X_SHELL_WIDGET (f), w); +} + +static void +emacs_Xt_event_widget_focus_out (Widget w, + XEvent *event, + String *params, + Cardinal *num_params) +{ +} + +static XtActionsRec widgetActionsList[] = +{ + {"widget-focus-in", emacs_Xt_event_widget_focus_in }, + {"widget-focus-out", emacs_Xt_event_widget_focus_out }, +}; + +static void +emacs_Xt_event_add_widget_actions (XtAppContext ctx) +{ + XtAppAddActions (ctx, widgetActionsList, 2); +} + + +/************************************************************************/ /* initialization */ /************************************************************************/ @@ -3074,6 +3175,7 @@ { Xt_event_stream = xnew (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->next_event_cb = emacs_Xt_next_event; Xt_event_stream->handle_magic_event_cb = emacs_Xt_handle_magic_event; Xt_event_stream->add_timeout_cb = emacs_Xt_add_timeout; @@ -3085,6 +3187,8 @@ Xt_event_stream->quit_p_cb = emacs_Xt_quit_p; Xt_event_stream->create_stream_pair_cb = emacs_Xt_create_stream_pair; Xt_event_stream->delete_stream_pair_cb = emacs_Xt_delete_stream_pair; + Xt_event_stream->current_event_timestamp_cb = + emacs_Xt_current_event_timestamp; the_Xt_timeout_blocktype = Blocktype_new (struct Xt_timeout_blocktype); @@ -3104,15 +3208,6 @@ dispatch_event_queue_tail = Qnil; pdump_wire (&dispatch_event_queue_tail); - DEFVAR_BOOL ("modifier-keys-are-sticky", &modifier_keys_are_sticky /* -*Non-nil makes modifier keys sticky. -This means that you can release the modifier key before pressing down -the key that you wish to be modified. Although this is non-standard -behavior, it is recommended because it reduces the strain on your hand, -thus reducing the incidence of the dreaded Emacs-pinky syndrome. -*/ ); - modifier_keys_are_sticky = 0; - DEFVAR_BOOL ("x-allow-sendevents", &x_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. @@ -3120,14 +3215,14 @@ x_allow_sendevents = 0; #ifdef DEBUG_XEMACS - DEFVAR_INT ("x-debug-events", &x_debug_events /* + DEFVAR_INT ("debug-x-events", &debug_x_events /* If non-zero, display debug information about X events that XEmacs sees. Information is displayed on stderr. Currently defined values are: 1 == non-verbose output 2 == verbose output */ ); - x_debug_events = 0; + debug_x_events = 0; #endif } @@ -3170,12 +3265,12 @@ Xt_app_con = XtCreateApplicationContext (); XtAppSetFallbackResources (Xt_app_con, (String *) x_fallback_resources); - /* In xselect.c */ + /* In select-x.c */ x_selection_timeout = (XtAppGetSelectionTimeout (Xt_app_con) / 1000); XSetErrorHandler (x_error_handler); XSetIOErrorHandler (x_IO_error_handler); -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE XtAppAddInput (Xt_app_con, signal_event_pipe[0], (XtPointer) (XtInputReadMask /* | XtInputExceptMask */), Xt_what_callback, 0); @@ -3192,6 +3287,8 @@ NULL, 0, XtCacheByDisplay, EmacsFreeXIMStyles); #endif /* XIM_XLIB */ + /* Add extra actions to native widgets to handle focus and friends. */ + emacs_Xt_event_add_widget_actions (Xt_app_con); /* insert the visual inheritance patch/hack described above */ orig_shell_init_proc = shellClassRec.core_class.initialize; diff -r 72a7cfa4a488 -r abe6d1db359e src/event-msw.c --- a/src/event-msw.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/event-msw.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,7 +1,7 @@ -/* The mswindows event_stream interface. +/* 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 Ben Wing. + Copyright (C) 1996, 2000 Ben Wing. Copyright (C) 1997 Jonathan Harris. This file is part of XEmacs. @@ -41,6 +41,7 @@ #endif #ifdef HAVE_MENUBARS +# include "menubar.h" # include "menubar-msw.h" #endif @@ -57,6 +58,7 @@ #include "process.h" #include "redisplay.h" #include "select.h" +#include "window.h" #include "sysproc.h" #include "syswait.h" #include "systime.h" @@ -67,14 +69,14 @@ #ifdef HAVE_MSG_SELECT #include "sysfile.h" #include "console-tty.h" -#elif defined(__CYGWIN32__) +#elif defined(CYGWIN) typedef unsigned int SOCKET; #endif #include #include -#if defined (__CYGWIN32__) && (CYGWIN_VERSION_DLL_MAJOR < 20) -typedef NMHDR *LPNMHDR; +#if !(defined(CYGWIN) || defined(MINGW)) +# include /* For IShellLink */ #endif #ifdef HAVE_MENUBARS @@ -94,10 +96,13 @@ static Lisp_Object mswindows_find_console (HWND hwnd); static Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods, int extendedp); -static int mswindows_modifier_state (BYTE* keymap, int has_AltGr); +static int mswindows_modifier_state (BYTE* keymap, DWORD fwKeys, + int has_AltGr); static void mswindows_set_chord_timer (HWND hwnd); static int mswindows_button2_near_enough (POINTS p1, POINTS p2); static int mswindows_current_layout_has_AltGr (void); +static int mswindows_handle_sticky_modifiers (WPARAM wParam, LPARAM lParam, + int downp, int keyp); static struct event_stream *mswindows_event_stream; @@ -128,6 +133,7 @@ /* Number of wait handles */ static int mswindows_waitable_count=0; #endif /* HAVE_MSG_SELECT */ + /* Brush for painting widgets */ static HBRUSH widget_brush = 0; static LONG last_widget_brushed = 0; @@ -139,12 +145,16 @@ /* These are Lisp integers; see DEFVARS in this file for description. */ int mswindows_dynamic_frame_resize; -int mswindows_meta_activates_menu; +int mswindows_alt_by_itself_activates_menu; int mswindows_num_mouse_buttons; int mswindows_mouse_button_max_skew_x; int mswindows_mouse_button_max_skew_y; int mswindows_mouse_button_tolerance; +#ifdef DEBUG_XEMACS +int debug_mswindows_events; +#endif + /* This is the event signaled by the event pump. See mswindows_pump_outstanding_events for comments */ static Lisp_Object mswindows_error_caught_in_modal_loop; @@ -152,6 +162,8 @@ /* Count of wound timers */ static int mswindows_pending_timers_count; + +static DWORD mswindows_last_mouse_button_state; /************************************************************************/ /* Pipe instream - reads process output */ @@ -178,11 +190,11 @@ struct ntpipe_slurp_stream_shared_data { HANDLE hev_thread; /* Our thread blocks on this, signaled by caller */ - /* This is a manual-reset object. */ + /* This is a manual-reset object. */ HANDLE hev_caller; /* Caller blocks on this, and we signal it */ - /* This is a manual-reset object. */ + /* This is a manual-reset object. */ HANDLE hev_unsleep; /* Pipe read delay is canceled if this is set */ - /* This is a manual-reset object. */ + /* This is a manual-reset object. */ HANDLE hpipe; /* Pipe read end handle. */ LONG die_p; /* Thread must exit ASAP if non-zero */ BOOL eof_p : 1; /* Set when thread saw EOF */ @@ -221,7 +233,7 @@ } static struct ntpipe_slurp_stream_shared_data* -slurper_allocate_shared_data() +slurper_allocate_shared_data (void) { int i=0; for (i=0; iidle_p); WaitForSingleObject (s->hev_thread, INFINITE); - if (s->die_p) - break; - - /* Write passed buffer */ - if (!WriteFile (s->hpipe, s->buffer, s->size, &bytes_written, NULL) - || bytes_written != s->size) + /* Write passed buffer if any */ + if (s->size > 0) { - s->error_p = TRUE; - InterlockedIncrement (&s->die_p); + if (!WriteFile (s->hpipe, s->buffer, s->size, &bytes_written, NULL) + || bytes_written != s->size) + { + s->error_p = TRUE; + InterlockedIncrement (&s->die_p); + } + /* Set size to zero so we won't write it again if the closer sets + die_p and kicks us */ + s->size = 0; } if (s->die_p) @@ -537,6 +552,15 @@ return Qnil; } + /* Set the priority of the thread higher so we don't end up waiting + on it to send things. */ + if (!SetThreadPriority (s->hthread, THREAD_PRIORITY_HIGHEST)) + { + CloseHandle (s->hthread); + Lstream_delete (lstr); + return Qnil; + } + /* hev_thread is an auto-reset event, initially nonsignaled */ s->hev_thread = CreateEvent (NULL, FALSE, FALSE, NULL); @@ -577,6 +601,10 @@ /* Start output */ InterlockedDecrement (&s->idle_p); SetEvent (s->hev_thread); + /* Give it a chance to run -- this dramatically improves performance + of things like crypt. */ + if (xSwitchToThread) /* not in Win9x or NT 3.51 */ + (void) xSwitchToThread (); return size; } @@ -595,14 +623,18 @@ /* Force thread stop */ InterlockedIncrement (&s->die_p); - /* Close pipe handle, possibly breaking it */ - CloseHandle (s->hpipe); - - /* Thread will end upon unblocking */ + /* Thread will end upon unblocking. If it's already unblocked this will + do nothing, but the thread won't look at die_p until it's written any + pending output. */ SetEvent (s->hev_thread); /* Wait while thread terminates */ WaitForSingleObject (s->hthread, INFINITE); + + /* Close pipe handle, possibly breaking it */ + CloseHandle (s->hpipe); + + /* Close the thread handle */ CloseHandle (s->hthread); /* Destroy the event */ @@ -632,8 +664,8 @@ SOCKET s; /* Socket handle (which is a Win32 handle) */ OVERLAPPED ov; /* Overlapped I/O structure */ void* buffer; /* Buffer. Allocated for input stream only */ - unsigned int bufsize; /* Number of bytes last read */ - unsigned int bufpos; /* Position in buffer for next fetch */ + unsigned long bufsize; /* Number of bytes last read */ + unsigned long bufpos; /* 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 */ @@ -712,7 +744,7 @@ } static ssize_t -winsock_writer (Lstream *stream, CONST unsigned char *data, size_t size) +winsock_writer (Lstream *stream, const unsigned char *data, size_t size) { struct winsock_stream *str = WINSOCK_STREAM_DATA (stream); @@ -785,7 +817,7 @@ } static Lisp_Object -make_winsock_stream_1 (SOCKET s, LPARAM param, CONST char *mode) +make_winsock_stream_1 (SOCKET s, LPARAM param, const char *mode) { Lisp_Object obj; Lstream *lstr = Lstream_new (lstream_winsock, mode); @@ -864,15 +896,15 @@ /* * Add an emacs event to the proper dispatch queue */ -static void +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, + &mswindows_s_dispatch_event_queue, user_p ? &mswindows_u_dispatch_event_queue_tail : - &mswindows_s_dispatch_event_queue_tail); + &mswindows_s_dispatch_event_queue_tail); /* Avoid blocking on WaitMessage */ PostMessage (NULL, XM_BUMPQUEUE, 0, 0); @@ -930,27 +962,30 @@ } static void -mswindows_enqueue_mouse_button_event (HWND hwnd, UINT msg, POINTS where, DWORD when) +mswindows_enqueue_mouse_button_event (HWND hwnd, UINT msg, POINTS where, + int mods, DWORD when) { + int downp = (msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN || + msg == WM_RBUTTONDOWN); /* We always use last message time, because mouse button events may get delayed, and XEmacs double click recognition will fail */ Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event* event = XEVENT(emacs_event); - - event->channel = mswindows_find_frame(hwnd); + Lisp_Event* event = XEVENT (emacs_event); + + mswindows_handle_sticky_modifiers (0, 0, downp, 0); + 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, 0); - - if (msg==WM_LBUTTONDOWN || msg==WM_MBUTTONDOWN || - msg==WM_RBUTTONDOWN) + event->event.button.modifiers = mswindows_modifier_state (NULL, mods, 0); + + if (downp) { event->event_type = button_press_event; SetCapture (hwnd); @@ -990,7 +1025,7 @@ * Give a preference to user events over non-user ones. */ static Lisp_Object -mswindows_dequeue_dispatch_event () +mswindows_dequeue_dispatch_event (void) { Lisp_Object event; Lisp_Event* sevt; @@ -999,10 +1034,10 @@ !NILP(mswindows_s_dispatch_event_queue)); event = dequeue_event ( - NILP(mswindows_u_dispatch_event_queue) ? + NILP(mswindows_u_dispatch_event_queue) ? &mswindows_s_dispatch_event_queue : &mswindows_u_dispatch_event_queue, - NILP(mswindows_u_dispatch_event_queue) ? + NILP(mswindows_u_dispatch_event_queue) ? &mswindows_s_dispatch_event_queue_tail : &mswindows_u_dispatch_event_queue_tail); @@ -1033,9 +1068,9 @@ 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; + &mswindows_s_dispatch_event_queue; Lisp_Object* tail = user_p ? &mswindows_u_dispatch_event_queue_tail : - &mswindows_s_dispatch_event_queue_tail; + &mswindows_s_dispatch_event_queue_tail; assert (match->event_type == timeout_event || match->event_type == key_press_event); @@ -1220,7 +1255,7 @@ GCPRO1 (result); if (NILP(mswindows_error_caught_in_modal_loop)) - result = mswindows_protect_modal_loop (mswindows_unsafe_pump_events, Qnil); + result = mswindows_protect_modal_loop (mswindows_unsafe_pump_events, Qnil); UNGCPRO; return result; } @@ -1230,27 +1265,59 @@ * QUITP, and are interesting in keyboard messages only. */ static void -mswindows_drain_windows_queue (int keyboard_only_till_quit_char_p) +mswindows_drain_windows_queue (void) { MSG msg; - /* Minimize the hassle of misordered events by not fetching - past quit char if called from QUITP; */ - while (!(keyboard_only_till_quit_char_p && - mswindows_quit_chars_count > 0) && - PeekMessage (&msg, NULL, - keyboard_only_till_quit_char_p ? WM_KEYFIRST : 0, - keyboard_only_till_quit_char_p ? WM_KEYLAST : 0, - PM_REMOVE)) + /* should call mswindows_need_event_in_modal_loop() if in modal loop */ + assert (!mswindows_in_modal_loop); + + while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) { - /* We have to translate messages that are not sent to the main - window. This is so that key presses work ok in things like - edit fields. However, we *musn't* translate message for the - main window as this is handled in the wnd proc. */ - if (GetWindowLong (msg.hwnd, GWL_STYLE) & WS_CHILD) + char class_name_buf [sizeof (XEMACS_CLASS) + 2] = ""; + + if (mswindows_is_dialog_msg (&msg)) + { + mswindows_unmodalize_signal_maybe (); + continue; + } + + /* 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 */ + /* GetClassName will truncate a longer class name. By adding one + extra character, we are forcing textual comparison to fail + if the name is longer than XEMACS_CLASS */ + + GetClassName (msg.hwnd, class_name_buf, sizeof (class_name_buf) - 1); + if (stricmp (class_name_buf, XEMACS_CLASS) != 0) { + /* Not an XEmacs frame */ 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; + } DispatchMessage (&msg); mswindows_unmodalize_signal_maybe (); } @@ -1314,14 +1381,6 @@ return; } -#if 0 - /* Have to drain Windows message queue first, otherwise, we may miss - quit char when called from quit_p */ - /* #### This is, ehm, not quite true -- this function is not - called from quit_p. --kkm */ - mswindows_drain_windows_queue (); -#endif - while (NILP (mswindows_u_dispatch_event_queue) && NILP (mswindows_s_dispatch_event_queue)) { @@ -1351,50 +1410,53 @@ { if (FD_ISSET (windows_fd, &temp_mask)) { - mswindows_drain_windows_queue (0); + mswindows_drain_windows_queue (); } -#ifdef HAVE_TTY - /* Look for a TTY event */ - for (i = 0; i < MAXDESC-1; i++) + else { - /* 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)) +#ifdef HAVE_TTY + /* Look for a TTY event */ + for (i = 0; i < MAXDESC-1; i++) { - struct console *c = tty_find_console_from_fd (i); - Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event* event = XEVENT (emacs_event); - - assert (c); - if (read_event_from_tty_or_stream_desc (event, c, 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)) { - mswindows_enqueue_dispatch_event (emacs_event); - return; + struct console *c = tty_find_console_from_fd (i); + Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); + Lisp_Event* event = XEVENT (emacs_event); + + assert (c); + if (read_event_from_tty_or_stream_desc (event, c, i)) + { + mswindows_enqueue_dispatch_event (emacs_event); + return; + } } } - } #endif - /* Look for a process event */ - for (i = 0; i < MAXDESC-1; i++) - { - if (FD_ISSET (i, &temp_mask)) + /* Look for a process event */ + for (i = 0; i < MAXDESC-1; i++) { - if (FD_ISSET (i, &process_only_mask)) + if (FD_ISSET (i, &temp_mask)) { - Lisp_Process *p = - get_process_from_usid (FD_TO_USID(i)); - - mswindows_enqueue_process_event (p); - } - else - { - /* We might get here when a fake event came - through a signal. Return a dummy event, so - that a cycle of the command loop will - occur. */ - drain_signal_event_pipe (); - mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + if (FD_ISSET (i, &process_only_mask)) + { + Lisp_Process *p = + get_process_from_usid (FD_TO_USID(i)); + + mswindows_enqueue_process_event (p); + } + else + { + /* We might get here when a fake event came + through a signal. Return a dummy event, so + that a cycle of the command loop will + occur. */ + drain_signal_event_pipe (); + mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + } } } } @@ -1413,53 +1475,65 @@ } #else /* Now try getting a message or process event */ - active = MsgWaitForMultipleObjects (mswindows_waitable_count, - mswindows_waitable_handles, - FALSE, badly_p ? INFINITE : 0, - QS_ALLINPUT); - - /* This will assert if handle being waited for becomes abandoned. - Not the case currently tho */ - assert ((!badly_p && active == WAIT_TIMEOUT) || - (active >= WAIT_OBJECT_0 && - active <= WAIT_OBJECT_0 + mswindows_waitable_count)); - - if (active == WAIT_TIMEOUT) - { - /* No luck trying - just return what we've already got */ - return; - } - else if (active == WAIT_OBJECT_0 + mswindows_waitable_count) - { - /* Got your message, thanks */ - mswindows_drain_windows_queue (0); - } - 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) - { - /* Found a signaled process input handle */ - mswindows_enqueue_process_event (p); - } - 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 */ - mswindows_waitable_handles [ix] = - mswindows_waitable_handles [--mswindows_waitable_count]; - kick_status_notify (); - /* Have to return something: there may be no accompanying - process event */ - mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); - } - } + active = MsgWaitForMultipleObjects (mswindows_waitable_count, + mswindows_waitable_handles, + FALSE, badly_p ? INFINITE : 0, + QS_ALLINPUT); + + /* This will assert if handle being waited for becomes abandoned. + Not the case currently tho */ + assert ((!badly_p && active == WAIT_TIMEOUT) || + (active >= WAIT_OBJECT_0 && + active <= WAIT_OBJECT_0 + mswindows_waitable_count)); + + if (active == WAIT_TIMEOUT) + { + /* No luck trying - just return what we've already got */ + return; + } + else if (active == WAIT_OBJECT_0 + mswindows_waitable_count) + { + /* Got your message, thanks */ + mswindows_drain_windows_queue (); + } + 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) + { + /* Found a signaled process input handle */ + mswindows_enqueue_process_event (p); + } + 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 */ + 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. */ + /* #### horrible kludge till my real process fixes go in. + */ + if (!NILP (Vprocess_list)) + { + Lisp_Object vaffanculo = XCAR (Vprocess_list); + mswindows_enqueue_process_event (XPROCESS (vaffanculo)); + } + else /* trash me soon. */ + /* Have to return something: there may be no accompanying + process event */ + mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + } + } #endif - } /* while */ + } /* while */ } /************************************************************************/ @@ -1514,7 +1588,7 @@ { mswindows_dde_service, mswindows_dde_topic_system }, { 0, 0 } }; if (!(hszItem || DdeCmpStringHandles (hszItem, mswindows_dde_service)) && - !(hszTopic || DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system))); + !(hszTopic || DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system))) return (DdeCreateDataHandle (mswindows_dde_mlid, (LPBYTE)pairs, sizeof (pairs), 0L, 0, uFmt, 0)); } @@ -1524,7 +1598,7 @@ if (!DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system)) { DWORD len = DdeGetData (hdata, NULL, 0, 0); - char *cmd = alloca (len+1); + LPBYTE cmd = (LPBYTE) alloca (len+1); char *end; char *filename; struct gcpro gcpro1, gcpro2; @@ -1563,7 +1637,7 @@ if (*end) return DDE_FNOTPROCESSED; -#ifdef __CYGWIN32__ +#ifdef CYGWIN filename = alloca (cygwin32_win32_to_posix_path_list_buf_size (cmd) + 5); strcpy (filename, "file:"); cygwin32_win32_to_posix_path_list (cmd, filename+5); @@ -1609,23 +1683,336 @@ #endif /* - * Returns 1 if a key is a real modifier or special key, which + * Helper to do repainting - repaints can happen both from the windows + * procedure and from magic events + */ +static void +mswindows_handle_paint (struct frame *frame) +{ + HWND hwnd = FRAME_MSWINDOWS_HANDLE (frame); + + /* According to the docs we need to check GetUpdateRect() before + actually doing a WM_PAINT */ + if (GetUpdateRect (hwnd, NULL, FALSE)) + { + PAINTSTRUCT paintStruct; + int x, y, width, height; + + BeginPaint (hwnd, &paintStruct); + x = paintStruct.rcPaint.left; + y = paintStruct.rcPaint.top; + width = paintStruct.rcPaint.right - paintStruct.rcPaint.left; + height = paintStruct.rcPaint.bottom - paintStruct.rcPaint.top; + /* Normally we want to ignore expose events when child + windows are unmapped, however once we are in the guts of + WM_PAINT we need to make sure that we don't register + unmaps then because they will not actually occur. */ + /* #### commenting out the next line seems to fix some problems + but not all. only andy currently understands this stuff and + he needs to review it more carefully. --ben */ + if (!check_for_ignored_expose (frame, x, y, width, height)) + { + hold_ignored_expose_registration = 1; + mswindows_redraw_exposed_area (frame, x, y, width, height); + hold_ignored_expose_registration = 0; + } + EndPaint (hwnd, &paintStruct); + } +} + +/* + * Returns 1 if a key is a real modifier or special key, which * is better handled by DefWindowProc */ static int key_needs_default_processing_p (UINT vkey) { - if (mswindows_meta_activates_menu && vkey == VK_MENU) + if (mswindows_alt_by_itself_activates_menu && vkey == VK_MENU + /* if we let ALT activate the menu like this, then sticky ALT-modified + keystrokes become impossible. */ + && !modifier_keys_are_sticky) return 1; return 0; } +/* key-handling code is always ugly. It just ends up working out + that way. + + #### Most of the sticky-modifier code below is copied from similar + code in event-Xt.c. They should somehow or other be merged. + + Here are some pointers: + + -- DOWN_MASK indicates which modifiers should be treated as "down" + when the corresponding upstroke happens. It gets reset for + a particular modifier when that modifier goes up, and reset + for all modifiers when a non-modifier key is pressed. Example: + + I press Control-A-Shift and then release Control-A-Shift. + I want the Shift key to be sticky but not the Control key. + + -- If a modifier key is sticky, I can unstick it by pressing + the modifier key again. */ + +static WPARAM last_downkey; +static int need_to_add_mask, down_mask; + +#define XEMSW_LCONTROL (1<<0) +#define XEMSW_RCONTROL (1<<1) +#define XEMSW_LSHIFT (1<<2) +#define XEMSW_RSHIFT (1<<3) +#define XEMSW_LMENU (1<<4) +#define XEMSW_RMENU (1<<5) + +static int +mswindows_handle_sticky_modifiers (WPARAM wParam, LPARAM lParam, + int downp, int keyp) +{ + int mods = 0; + + if (!modifier_keys_are_sticky) /* Optimize for non-sticky modifiers */ + return 0; + + if (! (keyp && + (wParam == VK_CONTROL || wParam == VK_LCONTROL || + wParam == VK_RCONTROL || + wParam == VK_MENU || wParam == VK_LMENU || + wParam == VK_RMENU || + wParam == VK_SHIFT || wParam == VK_LSHIFT || + wParam == VK_RSHIFT))) + { /* Not a modifier key */ + if (downp && keyp && !last_downkey) + last_downkey = wParam; + /* If I hold press-and-release the Control key and then press + and hold down the right arrow, I want it to auto-repeat + Control-Right. On the other hand, if I do the same but + manually press the Right arrow a bunch of times, I want + to see one Control-Right and then a bunch of Rights. + This means that we need to distinguish between an + auto-repeated key and a key pressed and released a bunch + of times. */ + else if ((downp && !keyp) || + (downp && keyp && last_downkey && + (wParam != last_downkey || + /* the "previous key state" bit indicates autorepeat */ + ! (lParam & (1 << 30))))) + { + need_to_add_mask = 0; + last_downkey = 0; + } + if (downp) + down_mask = 0; + + mods = need_to_add_mask; + } + else /* Modifier key pressed */ + { + /* If a non-modifier key was pressed in the middle of a bunch + of modifiers, then it unsticks all the modifiers that were + previously pressed. We cannot unstick the modifiers until + now because we want to check for auto-repeat of the + non-modifier key. */ + + if (last_downkey) + { + last_downkey = 0; + need_to_add_mask = 0; + } + +#define FROB(mask) \ +do { \ + if (downp && keyp) \ + { \ + /* If modifier key is already sticky, \ + then unstick it. Note that we do \ + not test down_mask to deal with the \ + unlikely but possible case that the \ + modifier key auto-repeats. */ \ + if (need_to_add_mask & mask) \ + { \ + need_to_add_mask &= ~mask; \ + down_mask &= ~mask; \ + } \ + else \ + down_mask |= mask; \ + } \ + else \ + { \ + if (down_mask & mask) \ + { \ + down_mask &= ~mask; \ + need_to_add_mask |= mask; \ + } \ + } \ +} while (0) + + if ((wParam == VK_CONTROL && (lParam & 0x1000000)) + || wParam == VK_RCONTROL) + FROB (XEMSW_RCONTROL); + if ((wParam == VK_CONTROL && !(lParam & 0x1000000)) + || wParam == VK_LCONTROL) + FROB (XEMSW_LCONTROL); + + if ((wParam == VK_SHIFT && (lParam & 0x1000000)) + || wParam == VK_RSHIFT) + FROB (XEMSW_RSHIFT); + if ((wParam == VK_SHIFT && !(lParam & 0x1000000)) + || wParam == VK_LSHIFT) + FROB (XEMSW_LSHIFT); + + if ((wParam == VK_MENU && (lParam & 0x1000000)) + || wParam == VK_RMENU) + FROB (XEMSW_RMENU); + if ((wParam == VK_MENU && !(lParam & 0x1000000)) + || wParam == VK_LMENU) + FROB (XEMSW_LMENU); + } +#undef FROB + + if (mods && downp) + { + BYTE keymap[256]; + + GetKeyboardState (keymap); + + if (mods & XEMSW_LCONTROL) + { + keymap [VK_CONTROL] |= 0x80; + keymap [VK_LCONTROL] |= 0x80; + } + if (mods & XEMSW_RCONTROL) + { + keymap [VK_CONTROL] |= 0x80; + keymap [VK_RCONTROL] |= 0x80; + } + + if (mods & XEMSW_LSHIFT) + { + keymap [VK_SHIFT] |= 0x80; + keymap [VK_LSHIFT] |= 0x80; + } + if (mods & XEMSW_RSHIFT) + { + keymap [VK_SHIFT] |= 0x80; + keymap [VK_RSHIFT] |= 0x80; + } + + if (mods & XEMSW_LMENU) + { + keymap [VK_MENU] |= 0x80; + keymap [VK_LMENU] |= 0x80; + } + if (mods & XEMSW_RMENU) + { + keymap [VK_MENU] |= 0x80; + keymap [VK_RMENU] |= 0x80; + } + + SetKeyboardState (keymap); + return 1; + } + + return 0; +} + +static void +clear_sticky_modifiers (void) +{ + need_to_add_mask = 0; + last_downkey = 0; + down_mask = 0; +} + +#ifdef DEBUG_XEMACS + +#if 0 + +static void +output_modifier_keyboard_state (void) +{ + BYTE keymap[256]; + + GetKeyboardState (keymap); + + stderr_out ("GetKeyboardState VK_MENU %d %d VK_LMENU %d %d VK_RMENU %d %d\n", + keymap[VK_MENU] & 0x80 ? 1 : 0, + keymap[VK_MENU] & 0x1 ? 1 : 0, + keymap[VK_LMENU] & 0x80 ? 1 : 0, + keymap[VK_LMENU] & 0x1 ? 1 : 0, + keymap[VK_RMENU] & 0x80 ? 1 : 0, + keymap[VK_RMENU] & 0x1 ? 1 : 0); + stderr_out ("GetKeyboardState VK_CONTROL %d %d VK_LCONTROL %d %d VK_RCONTROL %d %d\n", + keymap[VK_CONTROL] & 0x80 ? 1 : 0, + keymap[VK_CONTROL] & 0x1 ? 1 : 0, + keymap[VK_LCONTROL] & 0x80 ? 1 : 0, + keymap[VK_LCONTROL] & 0x1 ? 1 : 0, + keymap[VK_RCONTROL] & 0x80 ? 1 : 0, + keymap[VK_RCONTROL] & 0x1 ? 1 : 0); + stderr_out ("GetKeyboardState VK_SHIFT %d %d VK_LSHIFT %d %d VK_RSHIFT %d %d\n", + keymap[VK_SHIFT] & 0x80 ? 1 : 0, + keymap[VK_SHIFT] & 0x1 ? 1 : 0, + keymap[VK_LSHIFT] & 0x80 ? 1 : 0, + keymap[VK_LSHIFT] & 0x1 ? 1 : 0, + keymap[VK_RSHIFT] & 0x80 ? 1 : 0, + keymap[VK_RSHIFT] & 0x1 ? 1 : 0); +} + +#endif + +/* try to debug the stuck-alt-key problem. + + #### this happens only inconsistently, and may only happen when using + StickyKeys in the Win2000 accessibility section of the control panel, + which is extremely broken for other reasons. */ + +static void +output_alt_keyboard_state (void) +{ + BYTE keymap[256]; + SHORT keystate[3]; + // SHORT asyncstate[3]; + + GetKeyboardState (keymap); + keystate[0] = GetKeyState (VK_MENU); + keystate[1] = GetKeyState (VK_LMENU); + keystate[2] = GetKeyState (VK_RMENU); + /* Doing this interferes with key processing. */ +/* asyncstate[0] = GetAsyncKeyState (VK_MENU); */ +/* asyncstate[1] = GetAsyncKeyState (VK_LMENU); */ +/* asyncstate[2] = GetAsyncKeyState (VK_RMENU); */ + + stderr_out ("GetKeyboardState VK_MENU %d %d VK_LMENU %d %d VK_RMENU %d %d\n", + keymap[VK_MENU] & 0x80 ? 1 : 0, + keymap[VK_MENU] & 0x1 ? 1 : 0, + keymap[VK_LMENU] & 0x80 ? 1 : 0, + keymap[VK_LMENU] & 0x1 ? 1 : 0, + keymap[VK_RMENU] & 0x80 ? 1 : 0, + keymap[VK_RMENU] & 0x1 ? 1 : 0); + stderr_out ("GetKeyState VK_MENU %d %d VK_LMENU %d %d VK_RMENU %d %d\n", + keystate[0] & 0x8000 ? 1 : 0, + keystate[0] & 0x1 ? 1 : 0, + keystate[1] & 0x8000 ? 1 : 0, + keystate[1] & 0x1 ? 1 : 0, + keystate[2] & 0x8000 ? 1 : 0, + keystate[2] & 0x1 ? 1 : 0); +/* stderr_out ("GetAsyncKeyState VK_MENU %d %d VK_LMENU %d %d VK_RMENU %d %d\n", */ +/* asyncstate[0] & 0x8000 ? 1 : 0, */ +/* asyncstate[0] & 0x1 ? 1 : 0, */ +/* asyncstate[1] & 0x8000 ? 1 : 0, */ +/* asyncstate[1] & 0x1 ? 1 : 0, */ +/* asyncstate[2] & 0x8000 ? 1 : 0, */ +/* asyncstate[2] & 0x1 ? 1 : 0); */ +} + +#endif /* DEBUG_XEMACS */ + + /* * The windows procedure for the window class XEMACS_CLASS */ LRESULT WINAPI -mswindows_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +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. */ @@ -1636,765 +2023,948 @@ struct frame *frame; struct mswindows_frame* msframe; - switch (message) - { - case WM_DESTROYCLIPBOARD: - /* We own the clipboard and someone else wants it. Delete our - cached copy of the clipboard contents so we'll ask for it from - Windows again when someone does a paste. */ - handle_selection_clear(QCLIPBOARD); - break; - - case WM_ERASEBKGND: - /* Erase background only during non-dynamic sizing */ - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - if (msframe->sizing && !mswindows_dynamic_frame_resize) - goto defproc; - return 1; - - case WM_CLOSE: - fobj = mswindows_find_frame (hwnd); - mswindows_enqueue_misc_user_event (fobj, Qeval, list3 (Qdelete_frame, fobj, Qt)); - break; - - case WM_KEYUP: - case WM_SYSKEYUP: - /* See Win95 comment under WM_KEYDOWN */ + /* Not perfect but avoids crashes. There is potential for wierd + behavior here. */ + if (gc_in_progress) + goto defproc; + + assert (!GetWindowLong (hwnd, GWL_USERDATA)); + switch (message_) { - BYTE keymap[256]; - - if (wParam == VK_CONTROL) - { - GetKeyboardState (keymap); - keymap [(lParam & 0x1000000) ? VK_RCONTROL : VK_LCONTROL] &= ~0x80; - SetKeyboardState (keymap); - } - else if (wParam == VK_MENU) - { - GetKeyboardState (keymap); - keymap [(lParam & 0x1000000) ? VK_RMENU : VK_LMENU] &= ~0x80; - SetKeyboardState (keymap); - } - }; - if (key_needs_default_processing_p (wParam)) - goto defproc; - else + case WM_DESTROYCLIPBOARD: + /* We own the clipboard and someone else wants it. Delete our + cached copy of the clipboard contents so we'll ask for it from + Windows again when someone does a paste, and destroy any memory + objects we hold on the clipboard that are not in the list of types + that Windows will delete itself. */ + mswindows_destroy_selection (QCLIPBOARD); + handle_selection_clear (QCLIPBOARD); + break; + + case WM_ERASEBKGND: + /* Erase background only during non-dynamic sizing */ + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + if (msframe->sizing && !mswindows_dynamic_frame_resize) + goto defproc; + return 1; + + case WM_CLOSE: + fobj = mswindows_find_frame (hwnd); + mswindows_enqueue_misc_user_event (fobj, Qeval, list3 (Qdelete_frame, fobj, Qt)); break; - case WM_KEYDOWN: - case WM_SYSKEYDOWN: - /* In some locales the right-hand Alt key is labelled AltGr. This key - * should produce alternative charcaters when combined with another key. - * eg on a German keyboard pressing AltGr+q should produce '@'. - * AltGr generates exactly the same keystrokes as LCtrl+RAlt. But if - * TranslateMessage() is called with *any* combination of Ctrl+Alt down, - * it translates as if AltGr were down. - * We get round this by removing all modifiers from the keymap before - * calling TranslateMessage() unless AltGr is *really* down. */ - { - BYTE keymap[256]; - int has_AltGr = mswindows_current_layout_has_AltGr (); - int mods; - int extendedp = lParam & 0x1000000; - Lisp_Object keysym; - - GetKeyboardState (keymap); - mods = mswindows_modifier_state (keymap, has_AltGr); - - /* Handle non-printables */ - if (!NILP (keysym = mswindows_key_to_emacs_keysym (wParam, mods, - extendedp))) - mswindows_enqueue_keypress_event (hwnd, keysym, mods); - else /* Normal keys & modifiers */ - { - int quit_ch = CONSOLE_QUIT_CHAR (XCONSOLE (mswindows_find_console (hwnd))); - BYTE keymap_orig[256]; - POINT pnt = { LOWORD (GetMessagePos()), HIWORD (GetMessagePos()) }; - MSG msg; - - msg.hwnd = hwnd; - msg.message = message; - msg.wParam = wParam; - msg.lParam = lParam; - msg.time = GetMessageTime(); - msg.pt = pnt; - - /* GetKeyboardState() does not work as documented on Win95. We have - * to loosely track Left and Right modifiers on behalf of the OS, - * without screwing up Windows NT which tracks them properly. */ - if (wParam == VK_CONTROL) - keymap [extendedp ? VK_RCONTROL : VK_LCONTROL] |= 0x80; - else if (wParam == VK_MENU) - keymap [extendedp ? VK_RMENU : VK_LMENU] |= 0x80; - - memcpy (keymap_orig, keymap, 256); - - /* Remove shift modifier from an ascii character */ - mods &= ~MOD_SHIFT; - - /* Clear control and alt modifiers unless AltGr is pressed */ - keymap [VK_RCONTROL] = 0; - keymap [VK_LMENU] = 0; - if (!has_AltGr || !(keymap [VK_LCONTROL] & 0x80) - || !(keymap [VK_RMENU] & 0x80)) - { - keymap [VK_LCONTROL] = 0; - keymap [VK_CONTROL] = 0; - keymap [VK_RMENU] = 0; - keymap [VK_MENU] = 0; - } + case WM_KEYUP: + case WM_SYSKEYUP: + + /* See Win95 comment under WM_KEYDOWN */ + { + BYTE keymap[256]; + int should_set_keymap = 0; + +#ifdef DEBUG_XEMACS + if (debug_mswindows_events) + { + stderr_out ("%s wparam=%d lparam=%d\n", + message_ == WM_KEYUP ? "WM_KEYUP" : "WM_SYSKEYUP", + wParam, (int)lParam); + output_alt_keyboard_state (); + } +#endif /* DEBUG_XEMACS */ + + mswindows_handle_sticky_modifiers (wParam, lParam, 0, 1); + if (wParam == VK_CONTROL) + { + GetKeyboardState (keymap); + keymap [(lParam & 0x1000000) ? VK_RCONTROL : VK_LCONTROL] &= ~0x80; + should_set_keymap = 1; + } + else if (wParam == VK_MENU) + { + GetKeyboardState (keymap); + keymap [(lParam & 0x1000000) ? VK_RMENU : VK_LMENU] &= ~0x80; + should_set_keymap = 1; + } + + if (should_set_keymap) + // && (message_ != WM_SYSKEYUP + // || NILP (Vmenu_accelerator_enabled))) SetKeyboardState (keymap); - /* Maybe generate some WM_[SYS]CHARs in the queue */ - TranslateMessage (&msg); - - while (PeekMessage (&msg, hwnd, WM_CHAR, WM_CHAR, PM_REMOVE) - || PeekMessage (&msg, hwnd, WM_SYSCHAR, WM_SYSCHAR, PM_REMOVE)) - { - int mods1 = mods; - WPARAM ch = msg.wParam; - - /* 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 */ - /* #### This might also not withstand localization, if - quit character is not a latin-1 symbol */ - if (((quit_ch < ' ' && (mods & MOD_CONTROL) && quit_ch + 'a' - 1 == ch) - || (quit_ch >= ' ' && !(mods & MOD_CONTROL) && quit_ch == ch)) - && ((mods & ~(MOD_CONTROL | MOD_SHIFT)) == 0)) - { - mods1 |= FAKE_MOD_QUIT; - ++mswindows_quit_chars_count; - } - - mswindows_enqueue_keypress_event (hwnd, make_char(ch), mods1); - } /* while */ - SetKeyboardState (keymap_orig); - } /* else */ - } - if (key_needs_default_processing_p (wParam)) - goto defproc; - else - break; - - case WM_MBUTTONDOWN: - case WM_MBUTTONUP: - /* Real middle mouse button has nothing to do with emulated one: - if one wants to exercise fingers playing chords on the mouse, - he is allowed to do that! */ - mswindows_enqueue_mouse_button_event (hwnd, message, - MAKEPOINTS (lParam), GetMessageTime()); - break; - - case WM_LBUTTONUP: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - msframe->last_click_time = GetMessageTime(); - - KillTimer (hwnd, BUTTON_2_TIMER_ID); - msframe->button2_need_lbutton = 0; - if (msframe->ignore_next_lbutton_up) - { - msframe->ignore_next_lbutton_up = 0; } - else if (msframe->button2_is_down) + + if (key_needs_default_processing_p (wParam)) + goto defproc; + else + break; + + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + + /* In some locales the right-hand Alt key is labelled AltGr. This key + * should produce alternative characters when combined with another key. + * eg on a German keyboard pressing AltGr+q should produce '@'. + * AltGr generates exactly the same keystrokes as LCtrl+RAlt. But if + * TranslateMessage() is called with *any* combination of Ctrl+Alt down, + * it translates as if AltGr were down. + * We get round this by removing all modifiers from the keymap before + * calling TranslateMessage() unless AltGr is *really* down. */ { - msframe->button2_is_down = 0; - msframe->ignore_next_rbutton_up = 1; - mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, - MAKEPOINTS (lParam), GetMessageTime()); - } - else - { - if (msframe->button2_need_rbutton) + BYTE keymap_trans[256]; + BYTE keymap_orig[256]; + BYTE keymap_sticky[256]; + int has_AltGr = mswindows_current_layout_has_AltGr (); + int mods = 0; + int extendedp = lParam & 0x1000000; + Lisp_Object keysym; + int sticky_changed; + +#ifdef DEBUG_XEMACS + if (debug_mswindows_events) { - msframe->button2_need_rbutton = 0; - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); + stderr_out ("%s wparam=%d lparam=%d\n", + message_ == WM_KEYDOWN ? "WM_KEYDOWN" : "WM_SYSKEYDOWN", + wParam, (int)lParam); + output_alt_keyboard_state (); } - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONUP, - MAKEPOINTS (lParam), GetMessageTime()); - } - break; - - case WM_RBUTTONUP: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - msframe->last_click_time = GetMessageTime(); - - KillTimer (hwnd, BUTTON_2_TIMER_ID); - msframe->button2_need_rbutton = 0; - if (msframe->ignore_next_rbutton_up) - { - msframe->ignore_next_rbutton_up = 0; - } - else if (msframe->button2_is_down) - { - msframe->button2_is_down = 0; - msframe->ignore_next_lbutton_up = 1; - mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, - MAKEPOINTS (lParam), GetMessageTime()); - } - else - { - if (msframe->button2_need_lbutton) +#endif /* DEBUG_XEMACS */ + + GetKeyboardState (keymap_orig); + frame = XFRAME (mswindows_find_frame (hwnd)); + if ((sticky_changed = + mswindows_handle_sticky_modifiers (wParam, lParam, 1, 1))) { - msframe->button2_need_lbutton = 0; - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - } - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONUP, - MAKEPOINTS (lParam), GetMessageTime()); - } - break; - - case WM_LBUTTONDOWN: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - - if (msframe->button2_need_lbutton) - { - KillTimer (hwnd, BUTTON_2_TIMER_ID); - msframe->button2_need_lbutton = 0; - msframe->button2_need_rbutton = 0; - if (mswindows_button2_near_enough (msframe->last_click_point, MAKEPOINTS (lParam))) - { - mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - msframe->button2_is_down = 1; + GetKeyboardState (keymap_sticky); + if (keymap_sticky[VK_MENU] & 0x80) + { + message_ = WM_SYSKEYDOWN; + /* We have to set the "context bit" so that the + TranslateMessage() call below that generates the + SYSCHAR message does its thing; see the documentation + on WM_SYSKEYDOWN */ + lParam |= 1 << 29; + } } else + memcpy (keymap_sticky, keymap_orig, 256); + + mods = mswindows_modifier_state (keymap_sticky, (DWORD) -1, has_AltGr); + + /* Handle non-printables */ + if (!NILP (keysym = mswindows_key_to_emacs_keysym (wParam, mods, + extendedp))) { - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - msframe->last_click_point, msframe->last_click_time); - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); + mswindows_enqueue_keypress_event (hwnd, keysym, mods); + if (sticky_changed) + SetKeyboardState (keymap_orig); } - } - else - { - mswindows_set_chord_timer (hwnd); - msframe->button2_need_rbutton = 1; - msframe->last_click_point = MAKEPOINTS (lParam); - } - msframe->last_click_time = GetMessageTime(); - break; - - case WM_RBUTTONDOWN: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - - if (msframe->button2_need_rbutton) - { - KillTimer (hwnd, BUTTON_2_TIMER_ID); - msframe->button2_need_lbutton = 0; - msframe->button2_need_rbutton = 0; - if (mswindows_button2_near_enough (msframe->last_click_point, MAKEPOINTS (lParam))) + else /* Normal keys & modifiers */ { - mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - msframe->button2_is_down = 1; - } - else - { - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - msframe->last_click_point, msframe->last_click_time); - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - } + Emchar quit_ch = + CONSOLE_QUIT_CHAR (XCONSOLE (mswindows_find_console (hwnd))); + POINT pnt = { LOWORD (GetMessagePos()), HIWORD (GetMessagePos()) }; + MSG msg, tranmsg; + int potential_accelerator = 0; + int got_accelerator = 0; + + msg.hwnd = hwnd; + msg.message = message_; + msg.wParam = wParam; + msg.lParam = lParam; + msg.time = GetMessageTime(); + msg.pt = pnt; + + /* GetKeyboardState() does not work as documented on Win95. We have + * to loosely track Left and Right modifiers on behalf of the OS, + * without screwing up Windows NT which tracks them properly. */ + if (wParam == VK_CONTROL) + { + keymap_orig[extendedp ? VK_RCONTROL : VK_LCONTROL] |= 0x80; + keymap_sticky[extendedp ? VK_RCONTROL : VK_LCONTROL] |= 0x80; + } + else if (wParam == VK_MENU) + { + keymap_orig[extendedp ? VK_RMENU : VK_LMENU] |= 0x80; + keymap_sticky[extendedp ? VK_RMENU : VK_LMENU] |= 0x80; + } + + if (!NILP (Vmenu_accelerator_enabled) && + !(mods & XEMACS_MOD_SHIFT) && message_ == WM_SYSKEYDOWN) + potential_accelerator = 1; + + /* Remove shift modifier from an ascii character */ + mods &= ~XEMACS_MOD_SHIFT; + + memcpy (keymap_trans, keymap_sticky, 256); + + /* Clear control and alt modifiers unless AltGr is pressed */ + keymap_trans[VK_RCONTROL] = 0; + keymap_trans[VK_LMENU] = 0; + if (!has_AltGr || !(keymap_trans[VK_LCONTROL] & 0x80) + || !(keymap_trans[VK_RMENU] & 0x80)) + { + keymap_trans[VK_LCONTROL] = 0; + keymap_trans[VK_CONTROL] = 0; + keymap_trans[VK_RMENU] = 0; + keymap_trans[VK_MENU] = 0; + } + SetKeyboardState (keymap_trans); + + /* Maybe generate some WM_[SYS]CHARs in the queue */ + TranslateMessage (&msg); + + while (PeekMessage (&tranmsg, hwnd, WM_CHAR, WM_CHAR, PM_REMOVE) + || PeekMessage (&tranmsg, hwnd, WM_SYSCHAR, WM_SYSCHAR, + PM_REMOVE)) + { + int mods1 = mods; + WPARAM ch = tranmsg.wParam; + + /* 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 */ + /* #### This might also not withstand localization, if + quit character is not a latin-1 symbol */ + if (((quit_ch < ' ' && (mods & XEMACS_MOD_CONTROL) + && quit_ch + 'a' - 1 == ch) + || (quit_ch >= ' ' && !(mods & XEMACS_MOD_CONTROL) + && quit_ch == ch)) + && ((mods & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_SHIFT)) + == 0)) + { + mods1 |= FAKE_MOD_QUIT; + ++mswindows_quit_chars_count; + } + else if (potential_accelerator && !got_accelerator && + mswindows_char_is_accelerator (frame, ch)) + { + got_accelerator = 1; + break; + } + mswindows_enqueue_keypress_event (hwnd, make_char (ch), mods1); + } /* while */ + + /* This generates WM_SYSCHAR messages, which are interpreted + by DefWindowProc as the menu selections. */ + if (got_accelerator) + { + SetKeyboardState (keymap_sticky); + TranslateMessage (&msg); + SetKeyboardState (keymap_orig); + goto defproc; + } + + SetKeyboardState (keymap_orig); + } /* else */ } - else - { - mswindows_set_chord_timer (hwnd); - msframe->button2_need_lbutton = 1; - msframe->last_click_point = MAKEPOINTS (lParam); - } - msframe->last_click_time = GetMessageTime(); - break; - - case WM_TIMER: - if (wParam == BUTTON_2_TIMER_ID) - { - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - KillTimer (hwnd, BUTTON_2_TIMER_ID); - - if (msframe->button2_need_lbutton) - { - msframe->button2_need_lbutton = 0; - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - msframe->last_click_point, msframe->last_click_time); - } - else if (msframe->button2_need_rbutton) - { - msframe->button2_need_rbutton = 0; - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - msframe->last_click_point, msframe->last_click_time); - } - } - else - assert ("Spurious timer fired" == 0); - break; - - case WM_MOUSEMOVE: - /* Optimization: don't report mouse movement while size is changing */ - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - if (!msframe->sizing) - { - /* When waiting for the second mouse button to finish - button2 emulation, and have moved too far, just pretend - as if timer has expired. This improves drag-select feedback */ - if ((msframe->button2_need_lbutton || msframe->button2_need_rbutton) - && !mswindows_button2_near_enough (msframe->last_click_point, - MAKEPOINTS (lParam))) + + if (key_needs_default_processing_p (wParam)) + goto defproc; + else + break; + + case WM_MBUTTONDOWN: + case WM_MBUTTONUP: + /* Real middle mouse button has nothing to do with emulated one: + if one wants to exercise fingers playing chords on the mouse, + he is allowed to do that! */ + mswindows_enqueue_mouse_button_event (hwnd, message_, + MAKEPOINTS (lParam), + wParam &~ MK_MBUTTON, + GetMessageTime()); + break; + + case WM_LBUTTONUP: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + msframe->last_click_time = GetMessageTime(); + + KillTimer (hwnd, BUTTON_2_TIMER_ID); + msframe->button2_need_lbutton = 0; + if (msframe->ignore_next_lbutton_up) + { + msframe->ignore_next_lbutton_up = 0; + } + else if (msframe->button2_is_down) + { + msframe->button2_is_down = 0; + msframe->ignore_next_rbutton_up = 1; + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, + MAKEPOINTS (lParam), + wParam + &~ (MK_LBUTTON | MK_MBUTTON + | MK_RBUTTON), + GetMessageTime()); + } + else + { + if (msframe->button2_need_rbutton) + { + msframe->button2_need_rbutton = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, + MAKEPOINTS (lParam), + wParam &~ MK_LBUTTON, + GetMessageTime()); + } + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONUP, + MAKEPOINTS (lParam), + wParam &~ MK_LBUTTON, + GetMessageTime()); + } + break; + + case WM_RBUTTONUP: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + msframe->last_click_time = GetMessageTime(); + + KillTimer (hwnd, BUTTON_2_TIMER_ID); + msframe->button2_need_rbutton = 0; + if (msframe->ignore_next_rbutton_up) + { + msframe->ignore_next_rbutton_up = 0; + } + else if (msframe->button2_is_down) + { + msframe->button2_is_down = 0; + msframe->ignore_next_lbutton_up = 1; + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, + MAKEPOINTS (lParam), + wParam + &~ (MK_LBUTTON | MK_MBUTTON + | MK_RBUTTON), + GetMessageTime()); + } + else + { + if (msframe->button2_need_lbutton) + { + msframe->button2_need_lbutton = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, + MAKEPOINTS (lParam), + wParam &~ MK_RBUTTON, + GetMessageTime()); + } + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONUP, + MAKEPOINTS (lParam), + wParam &~ MK_RBUTTON, + GetMessageTime()); + } + break; + + case WM_LBUTTONDOWN: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + + if (msframe->button2_need_lbutton) { KillTimer (hwnd, BUTTON_2_TIMER_ID); - SendMessage (hwnd, WM_TIMER, BUTTON_2_TIMER_ID, 0); - } - - emacs_event = Fmake_event (Qnil, Qnil); - event = XEVENT(emacs_event); - - 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, 0); - - mswindows_enqueue_dispatch_event (emacs_event); - } - break; - - case WM_CANCELMODE: - ReleaseCapture (); - /* Queue a `cancel-mode-internal' misc user event, so mouse - selection would be canceled if any */ - mswindows_enqueue_misc_user_event (mswindows_find_frame (hwnd), - Qcancel_mode_internal, Qnil); - break; - - case WM_NOTIFY: - { - LPNMHDR nmhdr = (LPNMHDR)lParam; - - if (nmhdr->code == TTN_NEEDTEXT) - { -#ifdef HAVE_TOOLBARS - LPTOOLTIPTEXT tttext = (LPTOOLTIPTEXT)lParam; - Lisp_Object btext; - - /* find out which toolbar */ - frame = XFRAME (mswindows_find_frame (hwnd)); - btext = mswindows_get_toolbar_button_text ( frame, - nmhdr->idFrom ); - - tttext->lpszText = NULL; - tttext->hinst = NULL; - - if (!NILP(btext)) + msframe->button2_need_lbutton = 0; + msframe->button2_need_rbutton = 0; + if (mswindows_button2_near_enough (msframe->last_click_point, + MAKEPOINTS (lParam))) { - /* I think this is safe since the text will only go away - when the toolbar does...*/ - TO_EXTERNAL_FORMAT (LISP_STRING, btext, - C_STRING_ALLOCA, tttext->lpszText, - Qnative); + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, + MAKEPOINTS (lParam), + wParam + &~ (MK_LBUTTON | MK_MBUTTON + | MK_RBUTTON), + GetMessageTime()); + msframe->button2_is_down = 1; } -#endif - } - /* handle tree view callbacks */ - else if (nmhdr->code == TVN_SELCHANGED) - { - NM_TREEVIEW* ptree = (NM_TREEVIEW*)lParam; - frame = XFRAME (mswindows_find_frame (hwnd)); - mswindows_handle_gui_wm_command (frame, 0, ptree->itemNew.lParam); - } - /* handle tab control callbacks */ - else if (nmhdr->code == TCN_SELCHANGE) - { - TC_ITEM item; - int idx = SendMessage (nmhdr->hwndFrom, TCM_GETCURSEL, 0, 0); - frame = XFRAME (mswindows_find_frame (hwnd)); - - item.mask = TCIF_PARAM; - SendMessage (nmhdr->hwndFrom, TCM_GETITEM, (WPARAM)idx, - (LPARAM)&item); - - mswindows_handle_gui_wm_command (frame, 0, item.lParam); - } - } - break; - - case WM_PAINT: - { - /* According to the docs we need to check GetUpdateRect() before - actually doing a WM_PAINT */ - if (GetUpdateRect (hwnd, NULL, FALSE)) - { - PAINTSTRUCT paintStruct; - int x, y, width, height; - - frame = XFRAME (mswindows_find_frame (hwnd)); - - BeginPaint (hwnd, &paintStruct); - x = paintStruct.rcPaint.left; - y = paintStruct.rcPaint.top; - width = paintStruct.rcPaint.right - paintStruct.rcPaint.left; - height = paintStruct.rcPaint.bottom - paintStruct.rcPaint.top; - /* Normally we want to ignore expose events when child - windows are unmapped, however once we are in the guts of - WM_PAINT we need to make sure that we don't register - unmaps then because they will not actually occur. */ - if (!check_for_ignored_expose (frame, x, y, width, height)) + else { - hold_ignored_expose_registration = 1; - mswindows_redraw_exposed_area (frame, x, y, width, height); - hold_ignored_expose_registration = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, + msframe->last_click_point, + msframe->last_click_mods + &~ MK_RBUTTON, + msframe->last_click_time); + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, + MAKEPOINTS (lParam), + wParam &~ MK_LBUTTON, + GetMessageTime()); } - - EndPaint (hwnd, &paintStruct); } else - goto defproc; - } - break; - - case WM_SIZE: - /* We only care about this message if our size has really changed */ - if (wParam==SIZE_RESTORED || wParam==SIZE_MAXIMIZED || wParam==SIZE_MINIMIZED) - { - RECT rect; - int columns, rows; - - fobj = mswindows_find_frame (hwnd); - frame = XFRAME (fobj); - msframe = FRAME_MSWINDOWS_DATA (frame); - - /* We cannot handle frame map and unmap hooks right in - this routine, because these may throw. We queue - magic events to run these hooks instead - kkm */ - - if (wParam==SIZE_MINIMIZED) + { + mswindows_set_chord_timer (hwnd); + msframe->button2_need_rbutton = 1; + msframe->last_click_point = MAKEPOINTS (lParam); + msframe->last_click_mods = wParam; + } + msframe->last_click_time = GetMessageTime(); + break; + + case WM_RBUTTONDOWN: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + + if (msframe->button2_need_rbutton) { - /* Iconified */ - FRAME_VISIBLE_P (frame) = 0; - mswindows_enqueue_magic_event (hwnd, XM_UNMAPFRAME); + KillTimer (hwnd, BUTTON_2_TIMER_ID); + msframe->button2_need_lbutton = 0; + msframe->button2_need_rbutton = 0; + if (mswindows_button2_near_enough (msframe->last_click_point, + MAKEPOINTS (lParam))) + { + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, + MAKEPOINTS (lParam), + wParam + &~ (MK_LBUTTON | MK_MBUTTON + | MK_RBUTTON), + GetMessageTime()); + msframe->button2_is_down = 1; + } + else + { + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, + msframe->last_click_point, + msframe->last_click_mods + &~ MK_LBUTTON, + msframe->last_click_time); + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, + MAKEPOINTS (lParam), + wParam &~ MK_RBUTTON, + GetMessageTime()); + } } else { - 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), - &FRAME_MSWINDOWS_CHARHEIGHT (frame)); - - pixel_to_char_size (frame, rect.right, rect.bottom, &columns, &rows); - change_frame_size (frame, rows, columns, 1); - - /* If we are inside frame creation, we have to apply geometric - properties now. */ - if (FRAME_MSWINDOWS_TARGET_RECT (frame)) + mswindows_set_chord_timer (hwnd); + msframe->button2_need_lbutton = 1; + msframe->last_click_point = MAKEPOINTS (lParam); + msframe->last_click_mods = wParam; + } + msframe->last_click_time = GetMessageTime(); + break; + + case WM_TIMER: + if (wParam == BUTTON_2_TIMER_ID) + { + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + KillTimer (hwnd, BUTTON_2_TIMER_ID); + + if (msframe->button2_need_lbutton) + { + msframe->button2_need_lbutton = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, + msframe->last_click_point, + msframe->last_click_mods + &~ MK_RBUTTON, + msframe->last_click_time); + } + else if (msframe->button2_need_rbutton) + { + msframe->button2_need_rbutton = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, + msframe->last_click_point, + msframe->last_click_mods + &~ MK_LBUTTON, + msframe->last_click_time); + } + } + else + assert ("Spurious timer fired" == 0); + break; + + case WM_MOUSEMOVE: + /* Optimization: don't report mouse movement while size is changing */ + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + if (!msframe->sizing) + { + /* When waiting for the second mouse button to finish + button2 emulation, and have moved too far, just pretend + as if timer has expired. This improves drag-select feedback */ + if ((msframe->button2_need_lbutton || msframe->button2_need_rbutton) + && !mswindows_button2_near_enough (msframe->last_click_point, + MAKEPOINTS (lParam))) { - /* Yes, we have to size again */ - mswindows_size_frame_internal ( frame, - FRAME_MSWINDOWS_TARGET_RECT - (frame)); - /* Reset so we do not get here again. The SetWindowPos call in - * mswindows_size_frame_internal can cause recursion here. */ - if (FRAME_MSWINDOWS_TARGET_RECT (frame)) - { - xfree (FRAME_MSWINDOWS_TARGET_RECT (frame)); - FRAME_MSWINDOWS_TARGET_RECT (frame) = 0; - } + KillTimer (hwnd, BUTTON_2_TIMER_ID); + SendMessage (hwnd, WM_TIMER, BUTTON_2_TIMER_ID, 0); + } + + emacs_event = Fmake_event (Qnil, Qnil); + event = XEVENT(emacs_event); + + 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); + + mswindows_enqueue_dispatch_event (emacs_event); + } + break; + + case WM_CANCELMODE: + ReleaseCapture (); + /* Queue a `cancel-mode-internal' misc user event, so mouse + selection would be canceled if any */ + mswindows_enqueue_misc_user_event (mswindows_find_frame (hwnd), + Qcancel_mode_internal, Qnil); + break; + + case WM_NOTIFY: + { + LPNMHDR nmhdr = (LPNMHDR)lParam; + + if (nmhdr->code == TTN_NEEDTEXT) + { +#ifdef HAVE_TOOLBARS + LPTOOLTIPTEXT tttext = (LPTOOLTIPTEXT)lParam; + Lisp_Object btext; + + /* find out which toolbar */ + frame = XFRAME (mswindows_find_frame (hwnd)); + btext = mswindows_get_toolbar_button_text ( frame, + nmhdr->idFrom ); + + tttext->lpszText = NULL; + tttext->hinst = NULL; + + if (!NILP(btext)) + { + /* I think this is safe since the text will only go away + when the toolbar does...*/ + LISP_STRING_TO_EXTERNAL (btext, tttext->lpszText, Qnative); + } +#endif + } + /* handle tree view callbacks */ + else if (nmhdr->code == TVN_SELCHANGED) + { + NM_TREEVIEW* ptree = (NM_TREEVIEW*)lParam; + frame = XFRAME (mswindows_find_frame (hwnd)); + mswindows_handle_gui_wm_command (frame, 0, ptree->itemNew.lParam); + } + /* handle tab control callbacks */ + else if (nmhdr->code == TCN_SELCHANGE) + { + TC_ITEM item; + int idx = SendMessage (nmhdr->hwndFrom, TCM_GETCURSEL, 0, 0); + frame = XFRAME (mswindows_find_frame (hwnd)); + + item.mask = TCIF_PARAM; + SendMessage (nmhdr->hwndFrom, TCM_GETITEM, (WPARAM)idx, + (LPARAM)&item); + + mswindows_handle_gui_wm_command (frame, 0, item.lParam); + } + } + break; + + case WM_PAINT: + /* hdc will be NULL unless this is a subwindow - in which case we + shouldn't have received a paint message for it here. */ + assert (wParam == 0); + + /* Can't queue a magic event because windows goes modal and sends paint + messages directly to the windows procedure when doing solid drags + and the message queue doesn't get processed. */ + mswindows_handle_paint (XFRAME (mswindows_find_frame (hwnd))); + break; + + case WM_SIZE: + /* We only care about this message if our size has really changed */ + if (wParam==SIZE_RESTORED || wParam==SIZE_MAXIMIZED || wParam==SIZE_MINIMIZED) + { + RECT rect; + int columns, rows; + + fobj = mswindows_find_frame (hwnd); + frame = XFRAME (fobj); + msframe = FRAME_MSWINDOWS_DATA (frame); + + /* We cannot handle frame map and unmap hooks right in + this routine, because these may throw. We queue + magic events to run these hooks instead - kkm */ + + if (wParam==SIZE_MINIMIZED) + { + /* Iconified */ + FRAME_VISIBLE_P (frame) = 0; + mswindows_enqueue_magic_event (hwnd, XM_UNMAPFRAME); } else { - if (!msframe->sizing && !FRAME_VISIBLE_P (frame)) - mswindows_enqueue_magic_event (hwnd, XM_MAPFRAME); - FRAME_VISIBLE_P (frame) = 1; - - if (!msframe->sizing || mswindows_dynamic_frame_resize) - redisplay (); + 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), + &FRAME_MSWINDOWS_CHARHEIGHT (frame)); + + pixel_to_char_size (frame, rect.right, rect.bottom, &columns, &rows); + change_frame_size (frame, rows, columns, 1); + + /* If we are inside frame creation, we have to apply geometric + properties now. */ + if (FRAME_MSWINDOWS_TARGET_RECT (frame)) + { + /* Yes, we have to size again */ + mswindows_size_frame_internal ( frame, + FRAME_MSWINDOWS_TARGET_RECT + (frame)); + /* Reset so we do not get here again. The SetWindowPos call in + * mswindows_size_frame_internal can cause recursion here. */ + if (FRAME_MSWINDOWS_TARGET_RECT (frame)) + { + xfree (FRAME_MSWINDOWS_TARGET_RECT (frame)); + FRAME_MSWINDOWS_TARGET_RECT (frame) = 0; + } + } + else + { + if (!msframe->sizing && !FRAME_VISIBLE_P (frame)) + mswindows_enqueue_magic_event (hwnd, XM_MAPFRAME); + FRAME_VISIBLE_P (frame) = 1; + + if (!msframe->sizing || mswindows_dynamic_frame_resize) + redisplay (); + } } } - } - break; - - /* Misc magic events which only require that the frame be identified */ - case WM_SETFOCUS: - case WM_KILLFOCUS: - mswindows_enqueue_magic_event (hwnd, message); - break; - - case WM_WINDOWPOSCHANGING: - { - WINDOWPOS *wp = (LPWINDOWPOS) lParam; - WINDOWPLACEMENT wpl = { sizeof(WINDOWPLACEMENT) }; - GetWindowPlacement(hwnd, &wpl); - - /* Only interested if size is changing and we're not being iconified */ - if (wpl.showCmd != SW_SHOWMINIMIZED - && wpl.showCmd != SW_SHOWMAXIMIZED - && !(wp->flags & SWP_NOSIZE)) + break; + + case WM_DISPLAYCHANGE: + { + struct device *d; + DWORD message_tick = GetMessageTime (); + + fobj = mswindows_find_frame (hwnd); + frame = XFRAME (fobj); + d = XDEVICE (FRAME_DEVICE (frame)); + + /* Do this only once per message. XEmacs can receive this message + through as many frames as it currently has open. Message time + will be the same for all these messages. Despite extreme + 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) + { + DEVICE_MSWINDOWS_UPDATE_TICK(d) = message_tick; + DeleteDC (DEVICE_MSWINDOWS_HCDC(d)); + DEVICE_MSWINDOWS_HCDC(d) = CreateCompatibleDC (NULL); + } + } + break; + + /* Misc magic events which only require that the frame be identified */ + case WM_SETFOCUS: + case WM_KILLFOCUS: + mswindows_enqueue_magic_event (hwnd, message_); + break; + + case WM_WINDOWPOSCHANGING: { - RECT ncsize = { 0, 0, 0, 0 }; - int pixwidth, pixheight; - AdjustWindowRectEx (&ncsize, GetWindowLong (hwnd, GWL_STYLE), - GetMenu(hwnd) != NULL, - GetWindowLong (hwnd, GWL_EXSTYLE)); - - round_size_to_real_char (XFRAME (mswindows_find_frame (hwnd)), - wp->cx - (ncsize.right - ncsize.left), - wp->cy - (ncsize.bottom - ncsize.top), - &pixwidth, &pixheight); - - /* Convert client sizes to window sizes */ - pixwidth += (ncsize.right - ncsize.left); - pixheight += (ncsize.bottom - ncsize.top); - - if (wpl.showCmd != SW_SHOWMAXIMIZED) + WINDOWPOS *wp = (LPWINDOWPOS) lParam; + WINDOWPLACEMENT wpl = { sizeof(WINDOWPLACEMENT) }; + GetWindowPlacement(hwnd, &wpl); + + /* Only interested if size is changing and we're not being iconified */ + if (wpl.showCmd != SW_SHOWMINIMIZED + && wpl.showCmd != SW_SHOWMAXIMIZED + && !(wp->flags & SWP_NOSIZE)) { - /* Adjust so that the bottom or right doesn't move if it's - * the top or left that's being changed */ - RECT rect; - GetWindowRect (hwnd, &rect); - - if (rect.left != wp->x) - wp->x += wp->cx - pixwidth; - if (rect.top != wp->y) - wp->y += wp->cy - pixheight; + RECT ncsize = { 0, 0, 0, 0 }; + int pixwidth, pixheight; + AdjustWindowRectEx (&ncsize, GetWindowLong (hwnd, GWL_STYLE), + GetMenu(hwnd) != NULL, + GetWindowLong (hwnd, GWL_EXSTYLE)); + + round_size_to_real_char (XFRAME (mswindows_find_frame (hwnd)), + wp->cx - (ncsize.right - ncsize.left), + wp->cy - (ncsize.bottom - ncsize.top), + &pixwidth, &pixheight); + + /* Convert client sizes to window sizes */ + pixwidth += (ncsize.right - ncsize.left); + pixheight += (ncsize.bottom - ncsize.top); + + if (wpl.showCmd != SW_SHOWMAXIMIZED) + { + /* Adjust so that the bottom or right doesn't move if it's + * the top or left that's being changed */ + RECT rect; + GetWindowRect (hwnd, &rect); + + if (rect.left != wp->x) + wp->x += wp->cx - pixwidth; + if (rect.top != wp->y) + wp->y += wp->cy - pixheight; + } + + wp->cx = pixwidth; + wp->cy = pixheight; } - - wp->cx = pixwidth; - wp->cy = pixheight; + /* DefWindowProc sends useful WM_GETMINMAXINFO message, and adjusts + window position if the user tries to track window too small */ } - /* DefWindowProc sends useful WM_GETMINMAXINFO message, and adjusts - window position if the user tries to track window too small */ - } - goto defproc; - - case WM_ENTERSIZEMOVE: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - msframe->sizing = 1; - return 0; - - case WM_EXITSIZEMOVE: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - msframe->sizing = 0; - /* Queue noop event */ - mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); - return 0; + goto defproc; + + case WM_ENTERSIZEMOVE: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + msframe->sizing = 1; + return 0; + + case WM_EXITSIZEMOVE: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + msframe->sizing = 0; + /* Queue noop event */ + mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + return 0; #ifdef HAVE_SCROLLBARS - case WM_VSCROLL: - case WM_HSCROLL: - { - /* Direction of scroll is determined by scrollbar instance. */ - int code = (int) LOWORD(wParam); - int pos = (short int) HIWORD(wParam); - HWND hwndScrollBar = (HWND) lParam; - struct gcpro gcpro1, gcpro2; - - mswindows_handle_scrollbar_event (hwndScrollBar, code, pos); - GCPRO2 (emacs_event, fobj); - if (UNBOUNDP(mswindows_pump_outstanding_events())) /* Can GC */ - { - /* Error during event pumping - cancel scroll */ - SendMessage (hwndScrollBar, WM_CANCELMODE, 0, 0); - } - UNGCPRO; - break; - } - - case WM_MOUSEWHEEL: - { - int keys = LOWORD (wParam); /* Modifier key flags */ - int delta = (short) HIWORD (wParam); /* Wheel rotation amount */ - struct gcpro gcpro1, gcpro2; - - if (mswindows_handle_mousewheel_event (mswindows_find_frame (hwnd), keys, delta)) - { - GCPRO2 (emacs_event, fobj); - mswindows_pump_outstanding_events (); /* Can GC */ - UNGCPRO; - } - else - goto defproc; - break; - } + case WM_VSCROLL: + case WM_HSCROLL: + { + /* Direction of scroll is determined by scrollbar instance. */ + int code = (int) LOWORD(wParam); + int pos = (short int) HIWORD(wParam); + HWND hwndScrollBar = (HWND) lParam; + struct gcpro gcpro1, gcpro2; + + mswindows_handle_scrollbar_event (hwndScrollBar, code, pos); + GCPRO2 (emacs_event, fobj); + if (UNBOUNDP(mswindows_pump_outstanding_events())) /* Can GC */ + { + /* Error during event pumping - cancel scroll */ + SendMessage (hwndScrollBar, WM_CANCELMODE, 0, 0); + } + UNGCPRO; + break; + } + + case WM_MOUSEWHEEL: + { + int keys = LOWORD (wParam); /* Modifier key flags */ + int delta = (short) HIWORD (wParam); /* Wheel rotation amount */ + struct gcpro gcpro1, gcpro2; + + if (mswindows_handle_mousewheel_event (mswindows_find_frame (hwnd), keys, delta)) + { + GCPRO2 (emacs_event, fobj); + mswindows_pump_outstanding_events (); /* Can GC */ + UNGCPRO; + } + else + goto defproc; + break; + } #endif #ifdef HAVE_MENUBARS - case WM_INITMENU: - if (UNBOUNDP (mswindows_handle_wm_initmenu ( - (HMENU) wParam, - XFRAME (mswindows_find_frame (hwnd))))) - SendMessage (hwnd, WM_CANCELMODE, 0, 0); - break; - - case WM_INITMENUPOPUP: - if (!HIWORD(lParam)) - { - if (UNBOUNDP (mswindows_handle_wm_initmenupopup ( - (HMENU) wParam, - XFRAME (mswindows_find_frame (hwnd))))) - SendMessage (hwnd, WM_CANCELMODE, 0, 0); - } - break; + case WM_INITMENU: + if (UNBOUNDP (mswindows_handle_wm_initmenu ( + (HMENU) wParam, + XFRAME (mswindows_find_frame (hwnd))))) + SendMessage (hwnd, WM_CANCELMODE, 0, 0); + break; + + case WM_INITMENUPOPUP: + if (!HIWORD(lParam)) + { + if (UNBOUNDP (mswindows_handle_wm_initmenupopup ( + (HMENU) wParam, + XFRAME (mswindows_find_frame (hwnd))))) + SendMessage (hwnd, WM_CANCELMODE, 0, 0); + } + break; #endif /* HAVE_MENUBARS */ - case WM_COMMAND: - { - WORD id = LOWORD (wParam); - WORD nid = HIWORD (wParam); - HWND cid = (HWND)lParam; - frame = XFRAME (mswindows_find_frame (hwnd)); + case WM_COMMAND: + { + WORD id = LOWORD (wParam); + WORD nid = HIWORD (wParam); + HWND cid = (HWND)lParam; + frame = XFRAME (mswindows_find_frame (hwnd)); #ifdef HAVE_TOOLBARS - if (!NILP (mswindows_handle_toolbar_wm_command (frame, cid, id))) - break; + if (!NILP (mswindows_handle_toolbar_wm_command (frame, cid, id))) + break; #endif - /* widgets in a buffer only eval a callback for suitable events.*/ - switch (nid) - { - case BN_CLICKED: - case EN_CHANGE: - case CBN_EDITCHANGE: - case CBN_SELCHANGE: - if (!NILP (mswindows_handle_gui_wm_command (frame, cid, id))) - return 0; - } - /* menubars always must come last since the hashtables do not - always exist*/ + /* widgets in a buffer only eval a callback for suitable events.*/ + switch (nid) + { + case BN_CLICKED: + case EN_CHANGE: + case CBN_EDITCHANGE: + case CBN_SELCHANGE: + if (!NILP (mswindows_handle_gui_wm_command (frame, cid, id))) + return 0; + } + /* menubars always must come last since the hashtables do not + always exist*/ #ifdef HAVE_MENUBARS - if (!NILP (mswindows_handle_wm_command (frame, id))) - break; + if (!NILP (mswindows_handle_wm_command (frame, id))) + break; #endif - return DefWindowProc (hwnd, message, wParam, lParam); - /* Bite me - a spurious command. This used to not be able to - happen but with the introduction of widgets its now - possible. */ - } - break; - - case WM_CTLCOLORBTN: - case WM_CTLCOLORLISTBOX: - case WM_CTLCOLOREDIT: - case WM_CTLCOLORSTATIC: - case WM_CTLCOLORSCROLLBAR: - { - /* if we get an opportunity to paint a widget then do so if - there is an appropriate face */ - HWND crtlwnd = (HWND)lParam; - LONG ii = GetWindowLong (crtlwnd, GWL_USERDATA); - if (ii) - { - Lisp_Object image_instance; - VOID_TO_LISP (image_instance, ii); - if (IMAGE_INSTANCEP (image_instance) - && - IMAGE_INSTANCE_TYPE_P (image_instance, IMAGE_WIDGET)) - { - /* set colors for the buttons */ - HDC hdc = (HDC)wParam; - if (last_widget_brushed != ii) - { - if (widget_brush) - DeleteObject (widget_brush); - widget_brush = CreateSolidBrush - (COLOR_INSTANCE_MSWINDOWS_COLOR - (XCOLOR_INSTANCE - (FACE_BACKGROUND - (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance))))); - } - last_widget_brushed = ii; - SetTextColor - (hdc, - COLOR_INSTANCE_MSWINDOWS_COLOR - (XCOLOR_INSTANCE - (FACE_FOREGROUND - (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance))))); - SetBkMode (hdc, OPAQUE); - SetBkColor - (hdc, - COLOR_INSTANCE_MSWINDOWS_COLOR - (XCOLOR_INSTANCE - (FACE_BACKGROUND - (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance))))); - return (LRESULT)widget_brush; - } - } - } - goto defproc; + return DefWindowProc (hwnd, message_, wParam, lParam); + /* Bite me - a spurious command. This used to not be able to + happen but with the introduction of widgets its now + possible. */ + } + break; + + case WM_CTLCOLORBTN: + case WM_CTLCOLORLISTBOX: + case WM_CTLCOLOREDIT: + case WM_CTLCOLORSTATIC: + case WM_CTLCOLORSCROLLBAR: + { + /* if we get an opportunity to paint a widget then do so if + there is an appropriate face */ + HWND crtlwnd = (HWND)lParam; + LONG ii = GetWindowLong (crtlwnd, GWL_USERDATA); + if (ii) + { + Lisp_Object image_instance; + VOID_TO_LISP (image_instance, ii); + if (IMAGE_INSTANCEP (image_instance) + && + IMAGE_INSTANCE_TYPE_P (image_instance, IMAGE_WIDGET)) + { + /* set colors for the buttons */ + HDC hdc = (HDC)wParam; + if (last_widget_brushed != ii) + { + if (widget_brush) + DeleteObject (widget_brush); + widget_brush = CreateSolidBrush + (COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_BACKGROUND + (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), + XIMAGE_INSTANCE_FRAME (image_instance))))); + } + last_widget_brushed = ii; + SetTextColor + (hdc, + COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_FOREGROUND + (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), + XIMAGE_INSTANCE_FRAME (image_instance))))); + SetBkMode (hdc, OPAQUE); + SetBkColor + (hdc, + COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_BACKGROUND + (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), + XIMAGE_INSTANCE_FRAME (image_instance))))); + return (LRESULT)widget_brush; + } + } + } + goto defproc; #ifdef HAVE_DRAGNDROP - case WM_DROPFILES: /* implementation ripped-off from event-Xt.c */ - { - UINT filecount, i, len; - POINT point; - char* filename; -#ifdef __CYGWIN32__ - char* fname; + case WM_DROPFILES: /* implementation ripped-off from event-Xt.c */ + { + UINT filecount, i, len; + POINT point; + char* filename; + char* fname; + + Lisp_Object l_dndlist = Qnil, l_item = Qnil; + struct gcpro gcpro1, gcpro2, gcpro3; + + emacs_event = Fmake_event (Qnil, Qnil); + event = XEVENT(emacs_event); + + GCPRO3 (emacs_event, l_dndlist, l_item); + + if (!DragQueryPoint ((HDROP) wParam, &point)) + point.x = point.y = -1; /* outside client area */ + + 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; + + filecount = DragQueryFile ((HDROP) wParam, 0xffffffff, NULL, 0); + for (i=0; i/ part and + * because they may contain reserved characters. But that's OK - + * they just need to be good enough to keep dragdrop.el happy. */ + fname = (char *)xmalloc (len+1); + DragQueryFile ((HANDLE) wParam, i, fname, len+1); + + /* May be a shell link aka "shortcut" - replace fname if so */ +#if !(defined(CYGWIN) || defined(MINGW)) + /* cygwin doesn't define this COM stuff */ + if (!stricmp (fname + strlen (fname) - 4, ".LNK")) + { + IShellLink* psl; + + if (CoCreateInstance (&CLSID_ShellLink, NULL, + CLSCTX_INPROC_SERVER, &IID_IShellLink, &psl) == S_OK) + { + IPersistFile* ppf; + + if (psl->lpVtbl->QueryInterface (psl, &IID_IPersistFile, + &ppf) == S_OK) + { + WORD wsz[MAX_PATH]; + WIN32_FIND_DATA wfd; + LPSTR resolved = (char *) xmalloc (MAX_PATH+1); + + MultiByteToWideChar (CP_ACP,0, fname, -1, wsz, MAX_PATH); + + if ((ppf->lpVtbl->Load (ppf, wsz, STGM_READ) == S_OK) && + (psl->lpVtbl->GetPath (psl, resolved, MAX_PATH, + &wfd, 0)==S_OK)) + { + xfree (fname); + fname = resolved; + len = strlen (fname); + } + + ppf->lpVtbl->Release (ppf); + } + + psl->lpVtbl->Release (psl); + } + } #endif - Lisp_Object l_dndlist = Qnil, l_item = Qnil; - struct gcpro gcpro1, gcpro2, gcpro3; - - emacs_event = Fmake_event (Qnil, Qnil); - event = XEVENT(emacs_event); - - GCPRO3 (emacs_event, l_dndlist, l_item); - - if (!DragQueryPoint ((HANDLE) wParam, &point)) - point.x = point.y = -1; /* outside client area */ - - event->event_type = misc_user_event; - event->channel = mswindows_find_frame(hwnd); - event->timestamp = GetMessageTime(); - event->event.misc.button = 1; /* #### Should try harder */ - event->event.misc.modifiers = mswindows_modifier_state (NULL, 0); - event->event.misc.x = point.x; - event->event.misc.y = point.y; - event->event.misc.function = Qdragdrop_drop_dispatch; - - filecount = DragQueryFile ((HANDLE) wParam, 0xffffffff, NULL, 0); - for (i=0; i/ part and - * because they may contain reserved characters. But that's OK. */ -#ifdef __CYGWIN32__ - fname = (char *)xmalloc (len+1); - DragQueryFile ((HANDLE) wParam, i, fname, len+1); - filename = xmalloc (cygwin32_win32_to_posix_path_list_buf_size (fname) + 5); - strcpy (filename, "file:"); - cygwin32_win32_to_posix_path_list (fname, filename+5); - xfree (fname); + +#ifdef CYGWIN + filename = xmalloc (cygwin32_win32_to_posix_path_list_buf_size (fname) + 5); + strcpy (filename, "file:"); + cygwin32_win32_to_posix_path_list (fname, filename+5); #else - filename = (char *)xmalloc (len+6); - strcpy (filename, "file:"); - DragQueryFile ((HANDLE) wParam, i, filename+5, len+1); - dostounix_filename (filename+5); + filename = (char *)xmalloc (len+6); + strcat (strcpy (filename, "file:"), fname); + dostounix_filename (filename+5); #endif - l_item = make_string (filename, strlen (filename)); - l_dndlist = Fcons (l_item, l_dndlist); - xfree (filename); - } - DragFinish ((HANDLE) wParam); - - event->event.misc.object = Fcons (Qdragdrop_URL, l_dndlist); - mswindows_enqueue_dispatch_event (emacs_event); - UNGCPRO; + xfree (fname); + l_item = make_string (filename, strlen (filename)); + l_dndlist = Fcons (l_item, l_dndlist); + xfree (filename); + } + DragFinish ((HDROP) wParam); + + event->event.misc.object = Fcons (Qdragdrop_URL, l_dndlist); + mswindows_enqueue_dispatch_event (emacs_event); + UNGCPRO; + } + break; +#endif + + defproc: + default: + return DefWindowProc (hwnd, message_, wParam, lParam); } - break; -#endif - - defproc: - default: - return DefWindowProc (hwnd, message, wParam, lParam); - } return (0); } @@ -2440,8 +3010,10 @@ time when a key typed at autorepeat rate of 30 cps! */ static HKL last_hkl = 0; static int last_hkl_has_AltGr; - - HKL current_hkl = GetKeyboardLayout (0); + HKL current_hkl = (HKL) -1; + + if (xGetKeyboardLayout) /* not in NT 3.5 */ + current_hkl = xGetKeyboardLayout (0); if (current_hkl != last_hkl) { TCHAR c; @@ -2460,29 +3032,46 @@ /* Returns the state of the modifier keys in the format expected by the * Lisp_Event key_data, button_data and motion_data modifiers member */ -int mswindows_modifier_state (BYTE* keymap, int has_AltGr) +static int +mswindows_modifier_state (BYTE* keymap, DWORD fwKeys, int has_AltGr) { int mods = 0; + int keys_is_real = 0; + BYTE keymap2[256]; + + if (fwKeys == (DWORD) -1) + fwKeys = mswindows_last_mouse_button_state; + else + { + keys_is_real = 1; + mswindows_last_mouse_button_state = fwKeys; + } if (keymap == NULL) { - keymap = (BYTE*) alloca(256); + keymap = keymap2; GetKeyboardState (keymap); has_AltGr = mswindows_current_layout_has_AltGr (); } + /* #### should look at fwKeys for MK_CONTROL. I don't understand how + AltGr works. */ if (has_AltGr && (keymap [VK_LCONTROL] & 0x80) && (keymap [VK_RMENU] & 0x80)) { - mods |= (keymap [VK_LMENU] & 0x80) ? MOD_META : 0; - mods |= (keymap [VK_RCONTROL] & 0x80) ? MOD_CONTROL : 0; + mods |= (keymap [VK_LMENU] & 0x80) ? XEMACS_MOD_META : 0; + mods |= (keymap [VK_RCONTROL] & 0x80) ? XEMACS_MOD_CONTROL : 0; } else { - mods |= (keymap [VK_MENU] & 0x80) ? MOD_META : 0; - mods |= (keymap [VK_CONTROL] & 0x80) ? MOD_CONTROL : 0; + mods |= (keymap [VK_MENU] & 0x80) ? XEMACS_MOD_META : 0; + mods |= (keymap [VK_CONTROL] & 0x80) ? XEMACS_MOD_CONTROL : 0; } - mods |= (keymap [VK_SHIFT] & 0x80) ? MOD_SHIFT : 0; + mods |= (keys_is_real ? fwKeys & MK_SHIFT : (keymap [VK_SHIFT] & 0x80)) + ? XEMACS_MOD_SHIFT : 0; + mods |= fwKeys & MK_LBUTTON ? XEMACS_MOD_BUTTON1 : 0; + mods |= fwKeys & MK_MBUTTON ? XEMACS_MOD_BUTTON2 : 0; + mods |= fwKeys & MK_RBUTTON ? XEMACS_MOD_BUTTON3 : 0; return mods; } @@ -2491,7 +3080,6 @@ * Translate a mswindows virtual key to a keysym. * Only returns non-Qnil for keys that don't generate WM_CHAR messages * or whose ASCII codes (like space) xemacs doesn't like. - * Virtual key values are defined in winresrc.h */ Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods, int extendedp) @@ -2500,6 +3088,7 @@ { switch (mswindows_key) { + case VK_CANCEL: return KEYSYM ("pause"); case VK_RETURN: return KEYSYM ("kp-enter"); case VK_PRIOR: return KEYSYM ("prior"); case VK_NEXT: return KEYSYM ("next"); @@ -2511,6 +3100,11 @@ case VK_DOWN: return KEYSYM ("down"); case VK_INSERT: return KEYSYM ("insert"); case VK_DELETE: return QKdelete; +#if 0 /* FSF Emacs allows these to return configurable syms/mods */ + case VK_LWIN return KEYSYM (""); + case VK_RWIN return KEYSYM (""); +#endif + case VK_APPS: return KEYSYM ("menu"); } } else @@ -2522,6 +3116,7 @@ case '\n': return QKlinefeed; case VK_CLEAR: return KEYSYM ("clear"); case VK_RETURN: return QKreturn; + case VK_PAUSE: return KEYSYM ("pause"); case VK_ESCAPE: return QKescape; case VK_SPACE: return QKspace; case VK_PRIOR: return KEYSYM ("kp-prior"); @@ -2539,11 +3134,6 @@ case VK_INSERT: return KEYSYM ("kp-insert"); case VK_DELETE: return KEYSYM ("kp-delete"); case VK_HELP: return KEYSYM ("help"); -#if 0 /* FSF Emacs allows these to return configurable syms/mods */ - case VK_LWIN return KEYSYM (""); - case VK_RWIN return KEYSYM (""); -#endif - case VK_APPS: return KEYSYM ("menu"); case VK_NUMPAD0: return KEYSYM ("kp-0"); case VK_NUMPAD1: return KEYSYM ("kp-1"); case VK_NUMPAD2: return KEYSYM ("kp-2"); @@ -2702,6 +3292,14 @@ case XM_BUMPQUEUE: break; + case WM_PAINT: + { + struct frame *f = XFRAME (EVENT_CHANNEL (emacs_event)); + mswindows_handle_paint (f); + (FRAME_MSWINDOWS_DATA (f))->paint_pending = 0; + } + break; + case WM_SETFOCUS: case WM_KILLFOCUS: { @@ -2709,18 +3307,19 @@ struct frame *f = XFRAME (frame); int in_p = (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event) == WM_SETFOCUS); Lisp_Object conser; - - /* struct gcpro gcpro1; */ - - /* Clear sticky modifiers here (if we had any) */ + struct gcpro gcpro1; + + /* On focus change, clear all memory of sticky modifiers + to avoid non-intuitive behavior. */ + clear_sticky_modifiers (); conser = Fcons (frame, Fcons (FRAME_DEVICE (f), in_p ? Qt : Qnil)); - /* GCPRO1 (conser); XXX Not necessary? */ + GCPRO1 (conser); emacs_handle_focus_change_preliminary (conser); /* Under X the stuff up to here is done in the X event handler. I Don't know why */ emacs_handle_focus_change_final (conser); - /* UNGCPRO; */ + UNGCPRO; } break; @@ -2760,7 +3359,7 @@ ? get_winsock_stream_waitable (XLSTREAM (instr)) : get_ntpipe_input_stream_waitable (XLSTREAM (instr))); #else - return get_ntpipe_input_stream_waitable (XLSTREAM (instr)); + return get_ntpipe_input_stream_waitable (XLSTREAM (instr)); #endif } @@ -2831,7 +3430,7 @@ /* Drain windows queue. This sets up number of quit characters in the queue */ - mswindows_drain_windows_queue (1); + mswindows_drain_windows_queue (); if (mswindows_quit_chars_count > 0) { @@ -2847,8 +3446,8 @@ { emacs_event = mswindows_cancel_dispatch_event (&match_against); assert (!NILP (emacs_event)); - - if (XEVENT(emacs_event)->event.key.modifiers & MOD_SHIFT) + + if (XEVENT(emacs_event)->event.key.modifiers & XEMACS_MOD_SHIFT) critical_p = 1; Fdeallocate_event(emacs_event); @@ -2932,7 +3531,7 @@ USID emacs_mswindows_delete_stream_pair (Lisp_Object instream, - Lisp_Object outstream) + Lisp_Object outstream) { /* Oh nothing special here for Win32 at all */ #if defined (HAVE_UNIX_PROCESSES) @@ -2961,6 +3560,12 @@ : HANDLE_TO_USID (get_ntpipe_input_stream_waitable (XLSTREAM (instream)))); } +static int +emacs_mswindows_current_event_timestamp (struct console *c) +{ + return GetTickCount (); +} + #ifndef HAVE_X_WINDOWS /* This is called from GC when a process object is about to be freed. If we've still got pointers to it in this file, we're gonna lose hard. @@ -2994,6 +3599,7 @@ mswindows_event_stream = xnew (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->add_timeout_cb = emacs_mswindows_add_timeout; @@ -3014,6 +3620,8 @@ mswindows_event_stream->create_stream_pair_cb = emacs_mswindows_create_stream_pair; mswindows_event_stream->delete_stream_pair_cb = emacs_mswindows_delete_stream_pair; #endif + mswindows_event_stream->current_event_timestamp_cb = + emacs_mswindows_current_event_timestamp; } void @@ -3034,13 +3642,30 @@ mswindows_error_caught_in_modal_loop = Qnil; staticpro (&mswindows_error_caught_in_modal_loop); - DEFVAR_BOOL ("mswindows-meta-activates-menu", &mswindows_meta_activates_menu /* -*Controls whether pressing and releasing the Meta (Alt) key should -activate the menubar. + +#ifdef DEBUG_XEMACS + DEFVAR_INT ("debug-mswindows-events", &debug_mswindows_events /* +If non-zero, display debug information about Windows events that XEmacs sees. +Information is displayed in a console window. Currently defined values are: + +1 == non-verbose output +2 == verbose output + +#### Unfortunately, not yet implemented. +*/ ); + debug_mswindows_events = 0; +#endif + + DEFVAR_BOOL ("mswindows-alt-by-itself-activates-menu", + &mswindows_alt_by_itself_activates_menu /* +*Controls whether pressing and releasing the Alt key activates the menubar. +This applies only if no intervening key was pressed. See also +`menu-accelerator-enabled', which is probably the behavior you actually want. Default is t. */ ); - DEFVAR_BOOL ("mswindows-dynamic-frame-resize", &mswindows_dynamic_frame_resize /* + DEFVAR_BOOL ("mswindows-dynamic-frame-resize", + &mswindows_dynamic_frame_resize /* *Controls redrawing frame contents during mouse-drag or keyboard resize operation. When non-nil, the frame is redrawn while being resized. When nil, frame is not redrawn, and exposed areas are filled with default @@ -3050,8 +3675,8 @@ Default is t on fast machines, nil on slow. */ ); -/* The description copied verbatim from nt-emacs. (C) Geoff Voelker */ - DEFVAR_INT ("mswindows-mouse-button-tolerance", &mswindows_mouse_button_tolerance /* + DEFVAR_INT ("mswindows-mouse-button-tolerance", + &mswindows_mouse_button_tolerance /* *Analogue of double click interval for faking middle mouse events. The value is the minimum time in milliseconds that must elapse between left/right button down events before they are considered distinct events. @@ -3060,12 +3685,12 @@ If negative or zero, currently set system default is used instead. */ ); -/* The description copied verbatim from nt-emacs. (C) Geoff Voelker */ DEFVAR_INT ("mswindows-num-mouse-buttons", &mswindows_num_mouse_buttons /* Number of physical mouse buttons. */ ); - DEFVAR_INT ("mswindows-mouse-button-max-skew-x", &mswindows_mouse_button_max_skew_x /* + DEFVAR_INT ("mswindows-mouse-button-max-skew-x", + &mswindows_mouse_button_max_skew_x /* *Maximum horizontal distance in pixels between points in which left and right button clicks occurred for them to be translated into single middle button event. Clicks must occur in time not longer than defined @@ -3073,7 +3698,8 @@ If negative or zero, currently set system default is used instead. */ ); - DEFVAR_INT ("mswindows-mouse-button-max-skew-y", &mswindows_mouse_button_max_skew_y /* + DEFVAR_INT ("mswindows-mouse-button-max-skew-y", + &mswindows_mouse_button_max_skew_y /* *Maximum vertical distance in pixels between points in which left and right button clicks occurred for them to be translated into single middle button event. Clicks must occur in time not longer than defined @@ -3084,7 +3710,7 @@ mswindows_mouse_button_max_skew_x = 0; mswindows_mouse_button_max_skew_y = 0; mswindows_mouse_button_tolerance = 0; - mswindows_meta_activates_menu = 1; + mswindows_alt_by_itself_activates_menu = 1; } void diff -r 72a7cfa4a488 -r abe6d1db359e src/event-stream.c --- a/src/event-stream.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/event-stream.c Mon Aug 13 11:35:02 2007 +0200 @@ -23,6 +23,20 @@ /* Synched up with: Not in FSF. */ +/* Authorship: + + Created 1991 by Jamie Zawinski. + A great deal of work over the ages by Ben Wing (Mule-ization for 19.12, + device abstraction for 19.12/19.13, async timers for 19.14, + rewriting of focus code for 19.12, pre-idle hook for 19.12, + redoing of signal and quit handling for 19.9 and 19.12, + misc-user events to clean up menu/scrollbar handling for 19.11, + function-key-map/key-translation-map/keyboard-translate-table for + 19.13/19.14, open-dribble-file for 19.13, much other cleanup). + focus-follows-mouse from Chuck Thompson, 1995. + XIM stuff by Martin Buchholz, c. 1996?. +*/ + /* This file has been Mule-ized. */ /* @@ -38,8 +52,6 @@ /* TODO: This stuff is way too hard to maintain - needs rework. - (global-set-key "\C-p" global-map) causes a crash - need recursion check. - C-x @ h x causes a crash. The command builder should deal only with key and button events. @@ -62,14 +74,6 @@ #include #include "lisp.h" -#ifdef HAVE_X_WINDOWS -#include "console-x.h" /* for menu accelerators ... */ -#include "gui-x.h" -#include "../lwlib/lwlib.h" -#else -#define lw_menu_active 0 -#endif - #include "blocktype.h" #include "buffer.h" #include "commands.h" @@ -81,6 +85,7 @@ #include "keymap.h" #include "lstream.h" #include "macros.h" /* for defining_keyboard_macro */ +#include "menubar.h" /* #### for evil kludges. */ #include "process.h" #include "window.h" @@ -107,21 +112,24 @@ Lisp_Object Vpre_command_hook, Vpost_command_hook; Lisp_Object Qpre_command_hook, Qpost_command_hook; +/* See simple.el */ +Lisp_Object Qhandle_pre_motion_command, Qhandle_post_motion_command; + /* Hook run when XEmacs is about to be idle. */ Lisp_Object Qpre_idle_hook, Vpre_idle_hook; /* Control gratuitous keyboard focus throwing. */ int focus_follows_mouse; -#ifdef ILL_CONCEIVED_HOOK +int modifier_keys_are_sticky; + +#if 0 /* FSF Emacs crap */ /* Hook run after a command if there's no more input soon. */ Lisp_Object Qpost_command_idle_hook, Vpost_command_idle_hook; /* Delay time in microseconds before running post-command-idle-hook. */ int post_command_idle_delay; -#endif /* ILL_CONCEIVED_HOOK */ - -#ifdef DEFERRED_ACTION_CRAP + /* List of deferred actions to be performed at a later time. The precise format isn't relevant here; we just check whether it is nil. */ Lisp_Object Vdeferred_action_list; @@ -129,7 +137,7 @@ /* Function to call to handle deferred actions, when there are any. */ Lisp_Object Vdeferred_action_function; Lisp_Object Qdeferred_action_function; -#endif /* DEFERRED_ACTION_CRAP */ +#endif /* FSF Emacs crap */ /* Non-nil disable property on a command means do not execute it; call disabled-command-hook's value instead. */ @@ -164,13 +172,20 @@ static Lisp_Object Qunread_command_events, Qunread_command_event; /* Previous command, represented by a Lisp object. - Does not include prefix commands and arg setting commands */ + Does not include prefix commands and arg setting commands. */ Lisp_Object Vlast_command; +/* Contents of this-command-properties for the last command. */ +Lisp_Object Vlast_command_properties; + /* If a command sets this, the value goes into - previous-command for the next command. */ + last-command for the next command. */ Lisp_Object Vthis_command; +/* If a command sets this, the value goes into + last-command-properties for the next command. */ +Lisp_Object Vthis_command_properties; + /* The value of point when the last command was executed. */ Bufpos last_point_position; @@ -235,30 +250,6 @@ recent-keys. */ int inhibit_input_event_recording; -/* prefix key(s) that must match in order to activate menu. - This is ugly. fix me. - */ -Lisp_Object Vmenu_accelerator_prefix; - -/* list of modifier keys to match accelerator for top level menus */ -Lisp_Object Vmenu_accelerator_modifiers; - -/* whether menu accelerators are enabled */ -Lisp_Object Vmenu_accelerator_enabled; - -/* keymap for auxiliary menu accelerator functions */ -Lisp_Object Vmenu_accelerator_map; - -Lisp_Object Qmenu_force; -Lisp_Object Qmenu_fallback; -Lisp_Object Qmenu_quit; -Lisp_Object Qmenu_up; -Lisp_Object Qmenu_down; -Lisp_Object Qmenu_left; -Lisp_Object Qmenu_right; -Lisp_Object Qmenu_select; -Lisp_Object Qmenu_escape; - Lisp_Object Qself_insert_defer_undo; /* this is in keymap.c */ @@ -288,60 +279,6 @@ /* The callback routines for the window system or terminal driver */ struct event_stream *event_stream; -/* This structure is what we use to encapsulate the state of a command sequence - being composed; key events are executed by adding themselves to the command - builder; if the command builder is then complete (does not still represent - a prefix key sequence) it executes the corresponding command. - */ -struct command_builder -{ - struct lcrecord_header header; - Lisp_Object console; /* back pointer to the console this command - builder is for */ - /* Qnil, or a Lisp_Event representing the first event read - * after the last command completed. Threaded. */ - /* #### NYI */ - Lisp_Object prefix_events; - /* Qnil, or a Lisp_Event representing event in the current - * keymap-lookup sequence. Subsequent events are threaded via - * the event's next slot */ - Lisp_Object current_events; - /* Last elt of above */ - Lisp_Object most_current_event; - /* Last elt before function map code took over. What this means is: - All prefixes up to (but not including) this event have non-nil - bindings, but the prefix including this event has a nil binding. - Any events in the chain after this one were read solely because - we're part of a possible function key. If we end up with - 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]; - - Bufbyte *echo_buf; - Bytecount echo_buf_length; /* size of echo_buf */ - Bytecount echo_buf_index; /* index into echo_buf - * -1 before doing echoing for new cmd */ - /* Self-insert-command is magic in that it doesn't always push an undo- - boundary: up to 20 consecutive self-inserts can happen before an undo- - boundary is pushed. This variable is that counter. - */ - int self_insert_countdown; -}; - static void echo_key_event (struct command_builder *, Lisp_Object event); static void maybe_kbd_translate (Lisp_Object event); @@ -507,6 +444,13 @@ 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) { @@ -666,6 +610,14 @@ event_stream->quit_p_cb (); } +static int +event_stream_current_event_timestamp (struct console *c) +{ + if (event_stream && event_stream->current_event_timestamp_cb) + return event_stream->current_event_timestamp_cb (c); + else + return 0; +} /**********************************************************************/ @@ -734,7 +686,10 @@ if (minibuf_level == 0 && echo_keystrokes > 0.0 - && !lw_menu_active) +#if defined (HAVE_X_WINDOWS) && defined (LWLIB_MENUBARS_LUCID) + && !x_kludge_lw_menu_active () +#endif + ) { if (!no_snooze) { @@ -820,6 +775,17 @@ XEVENT (event)->event.key.keysym = traduit; did_translate = 1; } + else if (CHARP (traduit)) + { + Lisp_Event ev2; + + zero_event (&ev2); + 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; + did_translate = 1; + } } #ifdef DEBUG_XEMACS @@ -1115,7 +1081,7 @@ static void print_timeout (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - CONST Lisp_Timeout *t = XTIMEOUT (obj); + const Lisp_Timeout *t = XTIMEOUT (obj); char buf[64]; sprintf (buf, "#", @@ -2090,7 +2056,12 @@ -- any events in `unread-command-events' or `unread-command-event'; else -- the next event in the currently executing keyboard macro, if any; else --- an event queued by `enqueue-eval-event', if any; else +-- an event queued by `enqueue-eval-event', if any, or any similar event + queued internally, such as a misc-user event. (For example, when an item + is selected from a menu or from a `question'-type dialog box, the item's + callback is not immediately executed, but instead a misc-user event + is generated and placed onto this queue; when it is dispatched, the + callback is executed.) Else -- the next available event from the window system or terminal driver. In the last case, this function will block until an event is available. @@ -2123,9 +2094,6 @@ XCOMMAND_BUILDER (con->command_builder); int store_this_key = 0; struct gcpro gcpro1; -#ifdef LWLIB_MENUBARS_LUCID - extern int in_menu_callback; /* defined in menubar-x.c */ -#endif /* LWLIB_MENUBARS_LUCID */ GCPRO1 (event); /* DO NOT do QUIT anywhere within this function or the functions it calls. @@ -2401,6 +2369,56 @@ return event; } +DEFUN ("dispatch-non-command-events", Fdispatch_non_command_events, 0, 0, 0, /* +Dispatch any pending "magic" events. + +This function is useful for forcing the redisplay of native +widgets. Normally these are redisplayed through a native window-system +event encoded as magic event, rather than by the redisplay code. This +function does not call redisplay or do any of the other things that +`next-event' does. +*/ + ()) +{ + /* This function can GC */ + Lisp_Object event = Qnil; + struct gcpro gcpro1; + GCPRO1 (event); + event = Fmake_event (Qnil, Qnil); + + /* Make sure that there will be something in the native event queue + so that externally managed things (e.g. widgets) get some CPU + time. */ + event_stream_force_event_pending (selected_frame ()); + + while (event_stream_event_pending_p (0)) + { + QUIT; /* next_event_internal() does not QUIT. */ + + /* We're a generator of the command_event_queue, so we can't be a + consumer as well. Also, we have no reason to consult the + command_event_queue; there are only user and eval-events there, + and we'd just have to put them back anyway. + */ + next_event_internal (event, 0); /* blocks */ + /* See the comment in accept-process-output about Vquit_flag */ + if (XEVENT_TYPE (event) == magic_event || + XEVENT_TYPE (event) == timeout_event || + XEVENT_TYPE (event) == process_event || + XEVENT_TYPE (event) == pointer_motion_event) + execute_internal_event (event); + else + { + enqueue_command_event_1 (event); + break; + } + } + + Fdeallocate_event (event); + UNGCPRO; + return Qnil; +} + static void reset_current_events (struct command_builder *command_builder) { @@ -2881,10 +2899,8 @@ return result; } -/* This handy little function is used by xselect.c and energize.c to - wait for replies from processes that aren't really processes (that is, - the X server and the Energize server). - */ +/* This handy little function is used by select-x.c to wait for replies + from processes that aren't really processes (e.g. the X server) */ void wait_delaying_user_input (int (*predicate) (void *arg), void *predicate_arg) { @@ -3096,502 +3112,6 @@ return event_binding (event0, 1); } -#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) -static void -menu_move_up (void) -{ - widget_value *current = lw_get_entries (False); - widget_value *entries = lw_get_entries (True); - widget_value *prev = NULL; - - while (entries != current) - { - if (entries->name /*&& entries->enabled*/) prev = entries; - entries = entries->next; - assert (entries); - } - - if (!prev) - /* move to last item */ - { - while (entries->next) - { - if (entries->name /*&& entries->enabled*/) prev = entries; - entries = entries->next; - } - if (prev) - { - if (entries->name /*&& entries->enabled*/) - prev = entries; - } - else - { - /* no selectable items in this menu, pop up to previous level */ - lw_pop_menu (); - return; - } - } - lw_set_item (prev); -} - -static void -menu_move_down (void) -{ - widget_value *current = lw_get_entries (False); - widget_value *new = current; - - while (new->next) - { - new = new->next; - if (new->name /*&& new->enabled*/) break; - } - - if (new==current||!(new->name/*||new->enabled*/)) - { - new = lw_get_entries (True); - while (new!=current) - { - if (new->name /*&& new->enabled*/) break; - new = new->next; - } - if (new==current&&!(new->name /*|| new->enabled*/)) - { - lw_pop_menu (); - return; - } - } - - lw_set_item (new); -} - -static void -menu_move_left (void) -{ - int level = lw_menu_level (); - int l = level; - widget_value *current; - - while (level-- >= 3) - lw_pop_menu (); - - menu_move_up (); - current = lw_get_entries (False); - if (l > 2 && current->contents) - lw_push_menu (current->contents); -} - -static void -menu_move_right (void) -{ - int level = lw_menu_level (); - int l = level; - widget_value *current; - - while (level-- >= 3) - lw_pop_menu (); - - menu_move_down (); - current = lw_get_entries (False); - if (l > 2 && current->contents) - lw_push_menu (current->contents); -} - -static void -menu_select_item (widget_value *val) -{ - if (val == NULL) - val = lw_get_entries (False); - - /* is match a submenu? */ - - if (val->contents) - { - /* enter the submenu */ - - lw_set_item (val); - lw_push_menu (val->contents); - } - else - { - /* Execute the menu entry by calling the menu's `select' - callback function - */ - lw_kill_menus (val); - } -} - -static Lisp_Object -command_builder_operate_menu_accelerator (struct command_builder *builder) -{ - /* this function can GC */ - - struct console *con = XCONSOLE (Vselected_console); - Lisp_Object evee = builder->most_current_event; - Lisp_Object binding; - widget_value *entries; - - extern int lw_menu_accelerate; /* lwlib.c */ - -#if 0 - { - int i; - Lisp_Object t; - char buf[50]; - - t = builder->current_events; - i = 0; - while (!NILP (t)) - { - i++; - sprintf (buf,"OPERATE (%d): ",i); - write_c_string (buf, Qexternal_debugging_output); - print_internal (t, Qexternal_debugging_output, 1); - write_c_string ("\n", Qexternal_debugging_output); - t = XEVENT_NEXT (t); - } - } -#endif /* 0 */ - - /* menu accelerator keys don't go into keyboard macros */ - if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro)) - con->kbd_macro_ptr = con->kbd_macro_end; - - /* don't echo menu accelerator keys */ - /*reset_key_echo (builder, 1);*/ - - if (!lw_menu_accelerate) - { - /* `convert' mouse display to keyboard display - by entering the open submenu - */ - entries = lw_get_entries (False); - if (entries->contents) - { - lw_push_menu (entries->contents); - lw_display_menu (CurrentTime); - } - } - - /* compare event to the current menu accelerators */ - - entries=lw_get_entries (True); - - while (entries) - { - Lisp_Object accel; - VOID_TO_LISP (accel, entries->accel); - if (entries->name && !NILP (accel)) - { - if (event_matches_key_specifier_p (XEVENT (evee), accel)) - { - /* a match! */ - - menu_select_item (entries); - - if (lw_menu_active) lw_display_menu (CurrentTime); - - reset_this_command_keys (Vselected_console, 1); - /*reset_command_builder_event_chain (builder);*/ - return Vmenu_accelerator_map; - } - } - entries = entries->next; - } - - /* try to look up event in menu-accelerator-map */ - - binding = event_binding_in (evee, Vmenu_accelerator_map, 1); - - if (NILP (binding)) - { - /* beep at user for undefined key */ - return Qnil; - } - else - { - if (EQ (binding, Qmenu_quit)) - { - /* turn off menus and set quit flag */ - lw_kill_menus (NULL); - Vquit_flag = Qt; - } - else if (EQ (binding, Qmenu_up)) - { - int level = lw_menu_level (); - if (level > 2) - menu_move_up (); - } - else if (EQ (binding, Qmenu_down)) - { - int level = lw_menu_level (); - if (level > 2) - menu_move_down (); - else - menu_select_item (NULL); - } - else if (EQ (binding, Qmenu_left)) - { - int level = lw_menu_level (); - if (level > 3) - { - lw_pop_menu (); - lw_display_menu (CurrentTime); - } - else - menu_move_left (); - } - else if (EQ (binding, Qmenu_right)) - { - int level = lw_menu_level (); - if (level > 2 && - lw_get_entries (False)->contents) - { - widget_value *current = lw_get_entries (False); - if (current->contents) - menu_select_item (NULL); - } - else - menu_move_right (); - } - else if (EQ (binding, Qmenu_select)) - menu_select_item (NULL); - else if (EQ (binding, Qmenu_escape)) - { - int level = lw_menu_level (); - - if (level > 2) - { - lw_pop_menu (); - lw_display_menu (CurrentTime); - } - else - { - /* turn off menus quietly */ - lw_kill_menus (NULL); - } - } - else if (KEYMAPP (binding)) - { - /* prefix key */ - reset_this_command_keys (Vselected_console, 1); - /*reset_command_builder_event_chain (builder);*/ - return binding; - } - else - { - /* turn off menus and execute binding */ - lw_kill_menus (NULL); - reset_this_command_keys (Vselected_console, 1); - /*reset_command_builder_event_chain (builder);*/ - return binding; - } - } - - if (lw_menu_active) lw_display_menu (CurrentTime); - - reset_this_command_keys (Vselected_console, 1); - /*reset_command_builder_event_chain (builder);*/ - - return Vmenu_accelerator_map; -} - -static Lisp_Object -menu_accelerator_junk_on_error (Lisp_Object errordata, Lisp_Object ignored) -{ - Vmenu_accelerator_prefix = Qnil; - Vmenu_accelerator_modifiers = Qnil; - Vmenu_accelerator_enabled = Qnil; - if (!NILP (errordata)) - { - Lisp_Object args[2]; - - args[0] = build_string ("Error in menu accelerators (setting to nil)"); - /* #### This should call - (with-output-to-string (display-error errordata)) - but that stuff is all in Lisp currently. */ - args[1] = errordata; - warn_when_safe_lispobj - (Qerror, Qwarning, - emacs_doprnt_string_lisp ((CONST Bufbyte *) "%s: %s", - Qnil, -1, 2, args)); - } - - return Qnil; -} - -static Lisp_Object -menu_accelerator_safe_compare (Lisp_Object event0) -{ - if (CONSP (Vmenu_accelerator_prefix)) - { - Lisp_Object t; - t=Vmenu_accelerator_prefix; - while (!NILP (t) - && !NILP (event0) - && event_matches_key_specifier_p (XEVENT (event0), Fcar (t))) - { - t = Fcdr (t); - event0 = XEVENT_NEXT (event0); - } - if (!NILP (t)) - return Qnil; - } - else if (NILP (event0)) - return Qnil; - else if (event_matches_key_specifier_p (XEVENT (event0), Vmenu_accelerator_prefix)) - event0 = XEVENT_NEXT (event0); - else - return Qnil; - return event0; -} - -static Lisp_Object -menu_accelerator_safe_mod_compare (Lisp_Object cons) -{ - return (event_matches_key_specifier_p (XEVENT (XCAR (cons)), XCDR (cons)) - ? Qt - : Qnil); -} - -static Lisp_Object -command_builder_find_menu_accelerator (struct command_builder *builder) -{ - /* this function can GC */ - Lisp_Object event0 = builder->current_events; - struct console *con = XCONSOLE (Vselected_console); - struct frame *f = XFRAME (CONSOLE_SELECTED_FRAME (con)); - Widget menubar_widget; - - /* compare entries in event0 against the menu prefix */ - - if ((!CONSOLE_X_P (XCONSOLE (builder->console))) || NILP (event0) || - XEVENT (event0)->event_type != key_press_event) - return Qnil; - - if (!NILP (Vmenu_accelerator_prefix)) - { - event0 = condition_case_1 (Qerror, - menu_accelerator_safe_compare, - event0, - menu_accelerator_junk_on_error, - Qnil); - } - - if (NILP (event0)) - return Qnil; - - menubar_widget = FRAME_X_MENUBAR_WIDGET (f); - if (menubar_widget - && CONSP (Vmenu_accelerator_modifiers)) - { - Lisp_Object fake; - Lisp_Object last = Qnil; - struct gcpro gcpro1; - Lisp_Object matchp; - - widget_value *val; - LWLIB_ID id = XPOPUP_DATA (f->menubar_data)->id; - - val = lw_get_all_values (id); - if (val) - { - val = val->contents; - - fake = Fcopy_sequence (Vmenu_accelerator_modifiers); - last = fake; - - while (!NILP (Fcdr (last))) - last = Fcdr (last); - - Fsetcdr (last, Fcons (Qnil, Qnil)); - last = Fcdr (last); - } - - fake = Fcons (Qnil, fake); - - GCPRO1 (fake); - - while (val) - { - Lisp_Object accel; - VOID_TO_LISP (accel, val->accel); - if (val->name && !NILP (accel)) - { - Fsetcar (last, accel); - Fsetcar (fake, event0); - matchp = condition_case_1 (Qerror, - menu_accelerator_safe_mod_compare, - fake, - menu_accelerator_junk_on_error, - Qnil); - if (!NILP (matchp)) - { - /* we found one! */ - - lw_set_menu (menubar_widget, val); - /* yah - yet another hack. - pretend emacs timestamp is the same as an X timestamp, - which for the moment it is. (read events.h) - */ - lw_map_menu (XEVENT (event0)->timestamp); - - if (val->contents) - lw_push_menu (val->contents); - - lw_display_menu (CurrentTime); - - /* menu accelerator keys don't go into keyboard macros */ - if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro)) - con->kbd_macro_ptr = con->kbd_macro_end; - - /* don't echo menu accelerator keys */ - /*reset_key_echo (builder, 1);*/ - reset_this_command_keys (Vselected_console, 1); - UNGCPRO; - - return Vmenu_accelerator_map; - } - } - - val = val->next; - } - - UNGCPRO; - } - return Qnil; -} - - -DEFUN ("accelerate-menu", Faccelerate_menu, 0, 0, "_", /* -Make the menubar active. Menu items can be selected using menu accelerators -or by actions defined in menu-accelerator-map. -*/ - ()) -{ - struct console *con = XCONSOLE (Vselected_console); - struct frame *f = XFRAME (CONSOLE_SELECTED_FRAME (con)); - LWLIB_ID id; - widget_value *val; - - if (NILP (f->menubar_data)) - error ("Frame has no menubar."); - - id = XPOPUP_DATA (f->menubar_data)->id; - val = lw_get_all_values (id); - val = val->contents; - lw_set_menu (FRAME_X_MENUBAR_WIDGET (f), val); - lw_map_menu (CurrentTime); - - lw_display_menu (CurrentTime); - - /* menu accelerator keys don't go into keyboard macros */ - if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro)) - con->kbd_macro_ptr = con->kbd_macro_end; - - return Qnil; -} -#endif /* HAVE_X_WINDOWS && HAVE_MENUBARS */ - /* 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. */ @@ -3713,9 +3233,11 @@ return Qnil; } - /* if we're currently in a menu accelerator, check there for further events */ + /* if we're currently in a menu accelerator, check there for further + events */ + /* #### fuck me! who wrote this crap? think "abstraction", baby. */ #if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) - if (lw_menu_active) + if (x_kludge_lw_menu_active ()) { return command_builder_operate_menu_accelerator (builder); } @@ -3766,14 +3288,14 @@ Lisp_Object terminal = builder->most_current_event; struct key_data* key = & XEVENT (terminal)->event.key; Emchar c = 0; - if ((key->modifiers & MOD_SHIFT) + if ((key->modifiers & XEMACS_MOD_SHIFT) || (CHAR_OR_CHAR_INTP (key->keysym) && ((c = XCHAR_OR_CHAR_INT (key->keysym)), c >= 'A' && c <= 'Z'))) { Lisp_Event terminal_copy = *XEVENT (terminal); - if (key->modifiers & MOD_SHIFT) - key->modifiers &= (~ MOD_SHIFT); + if (key->modifiers & XEMACS_MOD_SHIFT) + key->modifiers &= (~ XEMACS_MOD_SHIFT); else key->keysym = make_char (c + 'a' - 'A'); @@ -4174,10 +3696,10 @@ Fcopy_event (event, recent); e = XEVENT (recent); if (e->event_type == key_press_event) - e->event.key.modifiers |= MOD_META; + 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 |= MOD_META; + e->event.button.modifiers |= XEMACS_MOD_META; else abort (); @@ -4208,7 +3730,11 @@ if (KEYMAPP (leaf)) { - if (!lw_menu_active) +#if defined (HAVE_X_WINDOWS) && defined (LWLIB_MENUBARS_LUCID) + if (!x_kludge_lw_menu_active ()) +#else + if (1) +#endif { Lisp_Object prompt = Fkeymap_prompt (leaf, Qt); if (STRINGP (prompt)) @@ -4228,19 +3754,20 @@ else maybe_echo_keys (command_builder, 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 = make_console (con); - - enqueue_command_event (quit_event); - Vquit_flag = Qnil; - } + 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 = make_console (con); + + enqueue_command_event (quit_event); + Vquit_flag = Qnil; + } } else if (!NILP (leaf)) { @@ -4359,6 +3886,9 @@ { /* Start a new command next time */ Vlast_command = Vthis_command; + Vlast_command_properties = Vthis_command_properties; + Vthis_command_properties = Qnil; + /* Emacs 18 doesn't unconditionally clear the echoed keystrokes, so we don't either */ reset_this_command_keys (make_console (con), 0); @@ -4379,6 +3909,9 @@ safe_run_hook_trapping_errors ("Error in `pre-command-hook' (setting hook to nil)", Qpre_command_hook, 1); + + /* This is a kludge, but necessary; see simple.el */ + call0 (Qhandle_pre_motion_command); } /* Run the post command hook. */ @@ -4398,14 +3931,18 @@ Lisp_Object win = Fselected_window (Qnil); -#if 0 /* If the last command deleted the frame, `win' might be nil. It seems safest to do nothing in this case. */ + /* Note: Someone added the following comment and put #if 0's around + this code, not realizing that doing this invites a crash in the + line after. */ /* #### This doesn't really fix the problem, if delete-frame is called by some hook */ if (NILP (win)) return; -#endif + + /* This is a kludge, but necessary; see simple.el */ + call0 (Qhandle_post_motion_command); if (! zmacs_region_stays && (!MINI_WINDOW_P (XWINDOW (win)) @@ -4418,12 +3955,10 @@ ("Error in `post-command-hook' (setting hook to nil)", Qpost_command_hook, 1); -#ifdef DEFERRED_ACTION_CRAP +#if 0 /* FSF Emacs crap */ if (!NILP (Vdeferred_action_list)) call0 (Vdeferred_action_function); -#endif - -#ifdef ILL_CONCEIVED_HOOK + if (NILP (Vunread_command_events) && NILP (Vexecuting_macro) && !NILP (Vpost_command_idle_hook) @@ -4432,9 +3967,9 @@ safe_run_hook_trapping_errors ("Error in `post-command-idle-hook' (setting hook to nil)", Qpost_command_idle_hook, 1); -#endif - -#if 0 /* FSFmacs */ +#endif /* FSF Emacs crap */ + +#if 0 /* FSF Emacs */ if (!NILP (current_buffer->mark_active)) { if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode)) @@ -4446,7 +3981,7 @@ BUF_MODIFF (current_buffer) != prev_modiff) run_hook (intern ("activate-mark-hook")); } -#endif /* FSFmacs */ +#endif /* FSF Emacs */ /* #### Kludge!!! This is necessary to make sure that things are properly positioned even if post-command-hook moves point. @@ -4606,10 +4141,10 @@ be done without an undo boundary. This counter is reset as soon as a command other than self-insert-command is executed. - Programmers can also use the `self-insert-undo-magic' - property to install that behaviour on functions other + Programmers can also use the `self-insert-defer-undo' + property to install that behavior on functions other than `self-insert-command', or to change the magic - number 20 to something else. */ + number 20 to something else. #### DOCUMENT THIS! */ if (SYMBOLP (leaf)) { @@ -4903,6 +4438,23 @@ } + +DEFUN ("current-event-timestamp", Fcurrent_event_timestamp, 0, 1, 0, /* +Return the current event timestamp of the window system associated with CONSOLE. +CONSOLE defaults to the selected console if omitted. +*/ + (console)) +{ + struct console *c = decode_console (console); + int tiempo = event_stream_current_event_timestamp (c); + + /* This junk is so that timestamps don't get to be negative, but contain + as many bits as this particular emacs will allow. + */ + return make_int (((1L << (VALBITS - 1)) - 1) & tiempo); +} + + /************************************************************************/ /* initialization */ /************************************************************************/ @@ -4910,11 +4462,13 @@ void syms_of_event_stream (void) { + INIT_LRECORD_IMPLEMENTATION (command_builder); + INIT_LRECORD_IMPLEMENTATION (timeout); + defsymbol (&Qdisabled, "disabled"); defsymbol (&Qcommand_event_p, "command-event-p"); - deferror (&Qundefined_keystroke_sequence, "undefined-keystroke-sequence", - "Undefined keystroke sequence", Qerror); + DEFERROR_STANDARD (Qundefined_keystroke_sequence, Qinvalid_argument); DEFSUBR (Frecent_keys); DEFSUBR (Frecent_keys_ring_size); @@ -4932,23 +4486,22 @@ DEFSUBR (Fadd_async_timeout); DEFSUBR (Fdisable_async_timeout); DEFSUBR (Fdispatch_event); + DEFSUBR (Fdispatch_non_command_events); DEFSUBR (Fread_key_sequence); DEFSUBR (Fthis_command_keys); DEFSUBR (Freset_this_command_lengths); DEFSUBR (Fopen_dribble_file); -#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) - DEFSUBR (Faccelerate_menu); -#endif + DEFSUBR (Fcurrent_event_timestamp); defsymbol (&Qpre_command_hook, "pre-command-hook"); defsymbol (&Qpost_command_hook, "post-command-hook"); defsymbol (&Qunread_command_events, "unread-command-events"); defsymbol (&Qunread_command_event, "unread-command-event"); defsymbol (&Qpre_idle_hook, "pre-idle-hook"); -#ifdef ILL_CONCEIVED_HOOK + defsymbol (&Qhandle_pre_motion_command, "handle-pre-motion-command"); + defsymbol (&Qhandle_post_motion_command, "handle-post-motion-command"); +#if 0 /* FSF Emacs crap */ defsymbol (&Qpost_command_idle_hook, "post-command-idle-hook"); -#endif -#ifdef DEFERRED_ACTION_CRAP defsymbol (&Qdeferred_action_function, "deferred-action-function"); #endif defsymbol (&Qretry_undefined_key_binding_unshifted, @@ -4956,17 +4509,6 @@ defsymbol (&Qauto_show_make_point_visible, "auto-show-make-point-visible"); - defsymbol (&Qmenu_force, "menu-force"); - defsymbol (&Qmenu_fallback, "menu-fallback"); - - defsymbol (&Qmenu_quit, "menu-quit"); - defsymbol (&Qmenu_up, "menu-up"); - defsymbol (&Qmenu_down, "menu-down"); - defsymbol (&Qmenu_left, "menu-left"); - defsymbol (&Qmenu_right, "menu-right"); - defsymbol (&Qmenu_select, "menu-select"); - defsymbol (&Qmenu_escape, "menu-escape"); - defsymbol (&Qself_insert_defer_undo, "self-insert-defer-undo"); defsymbol (&Qcancel_mode_internal, "cancel-mode-internal"); } @@ -5047,7 +4589,7 @@ This occurs whenever it is going to block, waiting for an event. This generally happens as a result of a call to `next-event', `next-command-event', `sit-for', `sleep-for', `accept-process-output', -`x-get-selection', or various Energize-specific commands. +or `x-get-selection'. Errors running the hook are caught and ignored. */ ); Vpre_idle_hook = Qnil; @@ -5060,7 +4602,7 @@ */ ); focus_follows_mouse = 0; -#ifdef ILL_CONCEIVED_HOOK +#if 0 /* FSF Emacs crap */ /* Ill-conceived because it's not run in all sorts of cases where XEmacs is blocking. That's what `pre-idle-hook' is designed to solve. */ @@ -5077,9 +4619,7 @@ This is measured in microseconds. */ ); post_command_idle_delay = 5000; -#endif /* ILL_CONCEIVED_HOOK */ - -#ifdef DEFERRED_ACTION_CRAP + /* Random FSFmacs crap. There is absolutely nothing to gain, and a great deal to lose, in using this in place of just setting `post-command-hook'. */ @@ -5095,7 +4635,7 @@ whenever `deferred-action-list' is non-nil. */ ); Vdeferred_action_function = Qnil; -#endif /* DEFERRED_ACTION_CRAP */ +#endif /* FSF Emacs crap */ DEFVAR_LISP ("last-command-event", &Vlast_command_event /* Last keyboard or mouse button event that was part of a command. This @@ -5185,6 +4725,23 @@ */ ); Vthis_command = Qnil; + DEFVAR_LISP ("last-command-properties", &Vlast_command_properties /* +Value of `this-command-properties' for the last command. +Used by commands to help synchronize consecutive commands, in preference +to looking at `last-command' directly. +*/ ); + Vlast_command_properties = Qnil; + + DEFVAR_LISP ("this-command-properties", &Vthis_command_properties /* +Properties set by the current command. +At the beginning of each command, the current value of this variable is +copied to `last-command-properties', and then it is set to nil. Use `putf' +to add properties to this variable. Commands should use this to communicate +with pre/post-command hooks, subsequent commands, wrapping commands, etc. +in preference to looking at and/or setting `this-command'. +*/ ); + Vthis_command_properties = Qnil; + DEFVAR_LISP ("help-char", &Vhelp_char /* Character to recognize as meaning Help. When it is read, do `(eval help-form)', and display result if it's a string. @@ -5218,6 +4775,10 @@ keysym changed and its modifiers left alone. This is useful for dealing with non-standard X keyboards, such as the grievous damage that Sun has inflicted upon the world. +-- If an entry maps a symbol to a character, then a key-press event + whose keysym is the former symbol (with any modifiers at all) gets + changed into a key-press event matching the latter character, and the + resulting modifiers are the union of the original and new modifiers. -- If an entry maps a character to a character, then a key-press event matching the former character gets converted to a key-press event matching the latter character. This is useful on ASCII terminals @@ -5226,6 +4787,16 @@ -- If an entry maps a character to a symbol, then a key-press event matching the character gets converted to a key-press event whose keysym is the given symbol and which has no modifiers. + +Here's an example: This makes typing parens and braces easier by rerouting +their positions to eliminate the need to use the Shift key. + + (keyboard-translate ?[ ?() + (keyboard-translate ?] ?)) + (keyboard-translate ?{ ?[) + (keyboard-translate ?} ?]) + (keyboard-translate 'f11 ?{) + (keyboard-translate 'f12 ?}) */ ); DEFVAR_LISP ("retry-undefined-key-binding-unshifted", @@ -5238,6 +4809,15 @@ */ ); Vretry_undefined_key_binding_unshifted = Qt; + DEFVAR_BOOL ("modifier-keys-are-sticky", &modifier_keys_are_sticky /* +*Non-nil makes modifier keys sticky. +This means that you can release the modifier key before pressing down +the key that you wish to be modified. Although this is non-standard +behavior, it is recommended because it reduces the strain on your hand, +thus reducing the incidence of the dreaded Emacs-pinky syndrome. +*/ ); + modifier_keys_are_sticky = 0; + #ifdef HAVE_XIM DEFVAR_LISP ("composed-character-default-binding", &Vcomposed_character_default_binding /* @@ -5298,41 +4878,6 @@ Non-nil inhibits recording of input-events to recent-keys ring. */ ); inhibit_input_event_recording = 0; - - DEFVAR_LISP("menu-accelerator-prefix", &Vmenu_accelerator_prefix /* -Prefix key(s) that must be typed before menu accelerators will be activated. -Set this to a value acceptable by define-key. -*/ ); - Vmenu_accelerator_prefix = Qnil; - - DEFVAR_LISP ("menu-accelerator-modifiers", &Vmenu_accelerator_modifiers /* -Modifier keys which must be pressed to get to the top level menu accelerators. -This is a list of modifier key symbols. All modifier keys must be held down -while a valid menu accelerator key is pressed in order for the top level -menu to become active. - -See also menu-accelerator-enabled and menu-accelerator-prefix. -*/ ); - Vmenu_accelerator_modifiers = list1 (Qmeta); - - DEFVAR_LISP ("menu-accelerator-enabled", &Vmenu_accelerator_enabled /* -Whether menu accelerator keys can cause the menubar to become active. -If 'menu-force or 'menu-fallback, then menu accelerator keys can -be used to activate the top level menu. Once the menubar becomes active, the -accelerator keys can be used regardless of the value of this variable. - -menu-force is used to indicate that the menu accelerator key takes -precedence over bindings in the current keymap(s). menu-fallback means -that bindings in the current keymap take precedence over menu accelerator keys. -Thus a top level menu with an accelerator of "T" would be activated on a -keypress of Meta-t if menu-accelerator-enabled is menu-force. -However, if menu-accelerator-enabled is menu-fallback, then -Meta-t will not activate the menubar and will instead run the function -transpose-words, to which it is normally bound. - -See also menu-accelerator-modifiers and menu-accelerator-prefix. -*/ ); - Vmenu_accelerator_enabled = Qnil; } void @@ -5340,41 +4885,6 @@ { Vkeyboard_translate_table = make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); - - DEFVAR_LISP ("menu-accelerator-map", &Vmenu_accelerator_map /* -Keymap for use when the menubar is active. -The actions menu-quit, menu-up, menu-down, menu-left, menu-right, -menu-select and menu-escape can be mapped to keys in this map. - -menu-quit Immediately deactivate the menubar and any open submenus without - selecting an item. -menu-up Move the menu cursor up one row in the current menu. If the - move extends past the top of the menu, wrap around to the bottom. -menu-down Move the menu cursor down one row in the current menu. If the - move extends past the bottom of the menu, wrap around to the top. - If executed while the cursor is in the top level menu, move down - into the selected menu. -menu-left Move the cursor from a submenu into the parent menu. If executed - while the cursor is in the top level menu, move the cursor to the - left. If the move extends past the left edge of the menu, wrap - around to the right edge. -menu-right Move the cursor into a submenu. If the cursor is located in the - top level menu or is not currently on a submenu heading, then move - the cursor to the next top level menu entry. If the move extends - past the right edge of the menu, wrap around to the left edge. -menu-select Activate the item under the cursor. If the cursor is located on - a submenu heading, then move the cursor into the submenu. -menu-escape Pop up to the next level of menus. Moves from a submenu into its - parent menu. From the top level menu, this deactivates the - menubar. - -This keymap can also contain normal key-command bindings, in which case the -menubar is deactivated and the corresponding command is executed. - -The action bindings used by the menu accelerator code are designed to mimic -the actions of menu traversal keys in a commonly used PC operating system. -*/ ); - Vmenu_accelerator_map = Fmake_keymap(Qnil); } void diff -r 72a7cfa4a488 -r abe6d1db359e src/event-tty.c --- a/src/event-tty.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/event-tty.c Mon Aug 13 11:35:02 2007 +0200 @@ -249,6 +249,7 @@ tty_event_stream = xnew (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->add_timeout_cb = emacs_tty_add_timeout; diff -r 72a7cfa4a488 -r abe6d1db359e src/event-unixoid.c --- a/src/event-unixoid.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/event-unixoid.c Mon Aug 13 11:35:02 2007 +0200 @@ -225,7 +225,7 @@ { /* Something went seriously wrong; don't abort since maybe the TTY just died at the wrong time. */ - fprintf (stderr, "xemacs: select failed: errno = %d\n", errno); + stderr_out ("xemacs: select failed: errno = %d\n", errno); return 0; } /* else, we got interrupted by a signal, so try again. */ diff -r 72a7cfa4a488 -r abe6d1db359e src/events-mod.h --- a/src/events-mod.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/events-mod.h Mon Aug 13 11:35:02 2007 +0200 @@ -1,8 +1,13 @@ /* The modifiers XEmacs knows about; these appear in key and button events. */ -#define MOD_CONTROL (1<<0) -#define MOD_META (1<<1) -#define MOD_SUPER (1<<2) -#define MOD_HYPER (1<<3) -#define MOD_ALT (1<<4) -#define MOD_SHIFT (1<<5) /* not used for dual-case characters */ +#define XEMACS_MOD_CONTROL (1<<0) +#define XEMACS_MOD_META (1<<1) +#define XEMACS_MOD_SUPER (1<<2) +#define XEMACS_MOD_HYPER (1<<3) +#define XEMACS_MOD_ALT (1<<4) +#define XEMACS_MOD_SHIFT (1<<5) /* not used for dual-case characters */ +#define XEMACS_MOD_BUTTON1 (1<<6) +#define XEMACS_MOD_BUTTON2 (1<<7) +#define XEMACS_MOD_BUTTON3 (1<<8) +#define XEMACS_MOD_BUTTON4 (1<<9) +#define XEMACS_MOD_BUTTON5 (1<<10) diff -r 72a7cfa4a488 -r abe6d1db359e src/events.c --- a/src/events.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/events.c Mon Aug 13 11:35:02 2007 +0200 @@ -37,17 +37,6 @@ #include "keymap.h" /* for key_desc_list_to_event() */ #include "redisplay.h" #include "window.h" - -#ifdef WINDOWSNT -/* Hmm, under unix we want X modifiers, under NT we want X modifiers if - we are running X and Windows modifiers otherwise. - gak. This is a kludge until we support multiple native GUIs! -*/ -#undef MOD_ALT -#undef MOD_CONTROL -#undef MOD_SHIFT -#endif - #include "events-mod.h" /* Where old events go when they are explicitly deallocated. @@ -87,7 +76,7 @@ ((int *) event) [i] = 0xdeadbeef; event->event_type = dead_event; event->channel = Qnil; - set_lheader_implementation (&(event->lheader), &lrecord_event); + set_lheader_implementation (&event->lheader, &lrecord_event); XSET_EVENT_NEXT (ev, Qnil); } @@ -96,7 +85,7 @@ zero_event (Lisp_Event *e) { xzero (*e); - set_lheader_implementation (&(e->lheader), &lrecord_event); + set_lheader_implementation (&e->lheader, &lrecord_event); e->event_type = empty_event; e->next = Qnil; e->channel = Qnil; @@ -142,7 +131,7 @@ } static void -print_event_1 (CONST char *str, Lisp_Object obj, Lisp_Object printcharfun) +print_event_1 (const char *str, Lisp_Object obj, Lisp_Object printcharfun) { char buf[255]; write_c_string (str, printcharfun); @@ -429,7 +418,6 @@ */ (type, plist)) { - Lisp_Object tail, keyword, value; Lisp_Object event = Qnil; Lisp_Event *e; EMACS_INT coord_x = 0, coord_y = 0; @@ -460,7 +448,7 @@ (e.g. CHANNEL), which we don't want in empty events. */ e->event_type = empty_event; if (!NILP (plist)) - error ("Cannot set properties of empty event"); + syntax_error ("Cannot set properties of empty event", plist); UNGCPRO; return event; } @@ -483,7 +471,7 @@ else { /* Not allowed: Qprocess, Qtimeout, Qmagic, Qeval, Qmagic_eval. */ - signal_simple_error ("Invalid event type", type); + invalid_argument ("Invalid event type", type); } EVENT_CHANNEL (e) = Qnil; @@ -491,164 +479,169 @@ plist = Fcopy_sequence (plist); Fcanonicalize_plist (plist, Qnil); -#define WRONG_EVENT_TYPE_FOR_PROPERTY(type, prop) \ - error_with_frob (prop, "Invalid property for %s event", \ - string_data (symbol_name (XSYMBOL (type)))) +#define WRONG_EVENT_TYPE_FOR_PROPERTY(event_type, prop) \ + syntax_error_2 ("Invalid property for event type", prop, event_type) - EXTERNAL_PROPERTY_LIST_LOOP (tail, keyword, value, plist) - { - if (EQ (keyword, Qchannel)) - { - if (e->event_type == key_press_event) - { - if (!CONSOLEP (value)) - value = wrong_type_argument (Qconsolep, value); - } - else - { - if (!FRAMEP (value)) - value = wrong_type_argument (Qframep, value); - } - EVENT_CHANNEL (e) = value; - } - else if (EQ (keyword, Qkey)) - { - switch (e->event_type) - { - case key_press_event: - if (!SYMBOLP (value) && !CHARP (value)) - signal_simple_error ("Invalid event key", value); - e->event.key.keysym = value; - break; - default: - WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); - break; - } - } - else if (EQ (keyword, Qbutton)) - { - CHECK_NATNUM (value); - check_int_range (XINT (value), 0, 7); + { + EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, plist) + { + if (EQ (keyword, Qchannel)) + { + if (e->event_type == key_press_event) + { + if (!CONSOLEP (value)) + value = wrong_type_argument (Qconsolep, value); + } + else + { + if (!FRAMEP (value)) + value = wrong_type_argument (Qframep, value); + } + EVENT_CHANNEL (e) = value; + } + else if (EQ (keyword, Qkey)) + { + switch (e->event_type) + { + case key_press_event: + if (!SYMBOLP (value) && !CHARP (value)) + syntax_error ("Invalid event key", value); + e->event.key.keysym = value; + break; + default: + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); + break; + } + } + else if (EQ (keyword, Qbutton)) + { + CHECK_NATNUM (value); + check_int_range (XINT (value), 0, 7); - switch (e->event_type) - { - case button_press_event: - case button_release_event: - e->event.button.button = XINT (value); - break; - case misc_user_event: - e->event.misc.button = XINT (value); - break; - default: - WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); - break; - } - } - else if (EQ (keyword, Qmodifiers)) - { - int modifiers = 0; - Lisp_Object sym; + switch (e->event_type) + { + case button_press_event: + case button_release_event: + e->event.button.button = XINT (value); + break; + case misc_user_event: + e->event.misc.button = XINT (value); + break; + default: + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); + break; + } + } + else if (EQ (keyword, Qmodifiers)) + { + int modifiers = 0; - EXTERNAL_LIST_LOOP_2 (sym, value) - { - if (EQ (sym, Qcontrol)) modifiers |= MOD_CONTROL; - else if (EQ (sym, Qmeta)) modifiers |= MOD_META; - else if (EQ (sym, Qsuper)) modifiers |= MOD_SUPER; - else if (EQ (sym, Qhyper)) modifiers |= MOD_HYPER; - else if (EQ (sym, Qalt)) modifiers |= MOD_ALT; - else if (EQ (sym, Qsymbol)) modifiers |= MOD_ALT; - else if (EQ (sym, Qshift)) modifiers |= MOD_SHIFT; - else - signal_simple_error ("Invalid key modifier", sym); - } + EXTERNAL_LIST_LOOP_2 (sym, value) + { + if (EQ (sym, Qcontrol)) modifiers |= XEMACS_MOD_CONTROL; + else if (EQ (sym, Qmeta)) modifiers |= XEMACS_MOD_META; + else if (EQ (sym, Qsuper)) modifiers |= XEMACS_MOD_SUPER; + else if (EQ (sym, Qhyper)) modifiers |= XEMACS_MOD_HYPER; + else if (EQ (sym, Qalt)) modifiers |= XEMACS_MOD_ALT; + else if (EQ (sym, Qsymbol)) modifiers |= XEMACS_MOD_ALT; + else if (EQ (sym, Qshift)) modifiers |= XEMACS_MOD_SHIFT; + else if (EQ (sym, Qbutton1)) modifiers |= XEMACS_MOD_BUTTON1; + else if (EQ (sym, Qbutton2)) modifiers |= XEMACS_MOD_BUTTON2; + else if (EQ (sym, Qbutton3)) modifiers |= XEMACS_MOD_BUTTON3; + else if (EQ (sym, Qbutton4)) modifiers |= XEMACS_MOD_BUTTON4; + else if (EQ (sym, Qbutton5)) modifiers |= XEMACS_MOD_BUTTON5; + else + syntax_error ("Invalid key modifier", sym); + } - switch (e->event_type) - { - case key_press_event: - e->event.key.modifiers = modifiers; - break; - case button_press_event: - case button_release_event: - e->event.button.modifiers = modifiers; - break; - case pointer_motion_event: - e->event.motion.modifiers = modifiers; - break; - case misc_user_event: - e->event.misc.modifiers = modifiers; - break; - default: - WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); - break; - } - } - else if (EQ (keyword, Qx)) - { - switch (e->event_type) - { - case pointer_motion_event: - case button_press_event: - case button_release_event: - case misc_user_event: - /* Allow negative values, so we can specify toolbar - positions. */ - CHECK_INT (value); - coord_x = XINT (value); - break; - default: - WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); - break; - } - } - else if (EQ (keyword, Qy)) - { - switch (e->event_type) - { - case pointer_motion_event: - case button_press_event: - case button_release_event: - case misc_user_event: - /* Allow negative values; see above. */ - CHECK_INT (value); - coord_y = XINT (value); - break; - default: - WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); - break; - } - } - else if (EQ (keyword, Qtimestamp)) - { - CHECK_NATNUM (value); - e->timestamp = XINT (value); - } - else if (EQ (keyword, Qfunction)) - { - switch (e->event_type) - { - case misc_user_event: - e->event.eval.function = value; - break; - default: - WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); - break; - } - } - else if (EQ (keyword, Qobject)) - { - switch (e->event_type) - { - case misc_user_event: - e->event.eval.object = value; - break; - default: - WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); - break; - } - } - else - signal_simple_error_2 ("Invalid property", keyword, value); - } + switch (e->event_type) + { + case key_press_event: + e->event.key.modifiers = modifiers; + break; + case button_press_event: + case button_release_event: + e->event.button.modifiers = modifiers; + break; + case pointer_motion_event: + e->event.motion.modifiers = modifiers; + break; + case misc_user_event: + e->event.misc.modifiers = modifiers; + break; + default: + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); + break; + } + } + else if (EQ (keyword, Qx)) + { + switch (e->event_type) + { + case pointer_motion_event: + case button_press_event: + case button_release_event: + case misc_user_event: + /* Allow negative values, so we can specify toolbar + positions. */ + CHECK_INT (value); + coord_x = XINT (value); + break; + default: + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); + break; + } + } + else if (EQ (keyword, Qy)) + { + switch (e->event_type) + { + case pointer_motion_event: + case button_press_event: + case button_release_event: + case misc_user_event: + /* Allow negative values; see above. */ + CHECK_INT (value); + coord_y = XINT (value); + break; + default: + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); + break; + } + } + else if (EQ (keyword, Qtimestamp)) + { + CHECK_NATNUM (value); + e->timestamp = XINT (value); + } + else if (EQ (keyword, Qfunction)) + { + switch (e->event_type) + { + case misc_user_event: + e->event.eval.function = value; + break; + default: + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); + break; + } + } + else if (EQ (keyword, Qobject)) + { + switch (e->event_type) + { + case misc_user_event: + e->event.eval.object = value; + break; + default: + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); + break; + } + } + else + syntax_error_2 ("Invalid property", keyword, value); + } + } /* Insert the channel, if missing. */ if (NILP (EVENT_CHANNEL (e))) @@ -691,19 +684,25 @@ { case key_press_event: if (UNBOUNDP (e->event.key.keysym)) - error ("A key must be specified to make a keypress event"); + syntax_error ("A key must be specified to make a keypress event", + plist); break; case button_press_event: if (!e->event.button.button) - error ("A button must be specified to make a button-press event"); + syntax_error + ("A button must be specified to make a button-press event", + plist); break; case button_release_event: if (!e->event.button.button) - error ("A button must be specified to make a button-release event"); + syntax_error + ("A button must be specified to make a button-release event", + plist); break; case misc_user_event: if (NILP (e->event.misc.function)) - error ("A function must be specified to make a misc-user event"); + syntax_error ("A function must be specified to make a misc-user event", + plist); break; default: break; @@ -977,7 +976,7 @@ int use_console_meta_flag, int do_backspace_mapping) { Lisp_Object k = Qnil; - unsigned int m = 0; + int m = 0; if (event->event_type == dead_event) error ("character-to-event called with a deallocated event!"); @@ -996,21 +995,21 @@ break; case 1: /* top bit is meta */ c -= 128; - m = MOD_META; + m = XEMACS_MOD_META; break; default: /* this is a real character */ break; } } - if (c < ' ') c += '@', m |= MOD_CONTROL; - if (m & MOD_CONTROL) + if (c < ' ') c += '@', m |= XEMACS_MOD_CONTROL; + if (m & XEMACS_MOD_CONTROL) { switch (c) { - case 'I': k = QKtab; m &= ~MOD_CONTROL; break; - case 'J': k = QKlinefeed; m &= ~MOD_CONTROL; break; - case 'M': k = QKreturn; m &= ~MOD_CONTROL; break; - case '[': k = QKescape; m &= ~MOD_CONTROL; break; + case 'I': k = QKtab; m &= ~XEMACS_MOD_CONTROL; break; + case 'J': k = QKlinefeed; m &= ~XEMACS_MOD_CONTROL; break; + case 'M': k = QKreturn; m &= ~XEMACS_MOD_CONTROL; break; + case '[': k = QKescape; m &= ~XEMACS_MOD_CONTROL; break; default: #if defined(HAVE_TTY) if (do_backspace_mapping && @@ -1018,9 +1017,9 @@ c - '@' == XCHAR (con->tty_erase_char)) { k = QKbackspace; - m &= ~MOD_CONTROL; + m &= ~XEMACS_MOD_CONTROL; } -#endif /* defined(HAVE_TTY) && !defined(__CYGWIN32__) */ +#endif /* defined(HAVE_TTY) && !defined(CYGWIN) */ break; } if (c >= 'A' && c <= 'Z') c -= 'A'-'a'; @@ -1029,7 +1028,7 @@ else if (do_backspace_mapping && CHARP (con->tty_erase_char) && c == XCHAR (con->tty_erase_char)) k = QKbackspace; -#endif /* defined(HAVE_TTY) && !defined(__CYGWIN32__) */ +#endif /* defined(HAVE_TTY) && !defined(CYGWIN) */ else if (c == 127) k = QKdelete; else if (c == ' ') @@ -1067,7 +1066,7 @@ return -1; } if (!allow_extra_modifiers && - event->event.key.modifiers & (MOD_SUPER|MOD_HYPER|MOD_ALT)) + event->event.key.modifiers & (XEMACS_MOD_SUPER|XEMACS_MOD_HYPER|XEMACS_MOD_ALT)) return -1; if (CHAR_OR_CHAR_INTP (event->event.key.keysym)) c = XCHAR_OR_CHAR_INT (event->event.key.keysym); @@ -1086,7 +1085,7 @@ else return -1; - if (event->event.key.modifiers & MOD_CONTROL) + if (event->event.key.modifiers & XEMACS_MOD_CONTROL) { if (c >= 'a' && c <= 'z') c -= ('a' - 'A'); @@ -1104,7 +1103,7 @@ if (! allow_extra_modifiers) return -1; } - if (event->event.key.modifiers & MOD_META) + if (event->event.key.modifiers & XEMACS_MOD_META) { if (! allow_meta) return -1; if (c & 0200) return -1; /* don't allow M-oslash (overlap) */ @@ -1244,13 +1243,13 @@ key = event->event.key.keysym; /* Hack. */ if (! brief && CHARP (key) && - mod & (MOD_CONTROL | MOD_META | MOD_SUPER | MOD_HYPER)) + mod & (XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER)) { int k = XCHAR (key); if (k >= 'a' && k <= 'z') key = make_char (k - ('a' - 'A')); else if (k >= 'A' && k <= 'Z') - mod |= MOD_SHIFT; + mod |= XEMACS_MOD_SHIFT; } break; } @@ -1266,7 +1265,7 @@ } case magic_event: { - CONST char *name = NULL; + const char *name = NULL; #ifdef HAVE_X_WINDOWS { @@ -1289,15 +1288,16 @@ case dead_event: strcpy (buf, "DEAD-EVENT"); return; default: abort (); + return; } #define modprint1(x) do { strcpy (buf, (x)); buf += sizeof (x)-1; } while (0) #define modprint(x,y) do { if (brief) modprint1 (y); else modprint1 (x); } while (0) - if (mod & MOD_CONTROL) modprint ("control-", "C-"); - if (mod & MOD_META) modprint ("meta-", "M-"); - if (mod & MOD_SUPER) modprint ("super-", "S-"); - if (mod & MOD_HYPER) modprint ("hyper-", "H-"); - if (mod & MOD_ALT) modprint ("alt-", "A-"); - if (mod & MOD_SHIFT) modprint ("shift-", "Sh-"); + if (mod & XEMACS_MOD_CONTROL) modprint ("control-", "C-"); + if (mod & XEMACS_MOD_META) modprint ("meta-", "M-"); + if (mod & XEMACS_MOD_SUPER) modprint ("super-", "S-"); + if (mod & XEMACS_MOD_HYPER) modprint ("hyper-", "H-"); + if (mod & XEMACS_MOD_ALT) modprint ("alt-", "A-"); + if (mod & XEMACS_MOD_SHIFT) modprint ("shift-", "Sh-"); if (mouse_p) { modprint1 ("button"); @@ -1314,7 +1314,7 @@ } else if (SYMBOLP (key)) { - CONST char *str = 0; + const char *str = 0; if (brief) { if (EQ (key, QKlinefeed)) str = "LFD"; @@ -1452,6 +1452,10 @@ DEFUN ("event-timestamp", Fevent_timestamp, 1, 1, 0, /* Return the timestamp of the event object EVENT. +Timestamps are measured in milliseconds since the start of the window system. +They are NOT related to any current time measurement. +They should be compared with `event-timestamp<'. +See also `current-event-timestamp'. */ (event)) { @@ -1463,6 +1467,28 @@ XEVENT (event)->timestamp); } +#define TIMESTAMP_HALFSPACE (1L << (VALBITS - 2)) + +DEFUN ("event-timestamp<", Fevent_timestamp_lessp, 2, 2, 0, /* +Return true if timestamp TIME1 is earlier than timestamp TIME2. +This correctly handles timestamp wrap. +See also `event-timestamp' and `current-event-timestamp'. +*/ + (time1, time2)) +{ + EMACS_INT t1, t2; + + CHECK_NATNUM (time1); + CHECK_NATNUM (time2); + t1 = XINT (time1); + t2 = XINT (time2); + + if (t1 < t2) + return t2 - t1 < TIMESTAMP_HALFSPACE ? Qt : Qnil; + else + return t1 - t2 < TIMESTAMP_HALFSPACE ? Qnil : Qt; +} + #define CHECK_EVENT_TYPE(e,t1,sym) do { \ CHECK_LIVE_EVENT (e); \ if (XEVENT(e)->event_type != (t1)) \ @@ -1520,9 +1546,9 @@ } DEFUN ("event-modifier-bits", Fevent_modifier_bits, 1, 1, 0, /* -Return a number representing the modifier keys which were down +Return a number representing the modifier keys and buttons which were down when the given mouse or keyboard event was produced. -See also the function event-modifiers. +See also the function `event-modifiers'. */ (event)) { @@ -1546,21 +1572,67 @@ } DEFUN ("event-modifiers", Fevent_modifiers, 1, 1, 0, /* -Return a list of symbols, the names of the modifier keys +Return a list of symbols, the names of the modifier keys and buttons which were down when the given mouse or keyboard event was produced. -See also the function event-modifier-bits. +See also the function `event-modifier-bits'. + +The possible symbols in the list are + +`shift': The Shift key. Will not appear, in general, on key events + where the keysym is an ASCII character, because using Shift + on such a character converts it into another character rather + than actually just adding a Shift modifier. + +`control': The Control key. + +`meta': The Meta key. On PC's and PC-style keyboards, this is generally + labelled \"Alt\"; Meta is a holdover from early Lisp Machines and + such, propagated through the X Window System. On Sun keyboards, + this key is labelled with a diamond. + +`alt': The \"Alt\" key. Alt is in quotes because this does not refer + to what it obviously should refer to, namely the Alt key on PC + keyboards. Instead, it refers to the key labelled Alt on Sun + keyboards, and to no key at all on PC keyboards. + +`super': The Super key. Most keyboards don't have any such key, but + under X Windows using `xmodmap' you can assign any key (such as + an underused right-shift, right-control, or right-alt key) to + this key modifier. No support currently exists under MS Windows + for generating these modifiers. + +`hyper': The Hyper key. Works just like the Super key. + +`button1': The mouse buttons. This means that the specified button was held +`button2': down at the time the event occurred. NOTE: For button-press +`button3': events, the button that was just pressed down does NOT appear in +`button4': the modifiers. +`button5': + +Button modifiers are currently ignored when defining and looking up key and +mouse strokes in keymaps. This could be changed, which would allow a user to +create button-chord actions, use a button as a key modifier and do other +clever things. */ (event)) { int mod = XINT (Fevent_modifier_bits (event)); Lisp_Object result = Qnil; - if (mod & MOD_SHIFT) result = Fcons (Qshift, result); - if (mod & MOD_ALT) result = Fcons (Qalt, result); - if (mod & MOD_HYPER) result = Fcons (Qhyper, result); - if (mod & MOD_SUPER) result = Fcons (Qsuper, result); - if (mod & MOD_META) result = Fcons (Qmeta, result); - if (mod & MOD_CONTROL) result = Fcons (Qcontrol, result); - return result; + struct gcpro gcpro1; + + GCPRO1 (result); + if (mod & XEMACS_MOD_SHIFT) result = Fcons (Qshift, result); + if (mod & XEMACS_MOD_ALT) result = Fcons (Qalt, result); + if (mod & XEMACS_MOD_HYPER) result = Fcons (Qhyper, result); + if (mod & XEMACS_MOD_SUPER) result = Fcons (Qsuper, result); + if (mod & XEMACS_MOD_META) result = Fcons (Qmeta, result); + if (mod & XEMACS_MOD_CONTROL) result = Fcons (Qcontrol, result); + if (mod & XEMACS_MOD_BUTTON1) result = Fcons (Qbutton1, result); + if (mod & XEMACS_MOD_BUTTON2) result = Fcons (Qbutton2, result); + if (mod & XEMACS_MOD_BUTTON3) result = Fcons (Qbutton3, result); + if (mod & XEMACS_MOD_BUTTON4) result = Fcons (Qbutton4, result); + if (mod & XEMACS_MOD_BUTTON5) result = Fcons (Qbutton5, result); + RETURN_UNGCPRO (Fnreverse (result)); } static int @@ -1595,7 +1667,7 @@ w = find_window_by_pixel_pos (*x, *y, f->root_window); if (!w) - return 1; /* #### What should really happen here. */ + return 1; /* #### What should really happen here? */ *x -= w->pixel_left; *y -= w->pixel_top; @@ -2188,6 +2260,8 @@ void syms_of_events (void) { + INIT_LRECORD_IMPLEMENTATION (event); + DEFSUBR (Fcharacter_to_event); DEFSUBR (Fevent_to_character); @@ -2200,6 +2274,7 @@ DEFSUBR (Fevent_properties); DEFSUBR (Fevent_timestamp); + DEFSUBR (Fevent_timestamp_lessp); DEFSUBR (Fevent_key); DEFSUBR (Fevent_button); DEFSUBR (Fevent_modifier_bits); diff -r 72a7cfa4a488 -r abe6d1db359e src/events.h --- a/src/events.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/events.h Mon Aug 13 11:35:02 2007 +0200 @@ -130,10 +130,9 @@ event_stream layer to translate to this format. NOTE: #### All timestamps should be measured as milliseconds since XEmacs - started. Currently many or most events have a 0 as their - timestamp value, and for other timestamps, they are raw server - timestamps. (The X protocol doesn't provide any easy way of - translating between server time and real process time; yuck.) + started. Currently they are raw server timestamps. (The X protocol + doesn't provide any easy way of translating between server time and + real process time; yuck.) Every event type has the following structures: @@ -176,6 +175,7 @@ If this is an integer, it will be in the printing ASCII range: >32 and <127. modifiers Bucky-bits on that key: control, meta, etc. + Also includes buttons. For many keys, Shift is not a bit; that is implicit in the keyboard layout. @@ -183,12 +183,12 @@ button_release_event button What button went down or up. modifiers Bucky-bits on that button: shift, control, meta, etc. + Also includes other buttons (not the one pressed). x, y Where it was at the button-state-change (in pixels). pointer_motion_event x, y Where it was after it moved (in pixels). modifiers Bucky-bits down when the motion was detected. - (Possibly not all window systems will provide this?) process_event process the XEmacs "process" object in question @@ -329,12 +329,14 @@ void (*select_process_cb) (Lisp_Process *); void (*unselect_process_cb) (Lisp_Process *); void (*quit_p_cb) (void); + void (*force_event_pending) (struct frame* f); USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ , Lisp_Object* /* instream */, Lisp_Object* /* outstream */, int /* flags */); USID (*delete_stream_pair_cb) (Lisp_Object /* instream */, Lisp_Object /* outstream */); + int (*current_event_timestamp_cb) (struct console *); }; /* Flags for create_stream_pair_cb() FLAGS parameter */ @@ -366,20 +368,20 @@ struct key_data { Lisp_Object keysym; - unsigned char modifiers; + int modifiers; }; struct button_data { int button; - unsigned char modifiers; + int modifiers; int x, y; }; struct motion_data { int x, y; - unsigned char modifiers; + int modifiers; }; struct process_data @@ -406,7 +408,7 @@ Lisp_Object function; Lisp_Object object; int button; - unsigned char modifiers; + int modifiers; int x, y; }; @@ -532,9 +534,9 @@ extern Lisp_Object QKspace, QKtab, Qmouse_event_p, Vcharacter_set_property; extern Lisp_Object Qcancel_mode_internal; -/* Note: under X Windows, MOD_ALT is generated by the Alt key if there are +/* Note: under X Windows, XEMACS_MOD_ALT is generated by the Alt key if there are both Alt and Meta keys. If there are no Meta keys, then Alt generates - MOD_META instead. + XEMACS_MOD_META instead. */ #ifdef emacs @@ -661,4 +663,60 @@ #endif /* emacs */ +/* #### a hack, until accelerator shit is cleaned up */ + +/* This structure is what we use to encapsulate the state of a command sequence + being composed; key events are executed by adding themselves to the command + builder; if the command builder is then complete (does not still represent + a prefix key sequence) it executes the corresponding command. + */ +struct command_builder +{ + struct lcrecord_header header; + Lisp_Object console; /* back pointer to the console this command + builder is for */ + /* Qnil, or a Lisp_Event representing the first event read + * after the last command completed. Threaded. */ + /* #### NYI */ + Lisp_Object prefix_events; + /* Qnil, or a Lisp_Event representing event in the current + * keymap-lookup sequence. Subsequent events are threaded via + * the event's next slot */ + Lisp_Object current_events; + /* Last elt of above */ + Lisp_Object most_current_event; + /* Last elt before function map code took over. What this means is: + All prefixes up to (but not including) this event have non-nil + bindings, but the prefix including this event has a nil binding. + Any events in the chain after this one were read solely because + we're part of a possible function key. If we end up with + 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]; + + Bufbyte *echo_buf; + Bytecount echo_buf_length; /* size of echo_buf */ + Bytecount echo_buf_index; /* index into echo_buf + * -1 before doing echoing for new cmd */ + /* Self-insert-command is magic in that it doesn't always push an undo- + boundary: up to 20 consecutive self-inserts can happen before an undo- + boundary is pushed. This variable is that counter. + */ + int self_insert_countdown; +}; + #endif /* INCLUDED_events_h_ */ diff -r 72a7cfa4a488 -r abe6d1db359e src/extents.c --- a/src/extents.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/extents.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,6 @@ /* Copyright (c) 1994, 1995 Free Software Foundation, Inc. Copyright (c) 1995 Sun Microsystems, Inc. - Copyright (c) 1995, 1996 Ben Wing. + Copyright (c) 1995, 1996, 2000 Ben Wing. This file is part of XEmacs. @@ -227,6 +227,7 @@ #include "opaque.h" #include "process.h" #include "redisplay.h" +#include "gutter.h" /* ------------------------------- */ /* gap array */ @@ -461,10 +462,13 @@ /* FSFmacs bogosity */ Lisp_Object Vdefault_text_properties; - EXFUN (Fextent_properties, 1); EXFUN (Fset_extent_property, 3); +/* if true, we don't want to set any redisplay flags on modeline extent + changes */ +int in_modeline_generation; + /************************************************************************/ /* Generalized gap array */ @@ -1537,8 +1541,7 @@ assert (EXTENT_LIVE_P (extent)); assert (!extent_detached_p (extent)); { - Memind i = (endp) ? (extent_end (extent)) : - (extent_start (extent)); + Memind i = endp ? extent_end (extent) : extent_start (extent); Lisp_Object obj = extent_object (extent); return buffer_or_string_memind_to_bytind (obj, i); } @@ -1550,8 +1553,7 @@ assert (EXTENT_LIVE_P (extent)); assert (!extent_detached_p (extent)); { - Memind i = (endp) ? (extent_end (extent)) : - (extent_start (extent)); + Memind i = endp ? extent_end (extent) : extent_start (extent); Lisp_Object obj = extent_object (extent); return buffer_or_string_memind_to_bufpos (obj, i); } @@ -1591,33 +1593,47 @@ object = extent_object (extent); - if (!BUFFERP (object) || extent_detached_p (extent)) - /* #### Can changes to string extents affect redisplay? - I will have to think about this. What about string glyphs? - Things in the modeline? etc. */ - /* #### changes to string extents can certainly affect redisplay - if the extent is in some generated-modeline-string: when - we change an extent in generated-modeline-string, this changes - its parent, which is in `modeline-format', so we should - force the modeline to be updated. But how to determine whether - a string is a `generated-modeline-string'? Looping through - all buffers is not very efficient. Should we add all - `generated-modeline-string' strings to a hash table? - Maybe efficiency is not the greatest concern here and there's - no big loss in looping over the buffers. */ + if (extent_detached_p (extent)) return; - { - struct buffer *b; - b = XBUFFER (object); - BUF_FACECHANGE (b)++; - MARK_EXTENTS_CHANGED; - if (invisibility_change) - MARK_CLIP_CHANGED; - buffer_extent_signal_changed_region (b, - extent_endpoint_bufpos (extent, 0), - extent_endpoint_bufpos (extent, 1)); - } + else if (STRINGP (object)) + { + /* #### Changes to string extents can affect redisplay if they are + in the modeline or in the gutters. + + If the extent is in some generated-modeline-string: when we + change an extent in generated-modeline-string, this changes its + parent, which is in `modeline-format', so we should force the + modeline to be updated. But how to determine whether a string + is a `generated-modeline-string'? Looping through all buffers + is not very efficient. Should we add all + `generated-modeline-string' strings to a hash table? Maybe + efficiency is not the greatest concern here and there's no big + loss in looping over the buffers. + + If the extent is in a gutter we mark the gutter as + changed. This means (a) we can update extents in the gutters + when we need it. (b) we don't have to update the gutters when + only extents attached to buffers have changed. */ + + if (!in_modeline_generation) + MARK_EXTENTS_CHANGED; + gutter_extent_signal_changed_region_maybe (object, + extent_endpoint_bufpos (extent, 0), + extent_endpoint_bufpos (extent, 1)); + } + else if (BUFFERP (object)) + { + struct buffer *b; + b = XBUFFER (object); + BUF_FACECHANGE (b)++; + MARK_EXTENTS_CHANGED; + if (invisibility_change) + MARK_CLIP_CHANGED; + buffer_extent_signal_changed_region (b, + extent_endpoint_bufpos (extent, 0), + extent_endpoint_bufpos (extent, 1)); + } } /* A change to an extent occurred that might affect redisplay. @@ -1844,7 +1860,7 @@ case ME_ALL_EXTENTS_OPEN: start_open = 1, end_open = 1; break; case ME_ALL_EXTENTS_CLOSED_OPEN: start_open = 0, end_open = 1; break; case ME_ALL_EXTENTS_OPEN_CLOSED: start_open = 1, end_open = 0; break; - default: abort(); break; + default: abort(); return 0; } start = buffer_or_string_bytind_to_startind (obj, from, @@ -1879,7 +1895,7 @@ retval = (start <= exs && exs <= end) || (start <= exe && exe <= end); break; default: - abort(); break; + abort(); return 0; } return flags & ME_NEGATE_IN_REGION ? !retval : retval; } @@ -2599,12 +2615,11 @@ xfree (ef); } -/* Note: CONST is losing, but `const' is part of the interface of qsort() */ static int extent_priority_sort_function (const void *humpty, const void *dumpty) { - CONST EXTENT foo = * (CONST EXTENT *) humpty; - CONST EXTENT bar = * (CONST EXTENT *) dumpty; + const EXTENT foo = * (const EXTENT *) humpty; + const EXTENT bar = * (const EXTENT *) dumpty; if (extent_priority (foo) < extent_priority (bar)) return -1; return extent_priority (foo) > extent_priority (bar); @@ -2910,38 +2925,6 @@ extent objects. They are similar to the functions for other lrecord objects. allocate_extent() is in alloc.c, not here. */ -static Lisp_Object mark_extent (Lisp_Object); -static int extent_equal (Lisp_Object, Lisp_Object, int depth); -static unsigned long extent_hash (Lisp_Object obj, int depth); -static void print_extent (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag); -static Lisp_Object extent_getprop (Lisp_Object obj, Lisp_Object prop); -static int extent_putprop (Lisp_Object obj, Lisp_Object prop, - Lisp_Object value); -static int extent_remprop (Lisp_Object obj, Lisp_Object prop); -static Lisp_Object extent_plist (Lisp_Object obj); - -static const struct lrecord_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) }, - { XD_END } -}; - -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); - static Lisp_Object mark_extent (Lisp_Object obj) { @@ -3007,9 +2990,9 @@ { if (escapeflag) { - CONST char *title = ""; - CONST char *name = ""; - CONST char *posttitle = ""; + const char *title = ""; + const char *name = ""; + const char *posttitle = ""; Lisp_Object obj2 = Qnil; /* Destroyed extents have 't' in the object field, causing @@ -3131,6 +3114,13 @@ internal_hash (extent_object (e), depth + 1)); } +static const struct lrecord_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) }, + { XD_END } +}; + static Lisp_Object extent_getprop (Lisp_Object obj, Lisp_Object prop) { @@ -3189,6 +3179,20 @@ return Fextent_properties (obj); } +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); + /************************************************************************/ /* basic extent accessors */ @@ -3241,8 +3245,8 @@ if ((NILP (obj) && (flags & DE_MUST_HAVE_BUFFER)) || (extent_detached_p (extent) && (flags & DE_MUST_BE_ATTACHED))) { - signal_simple_error ("extent doesn't belong to a buffer or string", - extent_obj); + invalid_argument ("extent doesn't belong to a buffer or string", + extent_obj); } return extent; @@ -3532,7 +3536,9 @@ return Qnil; for (rest = parent; !NILP (rest); rest = extent_parent (XEXTENT (rest))) if (EQ (rest, extent)) - signal_simple_error ("Circular parent chain would result", extent); + signal_type_error (Qinvalid_change, + "Circular parent chain would result", + extent); if (NILP (parent)) { remove_extent_from_children_list (XEXTENT (cur_parent), extent); @@ -3895,7 +3901,7 @@ EQ (sym, Qstart_and_end_in_region) ? ME_START_AND_END_IN_REGION : EQ (sym, Qstart_or_end_in_region) ? ME_START_OR_END_IN_REGION : EQ (sym, Qnegate_in_region) ? ME_NEGATE_IN_REGION : - (signal_simple_error ("Invalid `map-extents' flag", sym), 0); + (invalid_argument ("Invalid `map-extents' flag", sym), 0); flags = XCDR (flags); } @@ -4233,11 +4239,12 @@ struct extent_at_arg { - EXTENT best_match; + Lisp_Object best_match; /* or list of extents */ Memind best_start; Memind best_end; Lisp_Object prop; EXTENT before; + int all_extents; }; enum extent_at_flag @@ -4258,7 +4265,7 @@ if (EQ (at_flag, Qbefore)) return EXTENT_AT_BEFORE; if (EQ (at_flag, Qat)) return EXTENT_AT_AT; - signal_simple_error ("Invalid AT-FLAG in `extent-at'", at_flag); + invalid_argument ("Invalid AT-FLAG in `extent-at'", at_flag); return EXTENT_AT_AFTER; /* unreached */ } @@ -4280,13 +4287,15 @@ return 0; } + if (!closure->all_extents) { - EXTENT current = closure->best_match; - - if (!current) + EXTENT current; + + if (NILP (closure->best_match)) goto accept; + current = XEXTENT (closure->best_match); /* redundant but quick test */ - else if (extent_start (current) > extent_start (e)) + if (extent_start (current) > extent_start (e)) return 0; /* we return the "last" best fit, instead of the first -- @@ -4299,20 +4308,27 @@ else return 0; accept: - closure->best_match = e; + XSETEXTENT (closure->best_match, e); closure->best_start = extent_start (e); closure->best_end = extent_end (e); } + else + { + Lisp_Object extent; + + XSETEXTENT (extent, e); + closure->best_match = Fcons (extent, closure->best_match); + } return 0; } static Lisp_Object extent_at_bytind (Bytind position, Lisp_Object object, Lisp_Object property, - EXTENT before, enum extent_at_flag at_flag) + EXTENT before, enum extent_at_flag at_flag, int all_extents) { struct extent_at_arg closure; - Lisp_Object extent_obj; + struct gcpro gcpro1; /* it might be argued that invalid positions should cause errors, but the principle of least surprise dictates that @@ -4330,20 +4346,21 @@ : position > buffer_or_string_absolute_end_byte (object))) return Qnil; - closure.best_match = 0; + closure.best_match = Qnil; closure.prop = property; closure.before = before; - + closure.all_extents = all_extents; + + GCPRO1 (closure.best_match); map_extents_bytind (at_flag == EXTENT_AT_BEFORE ? position - 1 : position, at_flag == EXTENT_AT_AFTER ? position + 1 : position, extent_at_mapper, (void *) &closure, object, 0, ME_START_OPEN | ME_ALL_EXTENTS_CLOSED); - - if (!closure.best_match) - return Qnil; - - XSETEXTENT (extent_obj, closure.best_match); - return extent_obj; + if (all_extents) + closure.best_match = Fnreverse (closure.best_match); + UNGCPRO; + + return closure.best_match; } DEFUN ("extent-at", Fextent_at, 1, 5, 0, /* @@ -4387,10 +4404,60 @@ else before_extent = decode_extent (before, DE_MUST_BE_ATTACHED); if (before_extent && !EQ (object, extent_object (before_extent))) - signal_simple_error ("extent not in specified buffer or string", object); + invalid_argument ("extent not in specified buffer or string", object); fl = decode_extent_at_flag (at_flag); - return extent_at_bytind (position, object, property, before_extent, fl); + return extent_at_bytind (position, object, property, before_extent, fl, 0); +} + +DEFUN ("extents-at", Fextents_at, 1, 5, 0, /* +Find all extents at POS in OBJECT having PROPERTY set. +Normally, an extent is "at" POS if it overlaps the region (POS, POS+1); + i.e. if it covers the character after POS. (However, see the definition + of AT-FLAG.) +This provides similar functionality to `extent-list', but does so in a way + that is compatible with `extent-at'. (For example, errors due to POS out of + range are ignored; this makes it safer to use this function in response to + a mouse event, because in many cases previous events have changed the buffer + contents.) +OBJECT specifies a buffer or string and defaults to the current buffer. +PROPERTY defaults to nil, meaning that any extent will do. +Properties are attached to extents with `set-extent-property', which see. +Returns nil if POS is invalid or there is no matching extent at POS. +If the fourth argument BEFORE is not nil, it must be an extent; any returned + extent will precede that extent. This feature allows `extents-at' to be + used by a loop over extents. +AT-FLAG controls how end cases are handled, and should be one of: + +nil or `after' An extent is at POS if it covers the character + after POS. This is consistent with the way + that text properties work. +`before' An extent is at POS if it covers the character + before POS. +`at' An extent is at POS if it overlaps or abuts POS. + This includes all zero-length extents at POS. + +Note that in all cases, the start-openness and end-openness of the extents +considered is ignored. If you want to pay attention to those properties, +you should use `map-extents', which gives you more control. +*/ + (pos, object, property, before, at_flag)) +{ + Bytind position; + EXTENT before_extent; + enum extent_at_flag fl; + + object = decode_buffer_or_string (object); + position = get_buffer_or_string_pos_byte (object, pos, GB_NO_ERROR_IF_BAD); + if (NILP (before)) + before_extent = 0; + else + before_extent = decode_extent (before, DE_MUST_BE_ATTACHED); + if (before_extent && !EQ (object, extent_object (before_extent))) + invalid_argument ("extent not in specified buffer or string", object); + fl = decode_extent_at_flag (at_flag); + + return extent_at_bytind (position, object, property, before_extent, fl, 1); } /* ------------------------------- */ @@ -4995,7 +5062,7 @@ if (EQ (layout_obj, Qwhitespace)) return GL_WHITESPACE; if (EQ (layout_obj, Qtext)) return GL_TEXT; - signal_simple_error ("Unknown glyph layout type", layout_obj); + invalid_argument ("Unknown glyph layout type", layout_obj); return GL_TEXT; /* unreached */ } @@ -5003,7 +5070,7 @@ set_extent_glyph_1 (Lisp_Object extent_obj, Lisp_Object glyph, int endp, Lisp_Object layout_obj) { - EXTENT extent = decode_extent (extent_obj, DE_MUST_HAVE_BUFFER); + EXTENT extent = decode_extent (extent_obj, 0); glyph_layout layout = symbol_to_glyph_layout (layout_obj); /* Make sure we've actually been given a valid glyph or it's nil @@ -5961,14 +6028,14 @@ /* text_props_only specifies whether we only consider text-property extents (those with the 'text-prop property set) or all extents. */ if (!text_props_only) - extent = extent_at_bytind (position, object, prop, 0, fl); + extent = extent_at_bytind (position, object, prop, 0, fl, 0); else { EXTENT prior = 0; while (1) { extent = extent_at_bytind (position, object, Qtext_prop, prior, - fl); + fl, 0); if (NILP (extent)) return Qnil; if (EQ (prop, Fextent_property (extent, Qtext_prop, Qnil))) @@ -6500,7 +6567,8 @@ prop = Fextent_property (extent, Qtext_prop, Qnil); if (NILP (prop)) - signal_simple_error ("Internal error: no text-prop", extent); + signal_type_error (Qinternal_error, + "Internal error: no text-prop", extent); val = Fextent_property (extent, prop, Qnil); #if 0 /* removed by bill perry, 2/9/97 @@ -6508,8 +6576,9 @@ ** with a value of Qnil. This is bad bad bad. */ if (NILP (val)) - signal_simple_error_2 ("Internal error: no text-prop", - extent, prop); + signal_type_error_2 (Qinternal_error, + "Internal error: no text-prop", + extent, prop); #endif Fput_text_property (from, to, prop, val, Qnil); return Qnil; /* important! */ @@ -6673,6 +6742,10 @@ void syms_of_extents (void) { + INIT_LRECORD_IMPLEMENTATION (extent); + INIT_LRECORD_IMPLEMENTATION (extent_info); + INIT_LRECORD_IMPLEMENTATION (extent_auxiliary); + defsymbol (&Qextentp, "extentp"); defsymbol (&Qextent_live_p, "extent-live-p"); @@ -6749,6 +6822,7 @@ DEFSUBR (Fmap_extents); DEFSUBR (Fmap_extent_children); DEFSUBR (Fextent_at); + DEFSUBR (Fextents_at); DEFSUBR (Fset_extent_initial_redisplay_function); DEFSUBR (Fextent_face); diff -r 72a7cfa4a488 -r abe6d1db359e src/extents.h --- a/src/extents.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/extents.h Mon Aug 13 11:35:02 2007 +0200 @@ -177,8 +177,8 @@ #define extent_no_chase_normal_field(e, field) ((e)->flags.field) -INLINE struct extent_auxiliary *extent_aux_or_default (EXTENT e); -INLINE struct extent_auxiliary * +INLINE_HEADER struct extent_auxiliary *extent_aux_or_default (EXTENT e); +INLINE_HEADER struct extent_auxiliary * extent_aux_or_default (EXTENT e) { return e->flags.has_aux ? @@ -259,8 +259,8 @@ #define extent_internal_p(e) extent_normal_field (e, internal) #define extent_in_red_event_p(e) extent_normal_field (e, in_red_event) -INLINE Lisp_Object * extent_no_chase_plist_addr (EXTENT e); -INLINE Lisp_Object * +INLINE_HEADER Lisp_Object * extent_no_chase_plist_addr (EXTENT e); +INLINE_HEADER Lisp_Object * extent_no_chase_plist_addr (EXTENT e) { return e->flags.has_aux ? &XCDR (e->plist) : &e->plist; @@ -318,6 +318,7 @@ EXFUN (Fset_extent_parent, 2); extern int inside_undo; +extern int in_modeline_generation; struct extent_fragment *extent_fragment_new (Lisp_Object buffer_or_string, struct frame *frm); @@ -339,8 +340,8 @@ /* extent_ancestor() chases all the parent links until there aren't any more. extent_ancestor_1() does the same thing but it a function; the following optimizes the most common case. */ -INLINE EXTENT extent_ancestor (EXTENT e); -INLINE EXTENT +INLINE_HEADER EXTENT extent_ancestor (EXTENT e); +INLINE_HEADER EXTENT extent_ancestor (EXTENT e) { return e->flags.has_parent ? extent_ancestor_1 (e) : e; diff -r 72a7cfa4a488 -r abe6d1db359e src/extw-Xt.c --- a/src/extw-Xt.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/extw-Xt.c Mon Aug 13 11:35:02 2007 +0200 @@ -28,7 +28,7 @@ ERROR! This ought not be getting compiled if EXTERNAL_WIDGET is undefined #endif -void fatal (CONST char *fmt, ...); +void fatal (const char *fmt, ...); #else /* not emacs */ static void fatal (char *msg); #endif diff -r 72a7cfa4a488 -r abe6d1db359e src/faces.c --- a/src/faces.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/faces.c Mon Aug 13 11:35:02 2007 +0200 @@ -496,7 +496,7 @@ } static int -update_face_inheritance_mapper (CONST void *hash_key, void *hash_contents, +update_face_inheritance_mapper (const void *hash_key, void *hash_contents, void *face_inheritance_closure) { Lisp_Object key, contents; @@ -1752,6 +1752,8 @@ void syms_of_faces (void) { + INIT_LRECORD_IMPLEMENTATION (face); + /* Qdefault, Qwidget, Qleft_margin, Qright_margin defined in general.c */ defsymbol (&Qmodeline, "modeline"); defsymbol (&Qgui_element, "gui-element"); @@ -1894,7 +1896,7 @@ (#### Perhaps we should remove the stuff from x-faces.el and only depend on this stuff here? That should work.) */ - CONST char *fonts[] = + const char *fonts[] = { "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*", @@ -1912,7 +1914,7 @@ "-*-*-*-*-*-*-*-120-*-*-*-*-*-*", "*" }; - CONST char **fontptr; + const char **fontptr; for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--) inst_list = Fcons (Fcons (list1 (Qx), build_string (*fontptr)), @@ -2028,13 +2030,13 @@ Vwidget_face = Fmake_face (Qwidget, build_string ("widget face"), Qnil); + set_specifier_fallback (Fget (Vwidget_face, Qfont, Qunbound), + Fget (Vgui_element_face, Qfont, Qunbound)); set_specifier_fallback (Fget (Vwidget_face, Qforeground, Qunbound), Fget (Vgui_element_face, Qforeground, Qunbound)); set_specifier_fallback (Fget (Vwidget_face, Qbackground, Qunbound), Fget (Vgui_element_face, Qbackground, Qunbound)); - set_specifier_fallback (Fget (Vwidget_face, Qbackground_pixmap, Qnil), - Fget (Vgui_element_face, Qbackground_pixmap, - Qunbound)); + /* We don't want widgets to have a default background pixmap. */ Vleft_margin_face = Fmake_face (Qleft_margin, build_string ("left margin face"), diff -r 72a7cfa4a488 -r abe6d1db359e src/faces.h --- a/src/faces.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/faces.h Mon Aug 13 11:35:02 2007 +0200 @@ -125,7 +125,7 @@ corresponding single-face cachels. Formerly we didn't bother to keep track of the faces used for - merging. We do know because we need to do so because there is no + merging. We do now because we need to do so because there is no other way to properly handle multiple charsets for Mule in the presence of display tables short of always computing the values for all charsets, which is very expensive. Instead, we use a diff -r 72a7cfa4a488 -r abe6d1db359e src/file-coding.c --- a/src/file-coding.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/file-coding.c Mon Aug 13 11:35:02 2007 +0200 @@ -66,7 +66,7 @@ static const struct lrecord_description fcd_description_1[] = { { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, coding_category_system), CODING_CATEGORY_LAST + 1 }, #ifdef MULE - { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, ucs_to_mule_table), 65536 }, + { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, ucs_to_mule_table), countof (fcd->ucs_to_mule_table) }, #endif { XD_END } }; @@ -176,67 +176,67 @@ #ifdef MULE struct detection_state; static int detect_coding_sjis (struct detection_state *st, - CONST unsigned char *src, + const unsigned char *src, unsigned int n); static void decode_coding_sjis (Lstream *decoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static void encode_coding_sjis (Lstream *encoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static int detect_coding_big5 (struct detection_state *st, - CONST unsigned char *src, + const unsigned char *src, unsigned int n); static void decode_coding_big5 (Lstream *decoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static void encode_coding_big5 (Lstream *encoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static int detect_coding_ucs4 (struct detection_state *st, - CONST unsigned char *src, + const unsigned char *src, unsigned int n); static void decode_coding_ucs4 (Lstream *decoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static void encode_coding_ucs4 (Lstream *encoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static int detect_coding_utf8 (struct detection_state *st, - CONST unsigned char *src, + const unsigned char *src, unsigned int n); static void decode_coding_utf8 (Lstream *decoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static void encode_coding_utf8 (Lstream *encoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static int postprocess_iso2022_mask (int mask); static void reset_iso2022 (Lisp_Object coding_system, struct iso2022_decoder *iso); static int detect_coding_iso2022 (struct detection_state *st, - CONST unsigned char *src, + const unsigned char *src, unsigned int n); static void decode_coding_iso2022 (Lstream *decoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static void encode_coding_iso2022 (Lstream *encoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); #endif /* MULE */ static void decode_coding_no_conversion (Lstream *decoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); static void encode_coding_no_conversion (Lstream *encoding, - CONST unsigned char *src, + const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); -static void mule_decode (Lstream *decoding, CONST unsigned char *src, +static void mule_decode (Lstream *decoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); -static void mule_encode (Lstream *encoding, CONST unsigned char *src, +static void mule_encode (Lstream *encoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n); typedef struct codesys_prop codesys_prop; @@ -732,7 +732,7 @@ JIS (the Japanese encoding commonly used for e-mail), EUC (the standard Unix encoding for Japanese and other languages), and Compound Text (the encoding used in X11). You can specify more - specific information about the conversion with the FLAGS argument. + specific information about the conversion with the PROPS argument. 'big5 Big5 (the encoding commonly used for Taiwanese). 'ccl @@ -882,7 +882,6 @@ (name, type, doc_string, props)) { Lisp_Coding_System *codesys; - Lisp_Object rest, key, value; enum coding_system_type ty; int need_to_setup_eol_systems = 1; @@ -914,92 +913,94 @@ CHECK_STRING (doc_string); CODING_SYSTEM_DOC_STRING (codesys) = doc_string; - EXTERNAL_PROPERTY_LIST_LOOP (rest, key, value, props) - { - if (EQ (key, Qmnemonic)) - { - if (!NILP (value)) - CHECK_STRING (value); - CODING_SYSTEM_MNEMONIC (codesys) = value; - } - - else if (EQ (key, Qeol_type)) - { - need_to_setup_eol_systems = NILP (value); - if (EQ (value, Qt)) - value = Qnil; - CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value); - } - - else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value; - else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value; + { + EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, props) + { + if (EQ (key, Qmnemonic)) + { + if (!NILP (value)) + CHECK_STRING (value); + CODING_SYSTEM_MNEMONIC (codesys) = value; + } + + else if (EQ (key, Qeol_type)) + { + need_to_setup_eol_systems = NILP (value); + if (EQ (value, Qt)) + value = Qnil; + CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value); + } + + else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value; + else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value; #ifdef MULE - else if (ty == CODESYS_ISO2022) - { + else if (ty == CODESYS_ISO2022) + { #define FROB_INITIAL_CHARSET(charset_num) \ CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, charset_num) = \ ((EQ (value, Qt) || EQ (value, Qnil)) ? value : Fget_charset (value)) - if (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0); - else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1); - else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2); - else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3); + if (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0); + else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1); + else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2); + else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3); #define FROB_FORCE_CHARSET(charset_num) \ CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (codesys, charset_num) = !NILP (value) - else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0); - else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1); - else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2); - else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3); + else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0); + else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1); + else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2); + else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3); #define FROB_BOOLEAN_PROPERTY(prop) \ CODING_SYSTEM_ISO2022_##prop (codesys) = !NILP (value) - else if (EQ (key, Qshort)) FROB_BOOLEAN_PROPERTY (SHORT); - else if (EQ (key, Qno_ascii_eol)) FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL); - else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL); - else if (EQ (key, Qseven)) FROB_BOOLEAN_PROPERTY (SEVEN); - else if (EQ (key, Qlock_shift)) FROB_BOOLEAN_PROPERTY (LOCK_SHIFT); - else if (EQ (key, Qno_iso6429)) FROB_BOOLEAN_PROPERTY (NO_ISO6429); - else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED); - - else if (EQ (key, Qinput_charset_conversion)) - { - codesys->iso2022.input_conv = - Dynarr_new (charset_conversion_spec); - parse_charset_conversion_specs (codesys->iso2022.input_conv, - value); - } - else if (EQ (key, Qoutput_charset_conversion)) - { - codesys->iso2022.output_conv = - Dynarr_new (charset_conversion_spec); - parse_charset_conversion_specs (codesys->iso2022.output_conv, - value); - } - else - signal_simple_error ("Unrecognized property", key); - } - else if (EQ (type, Qccl)) - { - if (EQ (key, Qdecode)) - { - CHECK_VECTOR (value); - CODING_SYSTEM_CCL_DECODE (codesys) = value; - } - else if (EQ (key, Qencode)) - { - CHECK_VECTOR (value); - CODING_SYSTEM_CCL_ENCODE (codesys) = value; - } - else - signal_simple_error ("Unrecognized property", key); - } + else if (EQ (key, Qshort)) FROB_BOOLEAN_PROPERTY (SHORT); + else if (EQ (key, Qno_ascii_eol)) FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL); + else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL); + else if (EQ (key, Qseven)) FROB_BOOLEAN_PROPERTY (SEVEN); + else if (EQ (key, Qlock_shift)) FROB_BOOLEAN_PROPERTY (LOCK_SHIFT); + else if (EQ (key, Qno_iso6429)) FROB_BOOLEAN_PROPERTY (NO_ISO6429); + else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED); + + else if (EQ (key, Qinput_charset_conversion)) + { + codesys->iso2022.input_conv = + Dynarr_new (charset_conversion_spec); + parse_charset_conversion_specs (codesys->iso2022.input_conv, + value); + } + else if (EQ (key, Qoutput_charset_conversion)) + { + codesys->iso2022.output_conv = + Dynarr_new (charset_conversion_spec); + parse_charset_conversion_specs (codesys->iso2022.output_conv, + value); + } + else + signal_simple_error ("Unrecognized property", key); + } + else if (EQ (type, Qccl)) + { + if (EQ (key, Qdecode)) + { + CHECK_VECTOR (value); + CODING_SYSTEM_CCL_DECODE (codesys) = value; + } + else if (EQ (key, Qencode)) + { + CHECK_VECTOR (value); + CODING_SYSTEM_CCL_ENCODE (codesys) = value; + } + else + signal_simple_error ("Unrecognized property", key); + } #endif /* MULE */ - else - signal_simple_error ("Unrecognized property", key); - } + else + signal_simple_error ("Unrecognized property", key); + } + } if (need_to_setup_eol_systems) setup_eol_coding_systems (codesys); @@ -1071,6 +1072,7 @@ return aliasee; else signal_simple_error ("Symbol is not a coding system alias", alias); + return Qnil; /* To keep the compiler happy */ } static Lisp_Object @@ -1217,7 +1219,7 @@ case EOL_LF: new_coding_system = CODING_SYSTEM_EOL_LF (cs); break; case EOL_CR: new_coding_system = CODING_SYSTEM_EOL_CR (cs); break; case EOL_CRLF: new_coding_system = CODING_SYSTEM_EOL_CRLF (cs); break; - default: abort (); + default: abort (); return Qnil; } return NILP (new_coding_system) ? coding_system : new_coding_system; @@ -1626,7 +1628,7 @@ } static eol_type_t -detect_eol_type (struct detection_state *st, CONST unsigned char *src, +detect_eol_type (struct detection_state *st, const unsigned char *src, unsigned int n) { int c; @@ -1671,7 +1673,7 @@ */ static int -detect_coding_type (struct detection_state *st, CONST Extbyte *src, +detect_coding_type (struct detection_state *st, const Extbyte *src, unsigned int n, int just_do_eol) { int c; @@ -2109,7 +2111,7 @@ static ssize_t decoding_reader (Lstream *stream, unsigned char *data, size_t size); static ssize_t decoding_writer (Lstream *stream, - CONST unsigned char *data, size_t size); + const unsigned char *data, size_t size); static int decoding_rewinder (Lstream *stream); static int decoding_seekable_p (Lstream *stream); static int decoding_flusher (Lstream *stream); @@ -2204,7 +2206,7 @@ } static ssize_t -decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) +decoding_writer (Lstream *stream, const unsigned char *data, size_t size) { struct decoding_stream *str = DECODING_STREAM_DATA (stream); ssize_t retval; @@ -2239,6 +2241,13 @@ } str->counter = 0; #endif /* MULE */ + if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT + || CODING_SYSTEM_EOL_TYPE (str->codesys) == EOL_AUTODETECT) + { + xzero (str->decst); + str->decst.eol_type = EOL_AUTODETECT; + str->decst.mask = ~0; + } str->flags = str->ch = 0; } @@ -2314,7 +2323,7 @@ static Lisp_Object make_decoding_stream_1 (Lstream *stream, Lisp_Object codesys, - CONST char *mode) + const char *mode) { Lstream *lstr = Lstream_new (lstream_decoding, mode); struct decoding_stream *str = DECODING_STREAM_DATA (lstr); @@ -2357,7 +2366,7 @@ be used for both reading and writing. */ static void -mule_decode (Lstream *decoding, CONST unsigned char *src, +mule_decode (Lstream *decoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { struct decoding_stream *str = DECODING_STREAM_DATA (decoding); @@ -2563,7 +2572,7 @@ }; static ssize_t encoding_reader (Lstream *stream, unsigned char *data, size_t size); -static ssize_t encoding_writer (Lstream *stream, CONST unsigned char *data, +static ssize_t encoding_writer (Lstream *stream, const unsigned char *data, size_t size); static int encoding_rewinder (Lstream *stream); static int encoding_seekable_p (Lstream *stream); @@ -2659,7 +2668,7 @@ } static ssize_t -encoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) +encoding_writer (Lstream *stream, const unsigned char *data, size_t size) { struct encoding_stream *str = ENCODING_STREAM_DATA (stream); ssize_t retval; @@ -2770,7 +2779,7 @@ static Lisp_Object make_encoding_stream_1 (Lstream *stream, Lisp_Object codesys, - CONST char *mode) + const char *mode) { Lstream *lstr = Lstream_new (lstream_encoding, mode); struct encoding_stream *str = ENCODING_STREAM_DATA (lstr); @@ -2801,7 +2810,7 @@ Store the encoded data into DST. */ static void -mule_encode (Lstream *encoding, CONST unsigned char *src, +mule_encode (Lstream *encoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); @@ -2948,7 +2957,7 @@ ((c) >= 0xA1 && (c) <= 0xDF) static int -detect_coding_sjis (struct detection_state *st, CONST unsigned char *src, +detect_coding_sjis (struct detection_state *st, const unsigned char *src, unsigned int n) { int c; @@ -2973,7 +2982,7 @@ /* Convert Shift-JIS data to internal format. */ static void -decode_coding_sjis (Lstream *decoding, CONST unsigned char *src, +decode_coding_sjis (Lstream *decoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { unsigned char c; @@ -3030,7 +3039,7 @@ /* Convert internally-formatted data to Shift-JIS. */ static void -encode_coding_sjis (Lstream *encoding, CONST unsigned char *src, +encode_coding_sjis (Lstream *encoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { unsigned char c; @@ -3234,7 +3243,7 @@ } while (0) static int -detect_coding_big5 (struct detection_state *st, CONST unsigned char *src, +detect_coding_big5 (struct detection_state *st, const unsigned char *src, unsigned int n) { int c; @@ -3260,7 +3269,7 @@ /* Convert Big5 data to internal format. */ static void -decode_coding_big5 (Lstream *decoding, CONST unsigned char *src, +decode_coding_big5 (Lstream *decoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { unsigned char c; @@ -3310,7 +3319,7 @@ /* Convert internally-formatted data to Big5. */ static void -encode_coding_big5 (Lstream *encoding, CONST unsigned char *src, +encode_coding_big5 (Lstream *encoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { unsigned char c; @@ -3435,13 +3444,13 @@ */ (code, character)) { - unsigned int c; + size_t c; CHECK_CHAR (character); - CHECK_INT (code); + CHECK_NATNUM (code); c = XINT (code); - if (c < sizeof (fcd->ucs_to_mule_table)) + if (c < countof (fcd->ucs_to_mule_table)) { fcd->ucs_to_mule_table[c] = character; return Qt; @@ -3453,7 +3462,7 @@ static Lisp_Object ucs_to_char (unsigned long code) { - if (code < sizeof (fcd->ucs_to_mule_table)) + if (code < countof (fcd->ucs_to_mule_table)) { return fcd->ucs_to_mule_table[code]; } @@ -3577,7 +3586,7 @@ } static int -detect_coding_ucs4 (struct detection_state *st, CONST unsigned char *src, +detect_coding_ucs4 (struct detection_state *st, const unsigned char *src, unsigned int n) { while (n--) @@ -3602,7 +3611,7 @@ } static void -decode_coding_ucs4 (Lstream *decoding, CONST unsigned char *src, +decode_coding_ucs4 (Lstream *decoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { struct decoding_stream *str = DECODING_STREAM_DATA (decoding); @@ -3638,7 +3647,7 @@ } static void -encode_coding_ucs4 (Lstream *encoding, CONST unsigned char *src, +encode_coding_ucs4 (Lstream *encoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); @@ -3651,7 +3660,7 @@ /* flags for handling composite chars. We do a little switcharoo on the source while we're outputting the composite char. */ unsigned int saved_n = 0; - CONST unsigned char *saved_src = NULL; + const unsigned char *saved_src = NULL; int in_composite = 0; back_to_square_n: @@ -3777,7 +3786,7 @@ /************************************************************************/ static int -detect_coding_utf8 (struct detection_state *st, CONST unsigned char *src, +detect_coding_utf8 (struct detection_state *st, const unsigned char *src, unsigned int n) { while (n--) @@ -3812,7 +3821,7 @@ } static void -decode_coding_utf8 (Lstream *decoding, CONST unsigned char *src, +decode_coding_utf8 (Lstream *decoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { struct decoding_stream *str = DECODING_STREAM_DATA (decoding); @@ -3926,7 +3935,7 @@ } static void -encode_coding_utf8 (Lstream *encoding, CONST unsigned char *src, +encode_coding_utf8 (Lstream *encoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); @@ -3940,7 +3949,7 @@ /* flags for handling composite chars. We do a little switcharoo on the source while we're outputting the composite char. */ unsigned int saved_n = 0; - CONST unsigned char *saved_src = NULL; + const unsigned char *saved_src = NULL; int in_composite = 0; back_to_square_n: @@ -4549,6 +4558,7 @@ { /* Can this ever be reached? -slb */ abort(); + return 0; } cs = CHARSET_BY_ATTRIBUTES (type, c, @@ -4644,7 +4654,7 @@ } static int -detect_coding_iso2022 (struct detection_state *st, CONST unsigned char *src, +detect_coding_iso2022 (struct detection_state *st, const unsigned char *src, unsigned int n) { int mask; @@ -4835,7 +4845,7 @@ /* Convert ISO2022-format data to internal format. */ static void -decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src, +decode_coding_iso2022 (Lstream *decoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { struct decoding_stream *str = DECODING_STREAM_DATA (decoding); @@ -5076,8 +5086,8 @@ iso2022_designate (Lisp_Object charset, unsigned char reg, struct encoding_stream *str, unsigned_char_dynarr *dst) { - static CONST char inter94[] = "()*+"; - static CONST char inter96[] = ",-./"; + static const char inter94[] = "()*+"; + static const char inter96[] = ",-./"; unsigned int type; unsigned char final; Lisp_Object old_charset = str->iso2022.charset[reg]; @@ -5161,7 +5171,7 @@ /* Convert internally-formatted data to ISO2022 format. */ static void -encode_coding_iso2022 (Lstream *encoding, CONST unsigned char *src, +encode_coding_iso2022 (Lstream *encoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { unsigned char charmask, c; @@ -5179,7 +5189,7 @@ /* flags for handling composite chars. We do a little switcharoo on the source while we're outputting the composite char. */ unsigned int saved_n = 0; - CONST unsigned char *saved_src = NULL; + const unsigned char *saved_src = NULL; int in_composite = 0; #endif /* ENABLE_COMPOSITE_CHARS */ @@ -5470,7 +5480,7 @@ contain all 256 possible byte values and that are not to be interpreted as being in any particular decoding. */ static void -decode_coding_no_conversion (Lstream *decoding, CONST unsigned char *src, +decode_coding_no_conversion (Lstream *decoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { unsigned char c; @@ -5495,7 +5505,7 @@ } static void -encode_coding_no_conversion (Lstream *encoding, CONST unsigned char *src, +encode_coding_no_conversion (Lstream *encoding, const unsigned char *src, unsigned_char_dynarr *dst, unsigned int n) { unsigned char c; @@ -5557,8 +5567,9 @@ void syms_of_file_coding (void) { - deferror (&Qcoding_system_error, "coding-system-error", - "Coding-system error", Qio_error); + INIT_LRECORD_IMPLEMENTATION (coding_system); + + DEFERROR_STANDARD (Qcoding_system_error, Qio_error); DEFSUBR (Fcoding_system_p); DEFSUBR (Ffind_coding_system); @@ -5825,9 +5836,9 @@ #ifdef MULE { - unsigned int i; - - for (i = 0; i < 65536; i++) + size_t i; + + for (i = 0; i < countof (fcd->ucs_to_mule_table); i++) fcd->ucs_to_mule_table[i] = Qnil; } staticpro (&mule_to_ucs_table); diff -r 72a7cfa4a488 -r abe6d1db359e src/fileio.c --- a/src/fileio.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/fileio.c Mon Aug 13 11:35:02 2007 +0200 @@ -24,7 +24,6 @@ #include #include "lisp.h" -#include #include "buffer.h" #include "events.h" @@ -54,24 +53,13 @@ #endif /* HPUX_PRE_8_0 */ #endif /* HPUX */ -#ifdef WINDOWSNT -#define NOMINMAX 1 -#include -#include -#include -#endif /* not WINDOWSNT */ - -#ifdef WINDOWSNT -#define CORRECT_DIR_SEPS(s) \ - do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ - else unixtodos_filename (s); \ - } while (0) +#ifdef WIN32_NATIVE #define IS_DRIVE(x) isalpha (x) /* Need to lower-case the drive letter, or else expanded filenames will sometimes compare inequal, because `expand-file-name' doesn't always down-case the drive letter. */ #define DRIVE_LETTER(x) tolower (x) -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ int lisp_to_time (Lisp_Object, time_t *); Lisp_Object time_to_lisp (time_t); @@ -135,7 +123,7 @@ /* signal a file error when errno contains a meaningful value. */ DOESNT_RETURN -report_file_error (CONST char *string, Lisp_Object data) +report_file_error (const char *string, Lisp_Object data) { /* #### dmoore - This uses current_buffer, better make sure no one has GC'd the current buffer. File handlers are giving me a headache @@ -148,7 +136,7 @@ } void -maybe_report_file_error (CONST char *string, Lisp_Object data, +maybe_report_file_error (const char *string, Lisp_Object data, Lisp_Object class, Error_behavior errb) { /* Optimization: */ @@ -164,14 +152,14 @@ /* signal a file error when errno does not contain a meaningful value. */ DOESNT_RETURN -signal_file_error (CONST char *string, Lisp_Object data) +signal_file_error (const char *string, Lisp_Object data) { signal_error (Qfile_error, list2 (build_translated_string (string), data)); } void -maybe_signal_file_error (CONST char *string, Lisp_Object data, +maybe_signal_file_error (const char *string, Lisp_Object data, Lisp_Object class, Error_behavior errb) { /* Optimization: */ @@ -183,7 +171,7 @@ } DOESNT_RETURN -signal_double_file_error (CONST char *string1, CONST char *string2, +signal_double_file_error (const char *string1, const char *string2, Lisp_Object data) { signal_error (Qfile_error, @@ -193,7 +181,7 @@ } void -maybe_signal_double_file_error (CONST char *string1, CONST char *string2, +maybe_signal_double_file_error (const char *string1, const char *string2, Lisp_Object data, Lisp_Object class, Error_behavior errb) { @@ -208,7 +196,7 @@ } DOESNT_RETURN -signal_double_file_error_2 (CONST char *string1, CONST char *string2, +signal_double_file_error_2 (const char *string1, const char *string2, Lisp_Object data1, Lisp_Object data2) { signal_error (Qfile_error, @@ -218,7 +206,7 @@ } void -maybe_signal_double_file_error_2 (CONST char *string1, CONST char *string2, +maybe_signal_double_file_error_2 (const char *string1, const char *string2, Lisp_Object data1, Lisp_Object data2, Lisp_Object class, Error_behavior errb) { @@ -289,7 +277,7 @@ } ssize_t -write_allowing_quit (int fildes, CONST void *buf, size_t size) +write_allowing_quit (int fildes, const void *buf, size_t size) { QUIT; return sys_write_1 (fildes, buf, size, 1); @@ -412,7 +400,7 @@ */ (file)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can GC. GC checked 2000-07-28 ben */ Bufbyte *beg; Bufbyte *p; Lisp_Object handler; @@ -432,7 +420,7 @@ p = beg + XSTRING_LENGTH (file); while (p != beg && !IS_ANY_SEP (p[-1]) -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* only recognize drive specifier at beginning */ && !(p[-1] == ':' && p == beg + 2) #endif @@ -440,14 +428,14 @@ if (p == beg) return Qnil; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* Expansion of "c:" to drive and default directory. */ /* (NT does the right thing.) */ if (p == beg + 2 && beg[1] == ':') { /* MAXPATHLEN+1 is guaranteed to be enough space for getdefdir. */ - Bufbyte *res = alloca (MAXPATHLEN + 1); - if (getdefdir (toupper (*beg) - 'A' + 1, res)) + Bufbyte *res = (Bufbyte*) alloca (MAXPATHLEN + 1); + if (_getdcwd (toupper (*beg) - 'A' + 1, (char *)res, MAXPATHLEN)) { char *c=((char *) res) + strlen ((char *) res); if (!IS_DIRECTORY_SEP (*c)) @@ -459,7 +447,7 @@ p = beg + strlen ((char *) beg); } } -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ return make_string (beg, p - beg); } @@ -471,7 +459,7 @@ */ (file)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can GC. GC checked 2000-07-28 ben */ Bufbyte *beg, *p, *end; Lisp_Object handler; @@ -487,7 +475,7 @@ end = p = beg + XSTRING_LENGTH (file); while (p != beg && !IS_ANY_SEP (p[-1]) -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* only recognize drive specifier at beginning */ && !(p[-1] == ':' && p == beg + 2) #endif @@ -507,7 +495,7 @@ */ (filename)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can GC. GC checked 2000-07-28 ben */ Lisp_Object handler; /* If the file name has special constructs in it, @@ -524,6 +512,7 @@ static char * file_name_as_directory (char *out, char *in) { + /* This function cannot GC */ int size = strlen (in); if (size == 0) @@ -556,7 +545,7 @@ */ (file)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can GC. GC checked 2000-07-28 ben */ char *buf; Lisp_Object handler; @@ -581,17 +570,18 @@ */ static int -directory_file_name (CONST char *src, char *dst) +directory_file_name (const char *src, char *dst) { + /* This function cannot GC */ long slen = strlen (src); /* Process as Unix format: just remove any final slash. But leave "/" unchanged; do not change it to "". */ strcpy (dst, src); if (slen > 1 && IS_DIRECTORY_SEP (dst[slen - 1]) -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE && !IS_ANY_SEP (dst[slen - 2]) -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ ) dst[slen - 1] = 0; return 1; @@ -606,7 +596,7 @@ */ (directory)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can GC. GC checked 2000-07-28 ben */ char *buf; Lisp_Object handler; @@ -635,8 +625,10 @@ This implementation is better than what one usually finds in libc. --hniksic */ +static unsigned int temp_name_rand; + DEFUN ("make-temp-name", Fmake_temp_name, 1, 1, 0, /* -Generate temporary file name starting with PREFIX. +Generate a temporary file name starting with PREFIX. The Emacs process number forms part of the result, so there is no danger of generating a name being used by another process. @@ -646,7 +638,8 @@ */ (prefix)) { - static char tbl[64] = { + static const char tbl[64] = + { 'A','B','C','D','E','F','G','H', 'I','J','K','L','M','N','O','P', 'Q','R','S','T','U','V','W','X', @@ -654,13 +647,12 @@ 'g','h','i','j','k','l','m','n', 'o','p','q','r','s','t','u','v', 'w','x','y','z','0','1','2','3', - '4','5','6','7','8','9','-','_' }; - static unsigned count, count_initialized_p; + '4','5','6','7','8','9','-','_' + }; Lisp_Object val; Bytecount len; Bufbyte *p, *data; - unsigned pid; CHECK_STRING (prefix); @@ -686,44 +678,37 @@ /* VAL is created by adding 6 characters to PREFIX. The first three are the PID of this process, in base 64, and the second three are - incremented if the file already exists. This ensures 262144 - unique file names per PID per PREFIX. */ - - pid = (unsigned)getpid (); - *p++ = tbl[pid & 63], pid >>= 6; - *p++ = tbl[pid & 63], pid >>= 6; - *p++ = tbl[pid & 63], pid >>= 6; + a pseudo-random number seeded from process startup time. This + ensures 262144 unique file names per PID per PREFIX per machine. */ + + { + unsigned int pid = (unsigned int) getpid (); + *p++ = tbl[(pid >> 0) & 63]; + *p++ = tbl[(pid >> 6) & 63]; + *p++ = tbl[(pid >> 12) & 63]; + } /* Here we try to minimize useless stat'ing when this function is invoked many times successively with the same PREFIX. We achieve - this by initializing count to a random value, and incrementing it - afterwards. */ - if (!count_initialized_p) - { - count = (unsigned)time (NULL); - /* Dumping temacs with a non-zero count_initialized_p wouldn't - make much sense. */ - if (NILP (Frunning_temacs_p ())) - count_initialized_p = 1; - } + this by using a very pseudo-random number generator to generate + file names unique to this process, with a very long cycle. */ while (1) { struct stat ignored; - unsigned num = count; - - p[0] = tbl[num & 63], num >>= 6; - p[1] = tbl[num & 63], num >>= 6; - p[2] = tbl[num & 63], num >>= 6; + + p[0] = tbl[(temp_name_rand >> 0) & 63]; + p[1] = tbl[(temp_name_rand >> 6) & 63]; + p[2] = tbl[(temp_name_rand >> 12) & 63]; /* Poor man's congruential RN generator. Replace with ++count for debugging. */ - count += 25229; - count %= 225307; + temp_name_rand += 25229; + temp_name_rand %= 225307; QUIT; - if (stat ((CONST char *) data, &ignored) < 0) + if (xemacs_stat ((const char *) data, &ignored) < 0) { /* We want to return only if errno is ENOENT. */ if (errno == ENOENT) @@ -757,23 +742,27 @@ */ (name, default_directory)) { - /* This function can GC */ + /* This function can GC. GC-checked 2000-07-11 ben */ Bufbyte *nm; Bufbyte *newdir, *p, *o; int tlen; Bufbyte *target; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE int drive = 0; int collapse_newdir = 1; #else struct passwd *pw; -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ int length; Lisp_Object handler; -#ifdef __CYGWIN32__ +#ifdef CYGWIN char *user; #endif + struct gcpro gcpro1, gcpro2; + + /* both of these get set below */ + GCPRO2 (name, default_directory); CHECK_STRING (name); @@ -781,8 +770,11 @@ call the corresponding file handler. */ handler = Ffind_file_name_handler (name, Qexpand_file_name); if (!NILP (handler)) - return call3_check_string (handler, Qexpand_file_name, name, - default_directory); + { + UNGCPRO; + return call3_check_string (handler, Qexpand_file_name, name, + default_directory); + } /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */ if (NILP (default_directory)) @@ -794,7 +786,10 @@ { handler = Ffind_file_name_handler (default_directory, Qexpand_file_name); if (!NILP (handler)) - return call3 (handler, Qexpand_file_name, name, default_directory); + { + UNGCPRO; + return call3 (handler, Qexpand_file_name, name, default_directory); + } } o = XSTRING_DATA (default_directory); @@ -813,26 +808,21 @@ /* Save time in some common cases - as long as default_directory is not relative, it can be canonicalized with name below (if it is needed at all) without requiring it to be expanded now. */ -#ifdef WINDOWSNT - /* Detect MSDOS file names with drive specifiers. */ +#ifdef WIN32_NATIVE + /* Detect Windows file names with drive specifiers. */ && ! (IS_DRIVE (o[0]) && (IS_DEVICE_SEP (o[1]) && IS_DIRECTORY_SEP (o[2]))) /* Detect Windows file names in UNC format. */ && ! (IS_DIRECTORY_SEP (o[0]) && IS_DIRECTORY_SEP (o[1])) -#else /* not WINDOWSNT */ +#else /* not WIN32_NATIVE */ /* Detect Unix absolute file names (/... alone is not absolute on - DOS or Windows). */ + Windows). */ && ! (IS_DIRECTORY_SEP (o[0])) -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ ) - { - struct gcpro gcpro1; - - GCPRO1 (name); - default_directory = Fexpand_file_name (default_directory, Qnil); - UNGCPRO; - } + + default_directory = Fexpand_file_name (default_directory, Qnil); #ifdef FILE_SYSTEM_CASE name = FILE_SYSTEM_CASE (name); @@ -842,15 +832,15 @@ into name should be safe during all of this, though. */ nm = XSTRING_DATA (name); -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* We will force directory separators to be either all \ or /, so make a local copy to modify, even if there ends up being no change. */ - nm = strcpy (alloca (strlen (nm) + 1), nm); + nm = strcpy ((char *)alloca (strlen ((char *)nm) + 1), (char *)nm); /* Find and remove drive specifier if present; this makes nm absolute even if the rest of the name appears to be relative. */ { - Bufbyte *colon = strrchr (nm, ':'); + Bufbyte *colon = (Bufbyte *) strrchr ((char *)nm, ':'); if (colon) /* Only recognize colon as part of drive specifier if there is a @@ -880,14 +870,14 @@ "//somedir". */ if (drive && IS_DIRECTORY_SEP (nm[0]) && IS_DIRECTORY_SEP (nm[1])) nm++; -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ /* If nm is absolute, look for /./ or /../ sequences; if none are found, we can probably return right away. We will avoid allocating a new string if name is already fully expanded. */ if ( IS_DIRECTORY_SEP (nm[0]) -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE && (drive || IS_DIRECTORY_SEP (nm[1])) #endif ) @@ -918,7 +908,7 @@ } if (!lose) { -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* Make sure directories are all separated with / or \ as desired, but avoid allocation of a new string when not required. */ @@ -935,12 +925,12 @@ XSTRING_DATA (name)[0] = DRIVE_LETTER (drive); XSTRING_DATA (name)[1] = ':'; } - return name; -#else /* not WINDOWSNT */ + RETURN_UNGCPRO (name); +#else /* not WIN32_NATIVE */ if (nm == XSTRING_DATA (name)) - return name; - return build_string ((char *) nm); -#endif /* not WINDOWSNT */ + RETURN_UNGCPRO (name); + RETURN_UNGCPRO (build_string ((char *) nm)); +#endif /* not WIN32_NATIVE */ } } @@ -977,7 +967,7 @@ Qfile_name); nm++; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE collapse_newdir = 0; #endif } @@ -996,7 +986,7 @@ multiple user profiles users defined, each with its HOME. Therefore, the following should be reworked to handle this case. */ -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* Now if the file given is "~foo/file" and HOME="c:/", then we want the file to be named "c:/file" ("~foo" becomes "c:/"). The variable o has "~foo", so we can use the @@ -1005,8 +995,8 @@ newdir = (Bufbyte *) get_home_directory(); dostounix_filename (newdir); nm += strlen(o) + 1; -#else /* not WINDOWSNT */ -#ifdef __CYGWIN32__ +#else /* not WIN32_NATIVE */ +#ifdef CYGWIN if ((user = user_login_name (NULL)) != NULL) { /* Does the user login name match the ~name? */ @@ -1018,7 +1008,7 @@ } if (! newdir) { -#endif /* __CYGWIN32__ */ +#endif /* CYGWIN */ /* Jamie reports that getpwnam() can get wedged by SIGIO/SIGALARM occurring in it. (It can call select()). */ slow_down_interrupts (); @@ -1029,17 +1019,17 @@ newdir = (Bufbyte *) pw -> pw_dir; nm = p; } -#ifdef __CYGWIN32__ +#ifdef CYGWIN } #endif -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ /* If we don't find a user of that name, leave the name unchanged; don't move nm forward to p. */ } } -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* On DOS and Windows, nm is absolute if a drive name was specified; use the drive's current directory as the prefix if needed. */ if (!newdir && drive) @@ -1048,7 +1038,7 @@ if (!IS_DIRECTORY_SEP (nm[0])) { newdir = alloca (MAXPATHLEN + 1); - if (!getdefdir (toupper (drive) - 'A' + 1, newdir)) + if (!_getdcwd (toupper (drive) - 'A' + 1, newdir, MAXPATHLEN)) newdir = NULL; } if (!newdir) @@ -1061,13 +1051,13 @@ newdir[3] = 0; } } -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ /* Finally, if no prefix has been specified and nm is not absolute, then it must be expanded relative to default_directory. */ if (1 -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE /* /... alone is not absolute on DOS and Windows. */ && !IS_DIRECTORY_SEP (nm[0]) #else @@ -1078,12 +1068,12 @@ newdir = XSTRING_DATA (default_directory); } -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE if (newdir) { /* First ensure newdir is an absolute name. */ if ( - /* Detect MSDOS file names with drive specifiers. */ + /* Detect Windows file names with drive specifiers. */ ! (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1]) && IS_DIRECTORY_SEP (newdir[2])) /* Detect Windows file names in UNC format. */ @@ -1113,7 +1103,7 @@ newdir = alloca (MAXPATHLEN + 1); if (drive) { - if (!getdefdir (toupper (drive) - 'A' + 1, newdir)) + if (!_getdcwd (toupper (drive) - 'A' + 1, newdir, MAXPATHLEN)) newdir = "/"; } else @@ -1144,7 +1134,7 @@ newdir = ""; } } -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ if (newdir) { @@ -1152,7 +1142,7 @@ just // (an incomplete UNC name). */ length = strlen ((char *) newdir); if (length > 1 && IS_DIRECTORY_SEP (newdir[length - 1]) -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE && !(length == 2 && IS_DIRECTORY_SEP (newdir[0])) #endif ) @@ -1169,14 +1159,14 @@ /* Now concatenate the directory and name to new space in the stack frame */ tlen += strlen ((char *) nm) + 1; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* Add reserved space for drive name. (The Microsoft x86 compiler produces incorrect code if the following two lines are combined.) */ target = (Bufbyte *) alloca (tlen + 2); target += 2; -#else /* not WINDOWSNT */ +#else /* not WIN32_NATIVE */ target = (Bufbyte *) alloca (tlen); -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ *target = 0; if (newdir) @@ -1225,7 +1215,7 @@ ++o; p += 3; } -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* if drive is set, we're not dealing with an UNC, so multiple dir-seps are redundant (and reportedly cause trouble under win95) */ @@ -1238,7 +1228,7 @@ } } -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* At last, set drive name, except for network file name. */ if (drive) { @@ -1251,15 +1241,11 @@ assert (IS_DIRECTORY_SEP (target[0]) && IS_DIRECTORY_SEP (target[1])); } CORRECT_DIR_SEPS (target); -#endif /* WINDOWSNT */ - - return make_string (target, o - target); +#endif /* WIN32_NATIVE */ + + RETURN_UNGCPRO (make_string (target, o - target)); } -#if 0 /* FSFmacs */ -/* another older version of expand-file-name; */ -#endif - DEFUN ("file-truename", Ffile_truename, 1, 2, 0, /* Return the canonical name of the given FILE. Second arg DEFAULT is directory to start with if FILE is relative @@ -1270,9 +1256,8 @@ */ (filename, default_)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can GC. GC checked 2000-07-28 ben. */ Lisp_Object expanded_name; - Lisp_Object handler; struct gcpro gcpro1; CHECK_STRING (filename); @@ -1283,11 +1268,15 @@ return Qnil; GCPRO1 (expanded_name); - handler = Ffind_file_name_handler (expanded_name, Qfile_truename); - UNGCPRO; - - if (!NILP (handler)) - return call2_check_string (handler, Qfile_truename, expanded_name); + + { + Lisp_Object handler = + Ffind_file_name_handler (expanded_name, Qfile_truename); + + if (!NILP (handler)) + RETURN_UNGCPRO + (call2_check_string (handler, Qfile_truename, expanded_name)); + } { char resolved_path[MAXPATHLEN]; @@ -1301,7 +1290,7 @@ p = path; if (elen > MAXPATHLEN) goto toolong; - + /* Try doing it all at once. */ /* !! Does realpath() Mule-encapsulate? Answer: Nope! So we do it above */ @@ -1312,14 +1301,25 @@ It claims to return a useful value in the "error" case, but since there is no indication provided of how far along the pathname the function went before erring, there is no way to use the - partial result returned. What a piece of junk. */ + partial result returned. What a piece of junk. + + The above comment refers to historical versions of + realpath(). The Unix98 specs state: + + "On successful completion, realpath() returns a + pointer to the resolved name. Otherwise, realpath() + returns a null pointer and sets errno to indicate the + error, and the contents of the buffer pointed to by + resolved_name are undefined." + + Since we depend on undocumented semantics of various system realpath()s, + we just use our own version in realpath.c. */ for (;;) { p = (Extbyte *) memchr (p + 1, '/', elen - (p + 1 - path)); if (p) *p = 0; - /* memset (resolved_path, 0, sizeof (resolved_path)); */ if (xrealpath ((char *) path, resolved_path)) { if (p) @@ -1337,7 +1337,8 @@ /* "On failure, it returns NULL, sets errno to indicate the error, and places in resolved_path the absolute pathname of the path component which could not be resolved." */ - if (p) + + if (p) { int plen = elen - (p - path); @@ -1358,17 +1359,20 @@ } { + Lisp_Object resolved_name; int rlen = strlen (resolved_path); if (elen > 0 && XSTRING_BYTE (expanded_name, elen - 1) == '/' && !(rlen > 0 && resolved_path[rlen - 1] == '/')) { if (rlen + 1 > countof (resolved_path)) goto toolong; - resolved_path[rlen] = '/'; - resolved_path[rlen + 1] = 0; - rlen = rlen + 1; + resolved_path[rlen++] = '/'; + resolved_path[rlen] = '\0'; } - return make_ext_string ((Bufbyte *) resolved_path, rlen, Qbinary); + TO_INTERNAL_FORMAT (DATA, (resolved_path, rlen), + LISP_STRING, resolved_name, + Qfile_name); + RETURN_UNGCPRO (resolved_name); } toolong: @@ -1377,7 +1381,7 @@ lose: report_file_error ("Finding truename", list1 (expanded_name)); } - return Qnil; /* suppress compiler warning */ + RETURN_UNGCPRO (Qnil); } @@ -1392,7 +1396,7 @@ */ (string)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can GC. GC checked 2000-07-28 ben. */ Bufbyte *nm; Bufbyte *s, *p, *o, *x, *endp; @@ -1419,12 +1423,12 @@ for (p = nm; p != endp; p++) { if ((p[0] == '~' -#if defined (WINDOWSNT) || defined (__CYGWIN32__) +#if defined (WIN32_NATIVE) || defined (CYGWIN) /* // at start of file name is meaningful in WindowsNT systems */ || (IS_DIRECTORY_SEP (p[0]) && p - 1 != nm) -#else /* not (WINDOWSNT || __CYGWIN32__) */ +#else /* not (WIN32_NATIVE || CYGWIN) */ || IS_DIRECTORY_SEP (p[0]) -#endif /* not (WINDOWSNT || __CYGWIN32__) */ +#endif /* not (WIN32_NATIVE || CYGWIN) */ ) && p != nm && (IS_DIRECTORY_SEP (p[-1]))) @@ -1432,7 +1436,7 @@ nm = p; substituted = 1; } -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE /* see comment in expand-file-name about drive specifiers */ else if (IS_DRIVE (p[0]) && p[1] == ':' && p > nm && IS_DIRECTORY_SEP (p[-1])) @@ -1440,7 +1444,7 @@ nm = p; substituted = 1; } -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ } /* See if any variables are substituted into the string @@ -1480,9 +1484,9 @@ target = (Bufbyte *) alloca (s - o + 1); strncpy ((char *) target, (char *) o, s - o); target[s - o] = 0; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE strupr (target); /* $home == $HOME etc. */ -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ /* Get variable value */ o = (Bufbyte *) egetenv ((char *) target); @@ -1531,9 +1535,9 @@ target = (Bufbyte *) alloca (s - o + 1); strncpy ((char *) target, (char *) o, s - o); target[s - o] = 0; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE strupr (target); /* $home == $HOME etc. */ -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ /* Get variable value */ o = (Bufbyte *) egetenv ((char *) target); @@ -1550,16 +1554,16 @@ for (p = xnm; p != x; p++) if ((p[0] == '~' -#if defined (WINDOWSNT) +#if defined (WIN32_NATIVE) || (IS_DIRECTORY_SEP (p[0]) && p - 1 != xnm) -#else /* not WINDOWSNT */ +#else /* not WIN32_NATIVE */ || IS_DIRECTORY_SEP (p[0]) -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ ) /* don't do p[-1] if that would go off the beginning --jwz */ && p != nm && p > xnm && IS_DIRECTORY_SEP (p[-1])) xnm = p; -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE else if (IS_DRIVE (p[0]) && p[1] == ':' && p > nm && IS_DIRECTORY_SEP (p[-1])) xnm = p; @@ -1568,12 +1572,13 @@ return make_string (xnm, x - xnm); badsubst: - error ("Bad format environment-variable substitution"); + syntax_error ("Bad format environment-variable substitution", string); missingclose: - error ("Missing \"}\" in environment-variable substitution"); + syntax_error ("Missing \"}\" in environment-variable substitution", + string); badvar: - error ("Substituting nonexistent environment variable \"%s\"", - target); + syntax_error_2 ("Substituting nonexistent environment variable", + string, build_string (target)); /* NOTREACHED */ return Qnil; /* suppress compiler warning */ @@ -1585,7 +1590,7 @@ Lisp_Object expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir) { - /* This function can call lisp */ + /* This function can call Lisp. GC checked 2000-07-28 ben */ Lisp_Object abspath; struct gcpro gcpro1; @@ -1611,15 +1616,15 @@ If the file does not exist, STATPTR->st_mode is set to 0. */ static void -barf_or_query_if_file_exists (Lisp_Object absname, CONST char *querystring, +barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring, int interactive, struct stat *statptr) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can call Lisp. GC checked 2000-07-28 ben */ struct stat statbuf; /* stat is a good way to tell whether the file exists, regardless of what access permissions it has. */ - if (stat ((char *) XSTRING_DATA (absname), &statbuf) >= 0) + if (xemacs_stat ((char *) XSTRING_DATA (absname), &statbuf) >= 0) { Lisp_Object tem; @@ -1629,7 +1634,7 @@ struct gcpro gcpro1; prompt = emacs_doprnt_string_c - ((CONST Bufbyte *) GETTEXT ("File %s already exists; %s anyway? "), + ((const Bufbyte *) GETTEXT ("File %s already exists; %s anyway? "), Qnil, -1, XSTRING_DATA (absname), GETTEXT (querystring)); @@ -1668,7 +1673,7 @@ */ (filename, newname, ok_if_already_exists, keep_time)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can call Lisp. GC checked 2000-07-28 ben */ int ifd, ofd, n; char buf[16 * 1024]; struct stat st, out_st; @@ -1710,8 +1715,10 @@ args[1] = Qnil; args[2] = Qnil; NGCPRO1 (*args); ngcpro1.nvars = 3; - if (XSTRING_BYTE (newname, XSTRING_LENGTH (newname) - 1) != '/') - args[i++] = build_string ("/"); + if (!IS_DIRECTORY_SEP (XSTRING_BYTE (newname, + XSTRING_LENGTH (newname) - 1))) + + args[i++] = Fchar_to_string (Vdirectory_sep_char); args[i++] = Ffile_name_nondirectory (filename); newname = Fconcat (i, args); NUNGCPRO; @@ -1721,7 +1728,7 @@ || INTP (ok_if_already_exists)) barf_or_query_if_file_exists (newname, "copy to it", INTP (ok_if_already_exists), &out_st); - else if (stat ((CONST char *) XSTRING_DATA (newname), &out_st) < 0) + else if (xemacs_stat ((const char *) XSTRING_DATA (newname), &out_st) < 0) out_st.st_mode = 0; ifd = interruptible_open ((char *) XSTRING_DATA (filename), O_RDONLY | OPEN_BINARY, 0); @@ -1734,7 +1741,7 @@ copyable by us. */ input_file_statable_p = (fstat (ifd, &st) >= 0); -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE if (out_st.st_mode != 0 && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino) { @@ -1784,19 +1791,19 @@ report_file_error ("I/O error", list1 (newname)); if (input_file_statable_p) - { - if (!NILP (keep_time)) { - EMACS_TIME atime, mtime; - EMACS_SET_SECS_USECS (atime, st.st_atime, 0); - EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); - if (set_file_times ((char *) XSTRING_DATA (newname), atime, - mtime)) - report_file_error ("I/O error", list1 (newname)); + if (!NILP (keep_time)) + { + EMACS_TIME atime, mtime; + EMACS_SET_SECS_USECS (atime, st.st_atime, 0); + EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); + if (set_file_times ((char *) XSTRING_DATA (newname), atime, + mtime)) + report_file_error ("I/O error", list1 (newname)); + } + chmod ((const char *) XSTRING_DATA (newname), + st.st_mode & 07777); } - chmod ((CONST char *) XSTRING_DATA (newname), - st.st_mode & 07777); - } /* We'll close it by hand */ XCAR (ofd_locative) = Qnil; @@ -1832,7 +1839,7 @@ { return Fsignal (Qfile_error, list3 (build_translated_string ("Creating directory"), - build_translated_string ("pathame too long"), + build_translated_string ("pathname too long"), dirname_)); } strncpy (dir, (char *) XSTRING_DATA (dirname_), @@ -1874,8 +1881,8 @@ } DEFUN ("delete-file", Fdelete_file, 1, 1, "fDelete file: ", /* -Delete specified file. One argument, a file name string. -If file has multiple names, it continues to exist with the other names. +Delete the file named FILENAME (a string). +If FILENAME has multiple names, it continues to exist with the other names. */ (filename)) { @@ -1972,13 +1979,10 @@ INTP (ok_if_already_exists), 0); /* Syncing with FSF 19.34.6 note: FSF does not have conditional code for - WINDOWSNT here; I've removed it. --marcpa */ - - /* FSFmacs only calls rename() here under BSD 4.1, and calls - link() and unlink() otherwise, but that's bogus. Sometimes - rename() succeeds where link()/unlink() fail, and we have - configure check for rename() and emulate using link()/unlink() - if necessary. */ + WIN32_NATIVE here; I've removed it. --marcpa */ + + /* We have configure check for rename() and emulate using + link()/unlink() if necessary. */ if (0 > rename ((char *) XSTRING_DATA (filename), (char *) XSTRING_DATA (newname))) { @@ -2043,10 +2047,10 @@ /* But FSF #defines link as sys_link which is supplied in nt.c. We can't do that because sysfile.h defines sys_link depending on ENCAPSULATE_LINK. Reverted to previous behavior pending a working fix. (jhar) */ -#if defined(WINDOWSNT) +#if defined(WIN32_NATIVE) /* Windows does not support this operation. */ report_file_error ("Adding new name", Flist (2, &filename)); -#else /* not defined(WINDOWSNT) */ +#else /* not defined(WIN32_NATIVE) */ unlink ((char *) XSTRING_DATA (newname)); if (0 > link ((char *) XSTRING_DATA (filename), @@ -2055,13 +2059,12 @@ report_file_error ("Adding new name", list2 (filename, newname)); } -#endif /* defined(WINDOWSNT) */ +#endif /* defined(WIN32_NATIVE) */ UNGCPRO; return Qnil; } -#ifdef S_IFLNK DEFUN ("make-symbolic-link", Fmake_symbolic_link, 2, 3, "FMake symbolic link to file: \nFMake symbolic link to file %s: \np", /* Make a symbolic link to FILENAME, named LINKNAME. Both args strings. @@ -2073,6 +2076,7 @@ (filename, linkname, ok_if_already_exists)) { /* This function can GC. GC checked 1997.06.04. */ + /* XEmacs change: run handlers even if local machine doesn't have symlinks */ Lisp_Object handler; struct gcpro gcpro1, gcpro2; @@ -2100,6 +2104,7 @@ RETURN_UNGCPRO (call4 (handler, Qmake_symbolic_link, filename, linkname, ok_if_already_exists)); +#ifdef S_IFLNK if (NILP (ok_if_already_exists) || INTP (ok_if_already_exists)) barf_or_query_if_file_exists (linkname, "make it a link", @@ -2112,10 +2117,11 @@ report_file_error ("Making symbolic link", list2 (filename, linkname)); } +#endif /* S_IFLNK */ + UNGCPRO; return Qnil; } -#endif /* S_IFLNK */ #ifdef HPUX_NET @@ -2134,8 +2140,8 @@ /* netunam, being a strange-o system call only used once, is not encapsulated. */ - TO_EXTERNAL_FORMAT (LISP_STRING, path, C_STRING_ALLOCA, path_ext, Qfile_name); - TO_EXTERNAL_FORMAT (LISP_STRING, login, C_STRING_ALLOCA, login_ext, Qnative); + LISP_STRING_TO_EXTERNAL (path, path_ext, Qfile_name); + LISP_STRING_TO_EXTERNAL (login, login_ext, Qnative); netresult = netunam (path_ext, login_ext); @@ -2155,7 +2161,7 @@ CHECK_STRING (filename); ptr = XSTRING_DATA (filename); return (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE || (IS_DRIVE (*ptr) && ptr[1] == ':' && IS_DIRECTORY_SEP (ptr[2])) #endif ) ? Qt : Qnil; @@ -2166,37 +2172,37 @@ static int check_executable (char *filename) { -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE struct stat st; - if (stat (filename, &st) < 0) + if (xemacs_stat (filename, &st) < 0) return 0; return ((st.st_mode & S_IEXEC) != 0); -#else /* not WINDOWSNT */ +#else /* not WIN32_NATIVE */ #ifdef HAVE_EACCESS - return eaccess (filename, 1) >= 0; + return eaccess (filename, X_OK) >= 0; #else /* Access isn't quite right because it uses the real uid and we really want to test with the effective uid. But Unix doesn't give us a right way to do it. */ - return access (filename, 1) >= 0; + return access (filename, X_OK) >= 0; #endif /* HAVE_EACCESS */ -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ } /* Return nonzero if file FILENAME exists and can be written. */ static int -check_writable (CONST char *filename) +check_writable (const char *filename) { #ifdef HAVE_EACCESS - return (eaccess (filename, 2) >= 0); + return (eaccess (filename, W_OK) >= 0); #else /* Access isn't quite right because it uses the real uid and we really want to test with the effective uid. But Unix doesn't give us a right way to do it. Opening with O_WRONLY could work for an ordinary file, but would lose for directories. */ - return (access (filename, 2) >= 0); + return (access (filename, W_OK) >= 0); #endif } @@ -2206,7 +2212,7 @@ */ (filename)) { - /* This function can call lisp */ + /* This function can call lisp; GC checked 2000-07-11 ben */ Lisp_Object abspath; Lisp_Object handler; struct stat statbuf; @@ -2223,7 +2229,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_exists_p, abspath); - return stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0 ? Qt : Qnil; + return xemacs_stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0 ? Qt : Qnil; } DEFUN ("file-executable-p", Ffile_executable_p, 1, 1, 0, /* @@ -2233,7 +2239,7 @@ (filename)) { - /* This function can GC. GC checked 1997.04.10. */ + /* This function can GC. GC checked 07-11-2000 ben. */ Lisp_Object abspath; Lisp_Object handler; struct gcpro gcpro1; @@ -2273,14 +2279,14 @@ if (!NILP (handler)) RETURN_UNGCPRO (call2 (handler, Qfile_readable_p, abspath)); -#if defined(WINDOWSNT) || defined(__CYGWIN32__) +#if defined(WIN32_NATIVE) || defined(CYGWIN) /* Under MS-DOS and Windows, open does not work for directories. */ UNGCPRO; if (access (XSTRING_DATA (abspath), 0) == 0) return Qt; else return Qnil; -#else /* not WINDOWSNT */ +#else /* not WIN32_NATIVE */ { int desc = interruptible_open ((char *) XSTRING_DATA (abspath), O_RDONLY | OPEN_BINARY, 0); UNGCPRO; @@ -2289,7 +2295,7 @@ close (desc); return Qt; } -#endif /* not WINDOWSNT */ +#endif /* not WIN32_NATIVE */ } /* Having this before file-symlink-p mysteriously caused it to be forgotten @@ -2316,7 +2322,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_writable_p, abspath); - if (stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0) + if (xemacs_stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0) return (check_writable ((char *) XSTRING_DATA (abspath)) ? Qt : Qnil); @@ -2337,11 +2343,13 @@ (filename)) { /* This function can GC. GC checked 1997.04.10. */ + /* XEmacs change: run handlers even if local machine doesn't have symlinks */ #ifdef S_IFLNK char *buf; int bufsize; int valsize; Lisp_Object val; +#endif Lisp_Object handler; struct gcpro gcpro1; @@ -2356,6 +2364,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_symlink_p, filename); +#ifdef S_IFLNK bufsize = 100; while (1) { @@ -2406,7 +2415,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_directory_p, abspath); - if (stat ((char *) XSTRING_DATA (abspath), &st) < 0) + if (xemacs_stat ((char *) XSTRING_DATA (abspath), &st) < 0) return Qnil; return (st.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil; } @@ -2431,7 +2440,7 @@ return call2 (handler, Qfile_accessible_directory_p, filename); -#if !defined(WINDOWSNT) +#if !defined(WIN32_NATIVE) if (NILP (Ffile_directory_p (filename))) return (Qnil); else @@ -2452,7 +2461,7 @@ UNGCPRO; return tem ? Qnil : Qt; } -#endif /* !defined(WINDOWSNT) */ +#endif /* !defined(WIN32_NATIVE) */ } DEFUN ("file-regular-p", Ffile_regular_p, 1, 1, 0, /* @@ -2479,7 +2488,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_regular_p, abspath); - if (stat ((char *) XSTRING_DATA (abspath), &st) < 0) + if (xemacs_stat ((char *) XSTRING_DATA (abspath), &st) < 0) return Qnil; return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil; } @@ -2508,14 +2517,14 @@ if (!NILP (handler)) return call2 (handler, Qfile_modes, abspath); - if (stat ((char *) XSTRING_DATA (abspath), &st) < 0) + if (xemacs_stat ((char *) XSTRING_DATA (abspath), &st) < 0) return Qnil; /* Syncing with FSF 19.34.6 note: not in FSF, #if 0'ed out here. */ #if 0 -#ifdef DOS_NT +#ifdef WIN32_NATIVE if (check_executable (XSTRING_DATA (abspath))) st.st_mode |= S_IEXEC; -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ #endif /* 0 */ return make_int (st.st_mode & 07777); @@ -2589,7 +2598,7 @@ */ ()) { -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE sync (); #endif return Qnil; @@ -2630,12 +2639,12 @@ return call3 (handler, Qfile_newer_than_file_p, abspath1, abspath2); - if (stat ((char *) XSTRING_DATA (abspath1), &st) < 0) + if (xemacs_stat ((char *) XSTRING_DATA (abspath1), &st) < 0) return Qnil; mtime1 = st.st_mtime; - if (stat ((char *) XSTRING_DATA (abspath2), &st) < 0) + if (xemacs_stat ((char *) XSTRING_DATA (abspath2), &st) < 0) return Qt; return (mtime1 > st.st_mtime) ? Qt : Qnil; @@ -2725,7 +2734,7 @@ fd = -1; - if (stat ((char *) XSTRING_DATA (filename), &st) < 0) + if (xemacs_stat ((char *) XSTRING_DATA (filename), &st) < 0) { if (fd >= 0) close (fd); badopen: @@ -3112,12 +3121,12 @@ */ (start, end, filename, append, visit, lockname, codesys)) { - /* This function can call lisp */ + /* This function can call lisp. GC checked 2000-07-28 ben */ int desc; int failure; int save_errno = 0; struct stat st; - Lisp_Object fn; + Lisp_Object fn = Qnil; int speccount = specpdl_depth (); int visiting_other = STRINGP (visit); int visiting = (EQ (visit, Qt) || visiting_other); @@ -3126,28 +3135,37 @@ Lisp_Object annotations = Qnil; struct buffer *given_buffer; Bufpos start1, end1; - - /* #### dmoore - if Fexpand_file_name or handlers kill the buffer, + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; + struct gcpro ngcpro1, ngcpro2; + Lisp_Object curbuf; + + XSETBUFFER (curbuf, current_buffer); + + /* start, end, visit, and append are never modified in this fun + so we don't protect them. */ + GCPRO5 (visit_file, filename, codesys, lockname, annotations); + NGCPRO2 (curbuf, fn); + + /* [[ dmoore - if Fexpand_file_name or handlers kill the buffer, we should signal an error rather than blissfully continuing along. ARGH, this function is going to lose lose lose. We need to protect the current_buffer from being destroyed, but the - multiple return points make this a pain in the butt. */ + multiple return points make this a pain in the butt. ]] we do + protect curbuf now. --ben */ #ifdef FILE_CODING codesys = Fget_coding_system (codesys); #endif /* FILE_CODING */ if (current_buffer->base_buffer && ! NILP (visit)) - error ("Cannot do file visiting in an indirect buffer"); + invalid_operation ("Cannot do file visiting in an indirect buffer", + curbuf); if (!NILP (start) && !STRINGP (start)) get_buffer_range_char (current_buffer, start, end, &start1, &end1, 0); { Lisp_Object handler; - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; - - GCPRO5 (start, filename, visit, visit_file, lockname); if (visiting_other) visit_file = Fexpand_file_name (visit, Qnil); @@ -3155,11 +3173,11 @@ visit_file = filename; filename = Fexpand_file_name (filename, Qnil); - UNGCPRO; - if (NILP (lockname)) lockname = visit_file; + /* We used to UNGCPRO here. BAD! visit_file is used below after + more Lisp calling. */ /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (filename, Qwrite_region); @@ -3178,21 +3196,15 @@ current_buffer->filename = visit_file; MARK_MODELINE_CHANGED; } + NUNGCPRO; + UNGCPRO; return val; } } #ifdef CLASH_DETECTION if (!auto_saving) - { - Lisp_Object curbuf; - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; - - XSETBUFFER (curbuf, current_buffer); - GCPRO5 (start, filename, visit_file, lockname, curbuf); - lock_file (lockname); - UNGCPRO; - } + lock_file (lockname); #endif /* CLASH_DETECTION */ /* Special kludge to simplify auto-saving. */ @@ -3221,8 +3233,8 @@ if (desc < 0) { desc = open ((char *) XSTRING_DATA (fn), - (O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY), - ((auto_saving) ? auto_save_mode_bits : CREAT_MODE)); + O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, + auto_saving ? auto_save_mode_bits : CREAT_MODE); } if (desc < 0) @@ -3238,9 +3250,9 @@ { Lisp_Object desc_locative = Fcons (make_int (desc), Qnil); Lisp_Object instream = Qnil, outstream = Qnil; - struct gcpro gcpro1, gcpro2; + struct gcpro nngcpro1, nngcpro2; /* need to gcpro; QUIT could happen out of call to write() */ - GCPRO2 (instream, outstream); + NNGCPRO2 (instream, outstream); record_unwind_protect (close_file_unwind, desc_locative); @@ -3298,7 +3310,6 @@ save_errno = errno; } Lstream_close (XLSTREAM (instream)); - UNGCPRO; #ifdef HAVE_FSYNC /* Note fsync appears to change the modtime on BSD4.2 (both vax and sun). @@ -3318,7 +3329,7 @@ systems where close() can change the modtime. This is known to happen on various NFS file systems, on Windows, and on Linux. Rather than handling this on a per-system basis, we - unconditionally do the stat() after the close(). */ + unconditionally do the xemacs_stat() after the close(). */ /* NFS can report a write failure now. */ if (close (desc) < 0) @@ -3332,9 +3343,11 @@ as necessary). */ XCAR (desc_locative) = Qnil; unbind_to (speccount, Qnil); + + NNUNGCPRO; } - stat ((char *) XSTRING_DATA (fn), &st); + xemacs_stat ((char *) XSTRING_DATA (fn), &st); #ifdef CLASH_DETECTION if (!auto_saving) @@ -3348,9 +3361,10 @@ current_buffer->modtime = st.st_mtime; if (failure) - error ("IO error writing %s: %s", - XSTRING_DATA (fn), - strerror (save_errno)); + { + errno = save_errno; + report_file_error ("Writing file", list1 (fn)); + } if (visiting) { @@ -3361,6 +3375,8 @@ } else if (quietly) { + NUNGCPRO; + UNGCPRO; return Qnil; } @@ -3370,19 +3386,21 @@ message ("Wrote %s", XSTRING_DATA (visit_file)); else { - struct gcpro gcpro1; Lisp_Object fsp; - GCPRO1 (fn); - + struct gcpro nngcpro1; + + NNGCPRO1 (fsp); fsp = Ffile_symlink_p (fn); if (NILP (fsp)) message ("Wrote %s", XSTRING_DATA (fn)); else message ("Wrote %s (symlink to %s)", XSTRING_DATA (fn), XSTRING_DATA (fsp)); - UNGCPRO; + NNUNGCPRO; } } + NUNGCPRO; + UNGCPRO; return Qnil; } @@ -3634,7 +3652,7 @@ */ (buf)) { - /* This function can call lisp */ + /* This function can call lisp; GC checked 2000-07-11 ben */ struct buffer *b; struct stat st; Lisp_Object handler; @@ -3652,7 +3670,7 @@ if (!NILP (handler)) return call2 (handler, Qverify_visited_file_modtime, buf); - if (stat ((char *) XSTRING_DATA (b->filename), &st) < 0) + if (xemacs_stat ((char *) XSTRING_DATA (b->filename), &st) < 0) { /* If the file doesn't exist now and didn't exist before, we say that it isn't modified, provided the error is a tame one. */ @@ -3724,7 +3742,7 @@ if (!NILP (handler)) /* The handler can find the file name the same way we did. */ return call2 (handler, Qset_visited_file_modtime, Qnil); - else if (stat ((char *) XSTRING_DATA (filename), &st) >= 0) + else if (xemacs_stat ((char *) XSTRING_DATA (filename), &st) >= 0) current_buffer->modtime = st.st_mtime; } @@ -3765,7 +3783,7 @@ /* Get visited file's mode to become the auto save file's mode. */ if (STRINGP (fn) && - stat ((char *) XSTRING_DATA (fn), &st) >= 0) + xemacs_stat ((char *) XSTRING_DATA (fn), &st) >= 0) /* But make sure we can overwrite it later! */ auto_save_mode_bits = st.st_mode | 0600; else @@ -3954,10 +3972,10 @@ set_buffer_internal (b); if (!auto_saved && NILP (no_message)) { - static CONST unsigned char *msg - = (CONST unsigned char *) "Auto-saving..."; + static const unsigned char *msg + = (const unsigned char *) "Auto-saving..."; echo_area_message (selected_frame (), msg, Qnil, - 0, strlen ((CONST char *) msg), + 0, strlen ((const char *) msg), Qauto_saving); } @@ -3983,7 +4001,7 @@ auto save name. */ if (listdesc >= 0) { - CONST Extbyte *auto_save_file_name_ext; + const Extbyte *auto_save_file_name_ext; Extcount auto_save_file_name_ext_len; TO_EXTERNAL_FORMAT (LISP_STRING, b->auto_save_file_name, @@ -3992,7 +4010,7 @@ Qfile_name); if (!NILP (b->filename)) { - CONST Extbyte *filename_ext; + const Extbyte *filename_ext; Extcount filename_ext_len; TO_EXTERNAL_FORMAT (LISP_STRING, b->filename, @@ -4061,10 +4079,10 @@ if (auto_saved && NILP (no_message) && NILP (clear_echo_area (selected_frame (), Qauto_saving, 0))) { - static CONST unsigned char *msg - = (CONST unsigned char *)"Auto-saving...done"; + static const unsigned char *msg + = (const unsigned char *)"Auto-saving...done"; echo_area_message (selected_frame (), msg, Qnil, 0, - strlen ((CONST char *) msg), Qauto_saving); + strlen ((const char *) msg), Qauto_saving); } Vquit_flag = oquit; @@ -4150,9 +4168,8 @@ defsymbol (&Qformat_annotate_function, "format-annotate-function"); defsymbol (&Qcompute_buffer_file_truename, "compute-buffer-file-truename"); - deferror (&Qfile_error, "file-error", "File error", Qio_error); - deferror (&Qfile_already_exists, "file-already-exists", - "File already exists", Qfile_error); + DEFERROR_STANDARD (Qfile_error, Qio_error); + DEFERROR_STANDARD (Qfile_already_exists, Qfile_error); DEFSUBR (Ffind_file_name_handler); @@ -4171,9 +4188,7 @@ DEFSUBR (Fdelete_file); DEFSUBR (Frename_file); DEFSUBR (Fadd_name_to_file); -#ifdef S_IFLNK DEFSUBR (Fmake_symbolic_link); -#endif /* S_IFLNK */ #ifdef HPUX_NET DEFSUBR (Fsysnetunam); #endif /* HPUX_NET */ @@ -4299,9 +4314,31 @@ on other platforms, it is initialized so that Lisp code can find out what the normal separator is. */ ); -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE Vdirectory_sep_char = make_char ('\\'); #else - Vdirectory_sep_char = make_char ('/'); + Vdirectory_sep_char = make_char ('/'); #endif + + reinit_vars_of_fileio (); } + +void +reinit_vars_of_fileio (void) +{ + /* We want temp_name_rand to be initialized to a value likely to be + unique to the process, not to the executable. The danger is that + two different XEmacs processes using the same binary on different + machines creating temp files in the same directory will be + unlucky enough to have the same pid. If we randomize using + process startup time, then in practice they will be unlikely to + collide. We use the microseconds field so that scripts that start + simultaneous XEmacs processes on multiple machines will have less + chance of collision. */ + { + EMACS_TIME thyme; + + EMACS_GET_TIME (thyme); + temp_name_rand = (unsigned int) (EMACS_SECS (thyme) ^ EMACS_USECS (thyme)); + } +} diff -r 72a7cfa4a488 -r abe6d1db359e src/filelock.c --- a/src/filelock.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/filelock.c Mon Aug 13 11:35:02 2007 +0200 @@ -34,14 +34,14 @@ Lisp_Object Qask_user_about_lock; #ifdef CLASH_DETECTION - + /* The strategy: to lock a file FN, create a symlink .#FN in FN's directory, with link data `user@host.pid'. This avoids a single mount (== failure) point for lock files. When the host in the lock data is the current host, we can check if the pid is valid with kill. - + Otherwise, we could look at a separate file that maps hostnames to reboot times to see if the remote pid can possibly be valid, since we don't want Emacs to have to communicate via pipes or sockets or @@ -63,13 +63,16 @@ Similarly, we don't worry about a possible 14-character limit on file names, because those are all the same systems that don't have symlinks. - + This is compatible with the locking scheme used by Interleaf (which has contributed this implementation for Emacs), and was designed by Ethan Jacobson, Kimbo Mundy, and others. - + --karl@cs.umb.edu/karl@hq.ileaf.com. */ +/* Note that muleization is provided by using mule-encapsulated + versions of the system calls we use like symlink(), unlink(), etc... */ + /* Here is the structure that stores information about a lock. */ @@ -90,27 +93,27 @@ /* Write the name of the lock file for FN into LFNAME. Length will be that of FN plus two more for the leading `.#' plus one for the null. */ #define MAKE_LOCK_NAME(lock, file) \ - (lock = (char *) alloca (XSTRING_LENGTH(file) + 2 + 1), \ - fill_in_lock_file_name (lock, (file))) + (lock = (char *) alloca (XSTRING_LENGTH (file) + 2 + 1), \ + fill_in_lock_file_name ((Bufbyte *) (lock), (file))) static void -fill_in_lock_file_name (lockfile, fn) - register char *lockfile; - register Lisp_Object fn; +fill_in_lock_file_name (Bufbyte *lockfile, Lisp_Object fn) { - register char *p; - - strcpy (lockfile, XSTRING_DATA(fn)); + Bufbyte *file_name = XSTRING_DATA (fn); + Bufbyte *p; + size_t dirlen; - /* Shift the nondirectory part of the file name (including the null) - right two characters. Here is one of the places where we'd have to - do something to support 14-character-max file names. */ - for (p = lockfile + strlen (lockfile); p != lockfile && *p != '/'; p--) - p[2] = *p; + for (p = file_name + XSTRING_LENGTH (fn) - 1; + p > file_name && !IS_ANY_SEP (p[-1]); + p--) + ; + dirlen = p - file_name; - /* Insert the `.#'. */ - p[1] = '.'; - p[2] = '#'; + memcpy (lockfile, file_name, dirlen); + p = lockfile + dirlen; + *(p++) = '.'; + *(p++) = '#'; + memcpy (p, file_name + dirlen, XSTRING_LENGTH (fn) - dirlen + 1); } /* Lock the lock file named LFNAME. @@ -118,21 +121,22 @@ Return 1 if successful, 0 if not. */ static int -lock_file_1 (char *lfname,int force) +lock_file_1 (char *lfname, int force) { - register int err; - char *user_name; + /* Does not GC. */ + int err; + char *lock_info_str; char *host_name; - char *lock_info_str; + char *user_name = user_login_name (NULL); - if (STRINGP (Fuser_login_name (Qnil))) - user_name = (char *) XSTRING_DATA (Fuser_login_name (Qnil)); - else + if (user_name == NULL) user_name = ""; - if (STRINGP (Fsystem_name ())) - host_name = (char *) XSTRING_DATA (Fsystem_name ()); + + if (STRINGP (Vsystem_name)) + host_name = (char *) XSTRING_DATA (Vsystem_name); else host_name = ""; + lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) + LOCK_PID_MAX + 5); @@ -140,7 +144,7 @@ (unsigned long) getpid ()); err = symlink (lock_info_str, lfname); - if (errno == EEXIST && force) + if (err != 0 && errno == EEXIST && force) { unlink (lfname); err = symlink (lock_info_str, lfname); @@ -157,7 +161,8 @@ static int current_lock_owner (lock_info_type *owner, char *lfname) { - int o, p, len, ret; + /* Does not GC. */ + int len, ret; int local_owner = 0; char *at, *dot; char *lfinfo = 0; @@ -171,7 +176,7 @@ len = readlink (lfname, lfinfo, bufsize); } while (len >= bufsize); - + /* If nonexistent lock file, all is well; otherwise, got strange error. */ if (len == -1) { @@ -181,7 +186,7 @@ /* Link info exists, so `len' is its length. Null terminate. */ lfinfo[len] = 0; - + /* Even if the caller doesn't want the owner info, we still have to read it to determine return value, so allocate it. */ if (!owner) @@ -189,7 +194,7 @@ owner = (lock_info_type *) alloca (sizeof (lock_info_type)); local_owner = 1; } - + /* Parse USER@HOST.PID. If can't parse, return -1. */ /* The USER is everything before the first @. */ at = strchr (lfinfo, '@'); @@ -202,7 +207,7 @@ owner->user = (char *) xmalloc (len + 1); strncpy (owner->user, lfinfo, len); owner->user[len] = 0; - + /* The PID is everything after the last `.'. */ owner->pid = atoi (dot + 1); @@ -214,10 +219,10 @@ /* We're done looking at the link info. */ xfree (lfinfo); - + /* On current host? */ - if (STRINGP (Fsystem_name ()) - && strcmp (owner->host, XSTRING_DATA(Fsystem_name ())) == 0) + if (STRINGP (Fsystem_name ()) + && strcmp (owner->host, (char *) XSTRING_DATA (Fsystem_name ())) == 0) { if (owner->pid == getpid ()) ret = 2; /* We own it. */ @@ -236,7 +241,7 @@ here's where we'd do it. */ ret = 1; } - + /* Avoid garbage. */ if (local_owner || ret <= 0) { @@ -254,13 +259,14 @@ static int lock_if_free (lock_info_type *clasher, char *lfname) { + /* Does not GC. */ if (lock_file_1 (lfname, 0) == 0) { int locker; if (errno != EEXIST) return -1; - + locker = current_lock_owner (clasher, lfname); if (locker == 2) { @@ -295,11 +301,11 @@ void lock_file (Lisp_Object fn) { - /* This function can GC. */ + /* This function can GC. GC checked 7-11-00 ben */ /* dmoore - and can destroy current_buffer and all sorts of other mean nasty things with pointy teeth. If you call this make sure you protect things right. */ - /* Somebody updated the code in this function and removed the previous + /* Somebody updated the code in this function and removed the previous comment. -slb */ register Lisp_Object attack, orig_fn; @@ -322,8 +328,8 @@ if (!NILP (subject_buf) && NILP (Fverify_visited_file_modtime (subject_buf)) && !NILP (Ffile_exists_p (fn))) - call1_in_buffer (XBUFFER(subject_buf), - Qask_user_about_supersession_threat, fn); + call1_in_buffer (XBUFFER (subject_buf), + Qask_user_about_supersession_threat, fn); } /* Try to lock the lock. */ @@ -337,7 +343,7 @@ sprintf (locker, "%s@%s (pid %lu)", lock_info.user, lock_info.host, lock_info.pid); FREE_LOCK_INFO (lock_info); - + attack = call2_in_buffer (BUFFERP (subject_buf) ? XBUFFER (subject_buf) : current_buffer, Qask_user_about_lock , fn, build_string (locker)); @@ -355,7 +361,11 @@ void unlock_file (Lisp_Object fn) { + /* This can GC */ register char *lfname; + struct gcpro gcpro1; + + GCPRO1 (fn); fn = Fexpand_file_name (fn, Qnil); @@ -363,28 +373,29 @@ if (current_lock_owner (0, lfname) == 2) unlink (lfname); + + UNGCPRO; } void -unlock_all_files () +unlock_all_files (void) { register Lisp_Object tail; - register struct buffer *b; for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) { - b = XBUFFER (XCDR (XCAR (tail))); + struct buffer *b = XBUFFER (XCDR (XCAR (tail))); if (STRINGP (b->file_truename) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) unlock_file (b->file_truename); } } DEFUN ("lock-buffer", Flock_buffer, 0, 1, 0, /* - Lock FILE, if current buffer is modified.\n\ -FILE defaults to current buffer's visited file,\n\ +Lock FILE, if current buffer is modified. +FILE defaults to current buffer's visited file, or else nothing is done if current buffer isn't visiting a file. */ - (file)) + (file)) { if (NILP (file)) file = current_buffer->file_truename; @@ -428,15 +439,18 @@ } DEFUN ("file-locked-p", Ffile_locked_p, 0, 1, 0, /* - Return nil if the FILENAME is not locked,\n\ +Return nil if the FILENAME is not locked, t if it is locked by you, else a string of the name of the locker. */ - (filename)) + (filename)) { Lisp_Object ret; register char *lfname; int owner; lock_info_type locker; + struct gcpro gcpro1; + + GCPRO1 (filename); filename = Fexpand_file_name (filename, Qnil); @@ -453,6 +467,8 @@ if (owner > 0) FREE_LOCK_INFO (locker); + UNGCPRO; + return ret; } diff -r 72a7cfa4a488 -r abe6d1db359e src/filemode.c --- a/src/filemode.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/filemode.c Mon Aug 13 11:35:02 2007 +0200 @@ -79,9 +79,9 @@ mode_string (unsigned short mode, char *str) { str[0] = ftypelet (mode); - rwx ((mode & 0700) << 0, &str[1]); - rwx ((mode & 0070) << 3, &str[4]); - rwx ((mode & 0007) << 6, &str[7]); + rwx ((unsigned short) ((mode & 0700) << 0), &str[1]); + rwx ((unsigned short) ((mode & 0070) << 3), &str[4]); + rwx ((unsigned short) ((mode & 0007) << 6), &str[7]); setst (mode, str); } diff -r 72a7cfa4a488 -r abe6d1db359e src/floatfns.c --- a/src/floatfns.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/floatfns.c Mon Aug 13 11:35:02 2007 +0200 @@ -79,7 +79,7 @@ /* If an argument is out of range for a mathematical function, here is the actual argument value to use in the error message. */ static Lisp_Object float_error_arg, float_error_arg2; -static CONST char *float_error_fn_name; +static const char *float_error_fn_name; /* Evaluate the floating point expression D, recording NUM as the original argument for error messages. @@ -126,7 +126,7 @@ /* Convert float to Lisp Integer if it fits, else signal a range error using the given arguments. */ static Lisp_Object -float_to_int (double x, CONST char *name, Lisp_Object num, Lisp_Object num2) +float_to_int (double x, const char *name, Lisp_Object num, Lisp_Object num2) { if (x >= ((EMACS_INT) 1 << (VALBITS-1)) || x <= - ((EMACS_INT) 1 << (VALBITS-1)) - (EMACS_INT) 1) @@ -988,6 +988,7 @@ void syms_of_floatfns (void) { + INIT_LRECORD_IMPLEMENTATION (float); /* Trig functions. */ diff -r 72a7cfa4a488 -r abe6d1db359e src/fns.c --- a/src/fns.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/fns.c Mon Aug 13 11:35:02 2007 +0200 @@ -36,10 +36,7 @@ #include "lisp.h" -#ifdef HAVE_UNISTD_H -#include -#endif -#include +#include "sysfile.h" #include "buffer.h" #include "bytecode.h" @@ -111,17 +108,25 @@ sizeof (long))); } +static size_t +size_bit_vector (const void *lheader) +{ + Lisp_Bit_Vector *v = (Lisp_Bit_Vector *) lheader; + return FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, + BIT_VECTOR_LONG_STORAGE (bit_vector_length (v))); +} + static const struct lrecord_description bit_vector_description[] = { { XD_LISP_OBJECT, offsetof (Lisp_Bit_Vector, next) }, { XD_END } }; -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("bit-vector", bit_vector, - mark_bit_vector, print_bit_vector, 0, - bit_vector_equal, bit_vector_hash, - bit_vector_description, - Lisp_Bit_Vector); +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); DEFUN ("identity", Fidentity, 1, 1, 0, /* Return the argument unchanged. @@ -196,7 +201,7 @@ #endif /* LOSING_BYTECODE */ void -check_losing_bytecode (CONST char *function, Lisp_Object seq) +check_losing_bytecode (const char *function, Lisp_Object seq) { if (COMPILED_FUNCTIONP (seq)) error_with_frob @@ -705,6 +710,7 @@ string_result_ptr = string_result; break; default: + val = Qnil; abort (); } } @@ -913,85 +919,82 @@ } DEFUN ("subseq", Fsubseq, 2, 3, 0, /* -Return a subsequence of SEQ, starting at index FROM and ending before TO. -TO may be nil or omitted; then the subsequence runs to the end of SEQ. -If FROM or TO is negative, it counts from the end. -The resulting subsequence is always the same type as the original - sequence. -If SEQ is a string, relevant parts of the string-extent-data are copied - to the new string. +Return the subsequence of SEQUENCE starting at START and ending before END. +END may be omitted; then the subsequence runs to the end of SEQUENCE. +If START or END is negative, it counts from the end. +The returned subsequence is always of the same type as SEQUENCE. +If SEQUENCE is a string, relevant parts of the string-extent-data +are copied to the new string. */ - (seq, from, to)) + (sequence, start, end)) { - EMACS_INT len, f, t; - - if (STRINGP (seq)) - return Fsubstring (seq, from, to); - - if (!LISTP (seq) && !VECTORP (seq) && !BIT_VECTORP (seq)) - { - check_losing_bytecode ("subseq", seq); - seq = wrong_type_argument (Qsequencep, seq); - } - - len = XINT (Flength (seq)); - - CHECK_INT (from); - f = XINT (from); - if (f < 0) - f = len + f; - - if (NILP (to)) - t = len; + EMACS_INT len, s, e; + + if (STRINGP (sequence)) + return Fsubstring (sequence, start, end); + + len = XINT (Flength (sequence)); + + CHECK_INT (start); + s = XINT (start); + if (s < 0) + s = len + s; + + if (NILP (end)) + e = len; else { - CHECK_INT (to); - t = XINT (to); - if (t < 0) - t = len + t; + CHECK_INT (end); + e = XINT (end); + if (e < 0) + e = len + e; } - if (!(0 <= f && f <= t && t <= len)) - args_out_of_range_3 (seq, make_int (f), make_int (t)); - - if (VECTORP (seq)) + if (!(0 <= s && s <= e && e <= len)) + args_out_of_range_3 (sequence, make_int (s), make_int (e)); + + if (VECTORP (sequence)) { - Lisp_Object result = make_vector (t - f, Qnil); + Lisp_Object result = make_vector (e - s, Qnil); EMACS_INT i; - Lisp_Object *in_elts = XVECTOR_DATA (seq); + Lisp_Object *in_elts = XVECTOR_DATA (sequence); Lisp_Object *out_elts = XVECTOR_DATA (result); - for (i = f; i < t; i++) - out_elts[i - f] = in_elts[i]; + for (i = s; i < e; i++) + out_elts[i - s] = in_elts[i]; return result; } - - if (LISTP (seq)) + else if (LISTP (sequence)) { Lisp_Object result = Qnil; EMACS_INT i; - seq = Fnthcdr (make_int (f), seq); - - for (i = f; i < t; i++) + sequence = Fnthcdr (make_int (s), sequence); + + for (i = s; i < e; i++) { - result = Fcons (Fcar (seq), result); - seq = Fcdr (seq); + result = Fcons (Fcar (sequence), result); + sequence = Fcdr (sequence); } return Fnreverse (result); } - - /* bit vector */ - { - Lisp_Object result = make_bit_vector (t - f, Qzero); - EMACS_INT i; - - for (i = f; i < t; i++) - set_bit_vector_bit (XBIT_VECTOR (result), i - f, - bit_vector_bit (XBIT_VECTOR (seq), i)); - return result; - } + else if (BIT_VECTORP (sequence)) + { + Lisp_Object result = make_bit_vector (e - s, Qzero); + EMACS_INT i; + + for (i = s; i < e; i++) + set_bit_vector_bit (XBIT_VECTOR (result), i - s, + bit_vector_bit (XBIT_VECTOR (sequence), i)); + return result; + } + else + { + abort (); /* unreachable, since Flength (sequence) did not get + an error */ + return Qnil; + } } @@ -1217,7 +1220,6 @@ */ (elt, list)) { - Lisp_Object list_elt, tail; EXTERNAL_LIST_LOOP_3 (list_elt, list, tail) { if (internal_equal (elt, list_elt, 0)) @@ -1234,7 +1236,6 @@ */ (elt, list)) { - Lisp_Object list_elt, tail; EXTERNAL_LIST_LOOP_3 (list_elt, list, tail) { if (internal_old_equal (elt, list_elt, 0)) @@ -1249,7 +1250,6 @@ */ (elt, list)) { - Lisp_Object list_elt, tail; EXTERNAL_LIST_LOOP_3 (list_elt, list, tail) { if (EQ_WITH_EBOLA_NOTICE (elt, list_elt)) @@ -1266,7 +1266,6 @@ */ (elt, list)) { - Lisp_Object list_elt, tail; EXTERNAL_LIST_LOOP_3 (list_elt, list, tail) { if (HACKEQ_UNSAFE (elt, list_elt)) @@ -1278,7 +1277,6 @@ Lisp_Object memq_no_quit (Lisp_Object elt, Lisp_Object list) { - Lisp_Object list_elt, tail; LIST_LOOP_3 (list_elt, list, tail) { if (EQ_WITH_EBOLA_NOTICE (elt, list_elt)) @@ -1294,7 +1292,6 @@ (key, list)) { /* This function can GC. */ - Lisp_Object elt, elt_car, elt_cdr; EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) { if (internal_equal (key, elt_car, 0)) @@ -1310,7 +1307,6 @@ (key, list)) { /* This function can GC. */ - Lisp_Object elt, elt_car, elt_cdr; EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) { if (internal_old_equal (key, elt_car, 0)) @@ -1334,7 +1330,6 @@ */ (key, list)) { - Lisp_Object elt, elt_car, elt_cdr; EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) { if (EQ_WITH_EBOLA_NOTICE (key, elt_car)) @@ -1352,7 +1347,6 @@ */ (key, list)) { - Lisp_Object elt, elt_car, elt_cdr; EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) { if (HACKEQ_UNSAFE (key, elt_car)) @@ -1368,7 +1362,6 @@ assq_no_quit (Lisp_Object key, Lisp_Object list) { /* This cannot GC. */ - Lisp_Object elt; LIST_LOOP_2 (elt, list) { Lisp_Object elt_car = XCAR (elt); @@ -1384,7 +1377,6 @@ */ (key, list)) { - Lisp_Object elt, elt_car, elt_cdr; EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) { if (internal_equal (key, elt_cdr, 0)) @@ -1399,7 +1391,6 @@ */ (key, list)) { - Lisp_Object elt, elt_car, elt_cdr; EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) { if (internal_old_equal (key, elt_cdr, 0)) @@ -1414,7 +1405,6 @@ */ (key, list)) { - Lisp_Object elt, elt_car, elt_cdr; EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) { if (EQ_WITH_EBOLA_NOTICE (key, elt_cdr)) @@ -1429,7 +1419,6 @@ */ (key, list)) { - Lisp_Object elt, elt_car, elt_cdr; EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) { if (HACKEQ_UNSAFE (key, elt_cdr)) @@ -1443,7 +1432,6 @@ Lisp_Object rassq_no_quit (Lisp_Object key, Lisp_Object list) { - Lisp_Object elt; LIST_LOOP_2 (elt, list) { Lisp_Object elt_cdr = XCDR (elt); @@ -1464,7 +1452,6 @@ */ (elt, list)) { - Lisp_Object list_elt; EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, (internal_equal (elt, list_elt, 0))); return list; @@ -1479,7 +1466,6 @@ */ (elt, list)) { - Lisp_Object list_elt; EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, (internal_old_equal (elt, list_elt, 0))); return list; @@ -1494,7 +1480,6 @@ */ (elt, list)) { - Lisp_Object list_elt; EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, (EQ_WITH_EBOLA_NOTICE (elt, list_elt))); return list; @@ -1509,7 +1494,6 @@ */ (elt, list)) { - Lisp_Object list_elt; EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, (HACKEQ_UNSAFE (elt, list_elt))); return list; @@ -1521,7 +1505,6 @@ Lisp_Object delq_no_quit (Lisp_Object elt, Lisp_Object list) { - Lisp_Object list_elt; LIST_LOOP_DELETE_IF (list_elt, list, (EQ_WITH_EBOLA_NOTICE (elt, list_elt))); return list; @@ -1571,7 +1554,6 @@ */ (key, list)) { - Lisp_Object elt; EXTERNAL_LIST_LOOP_DELETE_IF (elt, list, (CONSP (elt) && internal_equal (key, XCAR (elt), 0))); @@ -1595,7 +1577,6 @@ */ (key, list)) { - Lisp_Object elt; EXTERNAL_LIST_LOOP_DELETE_IF (elt, list, (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (key, XCAR (elt)))); @@ -1607,7 +1588,6 @@ Lisp_Object remassq_no_quit (Lisp_Object key, Lisp_Object list) { - Lisp_Object elt; LIST_LOOP_DELETE_IF (elt, list, (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (key, XCAR (elt)))); @@ -1623,7 +1603,6 @@ */ (value, list)) { - Lisp_Object elt; EXTERNAL_LIST_LOOP_DELETE_IF (elt, list, (CONSP (elt) && internal_equal (value, XCDR (elt), 0))); @@ -1639,7 +1618,6 @@ */ (value, list)) { - Lisp_Object elt; EXTERNAL_LIST_LOOP_DELETE_IF (elt, list, (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (value, XCDR (elt)))); @@ -1650,7 +1628,6 @@ Lisp_Object remrassq_no_quit (Lisp_Object value, Lisp_Object list) { - Lisp_Object elt; LIST_LOOP_DELETE_IF (elt, list, (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (value, XCDR (elt)))); @@ -1690,7 +1667,6 @@ (list)) { Lisp_Object reversed_list = Qnil; - Lisp_Object elt; EXTERNAL_LIST_LOOP_2 (elt, list) { reversed_list = Fcons (elt, reversed_list); @@ -2092,8 +2068,6 @@ bad_bad_turtle (Lisp_Object *plist, Lisp_Object *badplace, Error_behavior errb) { if (ERRB_EQ (errb, ERROR_ME)) - /* #### Eek, this will probably result in another error - when PLIST is printed out */ return Fsignal (Qcircular_property_list, list1 (*plist)); else { @@ -2368,8 +2342,7 @@ DEFUN ("valid-plist-p", Fvalid_plist_p, 1, 1, 0, /* Given a plist, return non-nil if its format is correct. If it returns nil, `check-valid-plist' will signal an error when given -the plist; that means it's a malformed or circular plist or has non-symbols -as keywords. +the plist; that means it's a malformed or circular plist. */ (plist)) { @@ -2446,9 +2419,7 @@ (lax_plist, prop, default_)) { Lisp_Object val = external_plist_get (&lax_plist, prop, 1, ERROR_ME); - if (UNBOUNDP (val)) - return default_; - return val; + return UNBOUNDP (val) ? default_ : val; } DEFUN ("lax-plist-put", Flax_plist_put, 3, 3, 0, /* @@ -2568,222 +2539,87 @@ return head; } -/* Symbol plists are directly accessible, so we need to protect against - invalid property list structure */ - -static Lisp_Object -symbol_getprop (Lisp_Object sym, Lisp_Object propname, Lisp_Object default_) -{ - Lisp_Object val = external_plist_get (&XSYMBOL (sym)->plist, propname, - 0, ERROR_ME); - return UNBOUNDP (val) ? default_ : val; -} - -static void -symbol_putprop (Lisp_Object sym, Lisp_Object propname, Lisp_Object value) -{ - external_plist_put (&XSYMBOL (sym)->plist, propname, value, 0, ERROR_ME); -} - -static int -symbol_remprop (Lisp_Object symbol, Lisp_Object propname) -{ - return external_remprop (&XSYMBOL (symbol)->plist, propname, 0, ERROR_ME); -} - -/* We store the string's extent info as the first element of the string's - property list; and the string's MODIFF as the first or second element - of the string's property list (depending on whether the extent info - is present), but only if the string has been modified. This is ugly - but it reduces the memory allocated for the string in the vast - majority of cases, where the string is never modified and has no - extent info. */ - - -static Lisp_Object * -string_plist_ptr (Lisp_String *s) -{ - Lisp_Object *ptr = &s->plist; - - if (CONSP (*ptr) && EXTENT_INFOP (XCAR (*ptr))) - ptr = &XCDR (*ptr); - if (CONSP (*ptr) && INTP (XCAR (*ptr))) - ptr = &XCDR (*ptr); - return ptr; -} - -static Lisp_Object -string_getprop (Lisp_String *s, Lisp_Object property, - Lisp_Object default_) -{ - Lisp_Object val = external_plist_get (string_plist_ptr (s), property, 0, - ERROR_ME); - return UNBOUNDP (val) ? default_ : val; -} - -static void -string_putprop (Lisp_String *s, Lisp_Object property, - Lisp_Object value) -{ - external_plist_put (string_plist_ptr (s), property, value, 0, ERROR_ME); -} - -static int -string_remprop (Lisp_String *s, Lisp_Object property) -{ - return external_remprop (string_plist_ptr (s), property, 0, ERROR_ME); -} - -static Lisp_Object -string_plist (Lisp_String *s) -{ - return *string_plist_ptr (s); -} - DEFUN ("get", Fget, 2, 3, 0, /* -Return the value of OBJECT's PROPNAME property. -This is the last VALUE stored with `(put OBJECT PROPNAME VALUE)'. +Return the value of OBJECT's PROPERTY property. +This is the last VALUE stored with `(put OBJECT PROPERTY VALUE)'. If there is no such property, return optional third arg DEFAULT -\(which defaults to `nil'). OBJECT can be a symbol, face, extent, -or string. See also `put', `remprop', and `object-plist'. +\(which defaults to `nil'). OBJECT can be a symbol, string, extent, +face, or glyph. See also `put', `remprop', and `object-plist'. */ - (object, propname, default_)) + (object, property, default_)) { /* Various places in emacs call Fget() and expect it not to quit, so don't quit. */ - - /* It's easiest to treat symbols specially because they may not - be an lrecord */ - if (SYMBOLP (object)) - return symbol_getprop (object, propname, default_); - else if (STRINGP (object)) - return string_getprop (XSTRING (object), propname, default_); - else if (LRECORDP (object)) - { - CONST struct lrecord_implementation *imp - = XRECORD_LHEADER_IMPLEMENTATION (object); - if (!imp->getprop) - goto noprops; - - { - Lisp_Object val = (imp->getprop) (object, propname); - if (UNBOUNDP (val)) - val = default_; - return val; - } - } + Lisp_Object val; + + if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->getprop) + val = XRECORD_LHEADER_IMPLEMENTATION (object)->getprop (object, property); else - { - noprops: - signal_simple_error ("Object type has no properties", object); - return Qnil; /* Not reached */ - } + signal_simple_error ("Object type has no properties", object); + + return UNBOUNDP (val) ? default_ : val; } DEFUN ("put", Fput, 3, 3, 0, /* -Store OBJECT's PROPNAME property with value VALUE. -It can be retrieved with `(get OBJECT PROPNAME)'. OBJECT can be a -symbol, face, extent, or string. - +Set OBJECT's PROPERTY to VALUE. +It can be subsequently retrieved with `(get OBJECT PROPERTY)'. +OBJECT can be a symbol, face, extent, or string. For a string, no properties currently have predefined meanings. For the predefined properties for extents, see `set-extent-property'. For the predefined properties for faces, see `set-face-property'. - See also `get', `remprop', and `object-plist'. */ - (object, propname, value)) + (object, property, value)) { - CHECK_SYMBOL (propname); CHECK_LISP_WRITEABLE (object); - if (SYMBOLP (object)) - symbol_putprop (object, propname, value); - else if (STRINGP (object)) - string_putprop (XSTRING (object), propname, value); - else if (LRECORDP (object)) + if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->putprop) { - CONST struct lrecord_implementation - *imp = XRECORD_LHEADER_IMPLEMENTATION (object); - if (imp->putprop) - { - if (! (imp->putprop) (object, propname, value)) - signal_simple_error ("Can't set property on object", propname); - } - else - goto noprops; + if (! XRECORD_LHEADER_IMPLEMENTATION (object)->putprop + (object, property, value)) + signal_simple_error ("Can't set property on object", property); } else - { - noprops: - signal_simple_error ("Object type has no settable properties", object); - } + signal_simple_error ("Object type has no settable properties", object); return value; } DEFUN ("remprop", Fremprop, 2, 2, 0, /* -Remove from OBJECT's property list the property PROPNAME and its -value. OBJECT can be a symbol, face, extent, or string. Returns -non-nil if the property list was actually changed (i.e. if PROPNAME -was present in the property list). See also `get', `put', and -`object-plist'. +Remove, from OBJECT's property list, PROPERTY and its corresponding value. +OBJECT can be a symbol, string, extent, face, or glyph. Return non-nil +if the property list was actually modified (i.e. if PROPERTY was present +in the property list). See also `get', `put', and `object-plist'. */ - (object, propname)) + (object, property)) { - int retval = 0; - - CHECK_SYMBOL (propname); + int ret = 0; + CHECK_LISP_WRITEABLE (object); - if (SYMBOLP (object)) - retval = symbol_remprop (object, propname); - else if (STRINGP (object)) - retval = string_remprop (XSTRING (object), propname); - else if (LRECORDP (object)) + if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->remprop) { - CONST struct lrecord_implementation - *imp = XRECORD_LHEADER_IMPLEMENTATION (object); - if (imp->remprop) - { - retval = (imp->remprop) (object, propname); - if (retval == -1) - signal_simple_error ("Can't remove property from object", - propname); - } - else - goto noprops; + ret = XRECORD_LHEADER_IMPLEMENTATION (object)->remprop (object, property); + if (ret == -1) + signal_simple_error ("Can't remove property from object", property); } else - { - noprops: - signal_simple_error ("Object type has no removable properties", object); - } - - return retval ? Qt : Qnil; + signal_simple_error ("Object type has no removable properties", object); + + return ret ? Qt : Qnil; } DEFUN ("object-plist", Fobject_plist, 1, 1, 0, /* -Return a property list of OBJECT's props. -For a symbol this is equivalent to `symbol-plist'. -Do not modify the property list directly; this may or may not have -the desired effects. (In particular, for a property with a special -interpretation, this will probably have no effect at all.) +Return a property list of OBJECT's properties. +For a symbol, this is equivalent to `symbol-plist'. +OBJECT can be a symbol, string, extent, face, or glyph. +Do not modify the returned property list directly; +this may or may not have the desired effects. Use `put' instead. */ (object)) { - if (SYMBOLP (object)) - return Fsymbol_plist (object); - else if (STRINGP (object)) - return string_plist (XSTRING (object)); - else if (LRECORDP (object)) - { - CONST struct lrecord_implementation - *imp = XRECORD_LHEADER_IMPLEMENTATION (object); - if (imp->plist) - return (imp->plist) (object); - else - signal_simple_error ("Object type has no properties", object); - } + if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->plist) + return XRECORD_LHEADER_IMPLEMENTATION (object)->plist (object); else signal_simple_error ("Object type has no properties", object); @@ -2804,7 +2640,7 @@ return 0; if (LRECORDP (obj1)) { - CONST struct lrecord_implementation + const struct lrecord_implementation *imp1 = XRECORD_LHEADER_IMPLEMENTATION (obj1), *imp2 = XRECORD_LHEADER_IMPLEMENTATION (obj2); @@ -3094,12 +2930,11 @@ if (vals == 0) we don't have any free space available and don't want to eat up any more stack with alloca(). - So we use EXTERNAL_LIST_LOOP_3 and GCPRO the tail. */ + So we use EXTERNAL_LIST_LOOP_3_NO_DECLARE and GCPRO the tail. */ if (vals) { Lisp_Object *val = vals; - Lisp_Object elt; LIST_LOOP_2 (elt, sequence) *val++ = elt; @@ -3115,12 +2950,13 @@ else { Lisp_Object elt, tail; + EMACS_INT len_unused; struct gcpro ngcpro1; NGCPRO1 (tail); { - EXTERNAL_LIST_LOOP_3 (elt, sequence, tail) + EXTERNAL_LIST_LOOP_4_NO_DECLARE (elt, sequence, tail, len_unused) { args[1] = elt; Ffuncall (2, args); @@ -3168,7 +3004,7 @@ } } else - abort(); /* cannot get here since Flength(sequence) did not get an error */ + abort (); /* unreachable, since Flength (sequence) did not get an error */ if (vals) UNGCPRO; @@ -3185,16 +3021,13 @@ size_t len = XINT (Flength (sequence)); Lisp_Object *args; int i; - struct gcpro gcpro1; int nargs = len + len - 1; - if (nargs < 0) return build_string (""); + if (len == 0) return build_string (""); args = alloca_array (Lisp_Object, nargs); - GCPRO1 (separator); mapcar1 (len, args, function, sequence); - UNGCPRO; for (i = len - 1; i >= 0; i--) args[i + i] = args[i]; @@ -3255,8 +3088,59 @@ } + + +DEFUN ("replace-list", Freplace_list, 2, 2, 0, /* +Destructively replace the list OLD with NEW. +This is like (copy-sequence NEW) except that it reuses the +conses in OLD as much as possible. If OLD and NEW are the same +length, no consing will take place. +*/ + (old, new)) +{ + Lisp_Object tail, oldtail = old, prevoldtail = Qnil; + + EXTERNAL_LIST_LOOP (tail, new) + { + if (!NILP (oldtail)) + { + CHECK_CONS (oldtail); + XCAR (oldtail) = XCAR (tail); + } + else if (!NILP (prevoldtail)) + { + XCDR (prevoldtail) = Fcons (XCAR (tail), Qnil); + prevoldtail = XCDR (prevoldtail); + } + else + old = oldtail = Fcons (XCAR (tail), Qnil); + + if (!NILP (oldtail)) + { + prevoldtail = oldtail; + oldtail = XCDR (oldtail); + } + } + + if (!NILP (prevoldtail)) + XCDR (prevoldtail) = Qnil; + else + old = Qnil; + + return old; +} + + /* #### this function doesn't belong in this file! */ +#ifdef HAVE_GETLOADAVG +#ifdef HAVE_SYS_LOADAVG_H +#include +#endif +#else +int getloadavg (double loadavg[], int nelem); /* Defined in getloadavg.c */ +#endif + DEFUN ("load-average", Fload_average, 0, 1, 0, /* Return list of 1 minute, 5 minute and 15 minute load averages. Each of the three load averages is multiplied by 100, @@ -3326,10 +3210,13 @@ (featurep '(or (and xemacs 19.15) (and emacs 19.34))) => ; Non-nil on XEmacs 19.15 and later, or FSF Emacs 19.34 and later. + (featurep '(and xemacs 21.02)) + => ; Non-nil on XEmacs 21.2 and later. + NOTE: The advanced arguments of this function (anything other than a symbol) are not yet supported by FSF Emacs. If you feel they are useful for supporting multiple Emacs variants, lobby Richard Stallman at -. +. */ (fexp)) { @@ -3859,6 +3746,8 @@ void syms_of_fns (void) { + INIT_LRECORD_IMPLEMENTATION (bit_vector); + defsymbol (&Qstring_lessp, "string-lessp"); defsymbol (&Qidentity, "identity"); defsymbol (&Qyes_or_no_p, "yes-or-no-p"); @@ -3938,6 +3827,7 @@ DEFSUBR (Fmapvector); DEFSUBR (Fmapc_internal); DEFSUBR (Fmapconcat); + DEFSUBR (Freplace_list); DEFSUBR (Fload_average); DEFSUBR (Ffeaturep); DEFSUBR (Frequire); diff -r 72a7cfa4a488 -r abe6d1db359e src/font-lock.c --- a/src/font-lock.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/font-lock.c Mon Aug 13 11:35:02 2007 +0200 @@ -368,8 +368,8 @@ /* OK, fine. */ return; #if 0 - /* This appears to cause huge slowdowns in files like - emacsfns.h, which have no top-level forms. + /* This appears to cause huge slowdowns in files which have no + top-level forms. In any case, it's not really necessary that we know for sure the top-level form we're in; if we're in a form diff -r 72a7cfa4a488 -r abe6d1db359e src/frame-msw.c --- a/src/frame-msw.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/frame-msw.c Mon Aug 13 11:35:02 2007 +0200 @@ -58,7 +58,7 @@ #define POPUP_WIDTH 30 #define POPUP_HEIGHT 10 -/* Default popup size, in characters */ +/* Default regular frame size, in characters */ #define DEFAULT_FRAME_WIDTH 80 #define DEFAULT_FRAME_HEIGHT 35 @@ -81,6 +81,21 @@ /*----- DISPLAY FRAME -----*/ /*---------------------------------------------------------------------*/ +HWND +mswindows_get_selected_frame_hwnd (void) +{ + Lisp_Object frame, device; + + device = Ffind_device (Qnil, Qmswindows); + if (NILP (device)) + return NULL; + frame = DEVICE_SELECTED_FRAME (XDEVICE (device)); + if (NILP (frame)) + return NULL; + + return FRAME_MSWINDOWS_HANDLE (XFRAME (frame)); +} + static void mswindows_init_frame_1 (struct frame *f, Lisp_Object props) { @@ -95,7 +110,7 @@ /* Pick up relevant properties */ initially_unmapped = Fplist_get (props, Qinitially_unmapped, Qnil); name = Fplist_get (props, Qname, Qnil); - + popup = Fplist_get (props, Qpopup, Qnil); if (EQ (popup, Qt)) popup = Fselected_frame (Qnil); @@ -121,25 +136,23 @@ FRAME_MSWINDOWS_TARGET_RECT (f)->left = NILP (left) ? -1 : abs (XINT (left)); FRAME_MSWINDOWS_TARGET_RECT (f)->top = NILP (top) ? -1 : abs (XINT (top)); - FRAME_MSWINDOWS_TARGET_RECT (f)->width = NILP (width) ? -1 : + FRAME_MSWINDOWS_TARGET_RECT (f)->width = NILP (width) ? -1 : abs (XINT (width)); - FRAME_MSWINDOWS_TARGET_RECT (f)->height = NILP (height) ? -1 : + FRAME_MSWINDOWS_TARGET_RECT (f)->height = NILP (height) ? -1 : abs (XINT (height)); - + /* Misc frame stuff */ - FRAME_MSWINDOWS_DATA(f)->button2_need_lbutton = 0; - FRAME_MSWINDOWS_DATA(f)->button2_need_rbutton = 0; - FRAME_MSWINDOWS_DATA(f)->button2_is_down = 0; - FRAME_MSWINDOWS_DATA(f)->ignore_next_lbutton_up = 0; - FRAME_MSWINDOWS_DATA(f)->ignore_next_rbutton_up = 0; - FRAME_MSWINDOWS_DATA(f)->sizing = 0; FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil; #ifdef HAVE_TOOLBARS - FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) = + FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) = make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); #endif /* hashtable of instantiated glyphs on the frame. */ - FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f) = + FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f) = + make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQUAL); + FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f) = + make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQUAL); + FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f) = make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQUAL); /* Will initialize these in WM_SIZE handler. We cannot do it now, because we do not know what is CW_USEDEFAULT height and width */ @@ -175,6 +188,7 @@ rect_default.top = rect.top + POPUP_OFFSET; char_to_real_pixel_size (f, POPUP_WIDTH, POPUP_HEIGHT, &rect_default.width, &rect_default.height); + FRAME_MSWINDOWS_POPUP (f) = 1; } AdjustWindowRectEx(&rect, style, ADJR_MENUFLAG, exstyle); @@ -186,9 +200,9 @@ hwnd = CreateWindowEx (exstyle, XEMACS_CLASS, STRINGP(f->name) ? XSTRING_DATA(f->name) : - (STRINGP(name) ? - (CONST Extbyte*)XSTRING_DATA(name) : - (CONST Extbyte*)XEMACS_CLASS), + (STRINGP(name) ? + (const Extbyte*)XSTRING_DATA(name) : + (const Extbyte*)XEMACS_CLASS), style, rect_default.left, rect_default.top, rect_default.width, rect_default.height, @@ -197,14 +211,19 @@ Vmswindows_frame_being_created = Qnil; if (hwnd == NULL) - error ("System call to create frame failed"); - + invalid_operation ("System call to create frame failed", + STRINGP (f->name) ? f->name : + STRINGP (name) ? name : + Qunbound); + FRAME_MSWINDOWS_HANDLE(f) = hwnd; SetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)LISP_TO_VOID(frame_obj)); FRAME_MSWINDOWS_DC(f) = GetDC (hwnd); - FRAME_MSWINDOWS_CDC(f) = CreateCompatibleDC (FRAME_MSWINDOWS_CDC(f)); SetTextAlign (FRAME_MSWINDOWS_DC(f), TA_BASELINE | TA_LEFT | TA_NOUPDATECP); + + if (FRAME_MSWINDOWS_POPUP (f)) + mswindows_register_popup_frame (frame_obj); } static void @@ -216,7 +235,7 @@ since we don't have X resources. This may change if we look at the registry. Even so these values can get overridden later.*/ - XEMACS_RECT_WH dest = { -1, -1, DEFAULT_FRAME_WIDTH, + XEMACS_RECT_WH dest = { -1, -1, DEFAULT_FRAME_WIDTH, DEFAULT_FRAME_HEIGHT }; mswindows_size_frame_internal (f, &dest); } @@ -228,7 +247,7 @@ { /* Don't do this earlier or we get a WM_PAINT before the frame is ready. * The SW_x parameter in the first call that an app makes to ShowWindow is - * ignored, and the parameter specified in the caller's STARTUPINFO is + * ignored, and the parameter specified in the caller's STARTUPINFO is * substituted instead. That parameter is SW_HIDE if we were started by * runemacs, so call this twice. #### runemacs is evil */ ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL); @@ -242,7 +261,7 @@ int first_on_console) { /* Windows, unlike X, is very synchronous. After the initial - frame is created, it will never be displayed, except for + frame is created, it will never be displayed, except for hollow border, unless we start pumping messages. Load progress messages show in the bottom of the hollow frame, which is ugly. We redisplay the initial frame here, so modeline and root window @@ -259,7 +278,9 @@ #ifdef HAVE_TOOLBARS mark_object (FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f)); #endif - mark_object (FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f)); + mark_object (FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f)); + mark_object (FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f)); + mark_object (FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f)); } static void @@ -273,7 +294,9 @@ { if (f->frame_data) { - DeleteDC(FRAME_MSWINDOWS_CDC(f)); + Lisp_Object frame; + XSETFRAME (frame, f); + mswindows_unregister_popup_frame (frame); ReleaseDC(FRAME_MSWINDOWS_HANDLE(f), FRAME_MSWINDOWS_DC(f)); DestroyWindow(FRAME_MSWINDOWS_HANDLE(f)); xfree (f->frame_data); @@ -297,7 +320,7 @@ if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) || IsZoomed (FRAME_MSWINDOWS_HANDLE(f))) ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE); - SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, + SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, 0, 0, rect.right-rect.left, rect.bottom-rect.top, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOMOVE); } @@ -305,13 +328,13 @@ static void mswindows_set_frame_position (struct frame *f, int xoff, int yoff) { - SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, + SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, xoff, yoff, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOSIZE); } static void -mswindows_make_frame_visible (struct frame *f) +mswindows_make_frame_visible (struct frame *f) { if (!FRAME_VISIBLE_P(f)) ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE); @@ -322,7 +345,7 @@ } static void -mswindows_make_frame_invisible (struct frame *f) +mswindows_make_frame_invisible (struct frame *f) { if (!FRAME_VISIBLE_P(f)) return; @@ -348,7 +371,7 @@ UnionRect(&rc_temp, &rc_me, &rc_other); if (!EqualRect (&rc_temp, &rc_other)) return 0; - + /* Then see if any window above us obscures us */ while ((hwnd = GetWindow (hwnd, GW_HWNDPREV)) != NULL) if (IsWindowVisible (hwnd)) @@ -391,11 +414,11 @@ { if (!XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon)) { - mswindows_initialize_image_instance_icon (XIMAGE_INSTANCE (f->icon), + mswindows_initialize_image_instance_icon (XIMAGE_INSTANCE (f->icon), FALSE); } - - SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HICON, + + SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HICON, (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon)); } } @@ -481,7 +504,19 @@ } static void -mswindows_set_title_from_bufbyte (struct frame *f, Bufbyte *title) +mswindows_enable_frame (struct frame *f) +{ + EnableWindow (FRAME_MSWINDOWS_HANDLE (f), TRUE); +} + +static void +mswindows_disable_frame (struct frame *f) +{ + EnableWindow (FRAME_MSWINDOWS_HANDLE (f), FALSE); +} + +static void +mswindows_set_title_from_bufbyte (struct frame *f, Bufbyte *title) { unsigned int new_checksum = hash_string (title, strlen (title)); if (new_checksum != FRAME_MSWINDOWS_TITLE_CHECKSUM(f)) @@ -552,7 +587,7 @@ if (STRINGP (val)) { Lisp_Object frm, font_spec; - + XSETFRAME (frm, f); font_spec = Fget (Fget_face (Qdefault), Qfont, Qnil); @@ -589,9 +624,9 @@ /* Now we've extracted the properties, apply them. Do not apply geometric properties during frame creation. This - is excessive anyways, and this loses becuase WM_SIZE has not + is excessive anyways, and this loses because WM_SIZE has not been sent yet, so frame width and height fields are not initialized. - + unfortunately WM_SIZE loses as well since the resize is only applied once and the first time WM_SIZE is applied not everything is initialised in the frame (toolbars for instance). enabling @@ -610,13 +645,12 @@ void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest) { - RECT rect; + RECT rect, ws_rect; int pixel_width, pixel_height; int size_p = (dest->width >=0 || dest->height >=0); int move_p = (dest->top >=0 || dest->left >=0); - struct device* d = XDEVICE (FRAME_DEVICE (f)); char_to_real_pixel_size (f, dest->width, dest->height, &pixel_width, &pixel_height); - + if (dest->width < 0) pixel_width = FRAME_PIXWIDTH (f); if (dest->height < 0) @@ -627,7 +661,7 @@ dest->left = rect.left; if (dest->top < 0) dest->top = rect.top; - + rect.left = rect.top = 0; rect.right = pixel_width; rect.bottom = pixel_height; @@ -637,40 +671,52 @@ GetMenu (FRAME_MSWINDOWS_HANDLE(f)) != NULL, GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_EXSTYLE)); - /* resize and move the window so that it fits on the screen. This is + /* resize and move the window so that it fits in the workspace. This is not restrictive since this will happen later anyway in WM_SIZE. We have to do this after adjusting the rect to account for menubar etc. */ + mswindows_get_workspace_coords (&ws_rect); pixel_width = rect.right - rect.left; pixel_height = rect.bottom - rect.top; - if (pixel_width > DEVICE_MSWINDOWS_HORZRES(d)) + if (pixel_width > ws_rect.right - ws_rect.left) { - pixel_width = DEVICE_MSWINDOWS_HORZRES(d); + pixel_width = ws_rect.right - ws_rect.left; size_p=1; } - if (pixel_height > DEVICE_MSWINDOWS_VERTRES(d)) + if (pixel_height > ws_rect.bottom - ws_rect.top) { - pixel_height = DEVICE_MSWINDOWS_VERTRES(d); + pixel_height = ws_rect.bottom - ws_rect.top; size_p=1; } - /* adjust position so window is on screen */ - if (dest->left + pixel_width > DEVICE_MSWINDOWS_HORZRES(d)) + /* adjust position so window is in workspace */ + if (dest->left + pixel_width > ws_rect.right) { - dest->left = DEVICE_MSWINDOWS_HORZRES(d) - pixel_width; + dest->left = ws_rect.right - pixel_width; move_p=1; } - if (dest->top + pixel_height > DEVICE_MSWINDOWS_VERTRES(d)) + if (dest->left < ws_rect.left) { - dest->top = DEVICE_MSWINDOWS_VERTRES(d) - pixel_height; + dest->left = ws_rect.left; move_p=1; } - if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) + if (dest->top + pixel_height > ws_rect.bottom) + { + dest->top = ws_rect.bottom - pixel_height; + move_p=1; + } + if (dest->top < ws_rect.top) + { + dest->top = ws_rect.top; + move_p=1; + } + + if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) || IsZoomed (FRAME_MSWINDOWS_HANDLE(f))) ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE); - SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, + SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, dest->left, dest->top, pixel_width, pixel_height, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | (size_p ? 0 : SWP_NOSIZE) @@ -709,15 +755,38 @@ /*----- PRINTER FRAME -----*/ /*---------------------------------------------------------------------*/ -EXFUN (Fset_frame_properties, 2); +/* + * With some driver/os combination (I discovered this with HP drivers + * under W2K), DC geometry is reset upon StartDoc and EndPage + * calls. This is called every time one of these calls is made. + */ +static void +apply_dc_geometry (struct frame* f) +{ + HDC hdc = DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f))); + SetTextAlign (hdc, TA_BASELINE | TA_LEFT | TA_NOUPDATECP); + SetViewportOrgEx (hdc, FRAME_MSPRINTER_PIXLEFT(f), + FRAME_MSPRINTER_PIXTOP(f), NULL); +} + +void +msprinter_start_page (struct frame *f) +{ + if (!FRAME_MSPRINTER_PAGE_STARTED (f)) + { + FRAME_MSPRINTER_PAGE_STARTED (f) = 1; + StartPage (DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f)))); + apply_dc_geometry (f); + } +} static void error_frame_unsizable (struct frame *f) { Lisp_Object frame; XSETFRAME (frame, f); - signal_simple_error ("Cannot resize frame (margins)" - " after print job has started.", frame); + invalid_change ("Cannot resize frame (margins) after print job has started.", + frame); } static void @@ -730,14 +799,11 @@ static void msprinter_init_frame_1 (struct frame *f, Lisp_Object props) { - HDC hdc = DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f))); - Lisp_Object frame_obj = Qnil; - /* Make sure this is the only frame on device. Windows printer can handle only one job at a time. */ if (!NILP (DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f))))) - error ("Only one frame (print job) at a time is allowed on " - "this printer device."); + invalid_operation ("Only one frame (print job) at a time is allowed on " + "this printer device", FRAME_DEVICE (f)); f->frame_data = xnew_and_zero (struct msprinter_frame); @@ -750,10 +816,6 @@ /* Negative for "uinspecified" */ FRAME_MSPRINTER_CHARWIDTH(f) = -1; FRAME_MSPRINTER_CHARHEIGHT(f) = -1; - - /* nil is for "system default" for these properties. */ - FRAME_MSPRINTER_ORIENTATION(f) = Qnil; - FRAME_MSPRINTER_DUPLEX(f) = Qnil; } static void @@ -761,55 +823,27 @@ { DOCINFO di; struct device *device = XDEVICE (FRAME_DEVICE (f)); - HDC hdc = DEVICE_MSPRINTER_HDC (device); + HDC hdc; int frame_left, frame_top, frame_width, frame_height; - /* Change printer parameters */ - { - DEVMODE* devmode = msprinter_get_devmode_copy (device); - devmode->dmFields = 0; - - if (!NILP (FRAME_MSPRINTER_ORIENTATION(f))) - { - devmode->dmFields = DM_ORIENTATION; - if (EQ (FRAME_MSPRINTER_ORIENTATION(f), Qportrait)) - devmode->dmOrientation = DMORIENT_PORTRAIT; - else if (EQ (FRAME_MSPRINTER_ORIENTATION(f), Qlandscape)) - devmode->dmOrientation = DMORIENT_LANDSCAPE; - else - abort(); - } - - if (!NILP (FRAME_MSPRINTER_DUPLEX(f))) - { - devmode->dmFields = DM_DUPLEX; - if (EQ (FRAME_MSPRINTER_DUPLEX(f), Qnone)) - devmode->dmDuplex = DMDUP_SIMPLEX; - if (EQ (FRAME_MSPRINTER_DUPLEX(f), Qvertical)) - devmode->dmDuplex = DMDUP_VERTICAL; - if (EQ (FRAME_MSPRINTER_DUPLEX(f), Qhorizontal)) - devmode->dmDuplex = DMDUP_HORIZONTAL; - else - abort(); - } - - msprinter_apply_devmode (device, devmode); - } + /* DC might be recreated in msprinter_apply_devmode, + so do not initialize until now */ + hdc = DEVICE_MSPRINTER_HDC (device); /* Compute geometry properties */ frame_left = (MulDiv (GetDeviceCaps (hdc, LOGPIXELSX), FRAME_MSPRINTER_LEFT_MARGIN(f), 1440) - GetDeviceCaps (hdc, PHYSICALOFFSETX)); - + if (FRAME_MSPRINTER_CHARWIDTH(f) > 0) { char_to_real_pixel_size (f, FRAME_MSPRINTER_CHARWIDTH(f), 0, &frame_width, NULL); - FRAME_MSPRINTER_RIGHT_MARGIN(f) = + FRAME_MSPRINTER_RIGHT_MARGIN(f) = MulDiv (GetDeviceCaps (hdc, PHYSICALWIDTH) - (frame_left + frame_width), 1440, GetDeviceCaps (hdc, LOGPIXELSX)); - } + } else frame_width = (GetDeviceCaps (hdc, PHYSICALWIDTH) - frame_left @@ -825,11 +859,11 @@ char_to_real_pixel_size (f, 0, FRAME_MSPRINTER_CHARHEIGHT(f), NULL, &frame_height); - FRAME_MSPRINTER_BOTTOM_MARGIN(f) = + FRAME_MSPRINTER_BOTTOM_MARGIN(f) = MulDiv (GetDeviceCaps (hdc, PHYSICALHEIGHT) - (frame_top + frame_height), 1440, GetDeviceCaps (hdc, LOGPIXELSY)); - } + } else frame_height = (GetDeviceCaps (hdc, PHYSICALHEIGHT) - frame_top @@ -838,13 +872,16 @@ /* Geometry sanity checks */ if (!frame_pixsize_valid_p (f, frame_width, frame_height)) - error ("Area inside print margins has shrunk to naught."); + invalid_operation ("Area inside print margins has shrunk to naught", + STRINGP (f->name) ? f->name : Qunbound); if (frame_left < 0 || frame_top < 0 || frame_left + frame_width > GetDeviceCaps (hdc, HORZRES) || frame_top + frame_height > GetDeviceCaps (hdc, VERTRES)) - error ("Print area is ouside of the printer's hardware printable area."); + invalid_operation ("Print area is ouside of the printer's " + "hardware printable area", + STRINGP (f->name) ? f->name : Qunbound); /* Apply XEmacs frame geometry and layout windows */ { @@ -855,10 +892,8 @@ change_frame_size (f, rows, columns, 0); } - /* Apply DC geometry */ - SetTextAlign (hdc, TA_BASELINE | TA_LEFT | TA_NOUPDATECP); - SetViewportOrgEx (hdc, frame_left, frame_top, NULL); - SetWindowOrgEx (hdc, 0, 0, NULL); + FRAME_MSPRINTER_PIXLEFT(f) = frame_left; + FRAME_MSPRINTER_PIXTOP(f) = frame_top; /* Start print job */ di.cbSize = sizeof (di); @@ -870,10 +905,12 @@ di.fwType = 0; if (StartDoc (hdc, &di) <= 0) - error ("Cannot start print job"); + invalid_operation ("Cannot start print job", + STRINGP (f->name) ? f->name : Qunbound); + + apply_dc_geometry (f); /* Finish frame setup */ - FRAME_MSPRINTER_CDC(f) = CreateCompatibleDC (hdc); FRAME_MSPRINTER_JOB_STARTED (f) = 1; FRAME_VISIBLE_P(f) = 0; } @@ -881,12 +918,6 @@ static void msprinter_mark_frame (struct frame *f) { - /* NOTE: These need not be marked as long as we allow only c-defined - symbols for their values. Although, marking these is safer than - expensive. [I know a proof to the theorem postulating that a - gator is longer than greener. Ask me. -- kkm] */ - mark_object (FRAME_MSPRINTER_ORIENTATION (f)); - mark_object (FRAME_MSPRINTER_DUPLEX (f)); } static void @@ -894,10 +925,11 @@ { if (f->frame_data) { + HDC hdc = DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f))); + if (FRAME_MSPRINTER_PAGE_STARTED (f)) + EndPage (hdc); if (FRAME_MSPRINTER_JOB_STARTED (f)) - EndDoc (DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f)))); - if (FRAME_MSPRINTER_CDC(f)) - DeleteDC(FRAME_MSPRINTER_CDC(f)); + EndDoc (hdc); xfree (f->frame_data); } @@ -915,10 +947,6 @@ return make_int (FRAME_MSPRINTER_RIGHT_MARGIN(f)); else if (EQ (Qbottom_margin, property)) return make_int (FRAME_MSPRINTER_BOTTOM_MARGIN(f)); - else if (EQ (Qorientation, property)) - return FRAME_MSPRINTER_ORIENTATION(f); - else if (EQ (Qduplex, property)) - return FRAME_MSPRINTER_DUPLEX(f); else return Qunbound; } @@ -927,16 +955,13 @@ msprinter_internal_frame_property_p (struct frame *f, Lisp_Object property) { return (EQ (Qleft_margin, property) || EQ (Qtop_margin, property) || - EQ (Qright_margin, property) || EQ (Qbottom_margin, property) || - EQ (Qorientation, property) || EQ (Qduplex, property)); + EQ (Qright_margin, property) || EQ (Qbottom_margin, property)); } static Lisp_Object msprinter_frame_properties (struct frame *f) { Lisp_Object props = Qnil; - props = cons3 (Qorientation, FRAME_MSPRINTER_ORIENTATION(f), props); - props = cons3 (Qduplex, FRAME_MSPRINTER_DUPLEX(f), props); props = cons3 (Qbottom_margin, make_int (FRAME_MSPRINTER_BOTTOM_MARGIN(f)), props); props = cons3 (Qright_margin, @@ -951,7 +976,6 @@ static void msprinter_set_frame_properties (struct frame *f, Lisp_Object plist) { - BOOL size_changed_p = FALSE; Lisp_Object tail; /* Extract the properties from plist */ @@ -1004,29 +1028,6 @@ CHECK_NATNUM (val); FRAME_MSPRINTER_BOTTOM_MARGIN(f) = XINT (val); } - else if (EQ (prop, Qorientation)) - { - maybe_error_if_job_active (f); - CHECK_SYMBOL (val); - if (!NILP(val) && - !EQ (val, Qportrait) && - !EQ (val, Qlandscape)) - signal_simple_error ("Page orientation can only be " - "'portrait or 'landscape", val); - FRAME_MSPRINTER_ORIENTATION(f) = val; - } - else if (EQ (prop, Qduplex)) - { - maybe_error_if_job_active (f); - CHECK_SYMBOL (val); - if (!NILP(val) && - !EQ (val, Qnone) && - !EQ (val, Qvertical) && - !EQ (val, Qhorizontal)) - signal_simple_error ("Duplex can only be 'none, " - "'vertical or 'horizontal", val); - FRAME_MSPRINTER_DUPLEX(f) = val; - } } } } @@ -1038,12 +1039,25 @@ error_frame_unsizable (f); } +static void +msprinter_eject_page (struct frame *f) +{ + /* #### Should we eject empty pages? */ + if (FRAME_MSPRINTER_PAGE_STARTED (f)) + { + FRAME_MSPRINTER_PAGE_STARTED (f) = 0; + EndPage (DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f)))); + apply_dc_geometry (f); + } +} + + void console_type_create_frame_mswindows (void) { /* Display frames */ CONSOLE_HAS_METHOD (mswindows, init_frame_1); - CONSOLE_HAS_METHOD (mswindows, init_frame_2); + CONSOLE_HAS_METHOD (mswindows, init_frame_2); CONSOLE_HAS_METHOD (mswindows, init_frame_3); CONSOLE_HAS_METHOD (mswindows, after_init_frame); CONSOLE_HAS_METHOD (mswindows, mark_frame); @@ -1053,6 +1067,8 @@ CONSOLE_HAS_METHOD (mswindows, set_mouse_position); CONSOLE_HAS_METHOD (mswindows, raise_frame); CONSOLE_HAS_METHOD (mswindows, lower_frame); + CONSOLE_HAS_METHOD (mswindows, enable_frame); + CONSOLE_HAS_METHOD (mswindows, disable_frame); CONSOLE_HAS_METHOD (mswindows, make_frame_visible); CONSOLE_HAS_METHOD (mswindows, make_frame_invisible); CONSOLE_HAS_METHOD (mswindows, iconify_frame); @@ -1067,8 +1083,8 @@ CONSOLE_HAS_METHOD (mswindows, frame_visible_p); CONSOLE_HAS_METHOD (mswindows, frame_totally_visible_p); CONSOLE_HAS_METHOD (mswindows, frame_iconified_p); - CONSOLE_HAS_METHOD (mswindows, set_frame_pointer); - CONSOLE_HAS_METHOD (mswindows, set_frame_icon); + CONSOLE_HAS_METHOD (mswindows, set_frame_pointer); + CONSOLE_HAS_METHOD (mswindows, set_frame_icon); CONSOLE_HAS_METHOD (mswindows, get_frame_parent); CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits); CONSOLE_HAS_METHOD (mswindows, frame_size_fixed_p); @@ -1083,6 +1099,7 @@ CONSOLE_HAS_METHOD (msprinter, frame_properties); CONSOLE_HAS_METHOD (msprinter, set_frame_properties); CONSOLE_HAS_METHOD (msprinter, set_frame_size); + CONSOLE_HAS_METHOD (msprinter, eject_page); } void @@ -1104,11 +1121,11 @@ DEFVAR_LISP ("mswindows-use-system-frame-size-defaults", &Vmswindows_use_system_frame_size_defaults /* Controls whether to use system or XEmacs defaults for frame size. -If nil then reasonable defaults are used for intial frame sizes. If t +If nil then reasonable defaults are used for initial frame sizes. If t then the system will choose default sizes for the frame. */ ); Vmswindows_use_system_frame_size_defaults = Qnil; - + DEFVAR_LISP ("default-mswindows-frame-plist", &Vdefault_mswindows_frame_plist /* Plist of default frame-creation properties for mswindows frames. These override what is specified in `default-frame-plist', but are @@ -1166,7 +1183,7 @@ top-margin typographical unit of measurement, right-margin equal to 1/1440 of an inch, or 1/20 of a bottom-margin point, and roughly equal to 7/400 of a - millimeter. If not specifified, each margin + millimeter. If not specified, each margin defaults to one inch (25.4 mm). MARGINS NOTE. right-margin and bottom-margin are overridden by @@ -1181,17 +1198,6 @@ (setq default-frame-plist '(height 55 'width 80) default-msprinter-frame-plist '(height nil 'width nil)) - - orientation Printer page orientation. Can be 'nil, - indicating system default, 'portrait - or 'landscape. - - duplex Duplex printing mode, subject to printer - support. Can be 'nil for the device default, - 'none for simplex printing, 'vertical or - 'horizontal for duplex page bound along - the corresponding page direction. - See also `default-frame-plist', which specifies properties which apply to all frames, not just mswindows frames. */ ); diff -r 72a7cfa4a488 -r abe6d1db359e src/frame-tty.c --- a/src/frame-tty.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/frame-tty.c Mon Aug 13 11:35:02 2007 +0200 @@ -124,7 +124,6 @@ static void tty_raise_frame_no_select (struct frame *f) { - Lisp_Object frame; LIST_LOOP_2 (frame, DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f)))) { struct frame *o = XFRAME (frame); diff -r 72a7cfa4a488 -r abe6d1db359e src/frame-x.c --- a/src/frame-x.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/frame-x.c Mon Aug 13 11:35:02 2007 +0200 @@ -23,6 +23,8 @@ /* Substantially rewritten for XEmacs. */ +/* 7-8-00 !!#### This file needs definite Mule review. */ + #include #include "lisp.h" @@ -50,6 +52,7 @@ #include "faces.h" #include "frame.h" #include "window.h" +#include "gutter.h" #ifdef HAVE_DRAGNDROP #include "dragdrop.h" @@ -113,7 +116,7 @@ /* We used to map over all frames here and then map over all widgets belonging to that frame. However it turns out that this was very fragile - as it requires our display stuctures to be in sync _and_ that the + as it requires our display structures to be in sync _and_ that the loop is told about every new widget somebody adds. Therefore we now let Xt find it for us (which does a bottom-up search which could even be faster) */ @@ -659,11 +662,9 @@ for (ptr = value; *ptr; ptr++) if (!BYTE_ASCII_P (*ptr)) { - CONST char * tmp; + const char * tmp; encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f))); - TO_EXTERNAL_FORMAT (C_STRING, value, - C_STRING_ALLOCA, tmp, - Qctext); + C_STRING_TO_EXTERNAL (value, tmp, Qctext); new_XtValue = (String) tmp; break; } @@ -760,17 +761,15 @@ if (STRINGP (prop)) { - CONST char *extprop; + const char *extprop; if (XSTRING_LENGTH (prop) == 0) continue; - TO_EXTERNAL_FORMAT (LISP_STRING, prop, - C_STRING_ALLOCA, extprop, - Qctext); + LISP_STRING_TO_EXTERNAL (prop, extprop, Qctext); if (STRINGP (val)) { - CONST Extbyte *extval; + const Extbyte *extval; Extcount extvallen; TO_EXTERNAL_FORMAT (LISP_STRING, val, @@ -1146,12 +1145,12 @@ x_event.xbutton.y_root = lisp_event->event.button.y; } modifier = lisp_event->event.button.modifiers; - if (modifier & MOD_SHIFT) state |= ShiftMask; - if (modifier & MOD_CONTROL) state |= ControlMask; - if (modifier & MOD_META) state |= xd->MetaMask; - if (modifier & MOD_SUPER) state |= xd->SuperMask; - if (modifier & MOD_HYPER) state |= xd->HyperMask; - if (modifier & MOD_ALT) state |= xd->AltMask; + 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); x_event.xbutton.state = state; @@ -1191,7 +1190,7 @@ Ctext=NULL; break; } - strcpy (Ctext+pos, (CONST char *)XSTRING_DATA (XCAR (item))); + strcpy (Ctext+pos, (const char *)XSTRING_DATA (XCAR (item))); pos += XSTRING_LENGTH (XCAR (item)) + 1; item = XCDR (item); } @@ -1367,7 +1366,7 @@ } len = XSTRING_LENGTH (XCAR (run)) + 1; dnd_data = (char *) xrealloc (dnd_data, dnd_len + len); - strcpy (dnd_data + dnd_len - 1, (CONST char *)XSTRING_DATA (XCAR (run))); + strcpy (dnd_data + dnd_len - 1, (const char *)XSTRING_DATA (XCAR (run))); dnd_len += len; run = XCDR (run); } @@ -1412,12 +1411,12 @@ } modifier = lisp_event->event.button.modifiers; - if (modifier & MOD_SHIFT) state |= ShiftMask; - if (modifier & MOD_CONTROL) state |= ControlMask; - if (modifier & MOD_META) state |= xd->MetaMask; - if (modifier & MOD_SUPER) state |= xd->SuperMask; - if (modifier & MOD_HYPER) state |= xd->HyperMask; - if (modifier & MOD_ALT) state |= xd->AltMask; + 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); x_event.xbutton.state = state; @@ -1550,13 +1549,16 @@ { struct window *win = XWINDOW (f->root_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); - WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) + + FRAME_LEFT_GUTTER_BOUNDS (f); + WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f) + + FRAME_TOP_GUTTER_BOUNDS (f); if (!NILP (f->minibuffer_window)) { win = XWINDOW (f->minibuffer_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) + + FRAME_LEFT_GUTTER_BOUNDS (f); } } @@ -1861,7 +1863,7 @@ #ifdef EXTERNAL_WIDGET Window window_id = 0; #endif - CONST char *name; + const char *name; Arg al [25]; int ac = 0; Widget text, container, shell; @@ -1872,9 +1874,7 @@ #endif if (STRINGP (f->name)) - TO_EXTERNAL_FORMAT (LISP_STRING, f->name, - C_STRING_ALLOCA, name, - Qctext); + LISP_STRING_TO_EXTERNAL (f->name, name, Qctext); else name = "emacs"; @@ -2486,6 +2486,18 @@ } } +static void +x_enable_frame (struct frame *f) +{ + XtSetSensitive (FRAME_X_SHELL_WIDGET (f), True); +} + +static void +x_disable_frame (struct frame *f) +{ + XtSetSensitive (FRAME_X_SHELL_WIDGET (f), False); +} + /* Change from withdrawn state to mapped state. */ static void x_make_frame_visible (struct frame *f) @@ -2789,6 +2801,8 @@ CONSOLE_HAS_METHOD (x, set_mouse_position); CONSOLE_HAS_METHOD (x, raise_frame); CONSOLE_HAS_METHOD (x, lower_frame); + CONSOLE_HAS_METHOD (x, enable_frame); + CONSOLE_HAS_METHOD (x, disable_frame); CONSOLE_HAS_METHOD (x, make_frame_visible); CONSOLE_HAS_METHOD (x, make_frame_invisible); CONSOLE_HAS_METHOD (x, iconify_frame); diff -r 72a7cfa4a488 -r abe6d1db359e src/frame.c --- a/src/frame.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/frame.c Mon Aug 13 11:35:02 2007 +0200 @@ -102,7 +102,7 @@ Lisp_Object Qnomini, Qvisible_nomini, Qiconic_nomini, Qinvisible_nomini; Lisp_Object Qvisible_iconic_nomini, Qinvisible_iconic_nomini; -Lisp_Object Qset_specifier, Qset_glyph_image, Qset_face_property; +Lisp_Object Qset_specifier, Qset_face_property; Lisp_Object Qface_property_instance; Lisp_Object Qframe_property_alias; @@ -121,8 +121,6 @@ the dynamic allocation time adds up. */ static Emchar_dynarr *title_string_emchar_dynarr; -EXFUN (Fset_frame_properties, 2); - static Lisp_Object mark_frame (Lisp_Object obj) @@ -132,8 +130,6 @@ #define MARKED_SLOT(x) mark_object (f->x) #include "frameslots.h" - mark_subwindow_cachels (f->subwindow_cachels); - if (FRAME_LIVE_P (f)) /* device is nil for a dead frame */ MAYBE_FRAMEMETH (f, mark_frame, (f)); @@ -202,20 +198,19 @@ XWINDOW (root_window)->pixel_width = 10; XWINDOW (root_window)->pixel_height = 9; - /* The size of the minibuffer window is now set in x_create_frame - in xfns.c. */ - f->root_window = root_window; f->selected_window = root_window; f->last_nonminibuf_window = root_window; /* cache of subwindows visible on frame */ - f->subwindow_cachels = Dynarr_new (subwindow_cachel); + f->subwindow_instance_cache = make_weak_list (WEAK_LIST_SIMPLE); /* associated exposure ignore list */ f->subwindow_exposures = 0; f->subwindow_exposures_tail = 0; + FRAME_SET_PAGENUMBER (f, 1); + /* Choose a buffer for the frame's root window. */ XWINDOW (root_window)->buffer = Qt; { @@ -270,7 +265,9 @@ FRAME_CONSOLE (XFRAME (XWINDOW (mini_window)->frame)))) error ("frame and minibuffer must be on the same console"); - if (NILP (mini_window)) + /* Do not create a default minibuffer frame on printer devices. */ + if (NILP (mini_window) + && DEVICE_DISPLAY_P (XDEVICE (FRAME_DEVICE (f)))) { struct console *con = XCONSOLE (FRAME_CONSOLE (f)); /* Use default-minibuffer-frame if possible. */ @@ -285,8 +282,13 @@ } /* Install the chosen minibuffer window, with proper buffer. */ - store_minibuf_frame_prop (f, mini_window); - Fset_window_buffer (mini_window, Vminibuffer_zero, Qt); + if (!NILP (mini_window)) + { + store_minibuf_frame_prop (f, mini_window); + Fset_window_buffer (mini_window, Vminibuffer_zero, Qt); + } + else + f->minibuffer_window = Qnil; } /* Make a frame containing only a minibuffer window. */ @@ -380,7 +382,7 @@ else name = build_string ("emacs"); - if (!NILP (Fstring_match (make_string ((CONST Bufbyte *) "\\.", 2), name, + if (!NILP (Fstring_match (make_string ((const Bufbyte *) "\\.", 2), name, Qnil, Qnil))) signal_simple_error (". not allowed in frame names", name); @@ -466,20 +468,14 @@ #endif reset_face_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f))); reset_glyph_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f))); - reset_subwindow_cachels (f); + change_frame_size (f, f->height, f->width, 0); - } MAYBE_FRAMEMETH (f, init_frame_2, (f, props)); Fset_frame_properties (frame, props); MAYBE_FRAMEMETH (f, init_frame_3, (f)); - /* now initialise the gutters, this won't change the frame size - so is ok here. */ - if (!DEVICE_STREAM_P (d)) - init_frame_gutters (f); - /* Hallelujah, praise the lord. */ f->init_finished = 1; @@ -505,6 +501,18 @@ MAYBE_FRAMEMETH (f, after_init_frame, (f, first_frame_on_device, first_frame_on_console)); + if (!DEVICE_STREAM_P (d)) + { + /* Now initialise the gutters. This won't change the frame size, + but is needed as input to the layout that change_frame_size + will eventually do. Unfortunately gutter sizing code relies + on the frame in question being visible so we can't do this + earlier. */ + init_frame_gutters (f); + + change_frame_size (f, f->height, f->width, 0); + } + if (first_frame_on_device) { if (first_frame_on_console) @@ -905,13 +913,13 @@ f->selected_window = window; if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f)) { -#ifdef HAVE_TOOLBARS if (!EQ (f->last_nonminibuf_window, window)) { +#ifdef HAVE_TOOLBARS MARK_TOOLBAR_CHANGED; +#endif MARK_GUTTER_CHANGED; } -#endif f->last_nonminibuf_window = window; } } @@ -1025,13 +1033,10 @@ } int -device_matches_console_spec (Lisp_Object frame, Lisp_Object device, - Lisp_Object console) +device_matches_console_spec (Lisp_Object device, Lisp_Object console) { if (EQ (console, Qwindow_system)) return DEVICE_WIN_P (XDEVICE (device)); - if (NILP (console)) - console = (DEVICE_CONSOLE (XDEVICE (FRAME_DEVICE (XFRAME (frame))))); if (DEVICEP (console)) return EQ (device, console); if (CONSOLEP (console)) @@ -1045,78 +1050,60 @@ FRAMETYPE and CONSOLE control which frames and devices are considered; see `next-frame'. */ -static Lisp_Object -next_frame_internal (Lisp_Object frame, Lisp_Object frametype, - Lisp_Object console, int called_from_delete_device) -{ - int passed = 0; - int started_over = 0; - - /* If this frame is dead, it won't be in frame_list, and we'll loop - forever. Forestall that. */ - CHECK_LIVE_FRAME (frame); - - while (1) - { - Lisp_Object devcons, concons; - - DEVICE_LOOP_NO_BREAK (devcons, concons) - { - Lisp_Object device = XCAR (devcons); - Lisp_Object frmcons; - - if (!device_matches_console_spec (frame, device, console)) - continue; - - DEVICE_FRAME_LOOP (frmcons, XDEVICE (device)) - { - Lisp_Object f = XCAR (frmcons); - if (passed) - { - /* #### Doing this here is bad and is now - unnecessary. The real bug was that f->iconified - was never, ever updated unless a user explicitly - called frame-iconified-p. That has now been - fixed. With this change removed all of the other - changes made to support this routine having the - called_from_delete_device arg could be removed. - But it is too close to release to do that now. */ -#if 0 - /* Make sure the visibility and iconified flags are - up-to-date unless we're being deleted. */ - if (!called_from_delete_device) - { - Fframe_iconified_p (f); - Fframe_visible_p (f); - } -#endif - - /* Decide whether this frame is eligible to be returned. */ - - /* If we've looped all the way around without finding any - eligible frames, return the original frame. */ - if (EQ (f, frame)) - return f; - - if (frame_matches_frametype (f, frametype)) - return f; - } - - if (EQ (frame, f)) - passed++; - } - } - /* We hit the end of the list, and need to start over again. */ - if (started_over) - return Qnil; - started_over++; - } -} - Lisp_Object next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) { - return next_frame_internal (frame, frametype, console, 0); + Lisp_Object first = Qnil; + Lisp_Object devcons, concons; + int passed = 0; + + CHECK_LIVE_FRAME (frame); + + DEVICE_LOOP_NO_BREAK (devcons, concons) + { + Lisp_Object device = XCAR (devcons); + Lisp_Object frmcons; + + if (!device_matches_console_spec (device, console)) + { + if (EQ (device, FRAME_DEVICE (XFRAME (frame)))) + passed = 1; + continue; + } + + DEVICE_FRAME_LOOP (frmcons, XDEVICE (device)) + { + Lisp_Object f = XCAR (frmcons); + + if (passed) + { + if (frame_matches_frametype (f, frametype)) + return f; + } + else + { + if (EQ (frame, f)) + { + passed = 1; + } + else + { + if (NILP (first) && frame_matches_frametype (f, frametype)) + first = f; + } + } + } + } + + if (NILP (first)) + /* We went through the whole frame list without finding a single + acceptable frame. Return the original frame. */ + return frame; + else + /* There were no acceptable frames in the list after FRAME; otherwise, + we would have returned directly from the loop. Since FIRST is the last + acceptable frame in the list, return it. */ + return first; } /* Return the previous frame in the frame list before FRAME. @@ -1124,50 +1111,52 @@ are considered; see `next-frame'. */ Lisp_Object -prev_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) +previous_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) { Lisp_Object devcons, concons; - Lisp_Object prev; - - /* If this frame is dead, it won't be in frame_list, and we'll loop - forever. Forestall that. */ + Lisp_Object last = Qnil; + CHECK_LIVE_FRAME (frame); - prev = Qnil; DEVICE_LOOP_NO_BREAK (devcons, concons) { Lisp_Object device = XCAR (devcons); Lisp_Object frmcons; - if (!device_matches_console_spec (frame, device, console)) - continue; + if (!device_matches_console_spec (device, console)) + { + if (EQ (device, FRAME_DEVICE (XFRAME (frame))) + && !NILP (last)) + return last; + continue; + } DEVICE_FRAME_LOOP (frmcons, XDEVICE (device)) { Lisp_Object f = XCAR (frmcons); - if (EQ (frame, f) && !NILP (prev)) - return prev; - - /* Decide whether this frame is eligible to be returned, - according to frametype. */ - - if (frame_matches_frametype (f, frametype)) - prev = f; - + if (EQ (frame, f)) + { + if (!NILP (last)) + return last; + } + else + { + if (frame_matches_frametype (f, frametype)) + last = f; + } } } - /* We've scanned the entire list. */ - if (NILP (prev)) + if (NILP (last)) /* We went through the whole frame list without finding a single acceptable frame. Return the original frame. */ return frame; else /* There were no acceptable frames in the list before FRAME; otherwise, - we would have returned directly from the loop. Since PREV is the last + we would have returned directly from the loop. Since LAST is the last acceptable frame in the list, return it. */ - return prev; + return last; } DEFUN ("next-frame", Fnext_frame, 0, 3, 0, /* @@ -1232,7 +1221,7 @@ { XSETFRAME (frame, decode_frame (frame)); - return prev_frame (frame, frametype, console); + return previous_frame (frame, frametype, console); } /* Return any frame for which PREDICATE is non-zero, or return Qnil @@ -1264,23 +1253,15 @@ (Exception: if F is a stream frame, it's OK to delete if any other frames exist.) */ -static int -other_visible_frames_internal (struct frame *f, int called_from_delete_device) +int +other_visible_frames (struct frame *f) { Lisp_Object frame; XSETFRAME (frame, f); if (FRAME_STREAM_P (f)) - return !EQ (frame, next_frame_internal (frame, Qt, Qt, - called_from_delete_device)); - return !EQ (frame, next_frame_internal (frame, Qvisible_iconic_nomini, Qt, - called_from_delete_device)); -} - -int -other_visible_frames (struct frame *f) -{ - return other_visible_frames_internal (f, 0); + return !EQ (frame, next_frame (frame, Qt, Qt)); + return !EQ (frame, next_frame (frame, Qvisible_iconic_nomini, Qt)); } /* Delete frame F. @@ -1343,7 +1324,7 @@ losing any way of communicating with the still running XEmacs process. So we put it back. */ if (!force && !allow_deletion_of_last_visible_frame && - !other_visible_frames_internal (f, called_from_delete_device)) + !other_visible_frames (f)) error ("Attempt to delete the sole visible or iconified frame"); /* Does this frame have a minibuffer, and is it the surrogate @@ -1469,22 +1450,17 @@ next = DEVMETH_OR_GIVEN (d, get_frame_parent, (f), Qnil); if (NILP (next) || EQ (next, frame) || ! FRAME_LIVE_P (XFRAME (next))) - next = next_frame_internal (frame, Qvisible, device, - called_from_delete_device); + next = next_frame (frame, Qvisible, device); if (NILP (next) || EQ (next, frame)) - next = next_frame_internal (frame, Qvisible, console, - called_from_delete_device); + next = next_frame (frame, Qvisible, console); + if (NILP (next) || EQ (next, frame)) + next = next_frame (frame, Qvisible, Qt); if (NILP (next) || EQ (next, frame)) - next = next_frame_internal (frame, Qvisible, Qt, - called_from_delete_device); + next = next_frame (frame, Qt, device); if (NILP (next) || EQ (next, frame)) - next = next_frame_internal (frame, Qt, device, - called_from_delete_device); + next = next_frame (frame, Qt, console); if (NILP (next) || EQ (next, frame)) - next = next_frame_internal (frame, Qt, console, - called_from_delete_device); - if (NILP (next) || EQ (next, frame)) - next = next_frame_internal (frame, Qt, Qt, called_from_delete_device); + next = next_frame (frame, Qt, Qt); /* if we haven't found another frame at this point then there aren't any. */ @@ -1506,9 +1482,7 @@ */ if (!EQ (device, FRAME_DEVICE(XFRAME(next)))) { - Lisp_Object next_f = - next_frame_internal (frame, Qt, device, - called_from_delete_device); + Lisp_Object next_f = next_frame (frame, Qt, device); if (NILP (next_f) || EQ (next_f, frame)) set_device_selected_frame (d, Qnil); else @@ -1546,6 +1520,12 @@ free_frame_toolbars (f); #endif free_frame_gutters (f); + /* Unfortunately deleting the frame will also delete the parent of + all of the subwindow instances current on the frame. I think this + can lead to bad things when trying to finalize the + instances. Thus we loop over all instance caches calling the + finalize method for each instance. */ + free_frame_subwindow_instances (f); /* This must be done before the window and window_mirror structures are freed. The scrollbar information is attached to them. */ @@ -1557,11 +1537,7 @@ f->root_window = Qnil; /* clear out the cached glyph information */ - if (f->subwindow_cachels) - { - Dynarr_free (f->subwindow_cachels); - f->subwindow_cachels = 0; - } + f->subwindow_instance_cache = Qnil; /* Remove the frame now from the list. This way, any events generated on this frame by the maneuvers below will disperse themselves. */ @@ -1735,13 +1711,14 @@ DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 0, 1, 0, /* Return a list (WINDOW X . Y) giving the current mouse window and position. -The position is given in pixel units, where (0, 0) is the upper-left corner. +The position is given in pixel units, where (0, 0) is the upper-left corner +of the window. When the cursor is not over a window, the return value is a list (nil nil). DEVICE specifies the device on which to read the mouse position, and defaults to the selected device. If the device is a mouseless terminal -or Emacs hasn't been programmed to read its mouse position, it returns +or XEmacs hasn't been programmed to read its mouse position, it returns the device's selected window for WINDOW and nil for X and Y. */ (device)) @@ -2087,8 +2064,61 @@ return Qnil; } + +DEFUN ("disable-frame", Fdisable_frame, 1, 1, 0, /* +Disable frame FRAME, so that it cannot have the focus or receive user input. +This is normally used during modal dialog boxes. +WARNING: Be very careful not to wedge XEmacs! +Use an `unwind-protect' that re-enables the frame to avoid this. +*/ + (frame)) +{ + struct frame *f = decode_frame (frame); + + f->disabled = 1; + MAYBE_FRAMEMETH (f, disable_frame, (f)); + return Qnil; +} + +DEFUN ("enable-frame", Fenable_frame, 1, 1, 0, /* +Enable frame FRAME, so that it can have the focus and receive user input. +Frames are normally enabled, unless explicitly disabled using `disable-frame'. +*/ + (frame)) +{ + struct frame *f = decode_frame (frame); + f->disabled = 0; + MAYBE_FRAMEMETH (f, enable_frame, (f)); + return Qnil; +} + /* Ben thinks there is no need for `redirect-frame-focus' or `frame-focus', crockish FSFmacs functions. See summary on focus in event-stream.c. */ + +DEFUN ("print-job-page-number", Fprint_job_page_number, 1, 1, 0, /* +Return current page number for the print job FRAME. +*/ + (frame)) +{ + CHECK_PRINTER_FRAME (frame); + return make_int (FRAME_PAGENUMBER (XFRAME (frame))); +} + +DEFUN ("print-job-eject-page", Fprint_job_eject_page, 1, 1, 0, /* +Eject page in the print job FRAME. +*/ + (frame)) +{ + struct frame *f; + + CHECK_PRINTER_FRAME (frame); + f = XFRAME (frame); + FRAMEMETH (f, eject_page, (f)); + FRAME_SET_PAGENUMBER (f, 1 + FRAME_PAGENUMBER (f)); + f->clear = 1; + + return Qnil; +} /***************************************************************************/ @@ -2232,8 +2262,9 @@ minibuffer Gives the minibuffer behavior for this frame. Either t (frame has its own minibuffer), `only' (frame is - a minibuffer-only frame), or a window (frame uses that - window, which is on another frame, as the minibuffer). + a minibuffer-only frame), `none' (frame has no minibuffer) + or a window (frame uses that window, which is on another + frame, as the minibuffer). unsplittable If non-nil, frame cannot be split by `display-buffer'. @@ -2247,7 +2278,13 @@ left-toolbar-visible-p, right-toolbar-visible-p, toolbar-buttons-captioned-p, top-toolbar-border-width, bottom-toolbar-border-width, left-toolbar-border-width, right-toolbar-border-width, - modeline-shadow-thickness, has-modeline-p + modeline-shadow-thickness, has-modeline-p, + default-gutter, top-gutter, bottom-gutter, left-gutter, right-gutter, + default-gutter-height, default-gutter-width, top-gutter-height, + bottom-gutter-height, left-gutter-width, right-gutter-width, + default-gutter-visible-p, top-gutter-visible-p, bottom-gutter-visible-p, + left-gutter-visible-p, right-gutter-visible-p, top-gutter-border-width, + bottom-gutter-border-width, left-gutter-border-width, right-gutter-border-width, [Giving the name of any built-in specifier variable is equivalent to calling `set-specifier' on the specifier, with a locale of FRAME. Giving the name to `frame-property' @@ -2851,8 +2888,6 @@ - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); - new_pixwidth += 2 * f->internal_border_width; - /* Adjust the width for the end glyph which may be a different width than the default character width. */ { @@ -2874,7 +2909,14 @@ if (new_pixheight) { - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = FRAME_TOP_BORDER_END (f); + /* Adjust for gutters here so that we always get set + properly. */ + new_pixheight -= + (FRAME_TOP_GUTTER_BOUNDS (f) + + FRAME_BOTTOM_GUTTER_BOUNDS (f)); + + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top + = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f)) @@ -2900,7 +2942,10 @@ new_pixheight - minibuf_height, 0); XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = - new_pixheight - minibuf_height + FRAME_TOP_BORDER_END (f); + FRAME_TOP_BORDER_END (f) + + FRAME_TOP_GUTTER_BOUNDS (f) + + FRAME_BOTTOM_GUTTER_BOUNDS (f) + + new_pixheight - minibuf_height; set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); } @@ -2915,13 +2960,20 @@ if (new_pixwidth) { - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = FRAME_LEFT_BORDER_END (f); + /* Adjust for gutters here so that we always get set + properly. */ + new_pixwidth -= + (FRAME_LEFT_GUTTER_BOUNDS (f) + + FRAME_RIGHT_GUTTER_BOUNDS (f)); + + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = + FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); if (FRAME_HAS_MINIBUF_P (f)) { XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = - FRAME_LEFT_BORDER_END (f); + FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); } @@ -2940,6 +2992,7 @@ } MARK_FRAME_TOOLBARS_CHANGED (f); + MARK_FRAME_GUTTERS_CHANGED (f); MARK_FRAME_CHANGED (f); f->echo_area_garbaged = 1; } @@ -3122,6 +3175,8 @@ void syms_of_frame (void) { + INIT_LRECORD_IMPLEMENTATION (frame); + defsymbol (&Qdelete_frame_hook, "delete-frame-hook"); defsymbol (&Qselect_frame_hook, "select-frame-hook"); defsymbol (&Qdeselect_frame_hook, "deselect-frame-hook"); @@ -3182,7 +3237,6 @@ defsymbol (&Qborder_width, "border-width"); /* Qwidth, Qheight, Qleft, Qtop in general.c */ defsymbol (&Qset_specifier, "set-specifier"); - defsymbol (&Qset_glyph_image, "set-glyph-image"); defsymbol (&Qset_face_property, "set-face-property"); defsymbol (&Qface_property_instance, "face-property-instance"); defsymbol (&Qframe_property_alias, "frame-property-alias"); @@ -3220,6 +3274,8 @@ DEFSUBR (Fvisible_frame_list); DEFSUBR (Fraise_frame); DEFSUBR (Flower_frame); + DEFSUBR (Fdisable_frame); + DEFSUBR (Fenable_frame); DEFSUBR (Fframe_property); DEFSUBR (Fframe_properties); DEFSUBR (Fset_frame_properties); @@ -3232,6 +3288,8 @@ DEFSUBR (Fset_frame_size); DEFSUBR (Fset_frame_position); DEFSUBR (Fset_frame_pointer); + DEFSUBR (Fprint_job_page_number); + DEFSUBR (Fprint_job_eject_page); } void @@ -3345,11 +3403,17 @@ Vsynchronize_minibuffers = Qnil; DEFVAR_LISP ("frame-title-format", &Vframe_title_format /* -Controls the title of the X window corresponding to the selected frame. +Controls the title of the window-system window of the selected frame. This is the same format as `modeline-format' with the exception that %- is ignored. */ ); +/* #### I would change this unilaterally but for the wrath of the Kyles +of the world. */ +#ifdef WIN32_NATIVE + Vframe_title_format = build_string ("%b - XEmacs"); +#else Vframe_title_format = build_string ("%S: %b"); +#endif DEFVAR_LISP ("frame-icon-title-format", &Vframe_icon_title_format /* Controls the title of the icon corresponding to the selected frame. @@ -3359,8 +3423,9 @@ DEFVAR_LISP ("default-frame-name", &Vdefault_frame_name /* The default name to assign to newly-created frames. -This can be overridden by arguments to `make-frame'. -This must be a string. +This can be overridden by arguments to `make-frame'. This must be a string. +This is used primarily for picking up X resources, and is *not* the title +of the frame. (See `frame-title-format'.) */ ); #ifndef INFODOCK Vdefault_frame_name = build_string ("emacs"); diff -r 72a7cfa4a488 -r abe6d1db359e src/frame.h --- a/src/frame.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/frame.h Mon Aug 13 11:35:02 2007 +0200 @@ -78,6 +78,9 @@ int order_count; #endif + /* Current page number for a printer frame. */ + int page_number; + /* Width of the internal border. This is a line of background color just inside the window's border. It is normally only non-zero on X frames, but we put it here to avoid introducing window system @@ -91,9 +94,6 @@ int modiff; - /* subwindow cache elements for this frame */ - subwindow_cachel_dynarr *subwindow_cachels; - struct expose_ignore* subwindow_exposures; struct expose_ignore* subwindow_exposures_tail; @@ -113,9 +113,14 @@ unsigned int current_toolbar_size[4]; #endif - /* Dynamic array of display lines for gutters */ - display_line_dynarr *current_display_lines; - display_line_dynarr *desired_display_lines; + /* Size of gutters as seen by redisplay. This is used to determine + whether to re-layout windows by a call to change_frame_size early + in redisplay_frame. */ + unsigned int current_gutter_bounds[4]; + + /* Dynamic arrays of display lines for gutters */ + 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 used for X window frames; defined in console-x.h */ @@ -137,6 +142,9 @@ /* one-bit flags: */ + /* Is focusing onto this frame disabled? (Modal dialog boxes) */ + unsigned int disabled :1; + /* Are we finished initializing? */ unsigned int init_finished :1; @@ -213,6 +221,7 @@ EXFUN (Fselect_frame, 1); EXFUN (Fset_frame_pointer, 2); EXFUN (Fset_frame_position, 3); +EXFUN (Fset_frame_properties, 2); EXFUN (Fset_frame_size, 4); extern Lisp_Object Qbackground_toolbar_color, Qbell_volume, Qborder_color; @@ -236,6 +245,7 @@ DECLARE_LRECORD (frame, struct frame); #define XFRAME(x) XRECORD (x, frame, struct frame) #define XSETFRAME(x, p) XSETRECORD (x, p, frame) +#define wrap_frame(p) wrap_object (p) #define FRAMEP(x) RECORDP (x, frame) #define CHECK_FRAME(x) CHECK_RECORD (x, frame) #define CONCHECK_FRAME(x) CONCHECK_RECORD (x, frame) @@ -254,9 +264,9 @@ #define FRAME_TYPE_P(f, type) EQ (FRAME_TYPE (f), Q##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE struct frame * +INLINE_HEADER struct frame * error_check_frame_type (struct frame * f, Lisp_Object sym); -INLINE struct frame * +INLINE_HEADER struct frame * error_check_frame_type (struct frame * f, Lisp_Object sym) { assert (EQ (FRAME_TYPE (f), sym)); @@ -284,6 +294,40 @@ (type##_console_methods->predicate_symbol, x); \ } while (0) +#define FRAME_DISPLAY_P(frm) \ + (DEVICE_DISPLAY_P (XDEVICE (FRAME_DEVICE (frm)))) + +#define CHECK_DISPLAY_FRAME(frm) \ + do { \ + CHECK_FRAME (frm); \ + CHECK_LIVE_FRAME (frm); \ + CHECK_DISPLAY_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ + } while (0) + +#define CONCHECK_DISPLAY_FRAME(frm) \ + do { \ + CONCHECK_FRAME (frm); \ + CONCHECK_LIVE_FRAME (frm); \ + CONCHECK_DISPLAY_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ + } while (0) + +#define FRAME_PRINTER_P(frm) \ + (DEVICE_PRINTER_P (XDEVICE (FRAME_DEVICE (frm)))) + +#define CHECK_PRINTER_FRAME(frm) \ + do { \ + CHECK_FRAME (frm); \ + CHECK_LIVE_FRAME (frm); \ + CHECK_PRINTER_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ + } while (0) + +#define CONCHECK_PRINTER_FRAME(frm) \ + do { \ + CONCHECK_FRAME (frm); \ + CONCHECK_LIVE_FRAME (frm); \ + CONCHECK_PRINTER_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ + } while (0) + /* #### These should be in the frame-*.h files but there are too many places where the abstraction is broken. Need to fix. */ @@ -332,7 +376,7 @@ #define MARK_FRAME_SUBWINDOWS_CHANGED(f) do { \ struct frame *mfgc_f = (f); \ - mfgc_f->subwindows_changed = 1; \ + mfgc_f->subwindows_changed = 1; \ mfgc_f->modiff++; \ if (!NILP (mfgc_f->device)) \ { \ @@ -340,12 +384,12 @@ MARK_DEVICE_SUBWINDOWS_CHANGED (mfgc_d); \ } \ else \ - subwindows_changed = 1; \ + subwindows_changed = 1; \ } while (0) #define MARK_FRAME_SUBWINDOWS_STATE_CHANGED(f) do { \ struct frame *mfgc_f = (f); \ - mfgc_f->subwindows_state_changed = 1; \ + mfgc_f->subwindows_state_changed = 1; \ mfgc_f->modiff++; \ if (!NILP (mfgc_f->device)) \ { \ @@ -369,14 +413,14 @@ toolbar_changed = 1; \ } while (0) -#define MARK_FRAME_GUTTERS_CHANGED(f) do { \ +#define MARK_FRAME_GUTTERS_CHANGED(f) do { \ struct frame *mftc_f = (f); \ mftc_f->gutter_changed = 1; \ mftc_f->modiff++; \ if (!NILP (mftc_f->device)) \ { \ struct device *mftc_d = XDEVICE (mftc_f->device); \ - MARK_DEVICE_GUTTERS_CHANGED (mftc_d); \ + MARK_DEVICE_GUTTERS_CHANGED (mftc_d); \ } \ else \ gutter_changed = 1; \ @@ -461,13 +505,15 @@ #define FRAME_MINIBUF_ONLY_P(f) \ EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f)) -#define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer) -#define FRAME_HEIGHT(f) ((f)->height) -#define FRAME_WIDTH(f) ((f)->width) -#define FRAME_CHARHEIGHT(f) ((f)->char_height) -#define FRAME_CHARWIDTH(f) ((f)->char_width) -#define FRAME_PIXHEIGHT(f) ((f)->pixheight) -#define FRAME_PIXWIDTH(f) ((f)->pixwidth) +#define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer) +#define FRAME_HEIGHT(f) ((f)->height) +#define FRAME_WIDTH(f) ((f)->width) +#define FRAME_CHARHEIGHT(f) ((f)->char_height) +#define FRAME_CHARWIDTH(f) ((f)->char_width) +#define FRAME_PIXHEIGHT(f) ((f)->pixheight) +#define FRAME_PIXWIDTH(f) ((f)->pixwidth) +#define FRAME_PAGENUMBER(f) ((f)->page_number + 0) +#define FRAME_SET_PAGENUMBER(f,x) (f)->page_number = (x); #ifdef HAVE_SCROLLBARS #define FRAME_SCROLLBAR_WIDTH(f) \ (NILP ((f)->vertical_scrollbar_visible_p) ? \ @@ -482,8 +528,8 @@ #define FW_FRAME(obj) \ (WINDOWP (obj) ? WINDOW_FRAME (XWINDOW (obj)) \ - : (FRAMEP (obj) ? obj \ - : Qnil)) + : (FRAMEP (obj) ? obj \ + : Qnil)) #define FRAME_NEW_HEIGHT(f) ((f)->new_height) #define FRAME_NEW_WIDTH(f) ((f)->new_width) @@ -502,7 +548,7 @@ NON_LVALUE ((f)->last_nonminibuf_window) #define FRAME_SB_VCACHE(f) ((f)->sb_vcache) #define FRAME_SB_HCACHE(f) ((f)->sb_hcache) -#define FRAME_SUBWINDOW_CACHE(f) ((f)->subwindow_cachels) +#define FRAME_SUBWINDOW_CACHE(f) ((f)->subwindow_instance_cache) #if 0 /* FSFmacs */ @@ -579,7 +625,7 @@ FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR) #define FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \ - (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \ + (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \ ? FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, pos) \ : 0) @@ -638,18 +684,18 @@ if you encounter some odd toolbar behavior, you might want to look into this. --ben */ -#define FRAME_REAL_TOOLBAR_VISIBLE(f, pos) \ - ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ - && FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0) \ - ? FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \ +#define FRAME_REAL_TOOLBAR_VISIBLE(f, pos) \ + ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + && FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0) \ + ? FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \ : 0) -#define FRAME_REAL_TOOLBAR_SIZE(f, pos) \ - ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ - && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ - ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) \ +#define FRAME_REAL_TOOLBAR_SIZE(f, pos) \ + ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ + ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) \ : 0) #define FRAME_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \ - ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos) \ : 0) @@ -681,32 +727,32 @@ #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \ FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR) -#define FRAME_TOP_BORDER_START(f) \ - (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + \ +#define FRAME_TOP_BORDER_START(f) \ + (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + \ 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f)) -#define FRAME_TOP_BORDER_END(f) \ +#define FRAME_TOP_BORDER_END(f) \ (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f)) -#define FRAME_BOTTOM_BORDER_START(f) \ - (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \ - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ +#define FRAME_BOTTOM_BORDER_START(f) \ + (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \ + FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) -#define FRAME_BOTTOM_BORDER_END(f) \ - (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ +#define FRAME_BOTTOM_BORDER_END(f) \ + (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) -#define FRAME_LEFT_BORDER_START(f) \ - (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + \ +#define FRAME_LEFT_BORDER_START(f) \ + (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + \ 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f)) -#define FRAME_LEFT_BORDER_END(f) \ +#define FRAME_LEFT_BORDER_END(f) \ (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f)) -#define FRAME_RIGHT_BORDER_START(f) \ - (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \ - FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) - \ +#define FRAME_RIGHT_BORDER_START(f) \ + (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \ + FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) - \ 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)) -#define FRAME_RIGHT_BORDER_END(f) \ - (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - \ +#define FRAME_RIGHT_BORDER_END(f) \ + (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - \ 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f)) /* Equivalent in FSF Emacs: @@ -728,11 +774,8 @@ void update_frame_title (struct frame *f); Lisp_Object next_frame (Lisp_Object f, Lisp_Object frametype, Lisp_Object console); -Lisp_Object prev_frame (Lisp_Object f, Lisp_Object frametype, - Lisp_Object console); -void store_in_alist (Lisp_Object *alistptr, - CONST char *propname, - Lisp_Object val); +Lisp_Object previous_frame (Lisp_Object f, Lisp_Object frametype, + Lisp_Object console); void pixel_to_char_size (struct frame *f, int pixel_width, int pixel_height, int *char_width, int *char_height); void char_to_pixel_size (struct frame *f, int char_width, int char_height, @@ -768,8 +811,7 @@ void io_error_delete_frame (Lisp_Object frame); Lisp_Object find_some_frame (int (*predicate) (Lisp_Object, void *), void *closure); -int device_matches_console_spec (Lisp_Object frame, Lisp_Object device, - Lisp_Object console); +int device_matches_console_spec (Lisp_Object device, Lisp_Object console); Lisp_Object frame_first_window (struct frame *f); int show_gc_cursor (struct frame *f, Lisp_Object cursor); void set_frame_selected_window (struct frame *f, Lisp_Object window); diff -r 72a7cfa4a488 -r abe6d1db359e src/frameslots.h --- a/src/frameslots.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/frameslots.h Mon Aug 13 11:35:02 2007 +0200 @@ -84,6 +84,9 @@ /* frame property list */ MARKED_SLOT (plist); + /* buffer_alist at last redisplay. */ + 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. */ @@ -142,6 +145,9 @@ MARKED_SLOT_ARRAY (toolbar_border_width, 4); #endif +/* Cache of subwindow instances for this frame */ + MARKED_SLOT (subwindow_instance_cache); + /* Possible frame-local default for outside margin widths. */ MARKED_SLOT (left_margin_width); MARKED_SLOT (right_margin_width); diff -r 72a7cfa4a488 -r abe6d1db359e src/free-hook.c --- a/src/free-hook.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/free-hook.c Mon Aug 13 11:35:02 2007 +0200 @@ -131,7 +131,7 @@ #endif EMACS_INT present = (EMACS_INT) gethash (ptr, pointer_table, - (CONST void **) &size); + (const void **) &size); if (!present) { @@ -257,7 +257,7 @@ void *result = malloc (size); if (!ptr) return result; - present = (EMACS_INT) gethash (ptr, pointer_table, (CONST void **) &old_size); + present = (EMACS_INT) gethash (ptr, pointer_table, (const void **) &old_size); if (!present) { /* This can only happen by reallocing a pointer that didn't diff -r 72a7cfa4a488 -r abe6d1db359e src/general-slots.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/general-slots.h Mon Aug 13 11:35:02 2007 +0200 @@ -0,0 +1,256 @@ +/* Commonly-used symbols -- include file + Copyright (C) 1995 Sun Microsystems. + Copyright (C) 1995, 1996, 2000 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. */ + +/* The purpose of this file is as a central place to stick symbols + that don't have any obvious connection to any particular module + and might be used in many different contexts. + + Three types of declarations are allowed here: + + SYMBOL (Qfoo); declares a symbol "foo" + SYMBOL_KEYWORD (Q_foo); declares a keyword symbol ":foo" + SYMBOL_GENERAL (Qfoo, "bar"); declares a symbol named "bar" but stored in + the variable Qfoo + +To sort the crap in this file, use the following: + +(sort-regexp-fields nil + "^.*(Q_?\\(.*\\));$" "\\1" + (progn + (search-forward "SYMBOL") + (match-beginning 0)) + (point-max)) +*/ + +SYMBOL (Qabort); +SYMBOL_KEYWORD (Q_accelerator); +SYMBOL_KEYWORD (Q_active); +SYMBOL (Qactually_requested); +SYMBOL (Qafter); +SYMBOL (Qall); +SYMBOL (Qand); +SYMBOL (Qappend); +SYMBOL (Qassoc); +SYMBOL (Qat); +SYMBOL (Qautodetect); +SYMBOL (Qbad_variable); +SYMBOL (Qbefore); +SYMBOL (Qbinary); +SYMBOL (Qbitmap); +SYMBOL (Qboolean); +SYMBOL_KEYWORD (Q_border); +SYMBOL (Qbottom); +SYMBOL (Qbottom_margin); +SYMBOL (Qbuffer); +SYMBOL (Qbuilt_in); +SYMBOL (Qbutton); +SYMBOL_KEYWORD (Q_buttons); +SYMBOL_KEYWORD (Q_callback); +SYMBOL_KEYWORD (Q_callback_ex); +SYMBOL (Qcancel); +SYMBOL (Qcategory); +SYMBOL (Qcenter); +SYMBOL (Qchannel); +SYMBOL (Qchar); +SYMBOL (Qcharacter); +SYMBOL (Qchars); +SYMBOL (Qcolor); +SYMBOL (Qcolumns); +SYMBOL (Qcommand); +SYMBOL_KEYWORD (Q_config); +SYMBOL (Qconsole); +SYMBOL (Qcopies); +SYMBOL (Qcritical); +SYMBOL (Qctext); +SYMBOL (Qcursor); +SYMBOL (Qdata); +SYMBOL (Qdead); +SYMBOL (Qdefault); +SYMBOL (Qdelete); +SYMBOL (Qdelq); +SYMBOL_KEYWORD (Q_descriptor); +SYMBOL (Qdevice); +SYMBOL_KEYWORD (Q_device); +SYMBOL (Qdialog); +SYMBOL (Qdimension); +SYMBOL (Qdisplay); +SYMBOL (Qdoc_string); +SYMBOL (Qduplex); +SYMBOL (Qdynarr_overhead); +SYMBOL (Qempty); +SYMBOL (Qeq); +SYMBOL (Qeql); +SYMBOL (Qequal); +SYMBOL (Qeval); +SYMBOL (Qextents); +SYMBOL (Qface); +SYMBOL (Qfallback); +SYMBOL (Qfile); +SYMBOL (Qfile_name); +SYMBOL_KEYWORD (Q_filter); +SYMBOL (Qfont); +SYMBOL (Qframe); +SYMBOL (Qfrom_page); +SYMBOL (Qfull_assoc); +SYMBOL (Qfuncall); +SYMBOL (Qfunction); +SYMBOL (Qgap_overhead); +SYMBOL (Qgeneric); +SYMBOL (Qgeometry); +SYMBOL (Qglobal); +SYMBOL (Qgutter); +SYMBOL (Qheight); +SYMBOL_KEYWORD (Q_height); +SYMBOL (Qhelp); +SYMBOL (Qhighlight); +SYMBOL (Qhorizontal); +SYMBOL (Qicon); +SYMBOL (Qid); +SYMBOL (Qignore); +SYMBOL (Qimage); +SYMBOL_KEYWORD (Q_image); +SYMBOL_KEYWORD (Q_included); +SYMBOL (Qinfo); +SYMBOL (Qinherit); +SYMBOL_KEYWORD (Q_initial_focus); +SYMBOL (Qinteger); +SYMBOL (Qinternal); +SYMBOL_KEYWORD (Q_items); +SYMBOL_KEYWORD (Q_justify); +SYMBOL (Qkey); +SYMBOL (Qkey_assoc); +SYMBOL_KEYWORD (Q_key_sequence); +SYMBOL (Qkeyboard); +SYMBOL (Qkeymap); +SYMBOL_KEYWORD (Q_keys); +SYMBOL_KEYWORD (Q_label); +SYMBOL (Qlandscape); +SYMBOL (Qlast_command); +SYMBOL (Qleft); +SYMBOL (Qleft_margin); +SYMBOL (Qlet); +SYMBOL (Qlist); +SYMBOL (Qmagic); +SYMBOL (Qmalloc_overhead); +SYMBOL_KEYWORD (Q_margin_width); +SYMBOL (Qmarkers); +SYMBOL (Qmax); +SYMBOL (Qmemory); +SYMBOL (Qmenubar); +SYMBOL (Qmessage); +SYMBOL_GENERAL (Qminus, "-"); +SYMBOL (Qmodifiers); +SYMBOL (Qmotion); +SYMBOL (Qmsprinter); +SYMBOL (Qmswindows); +SYMBOL (Qname); +SYMBOL (Qnatnum); +SYMBOL (Qno); +SYMBOL (Qnone); +SYMBOL (Qnot); +SYMBOL (Qnothing); +SYMBOL (Qnotice); +SYMBOL (Qobject); +SYMBOL (Qok); +SYMBOL (Qold_assoc); +SYMBOL (Qold_delete); +SYMBOL (Qold_delq); +SYMBOL (Qold_rassoc); +SYMBOL (Qold_rassq); +SYMBOL (Qonly); +SYMBOL (Qor); +SYMBOL (Qorientation); +SYMBOL_KEYWORD (Q_orientation); +SYMBOL (Qother); +SYMBOL (Qpage_setup); +SYMBOL (Qpeer); +SYMBOL (Qpointer); +SYMBOL (Qpopup); +SYMBOL (Qportrait); +SYMBOL (Qprepend); +SYMBOL (Qprint); +SYMBOL (Qprint_setup); +SYMBOL (Qprinter); +SYMBOL_KEYWORD (Q_printer_settings); +SYMBOL (Qprocess); +SYMBOL_KEYWORD (Q_properties); +SYMBOL (Qprovide); +SYMBOL (Qquestion); +SYMBOL_KEYWORD (Q_question); +SYMBOL (Qradio); +SYMBOL (Qrassoc); +SYMBOL (Qrassq); +SYMBOL (Qremove_all); +SYMBOL (Qrequire); +SYMBOL (Qresource); +SYMBOL (Qretry); +SYMBOL (Qreturn); +SYMBOL (Qreverse); +SYMBOL (Qright); +SYMBOL (Qright_margin); +SYMBOL (Qsearch); +SYMBOL (Qselected); +SYMBOL_KEYWORD (Q_selected); +SYMBOL (Qset_glyph_image); +SYMBOL (Qsignal); +SYMBOL (Qsimple); +SYMBOL (Qsize); +SYMBOL (Qspace); +SYMBOL (Qspecifier); +SYMBOL (Qstandard); +SYMBOL (Qstream); +SYMBOL (Qstring); +SYMBOL_KEYWORD (Q_style); +SYMBOL_KEYWORD (Q_suffix); +SYMBOL (Qsymbol); +SYMBOL (Qsyntax); +SYMBOL (Qterminal); +SYMBOL (Qtest); +SYMBOL (Qtext); +SYMBOL_KEYWORD (Q_text); +SYMBOL (Qthis_command); +SYMBOL (Qtimeout); +SYMBOL (Qtimestamp); +SYMBOL_KEYWORD (Q_title); +SYMBOL (Qto_page); +SYMBOL (Qtoggle); +SYMBOL (Qtoolbar); +SYMBOL (Qtop); +SYMBOL (Qtop_margin); +SYMBOL (Qtty); +SYMBOL (Qtype); +SYMBOL (Qundecided); +SYMBOL (Qundefined); +SYMBOL (Qunimplemented); +SYMBOL_KEYWORD (Q_value); +SYMBOL (Qvalue_assoc); +SYMBOL (Qvertical); +SYMBOL (Qwarning); +SYMBOL (Qwidget); +SYMBOL (Qwidth); +SYMBOL_KEYWORD (Q_width); +SYMBOL (Qwindow); +SYMBOL (Qwindow_system); +SYMBOL (Qx); +SYMBOL (Qy); +SYMBOL (Qyes); diff -r 72a7cfa4a488 -r abe6d1db359e src/general.c --- a/src/general.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/general.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,6 @@ /* Commonly-used symbols Copyright (C) 1995 Sun Microsystems. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2000 Ben Wing. This file is part of XEmacs. @@ -21,312 +21,32 @@ /* Synched up with: Not in FSF. */ -/* The purpose of this file is as a central place to stick symbols - that don't have any obvious connection to any particular module - and might be used in many different contexts. - - #### More should be put here. - */ +/* See general-slots.h. +*/ #include #include "lisp.h" -Lisp_Object Qactually_requested; -Lisp_Object Qafter; -Lisp_Object Qall; -Lisp_Object Qand; -Lisp_Object Qassoc; -Lisp_Object Qat; -Lisp_Object Qautodetect; -Lisp_Object Qbad_variable; -Lisp_Object Qbefore; -Lisp_Object Qbinary; -Lisp_Object Qbitmap; -Lisp_Object Qboolean; -Lisp_Object Qbottom; -Lisp_Object Qbottom_margin; -Lisp_Object Qbuffer; -Lisp_Object Qbutton; -Lisp_Object Qcenter; -Lisp_Object Qcategory; -Lisp_Object Qchannel; -Lisp_Object Qchar; -Lisp_Object Qcharacter; -Lisp_Object Qchars; -Lisp_Object Qcolor; -Lisp_Object Qcolumns; -Lisp_Object Qcommand; -Lisp_Object Qconsole; -Lisp_Object Qcritical; -Lisp_Object Qctext; -Lisp_Object Qcursor; -Lisp_Object Qdata; -Lisp_Object Qdead; -Lisp_Object Qdefault; -Lisp_Object Qdelete; -Lisp_Object Qdelq; -Lisp_Object Qdevice; -Lisp_Object Qdimension; -Lisp_Object Qdisplay; -Lisp_Object Qdoc_string; -Lisp_Object Qduplex; -Lisp_Object Qdynarr_overhead; -Lisp_Object Qempty; -Lisp_Object Qeq; -Lisp_Object Qeql; -Lisp_Object Qequal; -Lisp_Object Qeval; -Lisp_Object Qextents; -Lisp_Object Qface; -Lisp_Object Qfile_name; -Lisp_Object Qfont; -Lisp_Object Qframe; -Lisp_Object Qfunction; -Lisp_Object Qgap_overhead; -Lisp_Object Qgeneric; -Lisp_Object Qgeometry; -Lisp_Object Qglobal; -Lisp_Object Qgutter; -Lisp_Object Qheight; -Lisp_Object Qhighlight; -Lisp_Object Qhorizontal; -Lisp_Object Qicon; -Lisp_Object Qid; -Lisp_Object Qimage; -Lisp_Object Qinfo; -Lisp_Object Qinherit; -Lisp_Object Qinteger; -Lisp_Object Qinternal; -Lisp_Object Qkey; -Lisp_Object Qkey_assoc; -Lisp_Object Qkeyboard; -Lisp_Object Qkeymap; -Lisp_Object Qlandscape; -Lisp_Object Qleft; -Lisp_Object Qleft_margin; -Lisp_Object Qlist; -Lisp_Object Qmagic; -Lisp_Object Qmalloc_overhead; -Lisp_Object Qmarkers; -Lisp_Object Qmax; -Lisp_Object Qmemory; -Lisp_Object Qmessage; -Lisp_Object Qminus; -Lisp_Object Qmodifiers; -Lisp_Object Qmotion; -Lisp_Object Qmsprinter; -Lisp_Object Qmswindows; -Lisp_Object Qname; -Lisp_Object Qnone; -Lisp_Object Qnot; -Lisp_Object Qnothing; -Lisp_Object Qnotice; -Lisp_Object Qobject; -Lisp_Object Qold_assoc; -Lisp_Object Qold_delete; -Lisp_Object Qold_delq; -Lisp_Object Qold_rassoc; -Lisp_Object Qold_rassq; -Lisp_Object Qonly; -Lisp_Object Qor; -Lisp_Object Qorientation; -Lisp_Object Qother; -Lisp_Object Qpointer; -Lisp_Object Qpopup; -Lisp_Object Qportrait; -Lisp_Object Qprint; -Lisp_Object Qprocess; -Lisp_Object Qprovide; -Lisp_Object Qrassoc; -Lisp_Object Qrassq; -Lisp_Object Qrequire; -Lisp_Object Qresource; -Lisp_Object Qreturn; -Lisp_Object Qreverse; -Lisp_Object Qright; -Lisp_Object Qright_margin; -Lisp_Object Qsearch; -Lisp_Object Qselected; -Lisp_Object Qsignal; -Lisp_Object Qsimple; -Lisp_Object Qsize; -Lisp_Object Qspace; -Lisp_Object Qspecifier; -Lisp_Object Qstream; -Lisp_Object Qstring; -Lisp_Object Qsymbol; -Lisp_Object Qsyntax; -Lisp_Object Qterminal; -Lisp_Object Qtest; -Lisp_Object Qtext; -Lisp_Object Qtimeout; -Lisp_Object Qtimestamp; -Lisp_Object Qtoolbar; -Lisp_Object Qtop; -Lisp_Object Qtop_margin; -Lisp_Object Qtty; -Lisp_Object Qtype; -Lisp_Object Qundecided; -Lisp_Object Qundefined; -Lisp_Object Qunimplemented; -Lisp_Object Qvalue_assoc; -Lisp_Object Qvertical; -Lisp_Object Qwarning; -Lisp_Object Qwidth; -Lisp_Object Qwidget; -Lisp_Object Qwindow; -Lisp_Object Qwindow_system; -Lisp_Object Qx; -Lisp_Object Qy; +#define SYMBOL(fou) Lisp_Object fou +#define SYMBOL_KEYWORD(la_cle_est_fou) Lisp_Object la_cle_est_fou +#define SYMBOL_GENERAL(tout_le_monde, est_fou) Lisp_Object tout_le_monde + +#include "general-slots.h" + +#undef SYMBOL +#undef SYMBOL_KEYWORD +#undef SYMBOL_GENERAL void syms_of_general (void) { - defsymbol (&Qactually_requested, "actually-requested"); - defsymbol (&Qafter, "after"); - defsymbol (&Qall, "all"); - defsymbol (&Qand, "and"); - defsymbol (&Qassoc, "assoc"); - defsymbol (&Qat, "at"); - defsymbol (&Qautodetect, "autodetect"); - defsymbol (&Qbad_variable, "bad-variable"); - defsymbol (&Qbefore, "before"); - defsymbol (&Qbinary, "binary"); - defsymbol (&Qbitmap, "bitmap"); - defsymbol (&Qboolean, "boolean"); - defsymbol (&Qbottom, "bottom"); - defsymbol (&Qbottom_margin, "bottom-margin"); - defsymbol (&Qbuffer, "buffer"); - defsymbol (&Qbutton, "button"); - defsymbol (&Qcategory, "category"); - defsymbol (&Qcenter, "center"); - defsymbol (&Qchannel, "channel"); - defsymbol (&Qchar, "char"); - defsymbol (&Qcharacter, "character"); - defsymbol (&Qchars, "chars"); - defsymbol (&Qcolor, "color"); - defsymbol (&Qcolumns, "columns"); - defsymbol (&Qcommand, "command"); - defsymbol (&Qconsole, "console"); - defsymbol (&Qcritical, "critical"); - defsymbol (&Qctext, "ctext"); - defsymbol (&Qcursor, "cursor"); - defsymbol (&Qdata, "data"); - defsymbol (&Qdead, "dead"); - defsymbol (&Qdefault, "default"); - defsymbol (&Qdelete, "delete"); - defsymbol (&Qdelq, "delq"); - defsymbol (&Qdevice, "device"); - defsymbol (&Qdimension, "dimension"); - defsymbol (&Qdisplay, "display"); - defsymbol (&Qdoc_string, "doc-string"); - defsymbol (&Qduplex, "duplex"); - defsymbol (&Qdynarr_overhead, "dynarr-overhead"); - defsymbol (&Qempty, "empty"); - defsymbol (&Qeq, "eq"); - defsymbol (&Qeql, "eql"); - defsymbol (&Qequal, "equal"); - defsymbol (&Qeval, "eval"); - defsymbol (&Qextents, "extents"); - defsymbol (&Qface, "face"); - defsymbol (&Qfile_name, "file-name"); - defsymbol (&Qfont, "font"); - defsymbol (&Qframe, "frame"); - defsymbol (&Qfunction, "function"); - defsymbol (&Qgap_overhead, "gap-overhead"); - defsymbol (&Qgeneric, "generic"); - defsymbol (&Qgeometry, "geometry"); - defsymbol (&Qglobal, "global"); - defsymbol (&Qgutter, "gutter"); - defsymbol (&Qheight, "height"); - defsymbol (&Qhighlight, "highlight"); - defsymbol (&Qhorizontal, "horizontal"); - defsymbol (&Qicon, "icon"); - defsymbol (&Qid, "id"); - defsymbol (&Qimage, "image"); - defsymbol (&Qinfo, "info"); - defsymbol (&Qinherit, "inherit"); - defsymbol (&Qinteger, "integer"); - defsymbol (&Qinternal, "internal"); - defsymbol (&Qkey, "key"); - defsymbol (&Qkey_assoc, "key-assoc"); - defsymbol (&Qkeyboard, "keyboard"); - defsymbol (&Qkeymap, "keymap"); - defsymbol (&Qlandscape, "landscape"); - defsymbol (&Qleft, "left"); - defsymbol (&Qleft_margin, "left-margin"); - defsymbol (&Qlist, "list"); - defsymbol (&Qmagic, "magic"); - defsymbol (&Qmalloc_overhead, "malloc-overhead"); - defsymbol (&Qmarkers, "markers"); - defsymbol (&Qmax, "max"); - defsymbol (&Qmemory, "memory"); - defsymbol (&Qmessage, "message"); - defsymbol (&Qminus, "-"); - defsymbol (&Qmodifiers, "modifiers"); - defsymbol (&Qmotion, "motion"); - defsymbol (&Qmsprinter, "msprinter"); - defsymbol (&Qmswindows, "mswindows"); - defsymbol (&Qname, "name"); - defsymbol (&Qnone, "none"); - defsymbol (&Qnot, "not"); - defsymbol (&Qnothing, "nothing"); - defsymbol (&Qnotice, "notice"); - defsymbol (&Qobject, "object"); - defsymbol (&Qold_assoc, "old-assoc"); - defsymbol (&Qold_delete, "old-delete"); - defsymbol (&Qold_delq, "old-delq"); - defsymbol (&Qold_rassoc, "old-rassoc"); - defsymbol (&Qold_rassq, "old-rassq"); - defsymbol (&Qonly, "only"); - defsymbol (&Qor, "or"); - defsymbol (&Qorientation, "orientation"); - defsymbol (&Qother, "other"); - defsymbol (&Qpointer, "pointer"); - defsymbol (&Qpopup, "popup"); - defsymbol (&Qportrait, "portrait"); - defsymbol (&Qprint, "print"); - defsymbol (&Qprocess, "process"); - defsymbol (&Qprovide, "provide"); - defsymbol (&Qrassoc, "rassoc"); - defsymbol (&Qrassq, "rassq"); - defsymbol (&Qrequire, "require"); - defsymbol (&Qresource, "resource"); - defsymbol (&Qreturn, "return"); - defsymbol (&Qreverse, "reverse"); - defsymbol (&Qright, "right"); - defsymbol (&Qright_margin, "right-margin"); - defsymbol (&Qsearch, "search"); - defsymbol (&Qselected, "selected"); - defsymbol (&Qsignal, "signal"); - defsymbol (&Qsimple, "simple"); - defsymbol (&Qsize, "size"); - defsymbol (&Qspace, "space"); - defsymbol (&Qspecifier, "specifier"); - defsymbol (&Qstream, "stream"); - defsymbol (&Qstring, "string"); - defsymbol (&Qsymbol, "symbol"); - defsymbol (&Qsyntax, "syntax"); - defsymbol (&Qterminal, "terminal"); - defsymbol (&Qtest, "test"); - defsymbol (&Qtext, "text"); - defsymbol (&Qtimeout, "timeout"); - defsymbol (&Qtimestamp, "timestamp"); - defsymbol (&Qtoolbar, "toolbar"); - defsymbol (&Qtop, "top"); - defsymbol (&Qtop_margin, "top-margin"); - defsymbol (&Qtty, "tty"); - defsymbol (&Qtype, "type"); - defsymbol (&Qundecided, "undecided"); - defsymbol (&Qundefined, "undefined"); - defsymbol (&Qunimplemented, "unimplemented"); - defsymbol (&Qvalue_assoc, "value-assoc"); - defsymbol (&Qvertical, "vertical"); - defsymbol (&Qwarning, "warning"); - defsymbol (&Qwidth, "width"); - defsymbol (&Qwidget, "widget"); - defsymbol (&Qwindow, "window"); - defsymbol (&Qwindow_system, "window-system"); - defsymbol (&Qx, "x"); - defsymbol (&Qy, "y"); +#define SYMBOL(loco) DEFSYMBOL (loco) +#define SYMBOL_KEYWORD(meshugeneh) DEFKEYWORD (meshugeneh) +#define SYMBOL_GENERAL(vachement, fou) defsymbol (&vachement, fou) + +#include "general-slots.h" + +#undef SYMBOL +#undef SYMBOL_KEYWORD +#undef SYMBOL_GENERAL } diff -r 72a7cfa4a488 -r abe6d1db359e src/getloadavg.c --- a/src/getloadavg.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/getloadavg.c Mon Aug 13 11:35:02 2007 +0200 @@ -44,7 +44,6 @@ convex DGUX hpux - MSDOS No-op for MSDOS. NeXT sgi sequent Sequent Dynix 3.x.x (BSD) @@ -52,7 +51,8 @@ sony_news NEWS-OS (works at least for 4.1C) UMAX UMAX4_3 - WIN32 No-op for Windows95/NT. + WIN32_NATIVE No-op for Windows9x/NT. + CYGWIN No-op for Cygwin. __linux__ Linux: assumes /proc filesystem mounted. Support from Michael K. Johnson. __NetBSD__ NetBSD: assumes /kern filesystem mounted. @@ -69,30 +69,8 @@ #include #endif -#ifndef WINDOWSNT -#ifndef __CYGWIN32__ - -#include - -/* Both the Emacs and non-Emacs sections want this. Some - configuration files' definitions for the LOAD_AVE_CVT macro (like - sparc.h's) use macros like FSCALE, defined here. */ -#ifdef unix -#include -#endif - -#ifdef XEMACS #include "lisp.h" #include "sysfile.h" /* for encapsulated open, close, read, write */ -#endif /* XEMACS */ - -/* Exclude all the code except the test program at the end - if the system has its own `getloadavg' function. - - The declaration of `errno' is needed by the test program - as well as the function itself, so it comes first. */ - -#include #ifndef HAVE_GETLOADAVG @@ -110,11 +88,9 @@ #define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0) #endif -#ifdef XEMACS #if defined (HAVE_KSTAT_H) #include #endif /* HAVE_KSTAT_H */ -#endif /* XEMACS */ #if !defined (BSD) && defined (ultrix) /* Ultrix behaves like BSD on Vaxen. */ @@ -457,17 +433,10 @@ #include #endif -#ifdef XEMACS #if defined (HAVE_SYS_PSTAT_H) #include #endif /* HAVE_SYS_PSTAT_H (on HPUX) */ -#endif /* XEMACS */ -#if defined(HAVE_FCNTL_H) || defined(_POSIX_VERSION) -#include -#else -#include -#endif /* Avoid static vars inside a function since in HPUX they dump as pure. */ @@ -512,6 +481,8 @@ Return the number written (never more than 3, but may be less than NELEM), or -1 if an error occurred. */ +int getloadavg (double loadavg[], int nelem); + int getloadavg (double loadavg[], int nelem) { @@ -779,7 +750,7 @@ : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale)); #endif /* OSF_MIPS */ -#if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32)) +#if !defined (LDAV_DONE) && (defined (WIN32_NATIVE) || defined (CYGWIN)) #define LDAV_DONE /* A faithful emulation is going to have to be saved for a rainy day. */ @@ -787,7 +758,7 @@ { loadavg[elem] = 0.0; } -#endif /* MSDOS */ +#endif /* WIN32_NATIVE or CYGWIN */ #if !defined (LDAV_DONE) && defined (OSF_ALPHA) #define LDAV_DONE @@ -960,22 +931,3 @@ exit (0); } #endif /* TEST */ - -#else - -/* Emulate getloadavg. */ -int -getloadavg (double loadavg[], int nelem) -{ - int i; - - /* A faithful emulation is going to have to be saved for a rainy day. */ - for (i = 0; i < nelem; i++) - { - loadavg[i] = 0.0; - } - return i; -} - -#endif /*__GNUWIN32__*/ -#endif /* WINDOWSNT */ diff -r 72a7cfa4a488 -r abe6d1db359e src/gif_io.c --- a/src/gif_io.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/gif_io.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,7 +1,11 @@ +#include + #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include "gifrlib.h" #include "sysfile.h" diff -r 72a7cfa4a488 -r abe6d1db359e src/glyphs-eimage.c --- a/src/glyphs-eimage.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/glyphs-eimage.c Mon Aug 13 11:35:02 2007 +0200 @@ -56,6 +56,7 @@ #include "buffer.h" #include "frame.h" #include "opaque.h" +#include "window.h" #include "sysfile.h" @@ -118,7 +119,8 @@ } static Lisp_Object -jpeg_normalize (Lisp_Object inst, Lisp_Object console_type) +jpeg_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { return simple_image_type_normalize (inst, console_type, Qjpeg); } @@ -372,7 +374,7 @@ { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - CONST Extbyte *bytes; + const Extbyte *bytes; Extcount len; /* #### This is a definite problem under Mule due to the amount of @@ -480,7 +482,7 @@ /* Step 6.5: Create the pixmap and set up the image instance */ /* now instantiate */ - MAYBE_DEVMETH (XDEVICE (ii->device), + MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), init_image_instance_from_eimage, (ii, cinfo.output_width, cinfo.output_height, 1, unwind.eimage, dest_mask, @@ -514,7 +516,8 @@ } static Lisp_Object -gif_normalize (Lisp_Object inst, Lisp_Object console_type) +gif_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { return simple_image_type_normalize (inst, console_type, Qgif); } @@ -580,12 +583,12 @@ struct gif_error_struct { - CONST char *err_str; /* return the error string */ + const char *err_str; /* return the error string */ jmp_buf setjmp_buffer; /* for return to caller */ }; static void -gif_error_func(CONST char *err_str, VoidPtr error_ptr) +gif_error_func(const char *err_str, VoidPtr error_ptr) { struct gif_error_struct *error_data = (struct gif_error_struct*)error_ptr; @@ -706,7 +709,7 @@ } /* now instantiate */ - MAYBE_DEVMETH (XDEVICE (ii->device), + MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), init_image_instance_from_eimage, (ii, width, height, unwind.giffile->ImageCount, unwind.eimage, dest_mask, instantiator, domain)); @@ -756,7 +759,8 @@ } static Lisp_Object -png_normalize (Lisp_Object inst, Lisp_Object console_type) +png_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { return simple_image_type_normalize (inst, console_type, Qpng); } @@ -769,7 +773,7 @@ struct png_memory_storage { - CONST Extbyte *bytes; /* The data */ + const Extbyte *bytes; /* The data */ Extcount len; /* How big is it? */ int index; /* Where are we? */ }; @@ -789,7 +793,7 @@ struct png_error_struct { - CONST char *err_str; + const char *err_str; jmp_buf setjmp_buffer; /* for return to caller */ }; @@ -893,7 +897,7 @@ /* Initialize the IO layer and read in header information */ { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - CONST Extbyte *bytes; + const Extbyte *bytes; Extcount len; assert (!NILP (data)); @@ -949,9 +953,9 @@ rgblist = MAYBE_LISP_DEVMETH (XDEVICE (c->device), color_instance_rgb_components, (c)); - my_background.red = XINT (XCAR (rgblist)); - my_background.green = XINT (XCAR (XCDR (rgblist))); - my_background.blue = XINT (XCAR (XCDR (XCDR (rgblist)))); + my_background.red = (unsigned short) XINT (XCAR (rgblist)); + my_background.green = (unsigned short) XINT (XCAR (XCDR (rgblist))); + my_background.blue = (unsigned short) XINT (XCAR (XCDR (XCDR (rgblist)))); } if (png_get_bKGD (png_ptr, info_ptr, &image_background)) @@ -1017,7 +1021,7 @@ } /* now instantiate */ - MAYBE_DEVMETH (XDEVICE (ii->device), + MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), init_image_instance_from_eimage, (ii, width, height, 1, unwind.eimage, dest_mask, instantiator, domain)); @@ -1042,7 +1046,8 @@ } static Lisp_Object -tiff_normalize (Lisp_Object inst, Lisp_Object console_type) +tiff_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { return simple_image_type_normalize (inst, console_type, Qtiff); } @@ -1170,7 +1175,7 @@ static struct tiff_error_struct tiff_err_data; static void -tiff_error_func(CONST char *module, CONST char *fmt, ...) +tiff_error_func(const char *module, const char *fmt, ...) { va_list vargs; @@ -1187,7 +1192,7 @@ } static void -tiff_warning_func(CONST char *module, CONST char *fmt, ...) +tiff_warning_func(const char *module, const char *fmt, ...) { va_list vargs; #ifdef HAVE_VSNPRINTF @@ -1254,7 +1259,7 @@ mem_struct.len = len; mem_struct.index = 0; - unwind.tiff = TIFFClientOpen ("memfile", "r", &mem_struct, + unwind.tiff = TIFFClientOpen ("memfile", "r", (thandle_t) &mem_struct, (TIFFReadWriteProc)tiff_memory_read, (TIFFReadWriteProc)tiff_memory_write, tiff_memory_seek, tiff_memory_close, tiff_memory_size, @@ -1299,7 +1304,7 @@ } /* now instantiate */ - MAYBE_DEVMETH (XDEVICE (ii->device), + MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), init_image_instance_from_eimage, (ii, width, height, 1, unwind.eimage, dest_mask, instantiator, domain)); diff -r 72a7cfa4a488 -r abe6d1db359e src/glyphs-msw.c --- a/src/glyphs-msw.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/glyphs-msw.c Mon Aug 13 11:35:02 2007 +0200 @@ -20,7 +20,7 @@ /* Synched up with: Not in FSF. */ -/* written by Andy Piper plagerising bits from +/* written by Andy Piper plagiarising bits from glyphs-x.c */ #include @@ -57,7 +57,6 @@ DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (layout); #ifdef HAVE_JPEG DECLARE_IMAGE_INSTANTIATOR_FORMAT (jpeg); #endif @@ -72,11 +71,16 @@ #endif #ifdef HAVE_XPM DEFINE_DEVICE_IIFORMAT (mswindows, xpm); +DEFINE_DEVICE_IIFORMAT (msprinter, xpm); #endif DEFINE_DEVICE_IIFORMAT (mswindows, xbm); +DEFINE_DEVICE_IIFORMAT (msprinter, xbm); #ifdef HAVE_XFACE DEFINE_DEVICE_IIFORMAT (mswindows, xface); +DEFINE_DEVICE_IIFORMAT (msprinter, xface); #endif +DECLARE_IMAGE_INSTANTIATOR_FORMAT (layout); +DEFINE_DEVICE_IIFORMAT (mswindows, native_layout); DEFINE_DEVICE_IIFORMAT (mswindows, button); DEFINE_DEVICE_IIFORMAT (mswindows, edit_field); DEFINE_DEVICE_IIFORMAT (mswindows, subwindow); @@ -103,7 +107,55 @@ enum image_instance_type type); static void mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, - struct frame* f); + HDC hcdc); + +/* + * Given device D, retrieve compatible device context. D can be either + * mswindows or an msprinter device. + */ +inline static HDC +get_device_compdc (struct device *d) +{ + if (DEVICE_MSWINDOWS_P (d)) + return DEVICE_MSWINDOWS_HCDC (d); + else + return DEVICE_MSPRINTER_HCDC (d); +} + +/* + * Initialize image instance pixel sizes in II. For a display bitmap, + * these will be same as real bitmap sizes. For a printer bitmap, + * these will be scaled up so that the bitmap is proportionally enlarged + * when output to printer. Redisplay code takes care of scaling, to + * conserve memory we do not really scale bitmaps. Set the watermark + * only here. + * #### Add support for unscalable bitmaps. + */ +static void init_image_instance_geometry (Lisp_Image_Instance *ii) +{ + struct device *d = DOMAIN_XDEVICE (ii->domain); + + if (/* #### Scaleable && */ DEVICE_MSPRINTER_P (d)) + { + HDC printer_dc = DEVICE_MSPRINTER_HCDC (d); + HDC display_dc = CreateCompatibleDC (NULL); + IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = + MulDiv (IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii), + GetDeviceCaps (printer_dc, LOGPIXELSX), + GetDeviceCaps (display_dc, LOGPIXELSX)); + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = + MulDiv (IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii), + GetDeviceCaps (printer_dc, LOGPIXELSY), + GetDeviceCaps (display_dc, LOGPIXELSY)); + } + else + { + IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = + IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii); + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = + IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii); + } +} #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3))) @@ -124,7 +176,7 @@ BITMAPINFO* bmp_info; unsigned char *ip, *dp; - if (DEVICE_MSWINDOWS_BITSPIXEL (d) > 0) + if (GetDeviceCaps (get_device_compdc (d), BITSPIXEL) > 0) { int bpline = BPLINE(width * 3); /* FIXME: we can do this because 24bpp implies no color table, once @@ -206,25 +258,28 @@ } /* build up an RGBQUAD colortable */ - for (i = 0; i < qtable->num_active_colors; i++) { - colortbl[i].rgbRed = (BYTE) qtable->rm[i]; - colortbl[i].rgbGreen = (BYTE) qtable->gm[i]; - colortbl[i].rgbBlue = (BYTE) qtable->bm[i]; - colortbl[i].rgbReserved = 0; - } + for (i = 0; i < qtable->num_active_colors; i++) + { + colortbl[i].rgbRed = (BYTE) qtable->rm[i]; + colortbl[i].rgbGreen = (BYTE) qtable->gm[i]; + colortbl[i].rgbBlue = (BYTE) qtable->bm[i]; + colortbl[i].rgbReserved = 0; + } /* now build up the data. picture has to be upside-down and back-to-front for msw bitmaps */ ip = pic; - for (i = height-1; i >= 0; i--) { - dp = (*bmp_data) + (i * bpline); - for (j = 0; j < width; j++) { - rd = *ip++; - gr = *ip++; - bl = *ip++; - *dp++ = QUANT_GET_COLOR (qtable,rd,gr,bl); + for (i = height-1; i >= 0; i--) + { + dp = (*bmp_data) + (i * bpline); + for (j = 0; j < width; j++) + { + rd = *ip++; + gr = *ip++; + bl = *ip++; + *dp++ = QUANT_GET_COLOR (qtable,rd,gr,bl); + } } - } xfree (qtable); } /* fix up the standard stuff */ @@ -294,22 +349,12 @@ int x_hot, int y_hot, int create_mask) { - Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - struct device *d = XDEVICE (device); - struct frame *f; + struct device *d = XDEVICE (IMAGE_INSTANCE_DEVICE (ii)); void* bmp_buf=0; - int type = 0; + enum image_instance_type type; HBITMAP bitmap; HDC hdc; - if (!DEVICE_MSWINDOWS_P (d)) - signal_simple_error ("Not an mswindows device", device); - - if (NILP (DEVICE_SELECTED_FRAME (d))) - signal_simple_error ("No selected frame on mswindows device", device); - - f = XFRAME (DEVICE_SELECTED_FRAME (d)); - if (dest_mask & IMAGE_COLOR_PIXMAP_MASK) type = IMAGE_COLOR_PIXMAP; else if (dest_mask & IMAGE_POINTER_MASK) @@ -317,13 +362,13 @@ else incompatible_image_types (instantiator, dest_mask, IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); - hdc = FRAME_MSWINDOWS_CDC (f); - - bitmap=CreateDIBSection (hdc, - bmp_info, - DIB_RGB_COLORS, - &bmp_buf, - 0,0); + + hdc = get_device_compdc (d); + bitmap = CreateDIBSection (hdc, + bmp_info, + DIB_RGB_COLORS, + &bmp_buf, + 0, 0); if (!bitmap || !bmp_buf) signal_simple_error ("Unable to create bitmap", instantiator); @@ -340,15 +385,18 @@ IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap; IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL; - IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = bmp_info->bmiHeader.biWidth; - IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = bmp_info->bmiHeader.biHeight; - IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; + IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) = + bmp_info->bmiHeader.biWidth; + IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) = + bmp_info->bmiHeader.biHeight; + IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), x_hot); XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), y_hot); + init_image_instance_geometry (ii); if (create_mask) { - mswindows_initialize_image_instance_mask (ii, f); + mswindows_initialize_image_instance_mask (ii, hdc); } if (type == IMAGE_POINTER) @@ -365,12 +413,10 @@ int slice, Lisp_Object instantiator) { - Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - struct device *d = XDEVICE (device); - struct frame *f = XFRAME (DEVICE_SELECTED_FRAME (d)); + struct device *d = XDEVICE (IMAGE_INSTANCE_DEVICE (ii)); void* bmp_buf=0; - HDC hdc = FRAME_MSWINDOWS_CDC (f); - HBITMAP bitmap = CreateDIBSection (hdc, + + HBITMAP bitmap = CreateDIBSection (get_device_compdc (d), bmp_info, DIB_RGB_COLORS, &bmp_buf, @@ -400,8 +446,7 @@ COLORREF bkcolor; int slice; - if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) - signal_simple_error ("Not an mswindows device", device); + CHECK_MSGDI_DEVICE (device); /* this is a hack but MaskBlt and TransparentBlt are not supported on most windows variants */ @@ -433,50 +478,49 @@ } } -static void set_mono_pixel ( unsigned char* bits, - int bpline, int height, - int x, int y, int white ) +inline static void +set_mono_pixel (unsigned char* bits, + int bpline, int height, + int x, int y, int white) { int i; - unsigned char bitnum; + unsigned char bitnum; /* Find the byte on which this scanline begins */ i = (height - y - 1) * bpline; /* Find the byte containing this pixel */ i += (x >> 3); /* Which bit is it? */ - bitnum = (unsigned char)( 7 - (x % 8) ); - if( white ) /* Turn it on */ - bits[i] |= (1<bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); + bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image); bmp_info->bmiHeader.biHeight = height; - bmp_info->bmiHeader.biPlanes=1; + bmp_info->bmiHeader.biPlanes = 1; bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); - bmp_info->bmiHeader.biBitCount=1; - bmp_info->bmiHeader.biCompression=BI_RGB; + bmp_info->bmiHeader.biBitCount = 1; + bmp_info->bmiHeader.biCompression = BI_RGB; bmp_info->bmiHeader.biClrUsed = 2; bmp_info->bmiHeader.biClrImportant = 2; bmp_info->bmiHeader.biSizeImage = height * maskbpline; @@ -492,7 +536,7 @@ if (!(mask = CreateDIBSection (hcdc, bmp_info, DIB_RGB_COLORS, - &and_bits, + (void**)&and_bits, 0,0))) { xfree (bmp_info); @@ -503,17 +547,17 @@ /* build up an in-memory set of bits to mess with */ xzero (*bmp_info); - bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); + bmp_info->bmiHeader.biWidth = IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image); bmp_info->bmiHeader.biHeight = -height; - bmp_info->bmiHeader.biPlanes=1; - bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); - bmp_info->bmiHeader.biBitCount=24; - bmp_info->bmiHeader.biCompression=BI_RGB; + bmp_info->bmiHeader.biPlanes = 1; + bmp_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmp_info->bmiHeader.biBitCount = 24; + bmp_info->bmiHeader.biCompression = BI_RGB; bmp_info->bmiHeader.biClrUsed = 0; bmp_info->bmiHeader.biClrImportant = 0; bmp_info->bmiHeader.biSizeImage = height * bpline; - dibits = xmalloc_and_zero (bpline * height); + dibits = (unsigned char*) xmalloc_and_zero (bpline * height); if (GetDIBits (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (image), 0, @@ -528,20 +572,20 @@ /* now set the colored bits in the mask and transparent ones to black in the original */ - for(i=0; idevice))) + if (!p->data) + return; + + if (DEVICE_LIVE_P (XDEVICE (IMAGE_INSTANCE_DEVICE (p)))) { - if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET - || - IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW) + if (image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (p)) + & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK)) { #ifdef DEBUG_WIDGETS debug_widget_instances--; @@ -2103,6 +2162,16 @@ return mswindows_get_hfont (XFONT_INSTANCE (font), under, strike); } +static HDWP +begin_defer_window_pos (struct frame *f) +{ +#ifdef DEFER_WINDOW_POS + if (FRAME_MSWINDOWS_DATA (f)->hdwp == 0) + FRAME_MSWINDOWS_DATA (f)->hdwp = BeginDeferWindowPos (10); +#endif + return FRAME_MSWINDOWS_DATA (f)->hdwp; +} + /* unmap the image if it is a widget. This is used by redisplay via redisplay_unmap_subwindows */ static void @@ -2110,11 +2179,34 @@ { if (IMAGE_INSTANCE_SUBWINDOW_ID (p)) { +#ifdef DEFER_WINDOW_POS + struct frame *f = XFRAME (IMAGE_INSTANCE_FRAME (p)); + HDWP hdwp = begin_defer_window_pos (f); + HDWP new_hdwp; + new_hdwp = DeferWindowPos (hdwp, IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p), + NULL, + 0, 0, 0, 0, + SWP_HIDEWINDOW | SWP_NOACTIVATE | + SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER + /* Setting this flag causes the call to + DeferWindowPos to fail with + "Invalid parameter". I don't understand + why we bother to try and set this + anyway. -- ben */ + /* | SWP_NOSENDCHANGING */ + ); + if (!new_hdwp) + mswindows_output_last_error ("unmapping"); + else + hdwp = new_hdwp; + FRAME_MSWINDOWS_DATA (f)->hdwp = hdwp; +#else SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p), NULL, 0, 0, 0, 0, - SWP_HIDEWINDOW | SWP_NOMOVE | SWP_NOSIZE - | SWP_NOSENDCHANGING); + SWP_HIDEWINDOW | SWP_NOACTIVATE | + SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER ); +#endif if (GetFocus() == WIDGET_INSTANCE_MSWINDOWS_HANDLE (p)) SetFocus (GetParent (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p))); } @@ -2126,6 +2218,11 @@ mswindows_map_subwindow (Lisp_Image_Instance *p, int x, int y, struct display_glyph_area* dga) { +#ifdef DEFER_WINDOW_POS + struct frame *f = XFRAME (IMAGE_INSTANCE_FRAME (p)); + HDWP hdwp = begin_defer_window_pos (f); + HDWP new_hdwp; +#endif /* move the window before mapping it ... */ SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p), NULL, @@ -2139,12 +2236,36 @@ SWP_NOZORDER | SWP_NOSIZE | SWP_NOCOPYBITS | SWP_NOSENDCHANGING); /* ... now map it - we are not allowed to move it at the same time. */ - SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p), - NULL, - 0, 0, 0, 0, - SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE - | SWP_SHOWWINDOW | SWP_NOCOPYBITS - | SWP_NOSENDCHANGING); + if (!IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (p)) + { +#ifdef DEFER_WINDOW_POS + new_hdwp = DeferWindowPos + (hdwp, + IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p), + NULL, 0, 0, 0, 0, + SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE + | SWP_SHOWWINDOW + /* | SWP_NOCOPYBITS */ + /* Setting this flag causes the call to + DeferWindowPos to fail with + "Invalid parameter". I don't understand + why we bother to try and set this + anyway. -- ben */ + /* | SWP_NOSENDCHANGING */ + | SWP_NOACTIVATE); + if (!new_hdwp) + mswindows_output_last_error ("mapping"); + else + hdwp = new_hdwp; + FRAME_MSWINDOWS_DATA (f)->hdwp = hdwp; +#else + SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p), + NULL, + 0, 0, 0, 0, + SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE + | SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOACTIVATE); +#endif + } } /* resize the subwindow instance */ @@ -2152,62 +2273,87 @@ mswindows_resize_subwindow (Lisp_Image_Instance* ii, int w, int h) { /* Set the size of the control .... */ - SetWindowPos (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), - NULL, - 0, 0, w, h, - SWP_NOZORDER | SWP_NOMOVE - | SWP_NOCOPYBITS | SWP_NOSENDCHANGING); + if (!SetWindowPos (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), + NULL, + 0, 0, w, h, + SWP_NOZORDER | SWP_NOMOVE + | SWP_NOCOPYBITS | SWP_NOSENDCHANGING)) + mswindows_output_last_error ("resizing"); +} + +/* Simply resize the window here. */ +static void +mswindows_redisplay_subwindow (Lisp_Image_Instance *p) +{ + mswindows_resize_subwindow (p, + IMAGE_INSTANCE_WIDTH (p), + IMAGE_INSTANCE_HEIGHT (p)); } /* when you click on a widget you may activate another widget this needs to be checked and all appropriate widgets updated */ static void -mswindows_update_subwindow (Lisp_Image_Instance *p) +mswindows_redisplay_widget (Lisp_Image_Instance *p) { - /* Now do widget specific updates. */ - if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET) + /* Possibly update the face font and colors. */ + if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (p)) + && (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) + || XFRAME (IMAGE_INSTANCE_FRAME (p))->faces_changed + || IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p))) { - /* buttons checked or otherwise */ - if ( EQ (IMAGE_INSTANCE_WIDGET_TYPE (p), Qbutton)) - { - if (gui_item_selected_p (IMAGE_INSTANCE_WIDGET_ITEM (p))) - SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), - BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - else - SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), - BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - /* set the widget font from the widget face */ SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), WM_SETFONT, (WPARAM) mswindows_widget_hfont - (p, IMAGE_INSTANCE_SUBWINDOW_FRAME (p)), + (p, IMAGE_INSTANCE_FRAME (p)), MAKELPARAM (TRUE, 0)); } + /* Possibly update the dimensions. */ + if (IMAGE_INSTANCE_SIZE_CHANGED (p)) + { + mswindows_resize_subwindow (p, + IMAGE_INSTANCE_WIDTH (p), + IMAGE_INSTANCE_HEIGHT (p)); + } + /* Possibly update the text in the widget. */ + if (IMAGE_INSTANCE_TEXT_CHANGED (p) + && !NILP (IMAGE_INSTANCE_WIDGET_TEXT (p))) + { + Extbyte* lparam=0; + TO_EXTERNAL_FORMAT (LISP_STRING, IMAGE_INSTANCE_WIDGET_TEXT (p), + C_STRING_ALLOCA, lparam, + Qnative); + SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), + WM_SETTEXT, 0, (LPARAM)lparam); + } } -/* register widgets into our hastable so that we can cope with the +/* register widgets into our hashtable so that we can cope with the callbacks. The hashtable is weak so deregistration is handled automatically */ static int -mswindows_register_gui_item (Lisp_Object gui, Lisp_Object domain) +mswindows_register_gui_item (Lisp_Object image_instance, + Lisp_Object gui, Lisp_Object domain) { - Lisp_Object frame = FW_FRAME (domain); + Lisp_Object frame = DOMAIN_FRAME (domain); struct frame* f = XFRAME (frame); - int id = gui_item_id_hash (FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f), + int id = gui_item_id_hash (FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f), gui, WIDGET_GLYPH_SLOT); - Fputhash (make_int (id), - XGUI_ITEM (gui)->callback, - FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f)); + Fputhash (make_int (id), image_instance, + FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f)); + Fputhash (make_int (id), XGUI_ITEM (gui)->callback, + FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f)); + Fputhash (make_int (id), XGUI_ITEM (gui)->callback_ex, + FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f)); return id; } static int mswindows_register_widget_instance (Lisp_Object instance, Lisp_Object domain) { - return mswindows_register_gui_item (XIMAGE_INSTANCE_WIDGET_ITEM (instance), + return mswindows_register_gui_item (instance, + XIMAGE_INSTANCE_WIDGET_ITEM (instance), domain); } @@ -2218,12 +2364,10 @@ { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - struct device* d = XDEVICE (device); - Lisp_Object frame = FW_FRAME (domain); + Lisp_Object frame = DOMAIN_FRAME (domain); HWND wnd; - if (!DEVICE_MSWINDOWS_P (d)) - signal_simple_error ("Not an mswindows device", device); + CHECK_MSWINDOWS_DEVICE (device); /* have to set the type this late in case there is no device instantiation for a widget */ @@ -2337,28 +2481,26 @@ mswindows_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain, - CONST char* class, int flags, int exflags) + const char* class, int flags, int exflags) { /* this function can call lisp */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), style; - struct device* d = XDEVICE (device); - Lisp_Object frame = FW_FRAME (domain); + Lisp_Object frame = DOMAIN_FRAME (domain); Extbyte* nm=0; HWND wnd; int id = 0xffff; Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); Lisp_Gui_Item* pgui = XGUI_ITEM (gui); - if (!DEVICE_MSWINDOWS_P (d)) - signal_simple_error ("Not an mswindows device", device); + CHECK_MSWINDOWS_DEVICE (device); if (!gui_item_active_p (gui)) flags |= WS_DISABLED; style = pgui->style; - if (!NILP (pgui->callback)) + if (!NILP (pgui->callback) || !NILP (pgui->callback_ex)) { id = mswindows_register_widget_instance (image_instance, domain); } @@ -2382,7 +2524,7 @@ IMAGE_INSTANCE_WIDGET_WIDTH (ii), IMAGE_INSTANCE_WIDGET_HEIGHT (ii), /* parent window */ - FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), + DOMAIN_MSWINDOWS_HANDLE (domain), (HMENU)id, /* No menu */ NULL, /* must be null for this class */ NULL)) == NULL) @@ -2412,9 +2554,37 @@ IMAGE_INSTANCE_SUBWINDOW_ID (ii) = wnd; SetWindowLong (wnd, GWL_USERDATA, (LONG)LISP_TO_VOID(image_instance)); /* set the widget font from the widget face */ - SendMessage (wnd, WM_SETFONT, - (WPARAM) mswindows_widget_hfont (ii, domain), - MAKELPARAM (TRUE, 0)); + if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) + SendMessage (wnd, WM_SETFONT, + (WPARAM) mswindows_widget_hfont (ii, domain), + MAKELPARAM (TRUE, 0)); +#if 0 + /* #### doesn't work. need to investigate more closely. */ + if (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS (ii)) + SetFocus (wnd); +#endif +} + +/* Instantiate a native layout widget. */ +static void +mswindows_native_layout_instantiate (Lisp_Object image_instance, + Lisp_Object instantiator, + Lisp_Object pointer_fg, Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) +{ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + + mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain, "STATIC", + /* Approximation to styles available with + an XEmacs layout. */ + (EQ (IMAGE_INSTANCE_LAYOUT_BORDER (ii), + Qetched_in) || + EQ (IMAGE_INSTANCE_LAYOUT_BORDER (ii), + Qetched_out) || + GLYPHP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)) + ? SS_ETCHEDFRAME : SS_SUNKEN) | DS_CONTROL, + 0); } /* Instantiate a button widget. Unfortunately instantiated widgets are @@ -2428,7 +2598,7 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - /* this function can call lisp */ + /* This function can call lisp */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); HWND wnd; int flags = WS_TABSTOP;/* BS_NOTIFY #### is needed to get exotic feedback @@ -2490,6 +2660,22 @@ } } +/* Update the state of a button. */ +static void +mswindows_button_redisplay (Lisp_Object image_instance) +{ + /* This function can GC if IN_REDISPLAY is false. */ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + + /* buttons checked or otherwise */ + if (gui_item_selected_p (IMAGE_INSTANCE_WIDGET_ITEM (ii))) + SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), + BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + else + SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), + BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); +} + /* instantiate an edit control */ static void mswindows_edit_field_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, @@ -2510,6 +2696,7 @@ { HWND wnd; Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + Lisp_Object val; mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, domain, PROGRESS_CLASS, WS_BORDER | PBS_SMOOTH, WS_EX_CLIENTEDGE); @@ -2521,7 +2708,7 @@ (XCOLOR_INSTANCE (FACE_BACKGROUND (XIMAGE_INSTANCE_WIDGET_FACE (ii), - XIMAGE_INSTANCE_SUBWINDOW_FRAME (ii)))))); + XIMAGE_INSTANCE_FRAME (ii)))))); #endif #ifdef PBS_SETBARCOLOR SendMessage (wnd, PBS_SETBARCOLOR, 0, @@ -2529,8 +2716,12 @@ (XCOLOR_INSTANCE (FACE_FOREGROUND (XIMAGE_INSTANCE_WIDGET_FACE (ii), - XIMAGE_INSTANCE_SUBWINDOW_FRAME (ii)))))); + XIMAGE_INSTANCE_FRAME (ii)))))); #endif + val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEMS (ii))->value; + CHECK_INT (val); + SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), + PBM_SETPOS, (WPARAM)XINT (val), 0); } /* instantiate a tree view widget */ @@ -2548,7 +2739,8 @@ if (GUI_ITEMP (item)) { - tvitem.item.lParam = mswindows_register_gui_item (item, domain); + tvitem.item.lParam = mswindows_register_gui_item (image_instance, + item, domain); tvitem.item.mask |= TVIF_PARAM; TO_EXTERNAL_FORMAT (LISP_STRING, XGUI_ITEM (item)->name, C_STRING_ALLOCA, tvitem.item.pszText, @@ -2619,18 +2811,54 @@ } } +/* Set the properties of a tree view. */ +static void +mswindows_tree_view_redisplay (Lisp_Object image_instance) +{ + /* This function can GC if IN_REDISPLAY is false. */ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + + if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) + { + HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); + Lisp_Object rest; + HTREEITEM parent; + /* Delete previous items. */ + SendMessage (wnd, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT); + /* define a root */ + parent = add_tree_item (image_instance, wnd, NULL, + XCAR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)), + TRUE, IMAGE_INSTANCE_DOMAIN (ii)); + + /* recursively add items to the tree view */ + /* add items to the tab */ + LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) + { + if (LISTP (XCAR (rest))) + add_tree_item_list (image_instance, wnd, parent, XCAR (rest), + IMAGE_INSTANCE_DOMAIN (ii)); + else + add_tree_item (image_instance, wnd, parent, XCAR (rest), FALSE, + IMAGE_INSTANCE_DOMAIN (ii)); + } + } +} + /* instantiate a tab control */ -static TC_ITEM* add_tab_item (Lisp_Object image_instance, - HWND wnd, Lisp_Object item, - Lisp_Object domain, int i) +static int +add_tab_item (Lisp_Object image_instance, + HWND wnd, Lisp_Object item, + Lisp_Object domain, int i) { - TC_ITEM tvitem, *ret; + TC_ITEM tvitem; + int ret = 0; tvitem.mask = TCIF_TEXT; if (GUI_ITEMP (item)) { - tvitem.lParam = mswindows_register_gui_item (item, domain); + tvitem.lParam = mswindows_register_gui_item (image_instance, + item, domain); tvitem.mask |= TCIF_PARAM; TO_EXTERNAL_FORMAT (LISP_STRING, XGUI_ITEM (item)->name, C_STRING_ALLOCA, tvitem.pszText, @@ -2646,8 +2874,8 @@ tvitem.cchTextMax = strlen (tvitem.pszText); - if ((ret = (TC_ITEM*)SendMessage (wnd, TCM_INSERTITEM, - i, (LPARAM)&tvitem)) < 0) + if ((ret = SendMessage (wnd, TCM_INSERTITEM, + i, (LPARAM)&tvitem)) < 0) signal_simple_error ("error adding tab entry", item); return ret; @@ -2658,9 +2886,10 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { + /* This function can call lisp */ Lisp_Object rest; HWND wnd; - int i = 0; + int i = 0, selected = 0; Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation); unsigned int flags = WS_TABSTOP; @@ -2678,48 +2907,92 @@ pointer_bg, dest_mask, domain, WC_TABCONTROL, /* borders don't suit tabs so well */ flags, 0); - wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* add items to the tab */ LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) { - add_tab_item (image_instance, wnd, XCAR (rest), domain, i); + int idx = add_tab_item (image_instance, wnd, XCAR (rest), domain, i); + assert (idx == i); + if (gui_item_selected_p (XCAR (rest))) + selected = i; i++; } + SendMessage (wnd, TCM_SETCURSEL, selected, 0); } -/* set the properties of a tab control */ -static Lisp_Object -mswindows_tab_control_set_property (Lisp_Object image_instance, Lisp_Object prop, - Lisp_Object val) +/* Set the properties of a tab control. */ +static void +mswindows_tab_control_redisplay (Lisp_Object image_instance) { + /* This function can GC if IN_REDISPLAY is false. */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - - if (EQ (prop, Q_items)) +#ifdef DEBUG_WIDGET_OUTPUT + stderr_out ("tab control %p redisplayed\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); +#endif + if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) + || + IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii)) { HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); - int i = 0; + int i = 0, selected = 0; Lisp_Object rest; - check_valid_item_list_1 (val); - - /* delete the pre-existing items */ - SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0); - - IMAGE_INSTANCE_WIDGET_ITEMS (ii) = - Fcons (XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)), - parse_gui_item_tree_children (val)); - - /* add items to the tab */ - LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) + + assert (!NILP (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); + + /* If only the order has changed then simply select the first + one. This stops horrendous rebuilding of the tabs each time + you click on one. */ + if (tab_control_order_only_changed (image_instance)) { - add_tab_item (image_instance, wnd, XCAR (rest), - IMAGE_INSTANCE_SUBWINDOW_FRAME (ii), i); - i++; + Lisp_Object selected = + gui_item_list_find_selected + (NILP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)) ? + XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)) : + XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))); + + LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) + { + if (gui_item_equal_sans_selected (XCAR (rest), selected, 0)) + { + Lisp_Object old_selected = gui_item_list_find_selected + (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); + + /* Pick up the new selected item. */ + XGUI_ITEM (old_selected)->selected = + XGUI_ITEM (XCAR (rest))->selected; + XGUI_ITEM (XCAR (rest))->selected = + XGUI_ITEM (selected)->selected; + /* We're not actually changing the items. */ + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 0; + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; + + SendMessage (wnd, TCM_SETCURSEL, i, 0); +#ifdef DEBUG_WIDGET_OUTPUT + stderr_out ("tab control %p selected item %d\n", + IMAGE_INSTANCE_SUBWINDOW_ID (ii), i); +#endif + break; + } + i++; + } } - - return Qt; + else + { + /* delete the pre-existing items */ + SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0); + + /* add items to the tab */ + LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) + { + add_tab_item (image_instance, wnd, XCAR (rest), + IMAGE_INSTANCE_FRAME (ii), i); + if (gui_item_selected_p (XCAR (rest))) + selected = i; + i++; + } + SendMessage (wnd, TCM_SETCURSEL, selected, 0); + } } - return Qunbound; } /* instantiate a static control possible for putting other things in */ @@ -2751,10 +3024,9 @@ int dest_mask, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - HANDLE wnd; + HWND wnd; Lisp_Object rest; - Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties), - Q_items, Qnil); + Lisp_Object items = find_keyword_in_vector (instantiator, Q_items); int len, height; /* Maybe ought to generalise this more but it may be very windows @@ -2768,7 +3040,7 @@ /* We now have everything right apart from the height. */ default_face_font_info (domain, 0, 0, &height, 0, 0); - GET_LIST_LENGTH (data, len); + GET_LIST_LENGTH (items, len); height = (height + WIDGET_BORDER_HEIGHT * 2 ) * len; IMAGE_INSTANCE_HEIGHT (ii) = height; @@ -2784,12 +3056,14 @@ image_instance_layout (image_instance, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNSPECIFIED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, domain); wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* add items to the combo box */ SendMessage (wnd, CB_RESETCONTENT, 0, 0); - LIST_LOOP (rest, Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), Q_items, Qnil)) + LIST_LOOP (rest, items) { Extbyte* lparam; TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (rest), @@ -2805,12 +3079,12 @@ mswindows_widget_property (Lisp_Object image_instance, Lisp_Object prop) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); + HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* get the text from a control */ if (EQ (prop, Q_text)) { Extcount len = SendMessage (wnd, WM_GETTEXTLENGTH, 0, 0); - Extbyte* buf =alloca (len+1); + Extbyte *buf = (Extbyte*) alloca (len+1); SendMessage (wnd, WM_GETTEXT, (WPARAM)len+1, (LPARAM) buf); return build_ext_string (buf, Qnative); @@ -2823,7 +3097,7 @@ mswindows_button_property (Lisp_Object image_instance, Lisp_Object prop) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); + HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* check the state of a button */ if (EQ (prop, Q_selected)) { @@ -2840,56 +3114,41 @@ mswindows_combo_box_property (Lisp_Object image_instance, Lisp_Object prop) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); + HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* get the text from a control */ if (EQ (prop, Q_text)) { long item = SendMessage (wnd, CB_GETCURSEL, 0, 0); Extcount len = SendMessage (wnd, CB_GETLBTEXTLEN, (WPARAM)item, 0); - Extbyte* buf = alloca (len+1); + Extbyte* buf = (Extbyte*) alloca (len+1); SendMessage (wnd, CB_GETLBTEXT, (WPARAM)item, (LPARAM)buf); return build_ext_string (buf, Qnative); } return Qunbound; } -/* set the properties of a control */ -static Lisp_Object -mswindows_widget_set_property (Lisp_Object image_instance, Lisp_Object prop, - Lisp_Object val) +/* set the properties of a progress gauge */ +static void +mswindows_progress_gauge_redisplay (Lisp_Object image_instance) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - if (EQ (prop, Q_text)) + if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) { - Extbyte* lparam=0; - CHECK_STRING (val); - TO_EXTERNAL_FORMAT (LISP_STRING, val, - C_STRING_ALLOCA, lparam, - Qnative); - SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), - WM_SETTEXT, 0, (LPARAM)lparam); - /* We don't return Qt here so that other widget methods can be - called afterwards. */ - } - return Qunbound; -} - -/* set the properties of a progres guage */ -static Lisp_Object -mswindows_progress_gauge_set_property (Lisp_Object image_instance, Lisp_Object prop, - Lisp_Object val) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - - if (EQ (prop, Q_percent)) - { + Lisp_Object val; +#ifdef ERROR_CHECK_GLYPHS + assert (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))); +#endif + val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))->value; +#ifdef DEBUG_WIDGET_OUTPUT + stderr_out ("progress gauge displayed value on %p updated to %ld\n", + WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), + XINT(val)); +#endif CHECK_INT (val); SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), PBM_SETPOS, (WPARAM)XINT (val), 0); - return Qt; } - return Qunbound; } LRESULT WINAPI @@ -2929,94 +3188,104 @@ void console_type_create_glyphs_mswindows (void) { - /* image methods */ - + /* image methods - display */ CONSOLE_HAS_METHOD (mswindows, print_image_instance); CONSOLE_HAS_METHOD (mswindows, finalize_image_instance); CONSOLE_HAS_METHOD (mswindows, unmap_subwindow); CONSOLE_HAS_METHOD (mswindows, map_subwindow); - CONSOLE_HAS_METHOD (mswindows, update_subwindow); + CONSOLE_HAS_METHOD (mswindows, redisplay_subwindow); + CONSOLE_HAS_METHOD (mswindows, resize_subwindow); + CONSOLE_HAS_METHOD (mswindows, redisplay_widget); CONSOLE_HAS_METHOD (mswindows, image_instance_equal); CONSOLE_HAS_METHOD (mswindows, image_instance_hash); CONSOLE_HAS_METHOD (mswindows, init_image_instance_from_eimage); CONSOLE_HAS_METHOD (mswindows, locate_pixmap_file); - CONSOLE_HAS_METHOD (mswindows, resize_subwindow); + + /* image methods - printer */ + CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_image_instance); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_image_instance); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, image_instance_equal); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, image_instance_hash); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, init_image_instance_from_eimage); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, locate_pixmap_file); } void image_instantiator_format_create_glyphs_mswindows (void) { - IIFORMAT_VALID_CONSOLE (mswindows, nothing); - IIFORMAT_VALID_CONSOLE (mswindows, string); - IIFORMAT_VALID_CONSOLE (mswindows, layout); - IIFORMAT_VALID_CONSOLE (mswindows, formatted_string); - IIFORMAT_VALID_CONSOLE (mswindows, inherit); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, nothing); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, string); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, formatted_string); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, inherit); /* image-instantiator types */ + INITIALIZE_DEVICE_IIFORMAT (mswindows, xbm); + INITIALIZE_DEVICE_IIFORMAT (msprinter, xbm); + IIFORMAT_HAS_DEVMETHOD (mswindows, xbm, instantiate); + IIFORMAT_INHERITS_DEVMETHOD (msprinter, mswindows, xbm, instantiate); #ifdef HAVE_XPM INITIALIZE_DEVICE_IIFORMAT (mswindows, xpm); + INITIALIZE_DEVICE_IIFORMAT (msprinter, xpm); IIFORMAT_HAS_DEVMETHOD (mswindows, xpm, instantiate); + IIFORMAT_INHERITS_DEVMETHOD (msprinter, mswindows, xpm, instantiate); #endif - INITIALIZE_DEVICE_IIFORMAT (mswindows, xbm); - IIFORMAT_HAS_DEVMETHOD (mswindows, xbm, instantiate); #ifdef HAVE_XFACE INITIALIZE_DEVICE_IIFORMAT (mswindows, xface); + INITIALIZE_DEVICE_IIFORMAT (msprinter, xface); IIFORMAT_HAS_DEVMETHOD (mswindows, xface, instantiate); + IIFORMAT_INHERITS_DEVMETHOD (msprinter, mswindows, xface, instantiate); #endif #ifdef HAVE_JPEG - IIFORMAT_VALID_CONSOLE (mswindows, jpeg); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, jpeg); #endif #ifdef HAVE_TIFF - IIFORMAT_VALID_CONSOLE (mswindows, tiff); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, tiff); #endif #ifdef HAVE_PNG - IIFORMAT_VALID_CONSOLE (mswindows, png); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, png); #endif #ifdef HAVE_GIF - IIFORMAT_VALID_CONSOLE (mswindows, gif); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, gif); #endif #ifdef HAVE_WIDGETS + INITIALIZE_DEVICE_IIFORMAT (mswindows, widget); + IIFORMAT_HAS_DEVMETHOD (mswindows, widget, property); + /* layout widget */ + IIFORMAT_VALID_CONSOLE (mswindows, layout); + INITIALIZE_DEVICE_IIFORMAT (mswindows, native_layout); + IIFORMAT_HAS_DEVMETHOD (mswindows, native_layout, instantiate); /* button widget */ INITIALIZE_DEVICE_IIFORMAT (mswindows, button); IIFORMAT_HAS_DEVMETHOD (mswindows, button, property); IIFORMAT_HAS_DEVMETHOD (mswindows, button, instantiate); - + IIFORMAT_HAS_DEVMETHOD (mswindows, button, redisplay); + /* edit-field widget */ INITIALIZE_DEVICE_IIFORMAT (mswindows, edit_field); IIFORMAT_HAS_DEVMETHOD (mswindows, edit_field, instantiate); - + /* subwindow */ INITIALIZE_DEVICE_IIFORMAT (mswindows, subwindow); IIFORMAT_HAS_DEVMETHOD (mswindows, subwindow, instantiate); - - INITIALIZE_DEVICE_IIFORMAT (mswindows, widget); - IIFORMAT_HAS_DEVMETHOD (mswindows, widget, property); - IIFORMAT_HAS_DEVMETHOD (mswindows, widget, set_property); - /* label */ INITIALIZE_DEVICE_IIFORMAT (mswindows, label); IIFORMAT_HAS_DEVMETHOD (mswindows, label, instantiate); - /* combo box */ INITIALIZE_DEVICE_IIFORMAT (mswindows, combo_box); IIFORMAT_HAS_DEVMETHOD (mswindows, combo_box, property); IIFORMAT_HAS_DEVMETHOD (mswindows, combo_box, instantiate); - /* scrollbar */ INITIALIZE_DEVICE_IIFORMAT (mswindows, scrollbar); IIFORMAT_HAS_DEVMETHOD (mswindows, scrollbar, instantiate); - /* progress gauge */ INITIALIZE_DEVICE_IIFORMAT (mswindows, progress_gauge); - IIFORMAT_HAS_DEVMETHOD (mswindows, progress_gauge, set_property); + IIFORMAT_HAS_DEVMETHOD (mswindows, progress_gauge, redisplay); IIFORMAT_HAS_DEVMETHOD (mswindows, progress_gauge, instantiate); - /* tree view widget */ INITIALIZE_DEVICE_IIFORMAT (mswindows, tree_view); - /* IIFORMAT_HAS_DEVMETHOD (mswindows, progress, set_property);*/ IIFORMAT_HAS_DEVMETHOD (mswindows, tree_view, instantiate); - + IIFORMAT_HAS_DEVMETHOD (mswindows, tree_view, redisplay); /* tab control widget */ INITIALIZE_DEVICE_IIFORMAT (mswindows, tab_control); IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, instantiate); - IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, set_property); + IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, redisplay); #endif /* windows bitmap format */ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (bmp, "bmp"); @@ -3027,7 +3296,7 @@ IIFORMAT_VALID_KEYWORD (bmp, Q_data, check_valid_string); IIFORMAT_VALID_KEYWORD (bmp, Q_file, check_valid_string); - IIFORMAT_VALID_CONSOLE (mswindows, bmp); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, bmp); /* mswindows resources */ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (mswindows_resource, @@ -3042,7 +3311,7 @@ check_valid_resource_symbol); IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_id, check_valid_resource_id); IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_file, check_valid_string); - IIFORMAT_VALID_CONSOLE (mswindows, mswindows_resource); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, mswindows_resource); } void diff -r 72a7cfa4a488 -r abe6d1db359e src/glyphs-msw.h --- a/src/glyphs-msw.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/glyphs-msw.h Mon Aug 13 11:35:02 2007 +0200 @@ -36,6 +36,7 @@ { HBITMAP* bitmaps; HICON icon; + int real_width, real_height; }; #define MSWINDOWS_IMAGE_INSTANCE_DATA(i) \ @@ -48,9 +49,13 @@ #define IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES(i) \ (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->bitmaps) #define IMAGE_INSTANCE_MSWINDOWS_MASK(i) \ - (HBITMAP)(IMAGE_INSTANCE_PIXMAP_MASK (i)) + (*(HBITMAP*)&(IMAGE_INSTANCE_PIXMAP_MASK (i))) /* Make it lvalue */ #define IMAGE_INSTANCE_MSWINDOWS_ICON(i) \ (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->icon) +#define IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH(i) \ + (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->real_width) +#define IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT(i) \ + (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->real_height) #define XIMAGE_INSTANCE_MSWINDOWS_BITMAP(i) \ IMAGE_INSTANCE_MSWINDOWS_BITMAP (XIMAGE_INSTANCE (i)) @@ -91,14 +96,21 @@ }; #define MSWINDOWS_SUBWINDOW_DATA(i) \ -((struct mswindows_subwindow_data *) (i)->data) - + ((struct mswindows_subwindow_data *) (i)->data) #define IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW(i) \ (MSWINDOWS_SUBWINDOW_DATA (i)->clip_window) +#define XIMAGE_INSTANCE_MSWINDOWS_SUBWINDOW_DATA(i) \ + MSWINDOWS_SUBWINDOW_DATA (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW(i) \ IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (XIMAGE_INSTANCE (i)) +#define DOMAIN_MSWINDOWS_HANDLE(domain) \ + ((IMAGE_INSTANCEP (domain) && \ + XIMAGE_INSTANCE_MSWINDOWS_SUBWINDOW_DATA (domain)) ? \ + XWIDGET_INSTANCE_MSWINDOWS_HANDLE (domain) : \ + FRAME_MSWINDOWS_HANDLE (DOMAIN_XFRAME (domain))) + #endif /* HAVE_MS_WINDOWS */ #endif /* INCLUDED_glyphs_msw_h_ */ diff -r 72a7cfa4a488 -r abe6d1db359e src/glyphs-widget.c --- a/src/glyphs-widget.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/glyphs-widget.c Mon Aug 13 11:35:02 2007 +0200 @@ -55,10 +55,11 @@ Lisp_Object Qtab_control; DEFINE_IMAGE_INSTANTIATOR_FORMAT (layout); Lisp_Object Qlayout; +DEFINE_IMAGE_INSTANTIATOR_FORMAT (native_layout); +Lisp_Object Qnative_layout; -Lisp_Object Q_descriptor, Q_height, Q_width, Q_properties, Q_items; -Lisp_Object Q_image, Q_text, Q_percent, Q_orientation, Q_justify, Q_border; Lisp_Object Qetched_in, Qetched_out, Qbevel_in, Qbevel_out; +Lisp_Object Qmake_glyph; #ifdef DEBUG_WIDGETS int debug_widget_instances; @@ -82,16 +83,14 @@ } static void -check_valid_glyph_or_instantiator (Lisp_Object data) +check_valid_instantiator (Lisp_Object data) { Lisp_Object glyph = data; if (SYMBOLP (data)) glyph = XSYMBOL (data)->value; - if (IMAGE_INSTANCEP (glyph)) - CHECK_IMAGE_INSTANCE (glyph); - else if (!CONSP (glyph) && !VECTORP (glyph)) - CHECK_BUFFER_GLYPH (glyph); + if (!CONSP (glyph) && !VECTORP (glyph)) + invalid_argument ("instantiator item must be a vector", data); } static void @@ -100,7 +99,7 @@ if (!EQ (data, Qhorizontal) && !EQ (data, Qvertical)) - signal_simple_error ("unknown orientation for layout", data); + invalid_argument ("unknown orientation for layout", data); } static void @@ -113,14 +112,14 @@ !EQ (data, Qleft) && !EQ (data, Qright)) - signal_simple_error ("unknown orientation for tab control", data); + invalid_argument ("unknown orientation for tab control", data); } static void check_valid_justification (Lisp_Object data) { if (!EQ (data, Qleft) && !EQ (data, Qright) && !EQ (data, Qcenter)) - signal_simple_error ("unknown justification for layout", data); + invalid_argument ("unknown justification for layout", data); } static void @@ -129,7 +128,7 @@ if (!EQ (data, Qt) && !EQ (data, Qetched_in) && !EQ (data, Qetched_out) && !EQ (data, Qbevel_in) && !EQ (data, Qbevel_out) && !GLYPHP (data) && !VECTORP (data)) - signal_simple_error ("unknown border style for layout", data); + invalid_argument ("unknown border style for layout", data); } static void @@ -144,11 +143,18 @@ && !COMPILED_FUNCTIONP (data) && !CONSP (data)) { - signal_simple_error (":callback must be a function or expression", data); + invalid_argument (":callback must be a function or expression", data); } } static void +check_valid_int_or_function (Lisp_Object data) +{ + if (!INTP (data) && !CONSP (data)) + invalid_argument ("must be an integer or expresssion", data); +} + +static void check_valid_symbol (Lisp_Object data) { CHECK_SYMBOL (data); @@ -158,11 +164,11 @@ check_valid_string_or_vector (Lisp_Object data) { if (!STRINGP (data) && !VECTORP (data)) - signal_simple_error (":descriptor must be a string or a vector", data); + invalid_argument (":descriptor must be a string or a vector", data); } void -check_valid_item_list_1 (Lisp_Object items) +check_valid_item_list (Lisp_Object items) { Lisp_Object rest; @@ -174,32 +180,21 @@ else if (VECTORP (XCAR (rest))) gui_parse_item_keywords (XCAR (rest)); else if (LISTP (XCAR (rest))) - check_valid_item_list_1 (XCAR (rest)); + check_valid_item_list (XCAR (rest)); else - signal_simple_error ("Items must be vectors, lists or strings", items); + invalid_argument ("Items must be vectors, lists or strings", items); } } static void -check_valid_item_list (Lisp_Object data) -{ - Lisp_Object items; - - Fcheck_valid_plist (data); - items = Fplist_get (data, Q_items, Qnil); - - check_valid_item_list_1 (items); -} - -static void -check_valid_glyph_or_instantiator_list (Lisp_Object data) +check_valid_instantiator_list (Lisp_Object data) { Lisp_Object rest; CHECK_LIST (data); EXTERNAL_LIST_LOOP (rest, data) { - check_valid_glyph_or_instantiator (XCAR (rest)); + check_valid_instantiator (XCAR (rest)); } } @@ -209,26 +204,26 @@ /* This function calls lisp. */ Lisp_Object glyph = sym; struct gcpro gcpro1; - + GCPRO1 (glyph); /* if we have a symbol get at the actual data */ if (SYMBOLP (glyph)) glyph = XSYMBOL (glyph)->value; - + if (CONSP (glyph)) glyph = Feval (glyph); /* Be really helpful to the user. */ if (VECTORP (glyph)) { - glyph = call1 (intern ("make-glyph"), glyph); + glyph = call1 (Qmake_glyph, glyph); } /* substitute the new glyph */ RETURN_UNGCPRO (glyph); } -static void +static void substitute_keyword_value (Lisp_Object inst, Lisp_Object key, Lisp_Object val) { int i; @@ -254,24 +249,24 @@ type (Qedit_field for example). It is debatable whether we should wire things in this generalised way rather than treating widgets specially in image_instance_property. */ -static Lisp_Object +static Lisp_Object widget_property (Lisp_Object image_instance, Lisp_Object prop) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); struct image_instantiator_methods* meths; - +#if 0 /* The usefulness of this is dubious. */ /* first see if its a general property ... */ if (!NILP (Fplist_member (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop))) return Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop, Qnil); - +#endif /* .. then try device specific methods ... */ - meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), - IMAGE_INSTANCE_WIDGET_TYPE (ii), + meths = decode_device_ii_format (image_instance_device (image_instance), + IMAGE_INSTANCE_WIDGET_TYPE (ii), ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, property)) return IIFORMAT_METH (meths, property, (image_instance, prop)); /* ... then format specific methods ... */ - meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), + meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, property)) return IIFORMAT_METH (meths, property, (image_instance, prop)); @@ -279,86 +274,135 @@ return Qunbound; } -static Lisp_Object -widget_set_property (Lisp_Object image_instance, Lisp_Object prop, Lisp_Object val) +/* Update the displayed properties of a widget. + + #### This has been adapted from the original set_property functions + and thus reuses the state management of that. A better solution is + to simply re-parse the instantiator when items need updating. This + make comparing differences much simpler and obviates the need for a + lot of the state variables. + + #### property is still a valid function since we have to be able to + extract information from the actual widget. + + #### update_widget should probably be re-written to use the + instantiator. We probably want to keep a record of the differences + also to make this easy. We would also need a pending_instantiator + so that changes could be delayed. */ +static void +widget_update (Lisp_Object image_instance, Lisp_Object instantiator) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); struct image_instantiator_methods* meths; - Lisp_Object ret; - /* PIck up any generic properties that we might need to keep hold + Lisp_Object text = find_keyword_in_vector (instantiator, Q_text); + /* Pick up any generic properties that we might need to keep hold of. */ - if (EQ (prop, Q_text)) + if (!NILP (text)) { - IMAGE_INSTANCE_WIDGET_TEXT (ii) = val; + IMAGE_INSTANCE_WIDGET_TEXT (ii) = text; + IMAGE_INSTANCE_TEXT_CHANGED (ii) = 1; } /* Now try device specific methods first ... */ - meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), + meths = decode_device_ii_format (image_instance_device (image_instance), + IMAGE_INSTANCE_WIDGET_TYPE (ii), + ERROR_ME_NOT); + MAYBE_IIFORMAT_METH (meths, update, (image_instance, instantiator)); + /* ... then format specific methods ... */ + meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), + ERROR_ME_NOT); + MAYBE_IIFORMAT_METH (meths, update, (image_instance, instantiator)); +#if 0 /* The usefulness of this is dubious. */ + /* we didn't do any device specific properties, so shove the property in our plist. */ + IMAGE_INSTANCE_WIDGET_PROPS (ii) + = Fplist_put (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop, val); +#endif +} + +/* Like the rest of redisplay, we want widget updates to occur + asynchronously. Thus toolkit specific methods for setting + properties must be called by redisplay instead of by *_update. Thus + *_update records the change and this function actually implements + it. We want to be slightly clever about this however by supplying + format specific functions for the updates instead of lumping them + all into this function. Note that there is no need for format + generic functions. This is not the same as widget_update! */ +void +redisplay_widget (Lisp_Object widget) +{ + Lisp_Image_Instance* ii = XIMAGE_INSTANCE (widget); + struct image_instantiator_methods* meths; + + if (!WIDGET_IMAGE_INSTANCEP (widget) + || EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout) + || EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qnative_layout)) + return; + + /* Device-format specific methods - e.g. x_tab_control_redisplay () */ + meths = decode_device_ii_format (image_instance_device (widget), IMAGE_INSTANCE_WIDGET_TYPE (ii), ERROR_ME_NOT); - if (meths && HAS_IIFORMAT_METH_P (meths, set_property) - && - !UNBOUNDP (ret = - IIFORMAT_METH (meths, set_property, (image_instance, prop, val)))) + MAYBE_IIFORMAT_METH (meths, redisplay, (widget)); + + /* Device generic methods - e.g. x_redisplay_widget (). We must + update the widget's size as it may have been changed by the the + layout routines. We also do this here so that explicit resizing + from lisp does not result in synchronous updates. Do this last so + that format-specific methods have an opportunity to prevent + wholesale changes - e.g. rebuilding tabs. */ + MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), redisplay_widget, (ii)); + + /* Pick up the items we recorded earlier. */ + if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) { - return ret; + IMAGE_INSTANCE_WIDGET_ITEMS (ii) = + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii); + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; } - /* ... then format specific methods ... */ - meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), - ERROR_ME_NOT); - if (meths && HAS_IIFORMAT_METH_P (meths, set_property) - && - !UNBOUNDP (ret = - IIFORMAT_METH (meths, set_property, (image_instance, prop, val)))) - { - return ret; - } - /* we didn't do any device specific properties, so shove the property in our plist */ - IMAGE_INSTANCE_WIDGET_PROPS (ii) - = Fplist_put (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop, val); - return val; } /* Query for a widgets desired geometry. If no type specific method is provided then use the widget text to calculate sizes. */ -static void -widget_query_geometry (Lisp_Object image_instance, - unsigned int* width, unsigned int* height, +static void +widget_query_geometry (Lisp_Object image_instance, + int* width, int* height, enum image_instance_geometry disp, Lisp_Object domain) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); struct image_instantiator_methods* meths; + Lisp_Object dynamic_width = Qnil; + Lisp_Object dynamic_height = Qnil; /* First just set up what we already have. */ if (width) *width = IMAGE_INSTANCE_WIDTH (ii); if (height) *height = IMAGE_INSTANCE_HEIGHT (ii); - + if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) || IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii)) { /* .. then try device specific methods ... */ - meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), - IMAGE_INSTANCE_WIDGET_TYPE (ii), + meths = decode_device_ii_format (image_instance_device (image_instance), + IMAGE_INSTANCE_WIDGET_TYPE (ii), ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, query_geometry)) - IIFORMAT_METH (meths, query_geometry, (image_instance, + IIFORMAT_METH (meths, query_geometry, (image_instance, width, height, disp, domain)); else { /* ... then format specific methods ... */ - meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), + meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, query_geometry)) - IIFORMAT_METH (meths, query_geometry, (image_instance, + IIFORMAT_METH (meths, query_geometry, (image_instance, width, height, disp, domain)); - else + else { - unsigned int w, h; - + int w, h; + /* Then if we are allowed to resize the widget, make the size the same as the text dimensions. */ query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii), @@ -371,32 +415,49 @@ *height = h + 2 * WIDGET_BORDER_HEIGHT; } } + /* Finish off with dynamic sizing. */ + if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii))) + { + dynamic_width = Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)); + if (INTP (dynamic_width)) + *width = XINT (dynamic_width); + } + if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii))) + { + dynamic_height = Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)); + if (INTP (dynamic_height)) + *height = XINT (dynamic_height); + } } } -static void -widget_layout (Lisp_Object image_instance, - unsigned int width, unsigned int height, Lisp_Object domain) +static int +widget_layout (Lisp_Object image_instance, + int width, int height, int xoffset, int yoffset, + Lisp_Object domain) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); struct image_instantiator_methods* meths; /* .. then try device specific methods ... */ - meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), - IMAGE_INSTANCE_WIDGET_TYPE (ii), + meths = decode_device_ii_format (image_instance_device (image_instance), + IMAGE_INSTANCE_WIDGET_TYPE (ii), ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, layout)) - IIFORMAT_METH (meths, layout, (image_instance, - width, height, domain)); + return IIFORMAT_METH (meths, layout, (image_instance, + width, height, xoffset, yoffset, + domain)); else { /* ... then format specific methods ... */ - meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), + meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, layout)) - IIFORMAT_METH (meths, layout, (image_instance, - width, height, domain)); + return IIFORMAT_METH (meths, layout, (image_instance, + width, height, xoffset, yoffset, + domain)); } + return 1; } static void @@ -405,38 +466,41 @@ Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor); if (NILP (desc)) - signal_simple_error ("Must supply :descriptor", instantiator); + syntax_error ("Must supply :descriptor", instantiator); if (VECTORP (desc)) gui_parse_item_keywords (desc); if (!NILP (find_keyword_in_vector (instantiator, Q_width)) && !NILP (find_keyword_in_vector (instantiator, Q_pixel_width))) - signal_simple_error ("Must supply only one of :width and :pixel-width", instantiator); + syntax_error ("Must supply only one of :width and :pixel-width", instantiator); if (!NILP (find_keyword_in_vector (instantiator, Q_height)) && !NILP (find_keyword_in_vector (instantiator, Q_pixel_height))) - signal_simple_error ("Must supply only one of :height and :pixel-height", instantiator); + syntax_error ("Must supply only one of :height and :pixel-height", instantiator); } static void combo_box_validate (Lisp_Object instantiator) { widget_validate (instantiator); - if (NILP (find_keyword_in_vector (instantiator, Q_properties))) - signal_simple_error ("Must supply item list", instantiator); + if (NILP (find_keyword_in_vector (instantiator, Q_items))) + syntax_error ("Must supply item list", instantiator); } /* we need to convert things like glyphs to images, eval expressions etc.*/ static Lisp_Object -widget_normalize (Lisp_Object inst, Lisp_Object console_type) +widget_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { /* This function can call lisp */ Lisp_Object glyph = find_keyword_in_vector (inst, Q_image); /* we need to eval glyph if its an expression, we do this for the - same reasons we normalize file to data. */ + same reasons we normalize file to data. + + #### should just normalize the data. */ if (!NILP (glyph)) { substitute_keyword_value (inst, Q_image, glyph_instantiator_to_glyph (glyph)); @@ -453,9 +517,13 @@ IMAGE_INSTANCE_WIDGET_PROPS (ii) = Qnil; SET_IMAGE_INSTANCE_WIDGET_FACE (ii, Qnil); IMAGE_INSTANCE_WIDGET_ITEMS (ii) = allocate_gui_item (); + IMAGE_INSTANCE_LAYOUT_CHILDREN (ii) = Qnil; + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii) = Qnil; + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii) = Qnil; IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 1; IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 1; - IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = 0; + IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = LAYOUT_HORIZONTAL; IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) = 0; } @@ -470,6 +538,9 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { + /* #### practically all of this should be moved to widget_update() + so that users can dynamically change all possible widget + properties. */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object face = find_keyword_in_vector (instantiator, Q_face); Lisp_Object height = find_keyword_in_vector (instantiator, Q_height); @@ -478,78 +549,34 @@ Lisp_Object pixheight = find_keyword_in_vector (instantiator, Q_pixel_height); Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor); Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image); - Lisp_Object props = find_keyword_in_vector (instantiator, Q_properties); Lisp_Object items = find_keyword_in_vector (instantiator, Q_items); Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation); + Lisp_Object mwidth = find_keyword_in_vector (instantiator, Q_margin_width); + Lisp_Object ifocus = find_keyword_in_vector (instantiator, Q_initial_focus); int pw=0, ph=0, tw=0, th=0; - + /* this just does pixel type sizing */ subwindow_instantiate (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, domain); - if (!(dest_mask & (IMAGE_WIDGET_MASK | IMAGE_LAYOUT_MASK))) - incompatible_image_types (instantiator, dest_mask, - IMAGE_WIDGET_MASK | IMAGE_LAYOUT_MASK); + if (!(dest_mask & IMAGE_WIDGET_MASK)) + incompatible_image_types (instantiator, dest_mask, IMAGE_WIDGET_MASK); initialize_widget_image_instance (ii, XVECTOR_DATA (instantiator)[0]); IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET; - IMAGE_INSTANCE_WIDGET_PROPS (ii) = props; /* retrieve the fg and bg colors */ if (!NILP (face)) SET_IMAGE_INSTANCE_WIDGET_FACE (ii, Fget_face (face)); - - /* Do layout specific initialisation. This feels a bit tacky, but - the alternative is a myriad of different little functions. */ - if (EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout)) - { - Lisp_Object rest, children = Qnil; - Lisp_Object border = find_keyword_in_vector (instantiator, Q_border); - if (NILP (orient)) - { - IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = LAYOUT_VERTICAL; - } - IMAGE_INSTANCE_TYPE (ii) = IMAGE_LAYOUT; - - if (EQ (border, Qt)) - { - IMAGE_INSTANCE_LAYOUT_BORDER (ii) = Qetched_in; - } - else if (GLYPHP (border)) - { - /* We are going to be sneaky here and add the border text as - just another child, the layout and output routines don't know - this and will just display at the offsets we prescribe. */ - children = Fcons (glyph_image_instance (border, domain, ERROR_ME, 1), - children); - IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (0); - } - else - { - IMAGE_INSTANCE_LAYOUT_BORDER (ii) = border; - } - - /* Pick up the sub-widgets. */ - LIST_LOOP (rest, items) - { - /* make sure the image is instantiated */ - Lisp_Object gii = glyph_image_instance (XCAR (rest), domain, ERROR_ME, 1); - children = Fcons (gii, children); - /* Make sure elements in the layout are in the order the - user expected. */ - children = Fnreverse (children); - } - IMAGE_INSTANCE_LAYOUT_CHILDREN (ii) = children; - } /* retrieve the gui item information. This is easy if we have been provided with a vector, more difficult if we have just been given keywords */ - else if (STRINGP (desc) || NILP (desc)) + if (STRINGP (desc) || NILP (desc)) { /* big cheat - we rely on the fact that a gui item looks like an instantiator */ - IMAGE_INSTANCE_WIDGET_ITEMS (ii) = + IMAGE_INSTANCE_WIDGET_ITEMS (ii) = gui_parse_item_keywords_no_errors (instantiator); IMAGE_INSTANCE_WIDGET_TEXT (ii) = desc; } @@ -559,22 +586,15 @@ /* Pick up the orientation before we do our first layout. */ if (EQ (orient, Qleft) || EQ (orient, Qright) || EQ (orient, Qvertical)) - IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = 1; + IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = LAYOUT_VERTICAL; /* parse more gui items out of the properties */ - if (!NILP (props) - && !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout)) + if (!NILP (items) && !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout) + && !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qnative_layout)) { - if (NILP (items)) - { - items = Fplist_get (props, Q_items, Qnil); - } - if (!NILP (items)) - { - IMAGE_INSTANCE_WIDGET_ITEMS (ii) = - Fcons (IMAGE_INSTANCE_WIDGET_ITEMS (ii), - parse_gui_item_tree_children (items)); - } + IMAGE_INSTANCE_WIDGET_ITEMS (ii) = + Fcons (IMAGE_INSTANCE_WIDGET_ITEMS (ii), + parse_gui_item_tree_children (items)); } /* Normalize size information. We now only assign sizes if the user @@ -583,8 +603,13 @@ geometry gets called. */ if (!NILP (pixwidth)) /* pixwidth takes precendent */ { - pw = XINT (pixwidth); - IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; + if (!INTP (pixwidth)) + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii) = pixwidth; + else + { + pw = XINT (pixwidth); + IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; + } } else if (!NILP (width)) { @@ -594,8 +619,13 @@ if (!NILP (pixheight)) { - ph = XINT (pixheight); - IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; + if (!INTP (pixheight)) + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii) = pixheight; + else + { + ph = XINT (pixheight); + IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; + } } else if (!NILP (height) && XINT (height) > 1) { @@ -622,24 +652,32 @@ if (!NILP (glyph)) { if (!pw) - pw = glyph_width (glyph, domain) + 2 * WIDGET_BORDER_WIDTH; + pw = glyph_width (glyph, image_instance) + 2 * WIDGET_BORDER_WIDTH; if (!ph) - ph = glyph_height (glyph, domain) + 2 * WIDGET_BORDER_HEIGHT; + ph = glyph_height (glyph, image_instance) + 2 * WIDGET_BORDER_HEIGHT; IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; } - /* When we create the widgets the window system expects a valid - size, so If we still don' t have sizes, call layout to pick them - up. If query_geometry or layout relies on the widget being in - existence then we are in catch 22. */ - image_instance_layout (image_instance, - pw ? pw : IMAGE_UNSPECIFIED_GEOMETRY, - ph ? ph : IMAGE_UNSPECIFIED_GEOMETRY, - domain); - /* Layout has already been done so we don't need to re-layout. */ - IMAGE_INSTANCE_DIRTYP (ii) = 0; + /* Pick up the margin width. */ + if (!NILP (mwidth)) + IMAGE_INSTANCE_MARGIN_WIDTH (ii) = XINT (mwidth); + + IMAGE_INSTANCE_WANTS_INITIAL_FOCUS (ii) = !NILP (ifocus); + /* Layout for the layout widget is premature at this point since the + children will not have been instantiated. We can't instantiate + them until the device instantiation method for the layout has + been executed. We do however want to record any specified + dimensions. */ + if (pw) IMAGE_INSTANCE_WIDTH (ii) = pw; + if (ph) IMAGE_INSTANCE_HEIGHT (ii) = ph; +} + +static void +widget_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, + Lisp_Object domain) +{ #ifdef DEBUG_WIDGETS debug_widget_instances++; stderr_out ("instantiated "); @@ -648,16 +686,43 @@ #endif } +/* Get the geometry of a button control. We need to adjust the size + depending on the type of button. */ +static void +button_query_geometry (Lisp_Object image_instance, + int* width, int* height, + enum image_instance_geometry disp, Lisp_Object domain) +{ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + int w, h; + query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii), + IMAGE_INSTANCE_WIDGET_FACE (ii), + &w, &h, 0, domain); + /* Adjust the size for borders. */ + if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii)) + { + *width = w + 2 * WIDGET_BORDER_WIDTH; + + if (EQ (XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEM (ii))->style, Qradio) + || + EQ (XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEM (ii))->style, Qtoggle)) + /* This is an approximation to the size of the actual button bit. */ + *width += 12; + } + if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii)) + *height = h + 2 * WIDGET_BORDER_HEIGHT; +} + /* tree-view geometry - get the height right */ static void -tree_view_query_geometry (Lisp_Object image_instance, - unsigned int* width, unsigned int* height, +tree_view_query_geometry (Lisp_Object image_instance, + int* width, int* height, enum image_instance_geometry disp, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii); - + if (*width) { /* #### what should this be. reconsider when X has tree views. */ @@ -677,23 +742,23 @@ /* Get the geometry of a tab control. This is based on the number of items and text therin in the tab control. */ static void -tab_control_query_geometry (Lisp_Object image_instance, - unsigned int* width, unsigned int* height, +tab_control_query_geometry (Lisp_Object image_instance, + int* width, int* height, enum image_instance_geometry disp, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii); + Lisp_Object items = XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); Lisp_Object rest; - unsigned int tw = 0, th = 0; + int tw = 0, th = 0; LIST_LOOP (rest, items) { - unsigned int h, w; + int h, w; query_string_geometry (XGUI_ITEM (XCAR (rest))->name, IMAGE_INSTANCE_WIDGET_FACE (ii), &w, &h, 0, domain); - tw += 2 * WIDGET_BORDER_WIDTH; /* some bias */ + tw += 5 * WIDGET_BORDER_WIDTH; /* some bias */ tw += w; th = max (th, h + 2 * WIDGET_BORDER_HEIGHT); } @@ -711,41 +776,263 @@ } } +/* Update the contents of a tab control. */ +static void +tab_control_update (Lisp_Object image_instance, + Lisp_Object instantiator) +{ + Lisp_Object items = find_keyword_in_vector (instantiator, Q_items); + /* Record new items for update. *_tab_control_redisplay will do the + rest. */ + if (!NILP (items)) + { + Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); + check_valid_item_list (items); +#ifdef DEBUG_WIDGET_OUTPUT + stderr_out ("tab control %p updated\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); +#endif + /* Don't set the actual items since we might decide not to use + the new ones (because nothing has really changed). If we did + set them and didn't use them then we would get into whole + heaps of trouble when the old items get GC'd. */ + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = + Fcons (XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)), + parse_gui_item_tree_children (items)); + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 1; + } +} + +/* Determine whether only the order has changed for a tab. */ +int tab_control_order_only_changed (Lisp_Object image_instance) +{ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + int found = 0, len, pending_len; + Lisp_Object rest; + + /* Degenerate case. */ + if (NILP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) + return 1; + + /* See whether we just need a change in order. */ + GET_LIST_LENGTH (IMAGE_INSTANCE_WIDGET_ITEMS (ii), len); + GET_LIST_LENGTH (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii), + pending_len); + if (len == pending_len) + { + LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) + { + Lisp_Object pending_rest; + found = 0; + LIST_LOOP (pending_rest, + XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) + { + if (gui_item_equal_sans_selected (XCAR (rest), + XCAR (pending_rest), 0)) + { + found = 1; + break; + } + } + if (!found) + break; + } + } + return found; +} + +/* Set the properties of a progress gauge */ +static void +progress_gauge_update (Lisp_Object image_instance, + Lisp_Object instantiator) +{ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + Lisp_Object value = find_keyword_in_vector (instantiator, Q_value); + + if (!NILP (value)) + { + CHECK_INT (value); +#ifdef DEBUG_WIDGET_OUTPUT + stderr_out ("progress gauge value set to %ld\n", XINT (value)); +#endif + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = + copy_gui_item_tree (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); +#ifdef ERROR_CHECK_GLYPHS + assert (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))); +#endif + if (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) + XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))->value = value; + + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 1; + } +} + /***************************************************************************** * widget layout * *****************************************************************************/ -static int -layout_possible_dest_types (void) -{ - return IMAGE_LAYOUT_MASK; -} - -/* we need to convert things like glyphs to images, eval expressions - etc.*/ +/* We need to cascade normalization.*/ static Lisp_Object -layout_normalize (Lisp_Object inst, Lisp_Object console_type) +layout_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { /* This function can call lisp */ - Lisp_Object items = find_keyword_in_vector (inst, Q_items); - Lisp_Object border = find_keyword_in_vector (inst, Q_border); - /* we need to eval glyph if its an expression, we do this for the - same reasons we normalize file to data. */ + struct gcpro gcpro1, gcpro2; + Lisp_Object alist = Qnil, new_items = Qnil, border; + /* This function can call lisp */ + Lisp_Object items; + + GCPRO2 (alist, new_items); + alist = tagged_vector_to_alist (inst); + items = assq_no_quit (Q_items, alist); + + /* We need to normalize sub-objects. */ if (!NILP (items)) { Lisp_Object rest; - LIST_LOOP (rest, items) + LIST_LOOP (rest, XCDR (items)) { - /* substitute the new glyph */ - Fsetcar (rest, glyph_instantiator_to_glyph (XCAR (rest))); + /* Substitute the new instantiator */ + new_items = Fcons (normalize_image_instantiator (XCAR (rest), + console_type, dest_mask), + new_items); + } + new_items = Fnreverse (new_items); + Fsetcdr (items, new_items); + } + /* Normalize the border spec. */ + border = assq_no_quit (Q_border, alist); + if (!NILP (border) && VECTORP (XCDR (border))) + { + Fsetcdr (border, normalize_image_instantiator (XCDR (border), + console_type, dest_mask)); + } + + { + Lisp_Object result = alist_to_tagged_vector (XVECTOR_DATA (inst)[0], + alist); + free_alist (alist); + RETURN_UNGCPRO (result); + } +} + +/* Update the instances in the layout. */ +static void +layout_update (Lisp_Object image_instance, Lisp_Object instantiator) +{ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + Lisp_Object items = find_keyword_in_vector (instantiator, Q_items); + Lisp_Object border_inst = find_keyword_in_vector (instantiator, Q_border); + Lisp_Object border = Qnil; + Lisp_Object children = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii); + int structure_changed = 0; + struct gcpro gcpro1; + + /* We want to avoid consing if we can. This is quite awkward because + we have to deal with the border as well as the items. */ + + GCPRO1 (border); + + if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))) + { + border = XCAR (children); + children = XCDR (children); + } + +#ifdef DEBUG_WIDGET_OUTPUT + stderr_out ("layout updated\n"); +#endif + /* Update the border. */ + if (!NILP (border_inst)) + { + if (VECTORP (border_inst)) + { + /* We are going to be sneaky here and add the border text as + just another child, the layout and output routines don't know + this and will just display at the offsets we prescribe. */ + if (!NILP (border)) + call3 (Qset_glyph_image, border, border_inst, + IMAGE_INSTANCE_DOMAIN (ii)); + else + { + border = Fcons (call1 (Qmake_glyph, border_inst), Qnil); + structure_changed = 1; + } + IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (0); + } + else + { + if (!NILP (border)) + { + border = Qnil; + structure_changed = 1; + } + if (EQ (border_inst, Qt)) + IMAGE_INSTANCE_LAYOUT_BORDER (ii) = Qetched_in; + else + IMAGE_INSTANCE_LAYOUT_BORDER (ii) = border_inst; } } - /* normalize the border spec. */ - if (VECTORP (border) || CONSP (border)) + + /* Pick up the sub-widgets. */ + if (!NILP (items)) { - substitute_keyword_value (inst, Q_border, glyph_instantiator_to_glyph (border)); + int len1, len2; + GET_LIST_LENGTH (items, len1); + GET_LIST_LENGTH (children, len2); + /* The structure hasn't changed so just update the images. */ + if (!structure_changed && len1 == len2) + { + /* Pick up the sub-widgets. */ + for (; !NILP (children); children = XCDR (children), items = XCDR (items)) + { + call3 (Qset_glyph_image, XCAR (children), XCAR (items), + IMAGE_INSTANCE_DOMAIN (ii)); + } + } + /* The structure has changed so start over. */ + else + { + /* Instantiate any new glyphs. */ + for (; !NILP (items); items = XCDR (items)) + { + border = Fcons (call1 (Qmake_glyph, XCAR (items)), border); + } + IMAGE_INSTANCE_LAYOUT_CHILDREN (ii) = Fnreverse (border); + } } - return inst; + UNGCPRO; +} + +static void +layout_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, + Lisp_Object pointer_fg, Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) +{ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation); + +#ifdef DEBUG_WIDGET_OUTPUT + stderr_out ("layout instantiated\n"); +#endif + /* Do widget type instantiation first. */ + widget_instantiate (image_instance, instantiator, pointer_fg, pointer_bg, + dest_mask, domain); + + if (NILP (orient)) + { + IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = LAYOUT_VERTICAL; + } + + /* Get child glyphs and finish instantiation. We can't do image + instance children yet as we might not have a containing + window. */ + layout_update (image_instance, instantiator); +} + +static void +layout_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, + Lisp_Object domain) +{ } /* Layout widget. Sizing commentary: we have a number of problems that @@ -758,30 +1045,30 @@ course these attributes can change dynamically and so the size should changed dynamically also. Only in a few limited cases should the size be fixed and remain fixed. Of course this actually means - that we don't really want to specifiy the size *at all* for most + that we don't really want to specify the size *at all* for most widgets - we want it to be discovered dynamically. Thus we can envisage the following scenarios: - + 1. A button is sized to accommodate its text, the text changes and the - button should change size also. + button should change size also. 2. A button is given an explicit size. Its size should never change. 3. Layout is put inside an area. The size of the area changes, the - layout should change with it. + layout should change with it. 4. A button grows to accommodate additional text. The whitespace around it should be modified to cope with the new layout - requirements. + requirements. 5. A button grows. The area surrounding it should grow also if - possible. + possible. What metrics are important? 1. Actual width and height. - + 2. Whether the width and height are what the widget actually wants, or - whether it can grow or shrink. + whether it can grow or shrink. Text glyphs are particularly troublesome since their metrics depend on the context in which they are being viewed. For instance they @@ -797,106 +1084,141 @@ /* Query the geometry of a layout widget. We assume that we can only get here if the size is not already fixed. */ static void -layout_query_geometry (Lisp_Object image_instance, unsigned int* width, - unsigned int* height, enum image_instance_geometry disp, +layout_query_geometry (Lisp_Object image_instance, int* width, + int* height, enum image_instance_geometry disp, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii), rest; int maxph = 0, maxpw = 0, nitems = 0, ph_adjust = 0; + int gheight, gwidth; + + /* If we are not initialized then we won't have any children. */ + if (!IMAGE_INSTANCE_INITIALIZED (ii)) + return; + + /* First just set up what we already have. */ + if (width) *width = IMAGE_INSTANCE_WIDTH (ii); + if (height) *height = IMAGE_INSTANCE_HEIGHT (ii); + + /* If we are not allowed to dynamically size then return. */ + if (!IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) + && + !IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii)) + return; + + /* Pick up the border text if we have one. */ + if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))) + { + glyph_query_geometry (XCAR (items), &gwidth, &gheight, disp, + image_instance); + ph_adjust = gheight / 2; + items = XCDR (items); + } /* Flip through the items to work out how much stuff we have to display */ LIST_LOOP (rest, items) { Lisp_Object glyph = XCAR (rest); - unsigned int gheight, gwidth; - - image_instance_query_geometry (glyph, &gwidth, &gheight, disp, domain); + glyph_query_geometry (glyph, &gwidth, &gheight, disp, image_instance); - /* Pick up the border text if we have one. */ - if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)) - && NILP (XCDR (rest))) + nitems ++; + if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) + == LAYOUT_HORIZONTAL) { - ph_adjust = gheight / 2; + maxph = max (maxph, gheight); + maxpw += gwidth; } else { - - nitems ++; - if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) - == LAYOUT_HORIZONTAL) - { - maxph = max (maxph, gheight); - maxpw += gwidth; - } - else - { - maxpw = max (maxpw, gwidth); - maxph += gheight; - } + maxpw = max (maxpw, gwidth); + maxph += gheight; } } - /* work out spacing between items and bounds of the layout. No user - provided width so we just do default spacing. */ - if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) - == LAYOUT_HORIZONTAL) - *width = maxpw + (nitems + 1) * WIDGET_BORDER_WIDTH * 2; - else - *width = maxpw + 2 * WIDGET_BORDER_WIDTH * 2; + /* Work out minimum space we need to fit all the items. This could + have been fixed by the user. */ + if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii))) + { + Lisp_Object dynamic_width = + Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)); + if (INTP (dynamic_width)) + *width = XINT (dynamic_width); + } + else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) + == LAYOUT_HORIZONTAL) + *width = maxpw + ((nitems + 1) * WIDGET_BORDER_WIDTH + + IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2; + else + *width = maxpw + 2 * (WIDGET_BORDER_WIDTH * 2 + + IMAGE_INSTANCE_MARGIN_WIDTH (ii)); /* Work out vertical spacings. */ - if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) - == LAYOUT_VERTICAL) - *height = maxph + (nitems + 1) * WIDGET_BORDER_HEIGHT * 2 + ph_adjust; - else - *height = maxph + 2 * WIDGET_BORDER_HEIGHT * 2 + ph_adjust; + if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii))) + { + Lisp_Object dynamic_height = + Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)); + if (INTP (dynamic_height)) + *height = XINT (dynamic_height); + } + else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) + == LAYOUT_VERTICAL) + *height = maxph + ((nitems + 1) * WIDGET_BORDER_HEIGHT + + IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; + else + *height = maxph + (2 * WIDGET_BORDER_HEIGHT + + IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; } - -static void -layout_layout (Lisp_Object image_instance, - unsigned int width, unsigned int height, Lisp_Object domain) +int +layout_layout (Lisp_Object image_instance, + int width, int height, int xoffset, int yoffset, + Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object rest; Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii); int x, y, maxph = 0, maxpw = 0, nitems = 0, horiz_spacing, vert_spacing, ph_adjust = 0; - unsigned int gheight, gwidth; + int gheight, gwidth; + + /* If we are not initialized then we won't have any children. */ + if (!IMAGE_INSTANCE_INITIALIZED (ii)) + return 0; - /* flip through the items to work out how much stuff we have to display */ + /* Pick up the border text if we have one. */ + if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))) + { + Lisp_Object border = XCAR (items); + items = XCDR (items); + glyph_query_geometry (border, &gwidth, &gheight, + IMAGE_DESIRED_GEOMETRY, image_instance); + ph_adjust = gheight / 2; + IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (ph_adjust); + + /* #### Really, what should this be? */ + glyph_do_layout (border, gwidth, gheight, 10, 0, + image_instance); + } + + /* Flip through the items to work out how much stuff we have to display. */ LIST_LOOP (rest, items) { Lisp_Object glyph = XCAR (rest); - - image_instance_query_geometry (glyph, &gwidth, &gheight, - IMAGE_DESIRED_GEOMETRY, domain); - /* Pick up the border text if we have one. */ - if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)) - && NILP (XCDR (rest))) + glyph_query_geometry (glyph, &gwidth, &gheight, + IMAGE_DESIRED_GEOMETRY, image_instance); + nitems ++; + if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) + == LAYOUT_HORIZONTAL) { - XIMAGE_INSTANCE_XOFFSET (glyph) = 10; /* Really, what should this be? */ - XIMAGE_INSTANCE_YOFFSET (glyph) = 0; - ph_adjust = gheight / 2; - IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (ph_adjust); + maxph = max (maxph, gheight); + maxpw += gwidth; } else { - - nitems ++; - if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) - == LAYOUT_HORIZONTAL) - { - maxph = max (maxph, gheight); - maxpw += gwidth; - } - else - { - maxpw = max (maxpw, gwidth); - maxph += gheight; - } + maxpw = max (maxpw, gwidth); + maxph += gheight; } } @@ -906,24 +1228,30 @@ just provide default spacing and will let the output routines clip.. */ horiz_spacing = WIDGET_BORDER_WIDTH * 2; - else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) + else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL) /* We have a larger area to display in so distribute the space evenly. */ - horiz_spacing = (width - maxpw) / (nitems + 1); + horiz_spacing = (width - (maxpw + + IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2)) + / (nitems + 1); else - horiz_spacing = (width - maxpw) / 2; + horiz_spacing = (width - maxpw) / 2 + - IMAGE_INSTANCE_MARGIN_WIDTH (ii); if (height < maxph) vert_spacing = WIDGET_BORDER_HEIGHT * 2; - else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) + else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_VERTICAL) - vert_spacing = (height - (maxph + ph_adjust)) / (nitems + 1); + vert_spacing = (height - (maxph + ph_adjust + + IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2)) + / (nitems + 1); else - vert_spacing = (height - (maxph + ph_adjust)) / 2; + vert_spacing = (height - (maxph + ph_adjust)) / 2 + - IMAGE_INSTANCE_MARGIN_WIDTH (ii); - y = vert_spacing + ph_adjust; - x = horiz_spacing; + y = vert_spacing + ph_adjust + IMAGE_INSTANCE_MARGIN_WIDTH (ii); + x = horiz_spacing + IMAGE_INSTANCE_MARGIN_WIDTH (ii); /* Now flip through putting items where we want them, paying attention to justification. Make sure we don't mess with the @@ -932,52 +1260,102 @@ { Lisp_Object glyph = XCAR (rest); - image_instance_query_geometry (glyph, &gwidth, &gheight, - IMAGE_DESIRED_GEOMETRY, domain); + glyph_query_geometry (glyph, &gwidth, &gheight, + IMAGE_DESIRED_GEOMETRY, image_instance); + + if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) + == LAYOUT_HORIZONTAL) + { + if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) + == LAYOUT_JUSTIFY_RIGHT) + y = height - (gheight + vert_spacing); + if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) + == LAYOUT_JUSTIFY_CENTER) + y = (height - gheight) / 2; + } + else + { + if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) + == LAYOUT_JUSTIFY_RIGHT) + x = width - (gwidth + horiz_spacing); + if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) + == LAYOUT_JUSTIFY_CENTER) + x = (width - gwidth) / 2; + } + + /* Now layout subwidgets if they require it. */ + glyph_do_layout (glyph, gwidth, gheight, x, y, image_instance); + + if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) + == LAYOUT_HORIZONTAL) + { + x += (gwidth + horiz_spacing); + } + else + { + y += (gheight + vert_spacing); + } + + } + return 1; +} + +/* Get the glyphs that comprise a layout. These are created internally + and so are otherwise inaccessible to lisp. We need some way of getting + properties from the widgets that comprise a layout and this is the + simplest way of doing it. - if (!INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)) - || !NILP (XCDR (rest))) - { - if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) - == LAYOUT_HORIZONTAL) - { - if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) - == LAYOUT_JUSTIFY_RIGHT) - y = height - (gheight + vert_spacing); - if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) - == LAYOUT_JUSTIFY_CENTER) - y = (height - gheight) / 2; - } - else - { - if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) - == LAYOUT_JUSTIFY_RIGHT) - x = width - (gwidth + horiz_spacing); - if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) - == LAYOUT_JUSTIFY_CENTER) - x = (width - gwidth) / 2; - } - - XIMAGE_INSTANCE_XOFFSET (glyph) = x; - XIMAGE_INSTANCE_YOFFSET (glyph) = y; - - if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) - == LAYOUT_HORIZONTAL) - { - x += (gwidth + horiz_spacing); - } - else - { - y += (gheight + vert_spacing); - } - } - - /* Now layout subwidgets if they require it. */ - image_instance_layout (glyph, gwidth, gheight, domain); + #### Eventually we should allow some more intelligent access to + sub-widgets. */ +static Lisp_Object +layout_property (Lisp_Object image_instance, Lisp_Object prop) +{ + /* This function can GC. */ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + if (EQ (prop, Q_items)) + { + if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)) && + CONSP (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii))) + return Fcopy_sequence (XCDR + (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii))); + else + return Fcopy_sequence (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii)); } + return Qunbound; +} - IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = width; - IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = height; +/* Layout subwindows if they are real subwindows. */ +static int +native_layout_layout (Lisp_Object image_instance, + int width, int height, int xoffset, int yoffset, + Lisp_Object domain) +{ + Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); + Lisp_Object rest; + + /* The first time this gets called, the layout will be only + partially instantiated. The children get done in + post_instantiate. */ + if (!IMAGE_INSTANCE_INITIALIZED (ii)) + return 0; + + /* Defining this overrides the default layout_layout so we first have to call that to get + suitable instances and values set up. */ + layout_layout (image_instance, width, height, xoffset, yoffset, domain); + + LIST_LOOP (rest, IMAGE_INSTANCE_LAYOUT_CHILDREN (ii)) + { + struct display_glyph_area dga; + dga.xoffset = 0; + dga.yoffset = 0; + dga.width = IMAGE_INSTANCE_WIDTH (ii); + dga.height = IMAGE_INSTANCE_HEIGHT (ii); + + map_subwindow (XCAR (rest), + IMAGE_INSTANCE_XOFFSET (ii), + IMAGE_INSTANCE_YOFFSET (ii), &dga); + } + return 1; } @@ -988,46 +1366,38 @@ void syms_of_glyphs_widget (void) { - defkeyword (&Q_descriptor, ":descriptor"); - defkeyword (&Q_height, ":height"); - defkeyword (&Q_width, ":width"); - defkeyword (&Q_properties, ":properties"); - defkeyword (&Q_items, ":items"); - defkeyword (&Q_image, ":image"); - defkeyword (&Q_percent, ":percent"); - defkeyword (&Q_text, ":text"); - defkeyword (&Q_orientation, ":orientation"); - defkeyword (&Q_justify, ":justify"); - defkeyword (&Q_border, ":border"); - - defsymbol (&Qetched_in, "etched-in"); - defsymbol (&Qetched_out, "etched-out"); - defsymbol (&Qbevel_in, "bevel-in"); - defsymbol (&Qbevel_out, "bevel-out"); + DEFSYMBOL (Qetched_in); + DEFSYMBOL (Qetched_out); + DEFSYMBOL (Qbevel_in); + DEFSYMBOL (Qbevel_out); + DEFSYMBOL (Qmake_glyph); } -#define VALID_GUI_KEYWORDS(type) do { \ - IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_active, check_valid_anything); \ - IIFORMAT_VALID_KEYWORD (type, Q_suffix, check_valid_anything); \ - IIFORMAT_VALID_KEYWORD (type, Q_keys, check_valid_string); \ - IIFORMAT_VALID_KEYWORD (type, Q_style, check_valid_symbol); \ - IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_selected, check_valid_anything); \ - IIFORMAT_VALID_KEYWORD (type, Q_filter, check_valid_anything); \ - IIFORMAT_VALID_KEYWORD (type, Q_config, check_valid_symbol); \ - IIFORMAT_VALID_KEYWORD (type, Q_included, check_valid_anything); \ - IIFORMAT_VALID_KEYWORD (type, Q_key_sequence, check_valid_string); \ - IIFORMAT_VALID_KEYWORD (type, Q_accelerator, check_valid_string); \ - IIFORMAT_VALID_KEYWORD (type, Q_label, check_valid_anything); \ - IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_callback, check_valid_callback); \ - IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_descriptor, check_valid_string_or_vector); \ +#define VALID_GUI_KEYWORDS(type) do { \ + IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_active, check_valid_anything); \ + IIFORMAT_VALID_KEYWORD (type, Q_suffix, check_valid_anything); \ + IIFORMAT_VALID_KEYWORD (type, Q_keys, check_valid_string); \ + IIFORMAT_VALID_KEYWORD (type, Q_style, check_valid_symbol); \ + IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_selected, check_valid_anything); \ + IIFORMAT_VALID_KEYWORD (type, Q_filter, check_valid_anything); \ + IIFORMAT_VALID_KEYWORD (type, Q_config, check_valid_symbol); \ + IIFORMAT_VALID_KEYWORD (type, Q_included, check_valid_anything); \ + IIFORMAT_VALID_KEYWORD (type, Q_initial_focus, check_valid_anything); \ + IIFORMAT_VALID_KEYWORD (type, Q_key_sequence, check_valid_string); \ + IIFORMAT_VALID_KEYWORD (type, Q_accelerator, check_valid_string); \ + IIFORMAT_VALID_KEYWORD (type, Q_label, check_valid_anything); \ + IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_callback, check_valid_callback); \ + IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_callback_ex, check_valid_callback); \ + IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_descriptor, \ + check_valid_string_or_vector); \ } while (0) -#define VALID_WIDGET_KEYWORDS(type) do { \ - IIFORMAT_VALID_KEYWORD (type, Q_width, check_valid_int); \ - IIFORMAT_VALID_KEYWORD (type, Q_height, check_valid_int); \ - IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int); \ - IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int); \ - IIFORMAT_VALID_KEYWORD (type, Q_face, check_valid_face); \ +#define VALID_WIDGET_KEYWORDS(type) do { \ + IIFORMAT_VALID_KEYWORD (type, Q_width, check_valid_int); \ + IIFORMAT_VALID_KEYWORD (type, Q_height, check_valid_int); \ + IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int_or_function); \ + IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int_or_function); \ + IIFORMAT_VALID_KEYWORD (type, Q_face, check_valid_face); \ } while (0) @@ -1035,7 +1405,7 @@ { /* we only do this for properties */ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM (widget, "widget"); IIFORMAT_HAS_METHOD (widget, property); - IIFORMAT_HAS_METHOD (widget, set_property); + IIFORMAT_HAS_METHOD (widget, update); IIFORMAT_HAS_METHOD (widget, query_geometry); IIFORMAT_HAS_METHOD (widget, layout); } @@ -1046,9 +1416,12 @@ IIFORMAT_HAS_SHARED_METHOD (button, validate, widget); IIFORMAT_HAS_SHARED_METHOD (button, possible_dest_types, widget); IIFORMAT_HAS_SHARED_METHOD (button, instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (button, post_instantiate, widget); IIFORMAT_HAS_SHARED_METHOD (button, normalize, widget); + IIFORMAT_HAS_SHARED_METHOD (button, governing_domain, subwindow); + IIFORMAT_HAS_METHOD (button, query_geometry); IIFORMAT_VALID_KEYWORD (button, - Q_image, check_valid_glyph_or_instantiator); + Q_image, check_valid_instantiator); VALID_WIDGET_KEYWORDS (button); VALID_GUI_KEYWORDS (button); } @@ -1059,6 +1432,8 @@ IIFORMAT_HAS_SHARED_METHOD (edit_field, validate, widget); IIFORMAT_HAS_SHARED_METHOD (edit_field, possible_dest_types, widget); IIFORMAT_HAS_SHARED_METHOD (edit_field, instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (edit_field, post_instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (edit_field, governing_domain, subwindow); VALID_WIDGET_KEYWORDS (edit_field); VALID_GUI_KEYWORDS (edit_field); } @@ -1068,13 +1443,16 @@ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (combo_box, "combo-box"); IIFORMAT_HAS_METHOD (combo_box, validate); IIFORMAT_HAS_SHARED_METHOD (combo_box, possible_dest_types, widget); + IIFORMAT_HAS_SHARED_METHOD (combo_box, governing_domain, subwindow); + VALID_GUI_KEYWORDS (combo_box); IIFORMAT_VALID_KEYWORD (combo_box, Q_width, check_valid_int); IIFORMAT_VALID_KEYWORD (combo_box, Q_height, check_valid_int); - IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width, check_valid_int); + IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width, + check_valid_int_or_function); IIFORMAT_VALID_KEYWORD (combo_box, Q_face, check_valid_face); - IIFORMAT_VALID_KEYWORD (combo_box, Q_properties, check_valid_item_list); + IIFORMAT_VALID_KEYWORD (combo_box, Q_items, check_valid_item_list); } static void image_instantiator_scrollbar (void) @@ -1083,10 +1461,14 @@ IIFORMAT_HAS_SHARED_METHOD (scrollbar, validate, widget); IIFORMAT_HAS_SHARED_METHOD (scrollbar, possible_dest_types, widget); IIFORMAT_HAS_SHARED_METHOD (scrollbar, instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (scrollbar, post_instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (scrollbar, governing_domain, subwindow); VALID_GUI_KEYWORDS (scrollbar); - IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, check_valid_int); - IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int); + IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, + check_valid_int_or_function); + IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, + check_valid_int_or_function); IIFORMAT_VALID_KEYWORD (scrollbar, Q_face, check_valid_face); } @@ -1096,8 +1478,13 @@ IIFORMAT_HAS_SHARED_METHOD (progress_gauge, validate, widget); IIFORMAT_HAS_SHARED_METHOD (progress_gauge, possible_dest_types, widget); IIFORMAT_HAS_SHARED_METHOD (progress_gauge, instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (progress_gauge, post_instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (progress_gauge, governing_domain, subwindow); + IIFORMAT_HAS_METHOD (progress_gauge, update); VALID_WIDGET_KEYWORDS (progress_gauge); VALID_GUI_KEYWORDS (progress_gauge); + + IIFORMAT_VALID_KEYWORD (progress_gauge, Q_value, check_valid_int); } static void image_instantiator_tree_view (void) @@ -1106,10 +1493,13 @@ IIFORMAT_HAS_SHARED_METHOD (tree_view, validate, combo_box); IIFORMAT_HAS_SHARED_METHOD (tree_view, possible_dest_types, widget); IIFORMAT_HAS_SHARED_METHOD (tree_view, instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (tree_view, post_instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (tree_view, governing_domain, subwindow); + IIFORMAT_HAS_SHARED_METHOD (tree_view, update, tab_control); IIFORMAT_HAS_METHOD (tree_view, query_geometry); VALID_WIDGET_KEYWORDS (tree_view); VALID_GUI_KEYWORDS (tree_view); - IIFORMAT_VALID_KEYWORD (tree_view, Q_properties, check_valid_item_list); + IIFORMAT_VALID_KEYWORD (tree_view, Q_items, check_valid_item_list); } static void image_instantiator_tab_control (void) @@ -1118,11 +1508,15 @@ IIFORMAT_HAS_SHARED_METHOD (tab_control, validate, combo_box); IIFORMAT_HAS_SHARED_METHOD (tab_control, possible_dest_types, widget); IIFORMAT_HAS_SHARED_METHOD (tab_control, instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (tab_control, post_instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (tab_control, governing_domain, subwindow); IIFORMAT_HAS_METHOD (tab_control, query_geometry); + IIFORMAT_HAS_METHOD (tab_control, update); VALID_WIDGET_KEYWORDS (tab_control); VALID_GUI_KEYWORDS (tab_control); - IIFORMAT_VALID_KEYWORD (tab_control, Q_orientation, check_valid_tab_orientation); - IIFORMAT_VALID_KEYWORD (tab_control, Q_properties, check_valid_item_list); + IIFORMAT_VALID_KEYWORD (tab_control, Q_orientation, + check_valid_tab_orientation); + IIFORMAT_VALID_KEYWORD (tab_control, Q_items, check_valid_item_list); } static void image_instantiator_labels (void) @@ -1130,25 +1524,53 @@ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (label, "label"); IIFORMAT_HAS_SHARED_METHOD (label, possible_dest_types, widget); IIFORMAT_HAS_SHARED_METHOD (label, instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (label, post_instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (label, governing_domain, subwindow); VALID_WIDGET_KEYWORDS (label); IIFORMAT_VALID_KEYWORD (label, Q_descriptor, check_valid_string); } +#define VALID_LAYOUT_KEYWORDS(layout) \ + VALID_WIDGET_KEYWORDS (layout); \ + IIFORMAT_VALID_KEYWORD (layout, Q_orientation, check_valid_orientation); \ + IIFORMAT_VALID_KEYWORD (layout, Q_justify, check_valid_justification); \ + IIFORMAT_VALID_KEYWORD (layout, Q_border, check_valid_border); \ + IIFORMAT_VALID_KEYWORD (layout, Q_margin_width, check_valid_int); \ + IIFORMAT_VALID_KEYWORD (layout, Q_items, \ + check_valid_instantiator_list) + static void image_instantiator_layout (void) { INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (layout, "layout"); - IIFORMAT_HAS_METHOD (layout, possible_dest_types); - IIFORMAT_HAS_SHARED_METHOD (layout, instantiate, widget); + IIFORMAT_HAS_SHARED_METHOD (layout, possible_dest_types, widget); + IIFORMAT_HAS_METHOD (layout, instantiate); + IIFORMAT_HAS_METHOD (layout, post_instantiate); + IIFORMAT_HAS_SHARED_METHOD (layout, governing_domain, subwindow); IIFORMAT_HAS_METHOD (layout, normalize); IIFORMAT_HAS_METHOD (layout, query_geometry); IIFORMAT_HAS_METHOD (layout, layout); - IIFORMAT_VALID_KEYWORD (layout, Q_pixel_width, check_valid_int); - IIFORMAT_VALID_KEYWORD (layout, Q_pixel_height, check_valid_int); - IIFORMAT_VALID_KEYWORD (layout, Q_orientation, check_valid_orientation); - IIFORMAT_VALID_KEYWORD (layout, Q_justify, check_valid_justification); - IIFORMAT_VALID_KEYWORD (layout, Q_border, check_valid_border); - IIFORMAT_VALID_KEYWORD (layout, Q_items, - check_valid_glyph_or_instantiator_list); + IIFORMAT_HAS_METHOD (layout, update); + IIFORMAT_HAS_METHOD (layout, property); + + VALID_GUI_KEYWORDS (layout); + VALID_LAYOUT_KEYWORDS (layout); +} + +static void image_instantiator_native_layout (void) +{ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (native_layout, "native-layout"); + IIFORMAT_HAS_SHARED_METHOD (native_layout, possible_dest_types, widget); + IIFORMAT_HAS_SHARED_METHOD (native_layout, instantiate, layout); + IIFORMAT_HAS_SHARED_METHOD (native_layout, post_instantiate, layout); + IIFORMAT_HAS_METHOD (native_layout, layout); + IIFORMAT_HAS_SHARED_METHOD (native_layout, governing_domain, subwindow); + IIFORMAT_HAS_SHARED_METHOD (native_layout, normalize, layout); + IIFORMAT_HAS_SHARED_METHOD (native_layout, query_geometry, layout); + IIFORMAT_HAS_SHARED_METHOD (native_layout, layout, layout); + IIFORMAT_HAS_SHARED_METHOD (native_layout, property, layout); + + VALID_GUI_KEYWORDS (native_layout); + VALID_LAYOUT_KEYWORDS (native_layout); } void @@ -1164,6 +1586,7 @@ image_instantiator_tab_control(); image_instantiator_labels(); image_instantiator_layout(); + image_instantiator_native_layout(); } void diff -r 72a7cfa4a488 -r abe6d1db359e src/glyphs-x.c --- a/src/glyphs-x.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/glyphs-x.c Mon Aug 13 11:35:02 2007 +0200 @@ -17,7 +17,6 @@ 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, @@ -25,6 +24,8 @@ /* Synched up with: Not in FSF. */ +/* 7-8-00 This file is more or less Mule-ized in my Mule workspace. */ + /* Original author: Jamie Zawinski for 19.8 font-truename stuff added by Jamie Zawinski for 19.10 subwindow support added by Chuck Thompson @@ -98,7 +99,6 @@ DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (layout); #ifdef HAVE_JPEG DECLARE_IMAGE_INSTANTIATOR_FORMAT (jpeg); #endif @@ -128,7 +128,9 @@ DEFINE_IMAGE_INSTANTIATOR_FORMAT (autodetect); #ifdef HAVE_WIDGETS +DECLARE_IMAGE_INSTANTIATOR_FORMAT (layout); DEFINE_DEVICE_IIFORMAT (x, widget); +DEFINE_DEVICE_IIFORMAT (x, native_layout); DEFINE_DEVICE_IIFORMAT (x, button); DEFINE_DEVICE_IIFORMAT (x, progress_gauge); DEFINE_DEVICE_IIFORMAT (x, edit_field); @@ -264,7 +266,7 @@ gr = *ip++; bl = *ip++; conv.val = pixarray[QUANT_GET_COLOR(qtable,rd,gr,bl)]; -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN if (outimg->byte_order == MSBFirst) for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q]; else @@ -339,7 +341,7 @@ bl = *ip++ >> (8 - bbits); conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift); -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN if (outimg->byte_order == MSBFirst) for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q]; else @@ -394,11 +396,14 @@ if (!p->data) return; - if (DEVICE_LIVE_P (XDEVICE (p->device))) + if (DEVICE_LIVE_P (XDEVICE (IMAGE_INSTANCE_DEVICE (p)))) { - Display *dpy = DEVICE_X_DISPLAY (XDEVICE (p->device)); - - if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET) + Display *dpy = DEVICE_X_DISPLAY + (XDEVICE (IMAGE_INSTANCE_DEVICE (p))); + if (0) + ; +#ifdef HAVE_WIDGETS + else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET) { if (IMAGE_INSTANCE_SUBWINDOW_ID (p)) { @@ -408,9 +413,15 @@ #endif lw_destroy_widget (IMAGE_INSTANCE_X_WIDGET_ID (p)); lw_destroy_widget (IMAGE_INSTANCE_X_CLIPWIDGET (p)); - IMAGE_INSTANCE_SUBWINDOW_ID (p) = 0; + + /* We can release the callbacks again. */ + ungcpro_popup_callbacks (IMAGE_INSTANCE_X_WIDGET_LWID (p)); + + IMAGE_INSTANCE_X_WIDGET_ID (p) = 0; + IMAGE_INSTANCE_X_CLIPWIDGET (p) = 0; } } +#endif else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW) { if (IMAGE_INSTANCE_SUBWINDOW_ID (p)) @@ -975,7 +986,7 @@ } } -int read_bitmap_data_from_file (CONST char *filename, unsigned int *width, +int read_bitmap_data_from_file (const char *filename, unsigned int *width, unsigned int *height, unsigned char **datap, int *x_hot, int *y_hot) { @@ -989,7 +1000,7 @@ static Pixmap pixmap_from_xbm_inline (Lisp_Object device, int width, int height, /* Note that data is in ext-format! */ - CONST Extbyte *bits) + const Extbyte *bits) { return XCreatePixmapFromBitmapData (DEVICE_X_DISPLAY (XDEVICE(device)), XtWindow (DEVICE_XT_APP_SHELL (XDEVICE (device))), @@ -1004,7 +1015,7 @@ init_image_instance_from_xbm_inline (Lisp_Image_Instance *ii, int width, int height, /* Note that data is in ext-format! */ - CONST char *bits, + const char *bits, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, @@ -1142,7 +1153,7 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, int width, int height, /* Note that data is in ext-format! */ - CONST char *bits) + const char *bits) { Lisp_Object mask_data = find_keyword_in_vector (instantiator, Q_mask_data); Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file); @@ -1151,15 +1162,13 @@ if (!NILP (mask_data)) { - CONST char *ext_data; - - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (mask_data))), - C_STRING_ALLOCA, ext_data, - Qbinary); + const char *ext_data; + + LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (mask_data))), ext_data, Qbinary); mask = pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii), XINT (XCAR (mask_data)), XINT (XCAR (XCDR (mask_data))), - (CONST unsigned char *) ext_data); + (const unsigned char *) ext_data); } init_image_instance_from_xbm_inline (ii, width, height, bits, @@ -1175,13 +1184,11 @@ int dest_mask, Lisp_Object domain) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - CONST char *ext_data; + const char *ext_data; assert (!NILP (data)); - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (data))), - C_STRING_ALLOCA, ext_data, - Qbinary); + LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (data))), ext_data, Qbinary); xbm_instantiate_1 (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, XINT (XCAR (data)), @@ -1660,15 +1667,14 @@ { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); int i, stattis; - char *p, *bits, *bp; - CONST char * volatile emsg = 0; - CONST char * volatile dstring; + char *bits, *bp; + const char *p; + const char * volatile emsg = 0; + const char * volatile dstring; assert (!NILP (data)); - TO_EXTERNAL_FORMAT (LISP_STRING, data, - C_STRING_ALLOCA, dstring, - Qbinary); + LISP_STRING_TO_EXTERNAL (data, dstring, Qbinary); if ((p = strchr (dstring, ':'))) { @@ -1732,7 +1738,8 @@ static Lisp_Object autodetect_normalize (Lisp_Object instantiator, - Lisp_Object console_type) + Lisp_Object console_type, + Lisp_Object dest_mask) { Lisp_Object file = find_keyword_in_vector (instantiator, Q_data); Lisp_Object filename = Qnil; @@ -1839,10 +1846,8 @@ alist = tagged_vector_to_alist (instantiator); if (dest_mask & IMAGE_POINTER_MASK) { - CONST char *name_ext; - TO_EXTERNAL_FORMAT (LISP_STRING, data, - C_STRING_ALLOCA, name_ext, - Qfile_name); + const char *name_ext; + LISP_STRING_TO_EXTERNAL (data, name_ext, Qfile_name); if (XmuCursorNameToIndex (name_ext) != -1) { result = alist_to_tagged_vector (Qcursor_font, alist); @@ -2031,7 +2036,7 @@ Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); Display *dpy; int i; - CONST char *name_ext; + const char *name_ext; Lisp_Object foreground, background; if (!DEVICE_X_P (XDEVICE (device))) @@ -2042,9 +2047,7 @@ if (!(dest_mask & IMAGE_POINTER_MASK)) incompatible_image_types (instantiator, dest_mask, IMAGE_POINTER_MASK); - TO_EXTERNAL_FORMAT (LISP_STRING, data, - C_STRING_ALLOCA, name_ext, - Qfile_name); + LISP_STRING_TO_EXTERNAL (data, name_ext, Qfile_name); if ((i = XmuCursorNameToIndex (name_ext)) == -1) signal_simple_error ("Unrecognized cursor-font name", data); @@ -2144,8 +2147,9 @@ x, y, dga->width, dga->height); XMoveWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p), subwindow, -dga->xoffset, -dga->yoffset); - XMapWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p), - IMAGE_INSTANCE_X_CLIPWINDOW (p)); + if (!IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (p)) + XMapWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p), + IMAGE_INSTANCE_X_CLIPWINDOW (p)); } else /* must be a widget */ { @@ -2155,36 +2159,109 @@ dga->width, dga->height, 0); XtMoveWidget (IMAGE_INSTANCE_X_WIDGET_ID (p), -dga->xoffset, -dga->yoffset); - XtMapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p)); + if (!IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (p)) + XtMapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p)); } } /* when you click on a widget you may activate another widget this needs to be checked and all appropriate widgets updated */ static void -x_update_subwindow (Lisp_Image_Instance *p) +x_redisplay_subwindow (Lisp_Image_Instance *p) +{ + /* Update the subwindow size if necessary. */ + if (IMAGE_INSTANCE_SIZE_CHANGED (p)) + { + XResizeWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p), + IMAGE_INSTANCE_X_SUBWINDOW_ID (p), + IMAGE_INSTANCE_WIDTH (p), + IMAGE_INSTANCE_HEIGHT (p)); + } +} + +/* Update all attributes that have changed. Lwlib actually does most + of this for us. */ +static void +x_redisplay_widget (Lisp_Image_Instance *p) { + /* This function can GC if IN_REDISPLAY is false. */ #ifdef HAVE_WIDGETS - if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET) + widget_value* wv = 0; + + /* First get the items if they have changed since this is a + structural change. As such it will nuke all added values so we + need to update most other things after the items have changed.*/ + if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) + { + Lisp_Object image_instance; + + XSETIMAGE_INSTANCE (image_instance, p); + wv = gui_items_to_widget_values + (image_instance, IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p), + /* #### this is not right; we need to keep track of which widgets + want accelerators and which don't */ 0); + wv->change = STRUCTURAL_CHANGE; + } + else { - widget_value* wv = gui_items_to_widget_values - (IMAGE_INSTANCE_WIDGET_ITEMS (p)); - - /* This seems ugly, but I'm not sure what else to do. */ - if (EQ (IMAGE_INSTANCE_WIDGET_TYPE (p), Qtab_control)) + /* Assume the lotus position, breath deeply and chant to + yourself lwlibsux, lwlibsux ... lw_get_all_values returns a + reference to the real values rather than a copy thus any + changes we make to the values we get back will look like they + have already been applied. If we rebuild the widget tree then + we may lose propertie. */ + wv = copy_widget_value_tree (lw_get_all_values + (IMAGE_INSTANCE_X_WIDGET_LWID (p)), + NO_CHANGE); + } + + /* Possibly update the colors and font */ + if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) + || + XFRAME (IMAGE_INSTANCE_FRAME (p))->faces_changed + || + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) + { + update_widget_face (wv, p, IMAGE_INSTANCE_FRAME (p)); + } + + /* Possibly update the text. */ + if (IMAGE_INSTANCE_TEXT_CHANGED (p)) + { + char* str; + Lisp_Object val = IMAGE_INSTANCE_WIDGET_TEXT (p); + LISP_STRING_TO_EXTERNAL (val, str, Qnative); + wv->value = str; + } + + /* Possibly update the size. */ + if (IMAGE_INSTANCE_SIZE_CHANGED (p) + || + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p) + || + IMAGE_INSTANCE_TEXT_CHANGED (p)) + { + assert (IMAGE_INSTANCE_X_WIDGET_ID (p) && + IMAGE_INSTANCE_X_CLIPWIDGET (p)) ; + + if (IMAGE_INSTANCE_X_WIDGET_ID (p)->core.being_destroyed + || !XtIsManaged(IMAGE_INSTANCE_X_WIDGET_ID (p))) { - update_tab_widget_face (wv, p, - IMAGE_INSTANCE_SUBWINDOW_FRAME (p)); + Lisp_Object sw; + XSETIMAGE_INSTANCE (sw, p); + signal_simple_error ("XEmacs bug: subwindow is deleted", sw); } - /* update the colors and font */ - update_widget_face (wv, p, IMAGE_INSTANCE_SUBWINDOW_FRAME (p)); - - /* now modify the widget */ - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), - wv, True); - free_widget_value_tree (wv); - /* subwindow resizing now gets done by the parent function. */ + + lw_add_widget_value_arg (wv, XtNwidth, + (Dimension)IMAGE_INSTANCE_WIDTH (p)); + lw_add_widget_value_arg (wv, XtNheight, + (Dimension)IMAGE_INSTANCE_HEIGHT (p)); } + + /* now modify the widget */ + lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), + wv, True); + free_widget_value_tree (wv); #endif } @@ -2197,15 +2274,15 @@ /* This function can GC */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - Lisp_Object frame = FW_FRAME (domain); + Lisp_Object frame = DOMAIN_FRAME (domain); struct frame* f = XFRAME (frame); Display *dpy; Screen *xs; Window pw, win; XSetWindowAttributes xswa; Mask valueMask = 0; - unsigned int w = IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii), - h = IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii); + unsigned int w = IMAGE_INSTANCE_WIDTH (ii), + h = IMAGE_INSTANCE_HEIGHT (ii); if (!DEVICE_X_P (XDEVICE (device))) signal_simple_error ("Not an X device", device); @@ -2272,34 +2349,6 @@ } #endif -static void -x_resize_subwindow (Lisp_Image_Instance* ii, int w, int h) -{ - if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW) - { - XResizeWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (ii), - IMAGE_INSTANCE_X_SUBWINDOW_ID (ii), - w, h); - } - else /* must be a widget */ - { - Arg al[2]; - - if ( !XtIsManaged(IMAGE_INSTANCE_X_WIDGET_ID (ii)) - || - IMAGE_INSTANCE_X_WIDGET_ID (ii)->core.being_destroyed ) - { - Lisp_Object sw; - XSETIMAGE_INSTANCE (sw, ii); - signal_simple_error ("XEmacs bug: subwindow is deleted", sw); - } - - XtSetArg (al [0], XtNwidth, (Dimension)w); - XtSetArg (al [1], XtNheight, (Dimension)h); - XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 2); - } -} - #ifdef HAVE_WIDGETS @@ -2342,6 +2391,11 @@ (IMAGE_INSTANCE_WIDGET_TEXT (ii), IMAGE_INSTANCE_WIDGET_FACE (ii), domain)))); + wv->change = VISIBLE_CHANGE; + /* #### Megahack - but its just getting too complicated to do this + in the right place. */ + if (EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qtab_control)) + update_tab_widget_face (wv, ii, domain); } static void @@ -2358,9 +2412,12 @@ domain); XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); lw_add_widget_value_arg (val, XtNtabForeground, fcolor.pixel); + wv->change = VISIBLE_CHANGE; + val->change = VISIBLE_CHANGE; for (cur = val->next; cur; cur = cur->next) { + cur->change = VISIBLE_CHANGE; if (cur->value) { lw_copy_widget_value_args (val, cur); @@ -2373,12 +2430,12 @@ x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain, - CONST char* type, widget_value* wv) + const char* type, widget_value* wv) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), pixel; struct device* d = XDEVICE (device); - Lisp_Object frame = FW_FRAME (domain); + Lisp_Object frame = DOMAIN_FRAME (domain); struct frame* f = XFRAME (frame); char* nm=0; Widget wid; @@ -2397,9 +2454,7 @@ IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET; if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) - TO_EXTERNAL_FORMAT (LISP_STRING, IMAGE_INSTANCE_WIDGET_TEXT (ii), - C_STRING_ALLOCA, nm, - Qnative); + LISP_STRING_TO_EXTERNAL (IMAGE_INSTANCE_WIDGET_TEXT (ii), nm, Qnative); ii->data = xnew_and_zero (struct x_subwindow_data); @@ -2411,9 +2466,9 @@ lw_add_widget_value_arg (clip_wv, XtNresize, False); lw_add_widget_value_arg (clip_wv, XtNwidth, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii)); + (Dimension)IMAGE_INSTANCE_WIDTH (ii)); lw_add_widget_value_arg (clip_wv, XtNheight, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); + (Dimension)IMAGE_INSTANCE_HEIGHT (ii)); clip_wv->enabled = True; clip_wv->name = xstrdup ("clip-window"); @@ -2436,12 +2491,12 @@ anymore...*/ pixel = FACE_FOREGROUND (IMAGE_INSTANCE_WIDGET_FACE (ii), - IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); + IMAGE_INSTANCE_FRAME (ii)); fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); pixel = FACE_BACKGROUND (IMAGE_INSTANCE_WIDGET_FACE (ii), - IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); + IMAGE_INSTANCE_FRAME (ii)); bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); lw_add_widget_value_arg (wv, XtNbackground, bcolor.pixel); @@ -2449,9 +2504,9 @@ /* we cannot allow widgets to resize themselves */ lw_add_widget_value_arg (wv, XtNresize, False); lw_add_widget_value_arg (wv, XtNwidth, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii)); + (Dimension)IMAGE_INSTANCE_WIDTH (ii)); lw_add_widget_value_arg (wv, XtNheight, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); + (Dimension)IMAGE_INSTANCE_HEIGHT (ii)); /* update the font. */ update_widget_face (wv, ii, domain); @@ -2460,15 +2515,6 @@ IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)wid; IMAGE_INSTANCE_X_WIDGET_LWID (ii) = id; - - /* Resize the widget here so that the values do not get copied by - lwlib. */ - ac = 0; - XtSetArg (al [ac], XtNwidth, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii)); ac++; - XtSetArg (al [ac], XtNheight, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); ac++; - XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac); /* because the EmacsManager is the widgets parent we have to offset the redisplay of the widget by the amount the text widget is inside the manager. */ @@ -2480,35 +2526,9 @@ XtSetMappedWhenManaged (wid, TRUE); free_widget_value_tree (wv); -} - -static Lisp_Object -x_widget_set_property (Lisp_Object image_instance, Lisp_Object prop, - Lisp_Object val) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - - /* Modify the text properties of the widget */ - if (EQ (prop, Q_text)) - { - char* str; - widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); - CHECK_STRING (val); - TO_EXTERNAL_FORMAT (LISP_STRING, val, - C_STRING_ALLOCA, str, - Qnative); - wv->value = str; - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, False); - } - - /* Modify the text properties of the widget */ - else if (EQ (prop, Q_face)) - { - widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); - update_widget_face (wv, ii, IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, False); - } - return Qunbound; + /* A kludgy but simple way to make sure the callback for a widget + doesn't get deleted. */ + gcpro_popup_callbacks (id); } /* get properties of a control */ @@ -2525,6 +2545,16 @@ return Qunbound; } +/* Instantiate a layout control for putting other widgets in. */ +static void +x_native_layout_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, + Lisp_Object pointer_fg, Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) +{ + x_widget_instantiate (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain, "layout", 0); +} + /* Instantiate a button widget. Unfortunately instantiated widgets are particular to a frame since they need to have a parent. It's not like images where you just select the image into the context you @@ -2539,9 +2569,7 @@ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image); - widget_value* wv = xmalloc_widget_value (); - - button_item_to_widget_value (gui, wv, 1, 1); + widget_value* wv = gui_items_to_widget_values (image_instance, gui, 1); if (!NILP (glyph)) { @@ -2568,6 +2596,30 @@ } } +/* Update a button's clicked state. + + #### This is overkill, but it works. Right now this causes all + button instances to flash for some reason buried deep in lwlib. In + theory this should be the Right Thing to do since lwlib should only + merge in changed values - and if nothing has changed then nothing + should get done. This may be because of the args stuff, + i.e. although the arg contents may be the same the args look + different and so are re-applied to the widget. */ +static void +x_button_redisplay (Lisp_Object image_instance) +{ + /* This function can GC if IN_REDISPLAY is false. */ + Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); + widget_value* wv = + gui_items_to_widget_values (image_instance, + IMAGE_INSTANCE_WIDGET_ITEMS (p), 1); + + /* now modify the widget */ + lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), + wv, True); + free_widget_value_tree (wv); +} + /* get properties of a button */ static Lisp_Object x_button_property (Lisp_Object image_instance, Lisp_Object prop) @@ -2594,30 +2646,29 @@ { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); - widget_value* wv = xmalloc_widget_value (); - - button_item_to_widget_value (gui, wv, 1, 1); + widget_value* wv = gui_items_to_widget_values (image_instance, gui, 0); x_widget_instantiate (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, domain, "progress", wv); } -/* set the properties of a progres guage */ -static Lisp_Object -x_progress_gauge_set_property (Lisp_Object image_instance, Lisp_Object prop, - Lisp_Object val) +/* set the properties of a progress gauge */ +static void +x_progress_gauge_redisplay (Lisp_Object image_instance) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - if (EQ (prop, Q_percent)) + if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) { Arg al [1]; - CHECK_INT (val); + Lisp_Object val; +#ifdef ERROR_CHECK_GLYPHS + assert (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))); +#endif + val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))->value; XtSetArg (al[0], XtNvalue, XINT (val)); XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 1); - return Qt; } - return Qunbound; } /* instantiate an edit control */ @@ -2628,9 +2679,7 @@ { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); - widget_value* wv = xmalloc_widget_value (); - - button_item_to_widget_value (gui, wv, 1, 1); + widget_value* wv = gui_items_to_widget_values (image_instance, gui, 0); x_widget_instantiate (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, domain, "text-field", wv); @@ -2650,7 +2699,8 @@ widget_instantiate (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, domain); - wv = gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); + wv = gui_items_to_widget_values (image_instance, + IMAGE_INSTANCE_WIDGET_ITEMS (ii), 0); x_widget_instantiate (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, domain, "combo-box", wv); @@ -2664,43 +2714,100 @@ { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); widget_value * wv = - gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); - + gui_items_to_widget_values (image_instance, + IMAGE_INSTANCE_WIDGET_ITEMS (ii), 0); update_tab_widget_face (wv, ii, - IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); - + IMAGE_INSTANCE_FRAME (ii)); x_widget_instantiate (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, domain, "tab-control", wv); } -/* set the properties of a tab control */ -static Lisp_Object -x_tab_control_set_property (Lisp_Object image_instance, Lisp_Object prop, - Lisp_Object val) +/* Set the properties of a tab control */ +static void +x_tab_control_redisplay (Lisp_Object image_instance) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - if (EQ (prop, Q_items)) + if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) + || + IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii)) { - widget_value * wv = 0; - check_valid_item_list_1 (val); - - IMAGE_INSTANCE_WIDGET_ITEMS (ii) = - Fcons (XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)), - parse_gui_item_tree_children (val)); - - wv = gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); + /* If only the order has changed then simply select the first + one of the pending set. This stops horrendous rebuilding - + and hence flicker - of the tabs each time you click on + one. */ + if (tab_control_order_only_changed (image_instance)) + { + Lisp_Object rest, selected = + gui_item_list_find_selected + (NILP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)) ? + XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)) : + XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))); + + LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) + { + if (gui_item_equal_sans_selected (XCAR (rest), selected, 0)) + { + /* There may be an encapsulated way of doing this, + but I couldn't find it. */ + Lisp_Object old_selected =gui_item_list_find_selected + (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); + Arg al [1]; + char* name; + unsigned int num_children, i; + Widget* children; + + LISP_STRING_TO_EXTERNAL (XGUI_ITEM (XCAR (rest))->name, + name, Qnative); + /* The name may contain a `.' which confuses + XtNameToWidget, so we do it ourselves. */ + children = XtCompositeChildren (IMAGE_INSTANCE_X_WIDGET_ID (ii), + &num_children); + for (i = 0; i < num_children; i++) + { + if (!strcmp (XtName (children [i]), name)) + { + XtSetArg (al [0], XtNtopWidget, children [i]); + XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 1); + break; + } + } + /* Pick up the new selected item. */ + XGUI_ITEM (old_selected)->selected = + XGUI_ITEM (XCAR (rest))->selected; + XGUI_ITEM (XCAR (rest))->selected = + XGUI_ITEM (selected)->selected; + /* We're not actually changing the items anymore. */ + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 0; + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; + break; + } + } + } + } + /* Possibly update the face. */ + if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) + || + XFRAME (IMAGE_INSTANCE_FRAME (ii))->faces_changed + || + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) + { + /* See previous comments on the brokeness of lwlib. + + #### There's actually not much point in doing this here + since, colors will have been set appropriately by + x_redisplay_widget. */ + widget_value* wv =copy_widget_value_tree + (lw_get_all_values + (IMAGE_INSTANCE_X_WIDGET_LWID (ii)), + NO_CHANGE); update_tab_widget_face (wv, ii, - IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); + IMAGE_INSTANCE_FRAME (ii)); lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, True); - free_widget_value_tree (wv); - return Qt; } - - return Qunbound; } /* instantiate a static control possible for putting other things in */ @@ -2711,9 +2818,7 @@ { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); - widget_value* wv = xmalloc_widget_value (); - - button_item_to_widget_value (gui, wv, 1, 1); + widget_value* wv = gui_items_to_widget_values (image_instance, gui, 0); x_widget_instantiate (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, domain, "button", wv); @@ -2747,8 +2852,8 @@ CONSOLE_HAS_METHOD (x, locate_pixmap_file); CONSOLE_HAS_METHOD (x, unmap_subwindow); CONSOLE_HAS_METHOD (x, map_subwindow); - CONSOLE_HAS_METHOD (x, resize_subwindow); - CONSOLE_HAS_METHOD (x, update_subwindow); + CONSOLE_HAS_METHOD (x, redisplay_widget); + CONSOLE_HAS_METHOD (x, redisplay_subwindow); } void @@ -2756,7 +2861,9 @@ { IIFORMAT_VALID_CONSOLE (x, nothing); IIFORMAT_VALID_CONSOLE (x, string); +#ifdef HAVE_WIDGETS IIFORMAT_VALID_CONSOLE (x, layout); +#endif IIFORMAT_VALID_CONSOLE (x, formatted_string); IIFORMAT_VALID_CONSOLE (x, inherit); #ifdef HAVE_XPM @@ -2781,17 +2888,20 @@ INITIALIZE_DEVICE_IIFORMAT (x, subwindow); IIFORMAT_HAS_DEVMETHOD (x, subwindow, instantiate); #ifdef HAVE_WIDGETS + /* layout widget */ + INITIALIZE_DEVICE_IIFORMAT (x, native_layout); + IIFORMAT_HAS_DEVMETHOD (x, native_layout, instantiate); /* button widget */ INITIALIZE_DEVICE_IIFORMAT (x, button); IIFORMAT_HAS_DEVMETHOD (x, button, property); IIFORMAT_HAS_DEVMETHOD (x, button, instantiate); - + IIFORMAT_HAS_DEVMETHOD (x, button, redisplay); + /* general widget methods. */ INITIALIZE_DEVICE_IIFORMAT (x, widget); IIFORMAT_HAS_DEVMETHOD (x, widget, property); - IIFORMAT_HAS_DEVMETHOD (x, widget, set_property); /* progress gauge */ INITIALIZE_DEVICE_IIFORMAT (x, progress_gauge); - IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, set_property); + IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, redisplay); IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, instantiate); /* text field */ INITIALIZE_DEVICE_IIFORMAT (x, edit_field); @@ -2800,12 +2910,12 @@ /* combo box */ INITIALIZE_DEVICE_IIFORMAT (x, combo_box); IIFORMAT_HAS_DEVMETHOD (x, combo_box, instantiate); - IIFORMAT_HAS_SHARED_DEVMETHOD (x, combo_box, set_property, tab_control); + IIFORMAT_HAS_SHARED_DEVMETHOD (x, combo_box, redisplay, tab_control); #endif /* tab control widget */ INITIALIZE_DEVICE_IIFORMAT (x, tab_control); IIFORMAT_HAS_DEVMETHOD (x, tab_control, instantiate); - IIFORMAT_HAS_DEVMETHOD (x, tab_control, set_property); + IIFORMAT_HAS_DEVMETHOD (x, tab_control, redisplay); /* label */ INITIALIZE_DEVICE_IIFORMAT (x, label); IIFORMAT_HAS_DEVMETHOD (x, label, instantiate); diff -r 72a7cfa4a488 -r abe6d1db359e src/glyphs-x.h --- a/src/glyphs-x.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/glyphs-x.h Mon Aug 13 11:35:02 2007 +0200 @@ -32,6 +32,7 @@ #include "xintrinsic.h" #include "../lwlib/lwlib.h" +#include "../lwlib/lwlib-utils.h" /**************************************************************************** * Image-Instance Object * @@ -96,7 +97,7 @@ Window parent_window; Window clip_window; } sub; - struct + struct { Widget clip_window; Position x_offset; @@ -122,6 +123,11 @@ (X_SUBWINDOW_INSTANCE_DATA (i)->data.wid.id) #define IMAGE_INSTANCE_X_CLIPWIDGET(i) \ (X_SUBWINDOW_INSTANCE_DATA (i)->data.wid.clip_window) +#define IMAGE_INSTANCE_X_SUBWINDOW_ID(i) \ + (* (Window *) & IMAGE_INSTANCE_SUBWINDOW_ID (i)) +#define IMAGE_INSTANCE_X_WIDGET_ID(i) \ + (* (Widget *) & IMAGE_INSTANCE_SUBWINDOW_ID (i)) + #define XIMAGE_INSTANCE_X_SUBWINDOW_PARENT(i) \ IMAGE_INSTANCE_X_SUBWINDOW_PARENT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_X_SUBWINDOW_DISPLAY(i) \ @@ -136,10 +142,14 @@ IMAGE_INSTANCE_X_CLIPWIDGET (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_X_CLIPWINDOW(i) \ IMAGE_INSTANCE_X_CLIPWINDOW (XIMAGE_INSTANCE (i)) -#define IMAGE_INSTANCE_X_SUBWINDOW_ID(i) \ - ((Window) IMAGE_INSTANCE_SUBWINDOW_ID (i)) -#define IMAGE_INSTANCE_X_WIDGET_ID(i) \ - ((Widget) IMAGE_INSTANCE_SUBWINDOW_ID (i)) +#define XIMAGE_INSTANCE_X_WIDGET_ID(i) \ + IMAGE_INSTANCE_X_WIDGET_ID (XIMAGE_INSTANCE (i)) + +#define DOMAIN_X_WIDGET(domain) \ + ((IMAGE_INSTANCEP (domain) && \ + X_SUBWINDOW_INSTANCE_DATA (XIMAGE_INSTANCE (domain))) ? \ + XIMAGE_INSTANCE_X_WIDGET_ID (domain) : \ + FRAME_X_CONTAINER_WIDGET (f) (DOMAIN_XFRAME (domain))) #endif /* HAVE_X_WINDOWS */ #endif /* INCLUDED_glyphs_x_h_ */ diff -r 72a7cfa4a488 -r abe6d1db359e src/glyphs.c --- a/src/glyphs.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/glyphs.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,7 +1,7 @@ /* Generic glyph/image implementation + display tables Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Tinker Systems - Copyright (C) 1995, 1996 Ben Wing + Copyright (C) 1995, 1996, 2000 Ben Wing Copyright (C) 1995 Sun Microsystems Copyright (C) 1998, 1999, 2000 Andy Piper @@ -30,20 +30,21 @@ #include #include "lisp.h" +#include "blocktype.h" #include "buffer.h" +#include "chartab.h" #include "device.h" #include "elhash.h" #include "faces.h" #include "frame.h" +#include "glyphs.h" #include "insdel.h" +#include "objects.h" #include "opaque.h" -#include "objects.h" +#include "rangetab.h" #include "redisplay.h" +#include "specifier.h" #include "window.h" -#include "frame.h" -#include "chartab.h" -#include "rangetab.h" -#include "blocktype.h" #ifdef HAVE_XPM #include @@ -58,7 +59,6 @@ Lisp_Object Qcolor_pixmap_image_instance_p; Lisp_Object Qpointer_image_instance_p; Lisp_Object Qsubwindow_image_instance_p; -Lisp_Object Qlayout_image_instance_p; Lisp_Object Qwidget_image_instance_p; Lisp_Object Qconst_glyph_variable; Lisp_Object Qmono_pixmap, Qcolor_pixmap, Qsubwindow; @@ -81,6 +81,7 @@ DEFINE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); DEFINE_IMAGE_INSTANTIATOR_FORMAT (subwindow); DEFINE_IMAGE_INSTANTIATOR_FORMAT (text); +DEFINE_IMAGE_INSTANTIATOR_FORMAT (pointer); #ifdef HAVE_WINDOW_SYSTEM DEFINE_IMAGE_INSTANTIATOR_FORMAT (xbm); @@ -120,15 +121,22 @@ Dynarr_declare (struct image_instantiator_format_entry); } image_instantiator_format_entry_dynarr; +/* This contains one entry per format, per device it's defined on. */ image_instantiator_format_entry_dynarr * the_image_instantiator_format_entry_dynarr; -static Lisp_Object allocate_image_instance (Lisp_Object device, Lisp_Object glyph); +static Lisp_Object allocate_image_instance (Lisp_Object governing_domain, + Lisp_Object parent, + Lisp_Object instantiator); static void image_validate (Lisp_Object instantiator); static void glyph_property_was_changed (Lisp_Object glyph, Lisp_Object property, Lisp_Object locale); +static void set_image_instance_dirty_p (Lisp_Object instance, int dirty); static void register_ignored_expose (struct frame* f, int x, int y, int width, int height); +static void cache_subwindow_instance_in_frame_maybe (Lisp_Object instance); +static void update_image_instance (Lisp_Object image_instance, + Lisp_Object instantiator); /* Unfortunately windows and X are different. In windows BeginPaint() will prevent WM_PAINT messages being generated so it is unnecessary to register exposures as they will not occur. Under X they will @@ -137,6 +145,7 @@ EXFUN (Fimage_instance_type, 1); EXFUN (Fglyph_type, 1); +EXFUN (Fnext_window, 4); /**************************************************************************** @@ -219,13 +228,18 @@ Given an IMAGE-INSTANTIATOR-FORMAT, return non-nil if it is valid. If LOCALE is non-nil then the format is checked in that domain. If LOCALE is nil the current console is used. + Valid formats are some subset of 'nothing, 'string, 'formatted-string, 'xpm, 'xbm, 'xface, 'gif, 'jpeg, 'png, 'tiff, 'cursor-font, 'font, -'autodetect, 'widget and 'subwindow, depending on how XEmacs was compiled. +'autodetect, 'subwindow, 'inherit, 'mswindows-resource, 'bmp, +'native-layout, 'layout, 'label, 'tab-control, 'tree-view, +'progress-gauge, 'scrollbar, 'combo-box, 'edit-field, 'button, +'widget, 'pointer, and 'text, depending on how XEmacs was compiled. */ (image_instantiator_format, locale)) { - return valid_image_instantiator_format_p (image_instantiator_format, locale) ? + return valid_image_instantiator_format_p (image_instantiator_format, + locale) ? Qt : Qnil; } @@ -248,8 +262,9 @@ entry.device = device; entry.meths = meths; Dynarr_add (the_image_instantiator_format_entry_dynarr, entry); - Vimage_instantiator_format_list = - Fcons (symbol, Vimage_instantiator_format_list); + if (NILP (memq_no_quit (symbol, Vimage_instantiator_format_list))) + Vimage_instantiator_format_list = + Fcons (symbol, Vimage_instantiator_format_list); } void @@ -421,6 +436,85 @@ return find_keyword_in_vector_or_given (vector, keyword, Qnil); } +static Lisp_Object +find_instantiator_differences (Lisp_Object new, Lisp_Object old) +{ + Lisp_Object alist = Qnil; + Lisp_Object *elt = XVECTOR_DATA (new); + Lisp_Object *old_elt = XVECTOR_DATA (old); + int len = XVECTOR_LENGTH (new); + struct gcpro gcpro1; + + /* If the vector length has changed then consider everything + changed. We could try and figure out what properties have + disappeared or been added, but this code is only used as an + optimization anyway so lets not bother. */ + if (len != XVECTOR_LENGTH (old)) + return new; + + GCPRO1 (alist); + + for (len -= 2; len >= 1; len -= 2) + { + /* Keyword comparisons can be done with eq, the value must be + done with equal. + #### Note that this does not optimize re-ordering. */ + if (!EQ (elt[len], old_elt[len]) + || !internal_equal (elt[len+1], old_elt[len+1], 0)) + alist = Fcons (Fcons (elt[len], elt[len+1]), alist); + } + + { + Lisp_Object result = alist_to_tagged_vector (elt[0], alist); + free_alist (alist); + RETURN_UNGCPRO (result); + } +} + +DEFUN ("set-instantiator-property", Fset_instantiator_property, + 3, 3, 0, /* +Destructively set the property KEYWORD of INSTANTIATOR to VAL. +If the property is not set then it is added to a copy of the +instantiator and the new instantiator returned. +Use `set-glyph-image' on glyphs to register instantiator changes. */ + (instantiator, keyword, val)) +{ + Lisp_Object *elt; + int len; + + CHECK_VECTOR (instantiator); + if (!KEYWORDP (keyword)) + signal_simple_error ("instantiator property must be a keyword", keyword); + + elt = XVECTOR_DATA (instantiator); + len = XVECTOR_LENGTH (instantiator); + + for (len -= 2; len >= 1; len -= 2) + { + if (EQ (elt[len], keyword)) + { + elt[len+1] = val; + break; + } + } + + /* Didn't find it so add it. */ + if (len < 1) + { + Lisp_Object alist = Qnil, result; + struct gcpro gcpro1; + + GCPRO1 (alist); + alist = tagged_vector_to_alist (instantiator); + alist = Fcons (Fcons (keyword, val), alist); + result = alist_to_tagged_vector (elt[0], alist); + free_alist (alist); + RETURN_UNGCPRO (result); + } + + return instantiator; +} + void check_valid_string (Lisp_Object data) { @@ -539,7 +633,90 @@ return Fvector (len, elt); } +#ifdef ERROR_CHECK_GLYPHS +static int +check_instance_cache_mapper (Lisp_Object key, Lisp_Object value, + void *flag_closure) +{ + /* This function can GC */ + /* value can be nil; we cache failures as well as successes */ + if (!NILP (value)) + { + Lisp_Object window; + VOID_TO_LISP (window, flag_closure); + assert (EQ (XIMAGE_INSTANCE_DOMAIN (value), window)); + } + + return 0; +} + +void +check_window_subwindow_cache (struct window* w) +{ + Lisp_Object window; + + XSETWINDOW (window, w); + + assert (!NILP (w->subwindow_instance_cache)); + elisp_maphash (check_instance_cache_mapper, + w->subwindow_instance_cache, + LISP_TO_VOID (window)); +} + +void +check_image_instance_structure (Lisp_Object instance) +{ + /* Weird nothing images exist at startup when the console is + deleted. */ + if (!NOTHING_IMAGE_INSTANCEP (instance)) + { + assert (DOMAIN_LIVE_P (instance)); + assert (VECTORP (XIMAGE_INSTANCE_INSTANTIATOR (instance))); + } + if (WINDOWP (XIMAGE_INSTANCE_DOMAIN (instance))) + check_window_subwindow_cache + (XWINDOW (XIMAGE_INSTANCE_DOMAIN (instance))); +} +#endif + +/* Determine what kind of domain governs the image instance. + Verify that the given domain is at least as specific, and extract + the governing domain from it. */ static Lisp_Object +get_image_instantiator_governing_domain (Lisp_Object instantiator, + Lisp_Object domain) +{ + int governing_domain; + + struct image_instantiator_methods *meths = + decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], + ERROR_ME); + governing_domain = IIFORMAT_METH_OR_GIVEN (meths, governing_domain, (), + GOVERNING_DOMAIN_DEVICE); + + if (governing_domain == GOVERNING_DOMAIN_WINDOW + && NILP (DOMAIN_WINDOW (domain))) + signal_simple_error_2 ("Domain for this instantiator must be resolvable to a window", + instantiator, domain); + else if (governing_domain == GOVERNING_DOMAIN_FRAME + && NILP (DOMAIN_FRAME (domain))) + signal_simple_error_2 + ("Domain for this instantiator must be resolvable to a frame", + instantiator, domain); + + if (governing_domain == GOVERNING_DOMAIN_WINDOW) + domain = DOMAIN_WINDOW (domain); + else if (governing_domain == GOVERNING_DOMAIN_FRAME) + domain = DOMAIN_FRAME (domain); + else if (governing_domain == GOVERNING_DOMAIN_DEVICE) + domain = DOMAIN_DEVICE (domain); + else + abort (); + + return domain; +} + +Lisp_Object normalize_image_instantiator (Lisp_Object instantiator, Lisp_Object contype, Lisp_Object dest_mask) @@ -550,8 +727,9 @@ if (STRINGP (instantiator)) instantiator = process_image_string_instantiator (instantiator, contype, XINT (dest_mask)); - - assert (VECTORP (instantiator)); + /* Subsequent validation will pick this up. */ + if (!VECTORP (instantiator)) + return instantiator; /* We have to always store the actual pixmap data and not the filename even though this is a potential memory pig. We have to do this because it is quite possible that we will need to @@ -567,47 +745,83 @@ meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], ERROR_ME); RETURN_UNGCPRO (IIFORMAT_METH_OR_GIVEN (meths, normalize, - (instantiator, contype), + (instantiator, contype, dest_mask), instantiator)); } } static Lisp_Object -instantiate_image_instantiator (Lisp_Object device, Lisp_Object domain, +instantiate_image_instantiator (Lisp_Object governing_domain, + Lisp_Object domain, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object glyph) { - Lisp_Object ii = allocate_image_instance (device, glyph); - struct image_instantiator_methods *meths; + Lisp_Object ii = allocate_image_instance (governing_domain, + IMAGE_INSTANCEP (domain) ? + domain : glyph, instantiator); + Lisp_Image_Instance* p = XIMAGE_INSTANCE (ii); + struct image_instantiator_methods *meths, *device_meths; struct gcpro gcpro1; - int methp = 0; GCPRO1 (ii); - if (!valid_image_instantiator_format_p (XVECTOR_DATA (instantiator)[0], device)) + if (!valid_image_instantiator_format_p (XVECTOR_DATA (instantiator)[0], + DOMAIN_DEVICE (governing_domain))) signal_simple_error ("Image instantiator format is invalid in this locale.", instantiator); meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], ERROR_ME); - methp = (int)HAS_IIFORMAT_METH_P (meths, instantiate); MAYBE_IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg, pointer_bg, dest_mask, domain)); - /* now do device specific instantiation */ - meths = decode_device_ii_format (device, XVECTOR_DATA (instantiator)[0], - ERROR_ME_NOT); - - if (!methp && (!meths || !HAS_IIFORMAT_METH_P (meths, instantiate))) + /* Now do device specific instantiation. */ + device_meths = decode_device_ii_format (DOMAIN_DEVICE (governing_domain), + XVECTOR_DATA (instantiator)[0], + ERROR_ME_NOT); + + if (!HAS_IIFORMAT_METH_P (meths, instantiate) + && (!device_meths || !HAS_IIFORMAT_METH_P (device_meths, instantiate))) signal_simple_error ("Don't know how to instantiate this image instantiator?", instantiator); - MAYBE_IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg, - pointer_bg, dest_mask, domain)); - UNGCPRO; - - return ii; + + /* In general native window system methods will require sane + geometry values, thus the instance needs to have been laid-out + before they get called. */ + image_instance_layout (ii, XIMAGE_INSTANCE_WIDTH (ii), + XIMAGE_INSTANCE_HEIGHT (ii), + IMAGE_UNCHANGED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, domain); + + MAYBE_IIFORMAT_METH (device_meths, instantiate, (ii, instantiator, pointer_fg, + pointer_bg, dest_mask, domain)); + /* Do post instantiation. */ + MAYBE_IIFORMAT_METH (meths, post_instantiate, (ii, instantiator, domain)); + MAYBE_IIFORMAT_METH (device_meths, post_instantiate, (ii, instantiator, domain)); + + /* We're done. */ + IMAGE_INSTANCE_INITIALIZED (p) = 1; + /* Now that we're done verify that we really are laid out. */ + if (IMAGE_INSTANCE_LAYOUT_CHANGED (p)) + image_instance_layout (ii, XIMAGE_INSTANCE_WIDTH (ii), + XIMAGE_INSTANCE_HEIGHT (ii), + IMAGE_UNCHANGED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, domain); + + /* We *must* have a clean image at this point. */ + IMAGE_INSTANCE_TEXT_CHANGED (p) = 0; + IMAGE_INSTANCE_SIZE_CHANGED (p) = 0; + IMAGE_INSTANCE_LAYOUT_CHANGED (p) = 0; + IMAGE_INSTANCE_DIRTYP (p) = 0; + + assert ( XIMAGE_INSTANCE_HEIGHT (ii) >= 0 + && XIMAGE_INSTANCE_WIDTH (ii) >= 0 ); + + ERROR_CHECK_IMAGE_INSTANCE (ii); + + RETURN_UNGCPRO (ii); } @@ -622,9 +836,26 @@ { Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj); + /* #### I want to check the instance here, but there are way too + many instances of the instance being marked while the domain is + dead. For instance you can get marked through an event when using + callback_ex.*/ +#if 0 + ERROR_CHECK_IMAGE_INSTANCE (obj); +#endif + mark_object (i->name); + mark_object (i->instantiator); + /* 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)) + i->domain = Qnil; + else + mark_object (i->domain); + /* We don't mark the glyph reference since that would create a - circularity preventing GC. */ + circularity preventing GC. Ditto the instantiator. */ switch (IMAGE_INSTANCE_TYPE (i)) { case IMAGE_TEXT: @@ -641,20 +872,27 @@ break; case IMAGE_WIDGET: - case IMAGE_LAYOUT: mark_object (IMAGE_INSTANCE_WIDGET_TYPE (i)); mark_object (IMAGE_INSTANCE_WIDGET_PROPS (i)); - mark_object (IMAGE_INSTANCE_WIDGET_FACE (i)); + mark_object (IMAGE_INSTANCE_SUBWINDOW_FACE (i)); mark_object (IMAGE_INSTANCE_WIDGET_ITEMS (i)); + mark_object (IMAGE_INSTANCE_LAYOUT_CHILDREN (i)); + mark_object (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (i)); + mark_object (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i)); + mark_object (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i)); case IMAGE_SUBWINDOW: - mark_object (IMAGE_INSTANCE_SUBWINDOW_FRAME (i)); break; default: break; } - MAYBE_DEVMETH (XDEVICE (i->device), mark_image_instance, (i)); + /* The image may have been previously finalized (yes that's weird, + see Fdelete_frame() and mark_window_as_deleted()), in which case + the domain will be nil, so cope with this. */ + if (!NILP (IMAGE_INSTANCE_DEVICE (i))) + MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (i)), + mark_image_instance, (i)); return i->device; } @@ -678,7 +916,7 @@ write_c_string (" ", printcharfun); } write_c_string ("on ", printcharfun); - print_internal (ii->device, printcharfun, 0); + print_internal (ii->domain, printcharfun, 0); write_c_string (" ", printcharfun); switch (IMAGE_INSTANCE_TYPE (ii)) { @@ -752,21 +990,25 @@ break; case IMAGE_WIDGET: + print_internal (IMAGE_INSTANCE_WIDGET_TYPE (ii), printcharfun, 0); + + if (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_ITEM (ii))) + { + write_c_string (" ", printcharfun); + print_internal (IMAGE_INSTANCE_WIDGET_TEXT (ii), printcharfun, 1); + } + if (!NILP (IMAGE_INSTANCE_WIDGET_FACE (ii))) { - write_c_string (" (", printcharfun); + write_c_string (" face=", printcharfun); print_internal (IMAGE_INSTANCE_WIDGET_FACE (ii), printcharfun, 0); - write_c_string (")", printcharfun); } - if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) - print_internal (IMAGE_INSTANCE_WIDGET_TEXT (ii), printcharfun, 0); case IMAGE_SUBWINDOW: - case IMAGE_LAYOUT: - sprintf (buf, " %dx%d", IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii), - IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); + sprintf (buf, " %dx%d", IMAGE_INSTANCE_WIDTH (ii), + IMAGE_INSTANCE_HEIGHT (ii)); write_c_string (buf, printcharfun); /* This is stolen from frame.c. Subwindows are strange in that they @@ -775,17 +1017,15 @@ write_c_string (" on #<", printcharfun); { - struct frame* f = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); + struct frame* f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); if (!FRAME_LIVE_P (f)) write_c_string ("dead", printcharfun); else write_c_string (DEVICE_TYPE_NAME (XDEVICE (FRAME_DEVICE (f))), printcharfun); - - write_c_string ("-frame ", printcharfun); } - write_c_string (">", printcharfun); + write_c_string ("-frame>", printcharfun); sprintf (buf, " 0x%p", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); write_c_string (buf, printcharfun); @@ -795,7 +1035,7 @@ abort (); } - MAYBE_DEVMETH (XDEVICE (ii->device), print_image_instance, + MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), print_image_instance, (ii, printcharfun, escapeflag)); sprintf (buf, " 0x%x>", ii->header.uid); write_c_string (buf, printcharfun); @@ -806,21 +1046,20 @@ { Lisp_Image_Instance *i = (Lisp_Image_Instance *) header; - if (IMAGE_INSTANCE_TYPE (i) == IMAGE_NOTHING) - /* objects like this exist at dump time, so don't bomb out. */ + /* objects like this exist at dump time, so don't bomb out. */ + if (IMAGE_INSTANCE_TYPE (i) == IMAGE_NOTHING + || + NILP (IMAGE_INSTANCE_DEVICE (i))) return; if (for_disksave) finalose (i); - /* do this so that the cachels get reset */ - if (IMAGE_INSTANCE_TYPE (i) == IMAGE_WIDGET - || - IMAGE_INSTANCE_TYPE (i) == IMAGE_SUBWINDOW) - { - MARK_FRAME_SUBWINDOWS_CHANGED - (XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (i))); - } - - MAYBE_DEVMETH (XDEVICE (i->device), finalize_image_instance, (i)); + /* We can't use the domain here, because it might have + disappeared. */ + MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (i)), + finalize_image_instance, (i)); + + /* Make sure we don't try this twice. */ + IMAGE_INSTANCE_DEVICE (i) = Qnil; } static int @@ -828,13 +1067,16 @@ { Lisp_Image_Instance *i1 = XIMAGE_INSTANCE (obj1); Lisp_Image_Instance *i2 = XIMAGE_INSTANCE (obj2); - struct device *d1 = XDEVICE (i1->device); - struct device *d2 = XDEVICE (i2->device); - - if (d1 != d2) - return 0; - if (IMAGE_INSTANCE_TYPE (i1) != IMAGE_INSTANCE_TYPE (i2) + + ERROR_CHECK_IMAGE_INSTANCE (obj1); + ERROR_CHECK_IMAGE_INSTANCE (obj2); + + if (!EQ (IMAGE_INSTANCE_DOMAIN (i1), + IMAGE_INSTANCE_DOMAIN (i2)) + || IMAGE_INSTANCE_TYPE (i1) != IMAGE_INSTANCE_TYPE (i2) || IMAGE_INSTANCE_WIDTH (i1) != IMAGE_INSTANCE_WIDTH (i2) + || IMAGE_INSTANCE_MARGIN_WIDTH (i1) != + IMAGE_INSTANCE_MARGIN_WIDTH (i2) || IMAGE_INSTANCE_HEIGHT (i1) != IMAGE_INSTANCE_HEIGHT (i2) || IMAGE_INSTANCE_XOFFSET (i1) != IMAGE_INSTANCE_XOFFSET (i2) || IMAGE_INSTANCE_YOFFSET (i1) != IMAGE_INSTANCE_YOFFSET (i2)) @@ -842,6 +1084,10 @@ if (!internal_equal (IMAGE_INSTANCE_NAME (i1), IMAGE_INSTANCE_NAME (i2), depth + 1)) return 0; + if (!internal_equal (IMAGE_INSTANCE_INSTANTIATOR (i1), + IMAGE_INSTANCE_INSTANTIATOR (i2), + depth + 1)) + return 0; switch (IMAGE_INSTANCE_TYPE (i1)) { @@ -876,17 +1122,28 @@ break; case IMAGE_WIDGET: - case IMAGE_LAYOUT: if (!(EQ (IMAGE_INSTANCE_WIDGET_TYPE (i1), IMAGE_INSTANCE_WIDGET_TYPE (i2)) && IMAGE_INSTANCE_SUBWINDOW_ID (i1) == IMAGE_INSTANCE_SUBWINDOW_ID (i2) + && + EQ (IMAGE_INSTANCE_WIDGET_FACE (i1), + IMAGE_INSTANCE_WIDGET_TYPE (i2)) && internal_equal (IMAGE_INSTANCE_WIDGET_ITEMS (i1), IMAGE_INSTANCE_WIDGET_ITEMS (i2), depth + 1) + && internal_equal (IMAGE_INSTANCE_LAYOUT_CHILDREN (i1), + IMAGE_INSTANCE_LAYOUT_CHILDREN (i2), + depth + 1) && internal_equal (IMAGE_INSTANCE_WIDGET_PROPS (i1), IMAGE_INSTANCE_WIDGET_PROPS (i2), depth + 1) + && internal_equal (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i1), + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i2), + depth + 1) + && internal_equal (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i1), + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i2), + depth + 1) )) return 0; break; @@ -901,17 +1158,48 @@ abort (); } - return DEVMETH_OR_GIVEN (d1, image_instance_equal, (i1, i2, depth), 1); + return DEVMETH_OR_GIVEN (DOMAIN_XDEVICE (i1->domain), + image_instance_equal, (i1, i2, depth), 1); +} + +/* Image instance domain manipulators. We can't error check in these + otherwise we get into infinite recursion. */ +Lisp_Object +image_instance_device (Lisp_Object instance) +{ + return XIMAGE_INSTANCE_DEVICE (instance); +} + +Lisp_Object +image_instance_frame (Lisp_Object instance) +{ + return XIMAGE_INSTANCE_FRAME (instance); +} + +Lisp_Object +image_instance_window (Lisp_Object instance) +{ + return DOMAIN_WINDOW (XIMAGE_INSTANCE_DOMAIN (instance)); +} + +int +image_instance_live_p (Lisp_Object instance) +{ + return DOMAIN_LIVE_P (XIMAGE_INSTANCE_DOMAIN (instance)); } static unsigned long image_instance_hash (Lisp_Object obj, int depth) { Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj); - struct device *d = XDEVICE (i->device); - unsigned long hash = HASH3 ((unsigned long) d, + unsigned long hash = HASH5 (LISP_HASH (IMAGE_INSTANCE_DOMAIN (i)), IMAGE_INSTANCE_WIDTH (i), - IMAGE_INSTANCE_HEIGHT (i)); + IMAGE_INSTANCE_MARGIN_WIDTH (i), + IMAGE_INSTANCE_HEIGHT (i), + internal_hash (IMAGE_INSTANCE_INSTANTIATOR (i), + depth + 1)); + + ERROR_CHECK_IMAGE_INSTANCE (obj); switch (IMAGE_INSTANCE_TYPE (i)) { @@ -933,21 +1221,26 @@ break; case IMAGE_WIDGET: - case IMAGE_LAYOUT: - hash = HASH4 (hash, - internal_hash (IMAGE_INSTANCE_WIDGET_TYPE (i), depth + 1), + /* We need the hash to be equivalent to what should be + displayed. */ + hash = HASH5 (hash, + LISP_HASH (IMAGE_INSTANCE_WIDGET_TYPE (i)), internal_hash (IMAGE_INSTANCE_WIDGET_PROPS (i), depth + 1), - internal_hash (IMAGE_INSTANCE_WIDGET_ITEMS (i), depth + 1)); + internal_hash (IMAGE_INSTANCE_WIDGET_ITEMS (i), depth + 1), + internal_hash (IMAGE_INSTANCE_LAYOUT_CHILDREN (i), + depth + 1)); case IMAGE_SUBWINDOW: - hash = HASH2 (hash, (int) IMAGE_INSTANCE_SUBWINDOW_ID (i)); + hash = HASH2 (hash, (EMACS_INT) IMAGE_INSTANCE_SUBWINDOW_ID (i)); break; default: abort (); } - return HASH2 (hash, DEVMETH_OR_GIVEN (d, image_instance_hash, (i, depth), - 0)); + return HASH2 (hash, DEVMETH_OR_GIVEN + (XDEVICE (image_instance_device (obj)), + image_instance_hash, (i, depth), + 0)); } DEFINE_LRECORD_IMPLEMENTATION ("image-instance", image_instance, @@ -957,24 +1250,42 @@ Lisp_Image_Instance); static Lisp_Object -allocate_image_instance (Lisp_Object device, Lisp_Object glyph) +allocate_image_instance (Lisp_Object governing_domain, Lisp_Object parent, + Lisp_Object instantiator) { Lisp_Image_Instance *lp = alloc_lcrecord_type (Lisp_Image_Instance, &lrecord_image_instance); Lisp_Object val; zero_lcrecord (lp); - lp->device = device; + /* 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 + valid. However, the only truly relevant domain is the domain in + which the instance is cached since this is the one that will be + common to the instances. */ + lp->domain = governing_domain; + /* The cache domain is not quite sufficient since the domain can get + deleted before the image instance does. We need to know the + domain device in order to finalize the image instance + properly. We therefore record the device also. */ + lp->device = DOMAIN_DEVICE (governing_domain); lp->type = IMAGE_NOTHING; lp->name = Qnil; lp->x_offset = 0; lp->y_offset = 0; - lp->width = 0; - lp->height = 0; - lp->glyph = glyph; - MARK_IMAGE_INSTANCE_CHANGED (lp); /* So that layouts get done. */ + 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; + XSETIMAGE_INSTANCE (val, lp); - MARK_GLYPHS_CHANGED; /* So that the dirty flag gets reset. */ + MARK_GLYPHS_CHANGED; + return val; } @@ -991,7 +1302,6 @@ if (EQ (type, Qpointer)) return IMAGE_POINTER; if (EQ (type, Qsubwindow)) return IMAGE_SUBWINDOW; if (EQ (type, Qwidget)) return IMAGE_WIDGET; - if (EQ (type, Qlayout)) return IMAGE_LAYOUT; maybe_signal_simple_error ("Invalid image-instance type", type, Qimage, errb); @@ -1011,7 +1321,6 @@ case IMAGE_POINTER: return Qpointer; case IMAGE_SUBWINDOW: return Qsubwindow; case IMAGE_WIDGET: return Qwidget; - case IMAGE_LAYOUT: return Qlayout; default: abort (); } @@ -1020,16 +1329,6 @@ } static int -image_instance_type_to_mask (enum image_instance_type type) -{ - /* This depends on the fact that enums are assigned consecutive - integers starting at 0. (Remember that IMAGE_UNKNOWN is the - first enum.) I'm fairly sure this behavior is ANSI-mandated, - so there should be no portability problems here. */ - return (1 << ((int) (type) - 1)); -} - -static int decode_image_instance_type_list (Lisp_Object list) { Lisp_Object rest; @@ -1081,7 +1380,7 @@ (Qerror, list2 (emacs_doprnt_string_lisp_2 - ((CONST Bufbyte *) + ((const Bufbyte *) "No compatible image-instance types given: wanted one of %s, got %s", Qnil, -1, 2, encode_image_instance_type_list (desired_dest_mask), @@ -1098,7 +1397,7 @@ DEFUN ("valid-image-instance-type-p", Fvalid_image_instance_type_p, 1, 1, 0, /* Given an IMAGE-INSTANCE-TYPE, return non-nil if it is valid. Valid types are some subset of 'nothing, 'text, 'mono-pixmap, 'color-pixmap, -'pointer, and 'subwindow, depending on how XEmacs was compiled. +'pointer, 'subwindow, and 'widget, depending on how XEmacs was compiled. */ (image_instance_type)) { @@ -1135,27 +1434,46 @@ } } +/* Recurse up the hierarchy looking for the topmost glyph. This means + that instances in layouts will inherit face properties from their + parent. */ +Lisp_Object image_instance_parent_glyph (Lisp_Image_Instance* ii) +{ + if (IMAGE_INSTANCEP (IMAGE_INSTANCE_PARENT (ii))) + { + return image_instance_parent_glyph + (XIMAGE_INSTANCE (IMAGE_INSTANCE_PARENT (ii))); + } + return IMAGE_INSTANCE_PARENT (ii); +} + static Lisp_Object -make_image_instance_1 (Lisp_Object data, Lisp_Object device, +make_image_instance_1 (Lisp_Object data, Lisp_Object domain, Lisp_Object dest_types) { Lisp_Object ii; struct gcpro gcpro1; int dest_mask; - - XSETDEVICE (device, decode_device (device)); - /* instantiate_image_instantiator() will abort if given an - image instance ... */ + Lisp_Object governing_domain; + if (IMAGE_INSTANCEP (data)) signal_simple_error ("Image instances not allowed here", data); image_validate (data); + domain = decode_domain (domain); + /* instantiate_image_instantiator() will abort if given an + image instance ... */ dest_mask = decode_image_instance_type_list (dest_types); - data = normalize_image_instantiator (data, DEVICE_TYPE (XDEVICE (device)), + data = normalize_image_instantiator (data, + DEVICE_TYPE (DOMAIN_XDEVICE (domain)), make_int (dest_mask)); GCPRO1 (data); - if (VECTORP (data) && EQ (XVECTOR_DATA (data)[0], Qinherit)) + /* After normalizing the data, it's always either an image instance (which + we filtered out above) or a vector. */ + if (EQ (XVECTOR_DATA (data)[0], Qinherit)) signal_simple_error ("Inheritance not allowed here", data); - ii = instantiate_image_instantiator (device, device, data, + governing_domain = + get_image_instantiator_governing_domain (data, domain); + ii = instantiate_image_instantiator (governing_domain, domain, data, Qnil, Qnil, dest_mask, Qnil); RETURN_UNGCPRO (ii); } @@ -1170,7 +1488,7 @@ instances, if you want more control over the instantiation process. DATA is an image instantiator, which describes the image; see -`image-specifier-p' for a description of the allowed values. +`make-image-specifier' for a description of the allowed values. DEST-TYPES should be a list of allowed image instance types that can be generated. The recognized image instance types are @@ -1197,37 +1515,70 @@ another program to be responsible for drawing into the window. 'widget A child window that contains a window-system widget, e.g. a push - button. - -The DEST-TYPES list is unordered. If multiple destination types -are possible for a given instantiator, the "most natural" type -for the instantiator's format is chosen. (For XBM, the most natural -types are `mono-pixmap', followed by `color-pixmap', followed by -`pointer'. For the other normal image formats, the most natural -types are `color-pixmap', followed by `mono-pixmap', followed by -`pointer'. For the string and formatted-string formats, the most -natural types are `text', followed by `mono-pixmap' (not currently -implemented), followed by `color-pixmap' (not currently implemented). -The other formats can only be instantiated as one type. (If you -want to control more specifically the order of the types into which -an image is instantiated, just call `make-image-instance' repeatedly -until it succeeds, passing less and less preferred destination types -each time. + button, text field, or slider. + +The DEST-TYPES list is unordered. If multiple destination types are +possible for a given instantiator, the "most natural" type for the +instantiator's format is chosen. (For XBM, the most natural types are +`mono-pixmap', followed by `color-pixmap', followed by `pointer'. For +the other normal image formats, the most natural types are +`color-pixmap', followed by `mono-pixmap', followed by `pointer'. For +the string and formatted-string formats, the most natural types are +`text', followed by `mono-pixmap' (not currently implemented), +followed by `color-pixmap' (not currently implemented). For MS +Windows resources, the most natural type for pointer resources is +`pointer', and for the others it's `color-pixmap'. The other formats +can only be instantiated as one type. (If you want to control more +specifically the order of the types into which an image is +instantiated, just call `make-image-instance' repeatedly until it +succeeds, passing less and less preferred destination types each +time.) + +See `make-image-specifier' for a description of the different image +instantiator formats. If DEST-TYPES is omitted, all possible types are allowed. +DOMAIN specifies the domain to which the image instance will be attached. +This domain is termed the \"governing domain\". The type of the governing +domain depends on the image instantiator format. (Although, more correctly, +it should probably depend on the image instance type.) For example, pixmap +image instances are specific to a device, but widget image instances are +specific to a particular XEmacs window because in order to display such a +widget when two windows onto the same buffer want to display the widget, +two separate underlying widgets must be created. (That's because a widget +is actually a child window-system window, and all window-system windows have +a unique existence on the screen.) This means that the governing domain for +a pixmap image instance will be some device (most likely, the only existing +device), whereas the governing domain for a widget image instance will be +some XEmacs window. + +If you specify an overly general DOMAIN (e.g. a frame when a window was +wanted), an error is signaled. If you specify an overly specific DOMAIN +\(e.g. a window when a device was wanted), the corresponding general domain +is fetched and used instead. For `make-image-instance', it makes no +difference whether you specify an overly specific domain or the properly +general domain derived from it. However, it does matter when creating an +image instance by instantiating a specifier or glyph (e.g. with +`glyph-image-instance'), because the more specific domain causes spec lookup +to start there and proceed to more general domains. (It would also matter +when creating an image instance with an instantiator format of `inherit', +but we currently disallow this. #### We should fix this.) + +If omitted, DOMAIN defaults to the selected window. + NO-ERROR controls what happens when the image cannot be generated. If nil, an error message is generated. If t, no messages are generated and this function returns nil. If anything else, a warning message is generated and this function returns nil. */ - (data, device, dest_types, no_error)) + (data, domain, dest_types, no_error)) { Error_behavior errb = decode_error_behavior_flag (no_error); return call_with_suspended_errors ((lisp_fn_t) make_image_instance_1, Qnil, Qimage, errb, - 3, data, device, dest_types); + 3, data, domain, dest_types); } DEFUN ("image-instance-p", Fimage_instance_p, 1, 1, 0, /* @@ -1246,6 +1597,7 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); return encode_image_instance_type (XIMAGE_INSTANCE_TYPE (image_instance)); } @@ -1258,6 +1610,20 @@ return XIMAGE_INSTANCE_NAME (image_instance); } +DEFUN ("image-instance-domain", Fimage_instance_domain, 1, 1, 0, /* +Return the governing domain of the given image instance. +The governing domain of an image instance is the domain that the image +instance is specific to. It is NOT necessarily the domain that was +given to the call to `specifier-instance' that resulted in the creation +of this image instance. See `make-image-instance' for more information +on governing domains. +*/ + (image_instance)) +{ + CHECK_IMAGE_INSTANCE (image_instance); + return XIMAGE_INSTANCE_DOMAIN (image_instance); +} + DEFUN ("image-instance-string", Fimage_instance_string, 1, 1, 0, /* Return the string of the given image instance. This will only be non-nil for text image instances and widgets. @@ -1285,12 +1651,13 @@ struct image_instantiator_methods* meths; CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); CHECK_SYMBOL (prop); ii = XIMAGE_INSTANCE (image_instance); /* ... then try device specific methods ... */ type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii)); - meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), + meths = decode_device_ii_format (image_instance_device (image_instance), type, ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, property) && @@ -1310,65 +1677,13 @@ return Qnil; } -DEFUN ("set-image-instance-property", Fset_image_instance_property, 3, 3, 0, /* -Set the given property of the given image instance. -Does nothing if the property or the property method do not exist for -the image instance in the domain. -*/ - (image_instance, prop, val)) -{ - Lisp_Image_Instance* ii; - Lisp_Object type, ret; - struct image_instantiator_methods* meths; - - CHECK_IMAGE_INSTANCE (image_instance); - CHECK_SYMBOL (prop); - ii = XIMAGE_INSTANCE (image_instance); - type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii)); - /* try device specific methods first ... */ - meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), - type, ERROR_ME_NOT); - if (meths && HAS_IIFORMAT_METH_P (meths, set_property) - && - !UNBOUNDP (ret = - IIFORMAT_METH (meths, set_property, (image_instance, prop, val)))) - { - val = ret; - } - else - { - /* ... then format specific methods ... */ - meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); - if (meths && HAS_IIFORMAT_METH_P (meths, set_property) - && - !UNBOUNDP (ret = - IIFORMAT_METH (meths, set_property, (image_instance, prop, val)))) - { - val = ret; - } - else - { - val = Qnil; - } - } - - /* Make sure the image instance gets redisplayed. - - ### This currently does not change the dirty state of an - enclosing layout which may be bad. */ - MARK_IMAGE_INSTANCE_CHANGED (ii); - MARK_SUBWINDOWS_STATE_CHANGED; - MARK_GLYPHS_CHANGED; - - return val; -} - DEFUN ("image-instance-file-name", Fimage_instance_file_name, 1, 1, 0, /* Return the file name from which IMAGE-INSTANCE was read, if known. */ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1388,6 +1703,7 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1408,6 +1724,7 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1427,6 +1744,7 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1435,7 +1753,6 @@ case IMAGE_POINTER: case IMAGE_SUBWINDOW: case IMAGE_WIDGET: - case IMAGE_LAYOUT: return make_int (XIMAGE_INSTANCE_HEIGHT (image_instance)); default: @@ -1449,6 +1766,7 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1457,7 +1775,6 @@ case IMAGE_POINTER: case IMAGE_SUBWINDOW: case IMAGE_WIDGET: - case IMAGE_LAYOUT: return make_int (XIMAGE_INSTANCE_WIDTH (image_instance)); default: @@ -1476,6 +1793,7 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1500,6 +1818,7 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1521,6 +1840,7 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1532,7 +1852,7 @@ case IMAGE_WIDGET: return FACE_FOREGROUND ( XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_SUBWINDOW_FRAME + XIMAGE_INSTANCE_FRAME (image_instance)); default: @@ -1548,6 +1868,7 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1559,7 +1880,7 @@ case IMAGE_WIDGET: return FACE_BACKGROUND ( XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_SUBWINDOW_FRAME + XIMAGE_INSTANCE_FRAME (image_instance)); default: @@ -1581,16 +1902,18 @@ Lisp_Object device; CHECK_IMAGE_INSTANCE (image_instance); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); CHECK_COLOR_INSTANCE (foreground); CHECK_COLOR_INSTANCE (background); - device = XIMAGE_INSTANCE_DEVICE (image_instance); + device = image_instance_device (image_instance); if (!HAS_DEVMETH_P (XDEVICE (device), colorize_image_instance)) return image_instance; /* #### There should be a copy_image_instance(), which calls a device-specific method to copy the window-system subobject. */ - new = allocate_image_instance (device, Qnil); + new = allocate_image_instance (XIMAGE_INSTANCE_DOMAIN (image_instance), + Qnil, Qnil); copy_lcrecord (XIMAGE_INSTANCE (new), XIMAGE_INSTANCE (image_instance)); /* note that if this method returns non-zero, this method MUST copy any window-system resources, so that when one image instance is @@ -1610,13 +1933,14 @@ special function then just return the width and / or height. */ void image_instance_query_geometry (Lisp_Object image_instance, - unsigned int* width, unsigned int* height, + int* width, int* height, enum image_instance_geometry disp, Lisp_Object domain) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); Lisp_Object type; struct image_instantiator_methods* meths; + ERROR_CHECK_IMAGE_INSTANCE (image_instance); type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii)); meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); @@ -1641,16 +1965,33 @@ function relatively simple to take account of that. An alternative approach is to consider separately the two cases, one where you don't mind what size you have (normal widgets) and one where you - want to specifiy something (layout widgets). */ + want to specify something (layout widgets). */ void image_instance_layout (Lisp_Object image_instance, - unsigned int width, unsigned int height, + int width, int height, + int xoffset, int yoffset, Lisp_Object domain) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); Lisp_Object type; struct image_instantiator_methods* meths; + ERROR_CHECK_IMAGE_INSTANCE (image_instance); + + /* Nothing is as nothing does. */ + if (NOTHING_IMAGE_INSTANCEP (image_instance)) + return; + + /* We don't want carefully calculated offsets to be mucked up by + random layouts. */ + if (xoffset != IMAGE_UNCHANGED_GEOMETRY) + XIMAGE_INSTANCE_XOFFSET (image_instance) = xoffset; + if (yoffset != IMAGE_UNCHANGED_GEOMETRY) + XIMAGE_INSTANCE_YOFFSET (image_instance) = yoffset; + + assert (XIMAGE_INSTANCE_YOFFSET (image_instance) >= 0 + && XIMAGE_INSTANCE_XOFFSET (image_instance) >= 0); + type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii)); meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); @@ -1659,7 +2000,8 @@ || height == IMAGE_UNSPECIFIED_GEOMETRY) { - unsigned int dwidth, dheight; + int dwidth = IMAGE_UNSPECIFIED_GEOMETRY; + int dheight = IMAGE_UNSPECIFIED_GEOMETRY; /* Get the desired geometry. */ if (meths && HAS_IIFORMAT_METH_P (meths, query_geometry)) @@ -1681,18 +2023,90 @@ height = dheight; } + /* If we don't have sane values then we cannot layout at this point and + must just return. */ + if (width == IMAGE_UNSPECIFIED_GEOMETRY + || + height == IMAGE_UNSPECIFIED_GEOMETRY) + return; + /* At this point width and height should contain sane values. Thus we set the glyph geometry and lay it out. */ + if (IMAGE_INSTANCE_WIDTH (ii) != width + || + IMAGE_INSTANCE_HEIGHT (ii) != height) + { + IMAGE_INSTANCE_SIZE_CHANGED (ii) = 1; + } + IMAGE_INSTANCE_WIDTH (ii) = width; IMAGE_INSTANCE_HEIGHT (ii) = height; - if (meths && HAS_IIFORMAT_METH_P (meths, layout)) + if (IIFORMAT_METH_OR_GIVEN (meths, layout, + (image_instance, width, height, xoffset, yoffset, + domain), 1)) + /* Do not clear the dirty flag here - redisplay will do this for + us at the end. */ + IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 0; +} + +/* Update an image instance from its changed instantiator. */ +static void +update_image_instance (Lisp_Object image_instance, + Lisp_Object instantiator) +{ + struct image_instantiator_methods* meths; + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + + ERROR_CHECK_IMAGE_INSTANCE (image_instance); + + if (NOTHING_IMAGE_INSTANCEP (image_instance)) + return; + + assert (!internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, 0) + || (internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, 0) + && internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, -10))); + + /* If the instantiator is identical then do nothing. We must use + equal here because the specifier code copies the instantiator. */ + if (!internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, 0)) { - IIFORMAT_METH (meths, layout, (image_instance, width, height, domain)); + /* Extract the changed properties so that device / format + methods only have to cope with these. We assume that + normalization has already been done. */ + Lisp_Object diffs = find_instantiator_differences + (instantiator, + IMAGE_INSTANCE_INSTANTIATOR (ii)); + Lisp_Object type = encode_image_instance_type + (IMAGE_INSTANCE_TYPE (ii)); + struct gcpro gcpro1; + GCPRO1 (diffs); + + /* try device specific methods first ... */ + meths = decode_device_ii_format (image_instance_device (image_instance), + type, ERROR_ME_NOT); + MAYBE_IIFORMAT_METH (meths, update, (image_instance, diffs)); + /* ... then format specific methods ... */ + meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); + MAYBE_IIFORMAT_METH (meths, update, (image_instance, diffs)); + + /* Instance and therefore glyph has changed so mark as dirty. + If we don't do this output optimizations will assume the + glyph is unchanged. */ + set_image_instance_dirty_p (image_instance, 1); + /* Structure has changed. */ + IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 1; + + UNGCPRO; } - /* else no change to the geometry. */ - - XIMAGE_INSTANCE_DIRTYP (image_instance) = 0; + /* We should now have a consistent instantiator so keep a record of + it. It is important that we don't actually update the window + system widgets here - we must do that when redisplay tells us + to. + + #### should we delay doing this until the display is up-to-date + also? */ + IMAGE_INSTANCE_INSTANTIATOR (ii) = instantiator; } /* @@ -1717,7 +2131,9 @@ if (TEXT_IMAGE_INSTANCEP (image)) { - XIMAGE_INSTANCE_DIRTYP (image) = 1; + Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image); + IMAGE_INSTANCE_DIRTYP (ii) = 1; + IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 1; if (GLYPHP (glyph_or_ii)) XGLYPH_DIRTYP (glyph_or_ii) = 1; return 1; @@ -1732,14 +2148,14 @@ /* error helpers */ /************************************************************************/ DOESNT_RETURN -signal_image_error (CONST char *reason, Lisp_Object frob) +signal_image_error (const char *reason, Lisp_Object frob) { signal_error (Qimage_conversion_error, list2 (build_translated_string (reason), frob)); } DOESNT_RETURN -signal_image_error_2 (CONST char *reason, Lisp_Object frob0, Lisp_Object frob1) +signal_image_error_2 (const char *reason, Lisp_Object frob0, Lisp_Object frob1) { signal_error (Qimage_conversion_error, list3 (build_translated_string (reason), frob0, frob1)); @@ -1763,7 +2179,11 @@ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); if (dest_mask & IMAGE_NOTHING_MASK) - IMAGE_INSTANCE_TYPE (ii) = IMAGE_NOTHING; + { + IMAGE_INSTANCE_TYPE (ii) = IMAGE_NOTHING; + IMAGE_INSTANCE_HEIGHT (ii) = 0; + IMAGE_INSTANCE_WIDTH (ii) = 0; + } else incompatible_image_types (instantiator, dest_mask, IMAGE_NOTHING_MASK); } @@ -1780,7 +2200,8 @@ } static Lisp_Object -inherit_normalize (Lisp_Object inst, Lisp_Object console_type) +inherit_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { Lisp_Object face; @@ -1833,7 +2254,7 @@ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); /* Should never get here with a domain other than a window. */ - assert (!NILP (string) && WINDOWP (domain)); + assert (!NILP (string) && WINDOWP (DOMAIN_WINDOW (domain))); if (dest_mask & IMAGE_TEXT_MASK) { IMAGE_INSTANCE_TYPE (ii) = IMAGE_TEXT; @@ -1850,14 +2271,13 @@ helper that is used elsewhere for calculating text geometry. */ void query_string_geometry (Lisp_Object string, Lisp_Object face, - unsigned int* width, unsigned int* height, - unsigned int* descent, Lisp_Object domain) + int* width, int* height, int* descent, Lisp_Object domain) { struct font_metric_info fm; unsigned char charsets[NUM_LEADING_BYTES]; struct face_cachel frame_cachel; struct face_cachel *cachel; - Lisp_Object frame = FW_FRAME (domain); + Lisp_Object frame = DOMAIN_FRAME (domain); /* Compute height */ if (height) @@ -1876,7 +2296,8 @@ } else { - cachel = WINDOW_FACE_CACHEL (XWINDOW (domain), DEFAULT_INDEX); + cachel = WINDOW_FACE_CACHEL (DOMAIN_XWINDOW (domain), + DEFAULT_INDEX); } ensure_face_cachel_complete (cachel, domain, charsets); @@ -1909,7 +2330,7 @@ struct face_cachel frame_cachel; struct face_cachel *cachel; int i; - Lisp_Object frame = FW_FRAME (domain); + Lisp_Object frame = DOMAIN_FRAME (domain); /* Compute string font info */ find_charsets_in_bufbyte_string (charsets, @@ -1938,11 +2359,11 @@ static void text_query_geometry (Lisp_Object image_instance, - unsigned int* width, unsigned int* height, + int* width, int* height, enum image_instance_geometry disp, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - unsigned int descent = 0; + int descent = 0; query_string_geometry (IMAGE_INSTANCE_TEXT_STRING (ii), IMAGE_INSTANCE_FACE (ii), @@ -1954,20 +2375,16 @@ } /* set the properties of a string */ -static Lisp_Object -text_set_property (Lisp_Object image_instance, Lisp_Object prop, - Lisp_Object val) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - - if (EQ (prop, Q_data)) +static void +text_update (Lisp_Object image_instance, Lisp_Object instantiator) +{ + Lisp_Object val = find_keyword_in_vector (instantiator, Q_data); + + if (!NILP (val)) { CHECK_STRING (val); - IMAGE_INSTANCE_TEXT_STRING (ii) = val; - - return Qt; + XIMAGE_INSTANCE_TEXT_STRING (image_instance) = val; } - return Qunbound; } @@ -2162,11 +2579,9 @@ unsigned int w, h; Extbyte *data; int result; - CONST char *filename_ext; - - TO_EXTERNAL_FORMAT (LISP_STRING, name, - C_STRING_ALLOCA, filename_ext, - Qfile_name); + const char *filename_ext; + + LISP_STRING_TO_EXTERNAL (name, filename_ext, Qfile_name); result = read_bitmap_data_from_file (filename_ext, &w, &h, &data, xhot, yhot); @@ -2252,7 +2667,8 @@ /* Normalize method for XBM's. */ static Lisp_Object -xbm_normalize (Lisp_Object inst, Lisp_Object console_type) +xbm_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { Lisp_Object file = Qnil, mask_file = Qnil; struct gcpro gcpro1, gcpro2, gcpro3; @@ -2335,7 +2751,8 @@ } static Lisp_Object -xface_normalize (Lisp_Object inst, Lisp_Object console_type) +xface_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { /* This function can call lisp */ Lisp_Object file = Qnil, mask_file = Qnil; @@ -2410,9 +2827,7 @@ int result; char *fname = 0; - TO_EXTERNAL_FORMAT (LISP_STRING, name, - C_STRING_ALLOCA, fname, - Qfile_name); + LISP_STRING_TO_EXTERNAL (name, fname, Qfile_name); result = XpmReadFileToData (fname, &data); if (result == XpmSuccess) @@ -2544,7 +2959,8 @@ } static Lisp_Object -xpm_normalize (Lisp_Object inst, Lisp_Object console_type) +xpm_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { Lisp_Object file = Qnil; Lisp_Object color_symbols; @@ -2641,7 +3057,14 @@ static Lisp_Object image_instantiate_cache_result (Lisp_Object locative) { - /* locative = (instance instantiator . subtable) */ + /* locative = (instance instantiator . subtable) + + So we are using the instantiator as the key and the instance as + the value. Since the hashtable is key-weak this means that the + image instance will stay around as long as the instantiator stays + around. The instantiator is stored in the `image' slot of the + glyph, so as long as the glyph is marked the instantiator will be + as well and hence the cached image instance also.*/ Fputhash (XCAR (XCDR (locative)), XCAR (locative), XCDR (XCDR (locative))); free_cons (XCONS (XCDR (locative))); free_cons (XCONS (locative)); @@ -2657,18 +3080,22 @@ Lisp_Object domain, Lisp_Object instantiator, Lisp_Object depth) { - Lisp_Object device = DFW_DEVICE (domain); - struct device *d = XDEVICE (device); Lisp_Object glyph = IMAGE_SPECIFIER_ATTACHEE (XIMAGE_SPECIFIER (specifier)); int dest_mask = XIMAGE_SPECIFIER_ALLOWED (specifier); int pointerp = dest_mask & image_instance_type_to_mask (IMAGE_POINTER); if (IMAGE_INSTANCEP (instantiator)) { - /* make sure that the image instance's device and type are + /* make sure that the image instance's governing domain and type are matching. */ - - if (EQ (device, XIMAGE_INSTANCE_DEVICE (instantiator))) + Lisp_Object governing_domain = XIMAGE_INSTANCE_DOMAIN (instantiator); + + if ((DEVICEP (governing_domain) + && EQ (governing_domain, DOMAIN_DEVICE (domain))) + || (FRAMEP (governing_domain) + && EQ (governing_domain, DOMAIN_FRAME (domain))) + || (WINDOWP (governing_domain) + && EQ (governing_domain, DOMAIN_WINDOW (domain)))) { int mask = image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instantiator)); @@ -2679,8 +3106,8 @@ instantiator); } else - signal_simple_error_2 ("Wrong device for image instance", - instantiator, device); + signal_simple_error_2 ("Wrong domain for image instance", + instantiator, domain); } else if (VECTORP (instantiator) && EQ (XVECTOR_DATA (instantiator)[0], Qinherit)) @@ -2692,122 +3119,156 @@ } else { - Lisp_Object instance; - Lisp_Object subtable; + Lisp_Object instance = Qnil; + Lisp_Object subtable = Qnil; Lisp_Object ls3 = Qnil; Lisp_Object pointer_fg = Qnil; Lisp_Object pointer_bg = Qnil; + Lisp_Object governing_domain = + get_image_instantiator_governing_domain (instantiator, domain); + struct gcpro gcpro1; + + GCPRO1 (instance); + + /* We have to put subwindow, widget and text image instances in + a per-window cache so that we can see the same glyph in + different windows. We use governing_domain to determine the type + of image_instance that will be created. */ if (pointerp) { pointer_fg = FACE_FOREGROUND (Vpointer_face, domain); pointer_bg = FACE_BACKGROUND (Vpointer_face, domain); - ls3 = list3 (instantiator, pointer_fg, pointer_bg); + ls3 = list3 (glyph, pointer_fg, pointer_bg); } - /* First look in the hash table. */ - subtable = Fgethash (make_int (dest_mask), d->image_instance_cache, - Qunbound); - if (UNBOUNDP (subtable)) + /* First look in the device cache. */ + if (DEVICEP (governing_domain)) { - /* For the image instance cache, we do comparisons with EQ rather - than with EQUAL, as we do for color and font names. - The reasons are: - - 1) pixmap data can be very long, and thus the hashing and - comparing will take awhile. - 2) It's not so likely that we'll run into things that are EQUAL - but not EQ (that can happen a lot with faces, because their - specifiers are copied around); but pixmaps tend not to be - in faces. - - However, if the image-instance could be a pointer, we have to - use EQUAL because we massaged the instantiator into a cons3 - also containing the foreground and background of the - pointer face. - */ - - subtable = make_lisp_hash_table (20, - pointerp ? HASH_TABLE_KEY_CAR_WEAK - : HASH_TABLE_KEY_WEAK, - pointerp ? HASH_TABLE_EQUAL - : HASH_TABLE_EQ); - Fputhash (make_int (dest_mask), subtable, - d->image_instance_cache); - instance = Qunbound; + subtable = Fgethash (make_int (dest_mask), + XDEVICE (governing_domain)-> + image_instance_cache, + Qunbound); + if (UNBOUNDP (subtable)) + { + /* For the image instance cache, we do comparisons with + EQ rather than with EQUAL, as we do for color and + font names. The reasons are: + + 1) pixmap data can be very long, and thus the hashing + and comparing will take awhile. + + 2) It's not so likely that we'll run into things that + are EQUAL but not EQ (that can happen a lot with + faces, because their specifiers are copied around); + but pixmaps tend not to be in faces. + + However, if the image-instance could be a pointer, we + have to use EQUAL because we massaged the + instantiator into a cons3 also containing the + foreground and background of the pointer face. */ + + subtable = make_lisp_hash_table + (20, pointerp ? HASH_TABLE_KEY_CAR_WEAK + : HASH_TABLE_KEY_WEAK, + pointerp ? HASH_TABLE_EQUAL + : HASH_TABLE_EQ); + Fputhash (make_int (dest_mask), subtable, + XDEVICE (governing_domain)->image_instance_cache); + instance = Qunbound; + } + else + { + instance = Fgethash (pointerp ? ls3 : glyph, + subtable, Qunbound); + } + } + else if (WINDOWP (governing_domain)) + { + /* Subwindows have a per-window cache and have to be treated + differently. */ + instance = + Fgethash (pointerp ? ls3 : glyph, + XWINDOW (governing_domain)->subwindow_instance_cache, + Qunbound); } else - { - instance = Fgethash (pointerp ? ls3 : instantiator, - subtable, Qunbound); - /* subwindows have a per-window cache and have to be treated - differently. dest_mask can be a bitwise OR of all image - types so we will only catch someone possibly trying to - instantiate a subwindow type thing. Unfortunately, this - will occur most of the time so this probably slows things - down. But with the current design I don't see anyway - round it. */ - if (UNBOUNDP (instance) - && - dest_mask & (IMAGE_SUBWINDOW_MASK - | IMAGE_WIDGET_MASK - | IMAGE_TEXT_MASK)) - { - if (!WINDOWP (domain)) - signal_simple_error ("Can't instantiate text or subwindow outside a window", - instantiator); - instance = Fgethash (instantiator, - XWINDOW (domain)->subwindow_instance_cache, - Qunbound); - } - } - + abort (); /* We're not allowed anything else currently. */ + + /* If we don't have an instance at this point then create + one. */ if (UNBOUNDP (instance)) { Lisp_Object locative = noseeum_cons (Qnil, - noseeum_cons (pointerp ? ls3 : instantiator, - subtable)); + noseeum_cons (pointerp ? ls3 : glyph, + DEVICEP (governing_domain) ? subtable + : XWINDOW (governing_domain) + ->subwindow_instance_cache)); int speccount = specpdl_depth (); - /* make sure we cache the failures, too. - Use an unwind-protect to catch such errors. - If we fail, the unwind-protect records nil in - the hash table. If we succeed, we change the - car of the locative to the resulting instance, - which gets recorded instead. */ + /* Make sure we cache the failures, too. Use an + unwind-protect to catch such errors. If we fail, the + unwind-protect records nil in the hash table. If we + succeed, we change the car of the locative to the + resulting instance, which gets recorded instead. */ record_unwind_protect (image_instantiate_cache_result, locative); - instance = instantiate_image_instantiator (device, - domain, - instantiator, - pointer_fg, pointer_bg, - dest_mask, - glyph); + instance = + instantiate_image_instantiator (governing_domain, + domain, instantiator, + pointer_fg, pointer_bg, + dest_mask, glyph); + + /* We need a per-frame cache for redisplay. */ + cache_subwindow_instance_in_frame_maybe (instance); Fsetcar (locative, instance); - /* only after the image has been instantiated do we know - whether we need to put it in the per-window image instance - cache. */ +#ifdef ERROR_CHECK_GLYPHS + if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance)) + & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) + assert (EQ (XIMAGE_INSTANCE_FRAME (instance), + DOMAIN_FRAME (domain))); +#endif + unbind_to (speccount, Qnil); +#ifdef ERROR_CHECK_GLYPHS if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance)) - & - (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) - { - if (!WINDOWP (domain)) - signal_simple_error ("Can't instantiate subwindow outside a window", - instantiator); - - Fsetcdr (XCDR (locative), XWINDOW (domain)->subwindow_instance_cache ); - } - unbind_to (speccount, Qnil); + & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) + assert (EQ (Fgethash ((pointerp ? ls3 : glyph), + XWINDOW (governing_domain) + ->subwindow_instance_cache, + Qunbound), instance)); +#endif } - else - free_list (ls3); - - if (NILP (instance)) + else if (NILP (instance)) signal_simple_error ("Can't instantiate image (probably cached)", instantiator); - return instance; + /* We found an instance. However, because we are using the glyph + as the hash key instead of the instantiator, the current + instantiator may not be the same as the original. Thus we + must update the instance based on the new + instantiator. Preserving instance identity like this is + important to stop excessive window system widget creation and + deletion - and hence flashing. */ + else + { + /* #### This function should be able to cope with *all* + changes to the instantiator, but currently only copes + with the most used properties. This means that it is + possible to make changes that don't get reflected in the + display. */ + update_image_instance (instance, instantiator); + free_list (ls3); + } + +#ifdef ERROR_CHECK_GLYPHS + if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance)) + & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) + assert (EQ (XIMAGE_INSTANCE_FRAME (instance), + DOMAIN_FRAME (domain))); +#endif + ERROR_CHECK_IMAGE_INSTANCE (instance); + RETURN_UNGCPRO (instance); } abort (); @@ -3021,187 +3482,7 @@ DEFUN ("image-specifier-p", Fimage_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is an image specifier. - -An image specifier is used for images (pixmaps and the like). It is used -to describe the actual image in a glyph. It is instanced as an image- -instance. - -Image instantiators come in many formats: `xbm', `xpm', `gif', `jpeg', -etc. This describes the format of the data describing the image. The -resulting image instances also come in many types -- `mono-pixmap', -`color-pixmap', `text', `pointer', etc. This refers to the behavior of -the image and the sorts of places it can appear. (For example, a -color-pixmap image has fixed colors specified for it, while a -mono-pixmap image comes in two unspecified shades "foreground" and -"background" that are determined from the face of the glyph or -surrounding text; a text image appears as a string of text and has an -unspecified foreground, background, and font; a pointer image behaves -like a mono-pixmap image but can only be used as a mouse pointer -\[mono-pixmap images cannot be used as mouse pointers]; etc.) It is -important to keep the distinction between image instantiator format and -image instance type in mind. Typically, a given image instantiator -format can result in many different image instance types (for example, -`xpm' can be instanced as `color-pixmap', `mono-pixmap', or `pointer'; -whereas `cursor-font' can be instanced only as `pointer'), and a -particular image instance type can be generated by many different -image instantiator formats (e.g. `color-pixmap' can be generated by `xpm', -`gif', `jpeg', etc.). - -See `make-image-instance' for a more detailed discussion of image -instance types. - -An image instantiator should be a string or a vector of the form - - [FORMAT :KEYWORD VALUE ...] - -i.e. a format symbol followed by zero or more alternating keyword-value -pairs. FORMAT should be one of - -'nothing - (Don't display anything; no keywords are valid for this. - Can only be instanced as `nothing'.) -'string - (Display this image as a text string. Can only be instanced - as `text', although support for instancing as `mono-pixmap' - should be added.) -'formatted-string - (Display this image as a text string, with replaceable fields; - not currently implemented.) -'xbm - (An X bitmap; only if X or Windows support was compiled into this XEmacs. - Can be instanced as `mono-pixmap', `color-pixmap', or `pointer'.) -'xpm - (An XPM pixmap; only if XPM support was compiled into this XEmacs. - Can be instanced as `color-pixmap', `mono-pixmap', or `pointer'.) -'xface - (An X-Face bitmap, used to encode people's faces in e-mail messages; - only if X-Face support was compiled into this XEmacs. Can be - instanced as `mono-pixmap', `color-pixmap', or `pointer'.) -'gif - (A GIF87 or GIF89 image; only if GIF support was compiled into this - XEmacs. NOTE: only the first frame of animated gifs will be displayed. - Can be instanced as `color-pixmap'.) -'jpeg - (A JPEG image; only if JPEG support was compiled into this XEmacs. - Can be instanced as `color-pixmap'.) -'png - (A PNG image; only if PNG support was compiled into this XEmacs. - Can be instanced as `color-pixmap'.) -'tiff - (A TIFF image; only if TIFF support was compiled into this XEmacs. - Can be instanced as `color-pixmap'.) -'cursor-font - (One of the standard cursor-font names, such as "watch" or - "right_ptr" under X. Under X, this is, more specifically, any - of the standard cursor names from appendix B of the Xlib manual - [also known as the file ] minus the XC_ prefix. - On other window systems, the valid names will be specific to the - type of window system. Can only be instanced as `pointer'.) -'font - (A glyph from a font; i.e. the name of a font, and glyph index into it - of the form "FONT fontname index [[mask-font] mask-index]". - Currently can only be instanced as `pointer', although this should - probably be fixed.) -'subwindow - (An embedded windowing system window.) -'edit-field - (A text editing widget glyph.) -'button - (A button widget glyph; either a push button, radio button or toggle button.) -'tab-control - (A tab widget glyph; a series of user selectable tabs.) -'progress-gauge - (A sliding widget glyph, for showing progress.) -'combo-box - (A drop list of selectable items in a widget glyph, for editing text.) -'label - (A static, text-only, widget glyph; for displaying text.) -'tree-view - (A folding widget glyph.) -'autodetect - (XEmacs tries to guess what format the data is in. If X support - exists, the data string will be checked to see if it names a filename. - If so, and this filename contains XBM or XPM data, the appropriate - sort of pixmap or pointer will be created. [This includes picking up - any specified hotspot or associated mask file.] Otherwise, if `pointer' - is one of the allowable image-instance types and the string names a - valid cursor-font name, the image will be created as a pointer. - Otherwise, the image will be displayed as text. If no X support - exists, the image will always be displayed as text.) -'inherit - Inherit from the background-pixmap property of a face. - -The valid keywords are: - -:data - (Inline data. For most formats above, this should be a string. For - XBM images, this should be a list of three elements: width, height, and - a string of bit data. This keyword is not valid for instantiator - formats `nothing' and `inherit'.) -:file - (Data is contained in a file. The value is the name of this file. - If both :data and :file are specified, the image is created from - what is specified in :data and the string in :file becomes the - value of the `image-instance-file-name' function when applied to - the resulting image-instance. This keyword is not valid for - instantiator formats `nothing', `string', `formatted-string', - `cursor-font', `font', `autodetect', and `inherit'.) -:foreground -:background - (For `xbm', `xface', `cursor-font', `widget' and `font'. These keywords - allow you to explicitly specify foreground and background colors. - The argument should be anything acceptable to `make-color-instance'. - This will cause what would be a `mono-pixmap' to instead be colorized - as a two-color color-pixmap, and specifies the foreground and/or - background colors for a pointer instead of black and white.) -:mask-data - (For `xbm' and `xface'. This specifies a mask to be used with the - bitmap. The format is a list of width, height, and bits, like for - :data.) -:mask-file - (For `xbm' and `xface'. This specifies a file containing the mask data. - If neither a mask file nor inline mask data is given for an XBM image, - and the XBM image comes from a file, XEmacs will look for a mask file - with the same name as the image file but with "Mask" or "msk" - appended. For example, if you specify the XBM file "left_ptr" - [usually located in "/usr/include/X11/bitmaps"], the associated - mask file "left_ptrmsk" will automatically be picked up.) -:hotspot-x -:hotspot-y - (For `xbm' and `xface'. These keywords specify a hotspot if the image - is instantiated as a `pointer'. Note that if the XBM image file - specifies a hotspot, it will automatically be picked up if no - explicit hotspot is given.) -:color-symbols - (Only for `xpm'. This specifies an alist that maps strings - that specify symbolic color names to the actual color to be used - for that symbolic color (in the form of a string or a color-specifier - object). If this is not specified, the contents of `xpm-color-symbols' - are used to generate the alist.) -:face - (Only for `inherit'. This specifies the face to inherit from. - For widget glyphs this also specifies the face to use for - display. It defaults to gui-element-face.) - -Keywords accepted as menu item specs are also accepted by widget -glyphs. These are `:selected', `:active', `:suffix', `:keys', -`:style', `:filter', `:config', `:included', `:key-sequence', -`:accelerator', `:label' and `:callback'. - -If instead of a vector, the instantiator is a string, it will be -converted into a vector by looking it up according to the specs in the -`console-type-image-conversion-list' (q.v.) for the console type of -the domain (usually a window; sometimes a frame or device) over which -the image is being instantiated. - -If the instantiator specifies data from a file, the data will be read -in at the time that the instantiator is added to the image (which may -be well before when the image is actually displayed), and the -instantiator will be converted into one of the inline-data forms, with -the filename retained using a :file keyword. This implies that the -file must exist when the instantiator is added to the image, but does -not need to exist at any other time (e.g. it may safely be a temporary -file). +See `make-image-specifier' for a description of image instantiators. */ (object)) { @@ -3371,8 +3652,7 @@ XIMAGE_SPECIFIER_ALLOWED (g->image) = IMAGE_NOTHING_MASK | IMAGE_TEXT_MASK | IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK - | IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK - | IMAGE_LAYOUT_MASK; + | IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK; break; case GLYPH_POINTER: XIMAGE_SPECIFIER_ALLOWED (g->image) = @@ -3458,7 +3738,7 @@ } DEFUN ("make-glyph-internal", Fmake_glyph_internal, 0, 1, 0, /* -Create and return a new uninitialized glyph or type TYPE. +Create and return a new uninitialized glyph of type TYPE. TYPE specifies the type of the glyph; this should be one of `buffer', `pointer', or `icon', and defaults to `buffer'. The type of the glyph @@ -3487,11 +3767,13 @@ DEFUN ("glyphp", Fglyphp, 1, 1, 0, /* Return non-nil if OBJECT is a glyph. -A glyph is an object used for pixmaps and the like. It is used +A glyph is an object used for pixmaps, widgets and the like. It is used in begin-glyphs and end-glyphs attached to extents, in marginal and textual annotations, in overlay arrows (overlay-arrow-* variables), in toolbar -buttons, and the like. Its image is described using an image specifier -- -see `image-specifier-p'. +buttons, and the like. Much more detailed information can be found at +`make-glyph'. Its image is described using an image specifier -- +see `make-image-specifier'. See also `make-image-instance' for further +information. */ (object)) { @@ -3526,6 +3808,7 @@ domain, errb, no_quit, 0, Qzero); assert (!UNBOUNDP (image_instance)); + ERROR_CHECK_IMAGE_INSTANCE (image_instance); return image_instance; } @@ -3556,9 +3839,11 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_DIRTYP (instance)) + if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, domain); + IMAGE_UNSPECIFIED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, domain); return XIMAGE_INSTANCE_WIDTH (instance); } @@ -3584,9 +3869,11 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_DIRTYP (instance)) + if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, domain); + IMAGE_UNSPECIFIED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, domain); if (XIMAGE_INSTANCE_TYPE (instance) == IMAGE_TEXT) return XIMAGE_INSTANCE_TEXT_ASCENT (instance); @@ -3602,9 +3889,11 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_DIRTYP (instance)) + if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, domain); + IMAGE_UNSPECIFIED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, domain); if (XIMAGE_INSTANCE_TYPE (instance) == IMAGE_TEXT) return XIMAGE_INSTANCE_TEXT_DESCENT (instance); @@ -3622,9 +3911,11 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_DIRTYP (instance)) + if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, domain); + IMAGE_UNSPECIFIED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, + IMAGE_UNCHANGED_GEOMETRY, domain); return XIMAGE_INSTANCE_HEIGHT (instance); } @@ -3683,10 +3974,29 @@ XGLYPH_DIRTYP (glyph_or_image) = dirty; } + if (!IMAGE_INSTANCEP (instance)) + return; + XIMAGE_INSTANCE_DIRTYP (instance) = dirty; } } +static void +set_image_instance_dirty_p (Lisp_Object instance, int dirty) +{ + if (IMAGE_INSTANCEP (instance)) + { + XIMAGE_INSTANCE_DIRTYP (instance) = dirty; + /* Now cascade up the hierarchy. */ + set_image_instance_dirty_p (XIMAGE_INSTANCE_PARENT (instance), + dirty); + } + else if (GLYPHP (instance)) + { + XGLYPH_DIRTYP (instance) = dirty; + } +} + /* #### do we need to cache this info to speed things up? */ Lisp_Object @@ -3741,43 +4051,46 @@ (XGLYPH (glyph)->after_change) (glyph, property, locale); } -#if 0 /* Not used for now */ -static void -glyph_query_geometry (Lisp_Object glyph_or_image, Lisp_Object window, - unsigned int* width, unsigned int* height, +void +glyph_query_geometry (Lisp_Object glyph_or_image, int* width, int* height, enum image_instance_geometry disp, Lisp_Object domain) { Lisp_Object instance = glyph_or_image; if (GLYPHP (glyph_or_image)) - instance = glyph_image_instance (glyph_or_image, window, ERROR_ME_NOT, 1); + instance = glyph_image_instance (glyph_or_image, domain, ERROR_ME_NOT, 1); image_instance_query_geometry (instance, width, height, disp, domain); } -static void -glyph_layout (Lisp_Object glyph_or_image, Lisp_Object window, - unsigned int width, unsigned int height, Lisp_Object domain) +void +glyph_do_layout (Lisp_Object glyph_or_image, int width, int height, + int xoffset, int yoffset, Lisp_Object domain) { Lisp_Object instance = glyph_or_image; if (GLYPHP (glyph_or_image)) - instance = glyph_image_instance (glyph_or_image, window, ERROR_ME_NOT, 1); - - image_instance_layout (instance, width, height, domain); -} -#endif + instance = glyph_image_instance (glyph_or_image, domain, ERROR_ME_NOT, 1); + + image_instance_layout (instance, width, height, xoffset, yoffset, domain); +} /***************************************************************************** * glyph cachel functions * *****************************************************************************/ -/* - #### All of this is 95% copied from face cachels. - Consider consolidating. - */ - +/* #### All of this is 95% copied from face cachels. Consider + consolidating. + + Why do we need glyph_cachels? Simply because a glyph_cachel captures + per-window information about a particular glyph. A glyph itself is + not created in any particular context, so if we were to rely on a + glyph to tell us about its dirtiness we would not be able to reset + the dirty flag after redisplaying it as it may exist in other + contexts. When we have redisplayed we need to know which glyphs to + reset the dirty flags on - the glyph_cachels give us a nice list we + can iterate through doing this. */ void mark_glyph_cachels (glyph_cachel_dynarr *elements) { @@ -3810,6 +4123,9 @@ and passing it to the size functions. */ instance = glyph_image_instance (glyph, window, ERROR_ME_NOT, 1); + if (!IMAGE_INSTANCEP (instance)) + return; + /* Mark text instance of the glyph dirty if faces have changed, because its geometry might have changed. */ invalidate_glyph_geometry_maybe (instance, w); @@ -3945,138 +4261,90 @@ per-frame instance cache that we use to determine if a subwindow is obscuring an area that we want to clear. We need to be able to flip through this quickly so a hashtable is not suitable hence the - subwindow_cachels. The question is should we just not mark - instances in the subwindow_cachels or should we try and invalidate - the cache at suitable points in redisplay? If we don't invalidate - the cache it will fill up with crud that will only get removed when - the frame is deleted. So invalidation is good, the question is when - and whether we mark as well. Go for the simple option - don't mark, - MARK_SUBWINDOWS_CHANGED when a subwindow gets deleted. */ - -void -mark_subwindow_cachels (subwindow_cachel_dynarr *elements) -{ - int elt; - - if (!elements) - return; - - for (elt = 0; elt < Dynarr_length (elements); elt++) - { - struct subwindow_cachel *cachel = Dynarr_atp (elements, elt); - mark_object (cachel->subwindow); - } -} - -static void -update_subwindow_cachel_data (struct frame *f, Lisp_Object subwindow, - struct subwindow_cachel *cachel) -{ - cachel->subwindow = subwindow; - cachel->width = XIMAGE_INSTANCE_SUBWINDOW_WIDTH (subwindow); - cachel->height = XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (subwindow); - cachel->updated = 1; -} - -static void -add_subwindow_cachel (struct frame *f, Lisp_Object subwindow) -{ - struct subwindow_cachel new_cachel; - - xzero (new_cachel); - new_cachel.subwindow = Qnil; - new_cachel.x=0; - new_cachel.y=0; - new_cachel.being_displayed=0; - - update_subwindow_cachel_data (f, subwindow, &new_cachel); - Dynarr_add (f->subwindow_cachels, new_cachel); -} - -static int -get_subwindow_cachel_index (struct frame *f, Lisp_Object subwindow) -{ - int elt; - - if (noninteractive) - return 0; - - for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) - { - struct subwindow_cachel *cachel = - Dynarr_atp (f->subwindow_cachels, elt); - - if (EQ (cachel->subwindow, subwindow) && !NILP (subwindow)) - { - if (!cachel->updated) - update_subwindow_cachel_data (f, subwindow, cachel); - return elt; - } - } - - /* If we didn't find the glyph, add it and then return its index. */ - add_subwindow_cachel (f, subwindow); - return elt; -} - -static void -update_subwindow_cachel (Lisp_Object subwindow) -{ - struct frame* f; - int elt; - - if (NILP (subwindow)) - return; - - f = XFRAME ( XIMAGE_INSTANCE_SUBWINDOW_FRAME (subwindow)); - - for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) - { - struct subwindow_cachel *cachel = - Dynarr_atp (f->subwindow_cachels, elt); - - if (EQ (cachel->subwindow, subwindow) && !NILP (subwindow)) - { - update_subwindow_cachel_data (f, subwindow, cachel); - } - } -} + subwindow_cachels. This is a weak list so unreference instances + will get deleted properly. */ /* redisplay in general assumes that drawing something will erase what was there before. unfortunately this does not apply to subwindows that need to be specifically unmapped in order to disappear. we take a brute force approach - on the basis that its cheap - and unmap all subwindows in a display line */ -void -reset_subwindow_cachels (struct frame *f) -{ - int elt; - for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) + +/* Put new instances in the frame subwindow cache. This is less costly than + doing it every time something gets mapped, and deleted instances will be + removed automatically. */ +static void +cache_subwindow_instance_in_frame_maybe (Lisp_Object instance) +{ + Lisp_Image_Instance* ii = XIMAGE_INSTANCE (instance); + if (!NILP (DOMAIN_FRAME (IMAGE_INSTANCE_DOMAIN (ii)))) { - struct subwindow_cachel *cachel = - Dynarr_atp (f->subwindow_cachels, elt); - - if (!NILP (cachel->subwindow) && cachel->being_displayed) + struct frame* f = DOMAIN_XFRAME (IMAGE_INSTANCE_DOMAIN (ii)); + XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)) + = Fcons (instance, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))); + } +} + +/* Unmap and finalize all subwindow instances in the frame cache. This + is necessary because GC will not guarantee the order things get + deleted in and moreover, frame finalization deletes the window + system windows before deleting XEmacs windows, and hence + subwindows. */ +int +unmap_subwindow_instance_cache_mapper (Lisp_Object key, Lisp_Object value, + void* finalize) +{ + /* value can be nil; we cache failures as well as successes */ + if (!NILP (value)) + { + struct frame* f = XFRAME (XIMAGE_INSTANCE_FRAME (value)); + unmap_subwindow (value); + if (finalize) { - cachel->updated = 1; - /* #### This is not optimal as update_subwindow will search - the cachels for ourselves as well. We could easily optimize. */ - unmap_subwindow (cachel->subwindow); + /* In case GC doesn't catch up fast enough, remove from the frame + cache also. Otherwise code that checks the sanity of the instance + will fail. */ + XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)) + = delq_no_quit (value, + XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))); + finalize_image_instance (XIMAGE_INSTANCE (value), 0); } } - Dynarr_reset (f->subwindow_cachels); + return 0; +} + +static void +finalize_all_subwindow_instances (struct window *w) +{ + if (!NILP (w->next)) finalize_all_subwindow_instances (XWINDOW (w->next)); + if (!NILP (w->vchild)) finalize_all_subwindow_instances (XWINDOW (w->vchild)); + if (!NILP (w->hchild)) finalize_all_subwindow_instances (XWINDOW (w->hchild)); + + elisp_maphash (unmap_subwindow_instance_cache_mapper, + w->subwindow_instance_cache, (void*)1); } void -mark_subwindow_cachels_as_not_updated (struct frame *f) -{ - int elt; - - for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) - Dynarr_atp (f->subwindow_cachels, elt)->updated = 0; -} - - +free_frame_subwindow_instances (struct frame* f) +{ + /* Make sure all instances are finalized. We have to do this via the + instance cache since some instances may be extant but not + displayed (and hence not in the frame cache). */ + finalize_all_subwindow_instances (XWINDOW (f->root_window)); +} + +/* Unmap all instances in the frame cache. */ +void +reset_frame_subwindow_instance_cache (struct frame* f) +{ + Lisp_Object rest; + + LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))) + { + Lisp_Object value = XCAR (rest); + unmap_subwindow (value); + } +} /***************************************************************************** * subwindow exposure ignorance * @@ -4102,9 +4370,9 @@ for (ei = f->subwindow_exposures, prev = 0; ei; ei = ei->next) { /* Checking for exact matches just isn't good enough as we - mighte get exposures for partially obscure subwindows, thus - we have to check for overlaps. Being conservative we will - check for exposures wholly contained by the subwindow, this + might get exposures for partially obscured subwindows, thus + we have to check for overlaps. Being conservative, we will + check for exposures wholly contained by the subwindow - this might give us what we want.*/ if (ei->x <= x && ei->y <= y && ei->x + ei->width >= x + width @@ -4168,20 +4436,23 @@ ****************************************************************************/ int find_matching_subwindow (struct frame* f, int x, int y, int width, int height) { - int elt; - - for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) + Lisp_Object rest; + + LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))) { - struct subwindow_cachel *cachel = - Dynarr_atp (f->subwindow_cachels, elt); - - if (cachel->being_displayed + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (XCAR (rest)); + + if (IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) + && + IMAGE_INSTANCE_DISPLAY_X (ii) <= x && - cachel->x <= x && cachel->y <= y + IMAGE_INSTANCE_DISPLAY_Y (ii) <= y && - cachel->x + cachel->width >= x + width + IMAGE_INSTANCE_DISPLAY_X (ii) + + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) >= x + width && - cachel->y + cachel->height >= y + height) + IMAGE_INSTANCE_DISPLAY_Y (ii) + + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) >= y + height) { return 1; } @@ -4194,74 +4465,146 @@ * subwindow functions * *****************************************************************************/ -/* update the displayed characteristics of a subwindow */ -static void -update_subwindow (Lisp_Object subwindow) +/* Update the displayed characteristics of a subwindow. This function + should generally only get called if the subwindow is actually + dirty. */ +void +redisplay_subwindow (Lisp_Object subwindow) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - - if (!IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET - || - NILP (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii))) - return; - - MAYBE_DEVMETH (XDEVICE (ii->device), update_subwindow, (ii)); - /* We must update the window's size as it may have been changed by - the the layout routines. We also do this here so that explicit resizing - from lisp does not result in synchronous updates. */ - MAYBE_DEVMETH (XDEVICE (ii->device), resize_subwindow, (ii, - IMAGE_INSTANCE_WIDTH (ii), - IMAGE_INSTANCE_HEIGHT (ii))); + int count = specpdl_depth (); + + /* The update method is allowed to call eval. Since it is quite + common for this function to get called from somewhere in + redisplay we need to make sure that quits are ignored. Otherwise + Fsignal will abort. */ + specbind (Qinhibit_quit, Qt); + + ERROR_CHECK_IMAGE_INSTANCE (subwindow); + + if (WIDGET_IMAGE_INSTANCEP (subwindow)) + { + if (image_instance_changed (subwindow)) + redisplay_widget (subwindow); + /* Reset the changed flags. */ + IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) = 0; + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 0; + IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii) = 0; + IMAGE_INSTANCE_TEXT_CHANGED (ii) = 0; + } + else if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW + && + !NILP (IMAGE_INSTANCE_FRAME (ii))) + { + MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), + redisplay_subwindow, (ii)); + } + + IMAGE_INSTANCE_SIZE_CHANGED (ii) = 0; + /* This function is typically called by redisplay just before + outputting the information to the screen. Thus we record a hash + of the output to determine whether on-screen is the same as + recorded structure. This approach has limitations in there is a + good chance that hash values will be different for the same + visual appearance. However, we would rather that then the other + way round - it simply means that we will get more displays than + we might need. We can get better hashing by making the depth + negative - currently it will recurse down 7 levels.*/ + IMAGE_INSTANCE_DISPLAY_HASH (ii) = internal_hash (subwindow, + IMAGE_INSTANCE_HASH_DEPTH); + + unbind_to (count, Qnil); +} + +/* Determine whether an image_instance has changed structurally and + hence needs redisplaying in some way. + + #### This should just look at the instantiator differences when we + get rid of the stored items altogether. In fact we should probably + store the new instantiator as well as the old - as we do with + gui_items currently - and then pick-up the new on the next + redisplay. This would obviate the need for any of this trickery + with hashcodes. */ +int +image_instance_changed (Lisp_Object subwindow) +{ + Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); + + if (internal_hash (subwindow, IMAGE_INSTANCE_HASH_DEPTH) != + IMAGE_INSTANCE_DISPLAY_HASH (ii)) + return 1; + /* #### I think there is probably a bug here. This gets called for + layouts - and yet the pending items are always nil for + layouts. We are saved by layout optimization, but I'm undecided + as to what the correct fix is. */ + else if (WIDGET_IMAGE_INSTANCEP (subwindow) + && (!internal_equal (IMAGE_INSTANCE_WIDGET_ITEMS (ii), + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii), 0) + || !NILP (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii)) + || IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii))) + return 1; + else + return 0; } /* Update all the subwindows on a frame. */ void -update_frame_subwindows (struct frame *f) -{ - int elt; - - if (f->subwindows_changed || f->subwindows_state_changed || f->faces_changed) - for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) - { - struct subwindow_cachel *cachel = - Dynarr_atp (f->subwindow_cachels, elt); - - if (cachel->being_displayed) - { - update_subwindow (cachel->subwindow); - } - } +update_widget_instances (Lisp_Object frame) +{ + struct frame* f; + Lisp_Object rest; + + /* Its possible for the preceding callback to have deleted the + frame, so cope with this. */ + if (!FRAMEP (frame) || !FRAME_LIVE_P (XFRAME (frame))) + return; + + CHECK_FRAME (frame); + f = XFRAME (frame); + + /* If we get called we know something has changed. */ + LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))) + { + Lisp_Object widget = XCAR (rest); + + if (XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (widget) + && + image_instance_changed (widget)) + { + set_image_instance_dirty_p (widget, 1); + MARK_FRAME_GLYPHS_CHANGED (f); + } + } } /* remove a subwindow from its frame */ void unmap_subwindow (Lisp_Object subwindow) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - int elt; - struct subwindow_cachel* cachel; struct frame* f; - if (!(IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET - || - IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW) + ERROR_CHECK_IMAGE_INSTANCE (subwindow); + + if (!image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) + & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK) || - NILP (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii))) + !IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii)) return; + #ifdef DEBUG_WIDGETS - stderr_out ("unmapping subwindow %d\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); + stderr_out ("unmapping subwindow %p\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); #endif - f = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); - elt = get_subwindow_cachel_index (f, subwindow); - cachel = Dynarr_atp (f->subwindow_cachels, elt); + f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); /* make sure we don't get expose events */ - register_ignored_expose (f, cachel->x, cachel->y, cachel->width, cachel->height); - cachel->x = ~0; - cachel->y = ~0; - cachel->being_displayed = 0; + register_ignored_expose (f, IMAGE_INSTANCE_DISPLAY_X (ii), + IMAGE_INSTANCE_DISPLAY_Y (ii), + IMAGE_INSTANCE_DISPLAY_WIDTH (ii), + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii)); IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 0; - MAYBE_DEVMETH (XDEVICE (ii->device), unmap_subwindow, (ii)); + MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (ii)), + unmap_subwindow, (ii)); } /* show a subwindow in its frame */ @@ -4269,42 +4612,28 @@ struct display_glyph_area *dga) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - int elt; - struct subwindow_cachel* cachel; struct frame* f; - if (!(IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET - || - IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW) - || - NILP (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii))) + ERROR_CHECK_IMAGE_INSTANCE (subwindow); + + if (!image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) + & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK)) return; #ifdef DEBUG_WIDGETS - stderr_out ("mapping subwindow %d, %dx%d@%d+%d\n", + stderr_out ("mapping subwindow %p, %dx%d@%d+%d\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii), dga->width, dga->height, x, y); #endif - f = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); + f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); + IMAGE_INSTANCE_DISPLAY_X (ii) = x; + IMAGE_INSTANCE_DISPLAY_Y (ii) = y; + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) = dga->width; + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) = dga->height; + + MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), + map_subwindow, (ii, x, y, dga)); IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 1; - elt = get_subwindow_cachel_index (f, subwindow); - cachel = Dynarr_atp (f->subwindow_cachels, elt); - cachel->x = x; - cachel->y = y; - cachel->width = dga->width; - cachel->height = dga->height; - cachel->being_displayed = 1; - - /* This forces any pending display changes to happen to the image - before we show it. I'm not sure whether or not we need mark as - clean here, but for now we will. */ - if (IMAGE_INSTANCE_DIRTYP (ii)) - { - update_subwindow (subwindow); - IMAGE_INSTANCE_DIRTYP (ii) = 0; - } - - MAYBE_DEVMETH (XDEVICE (ii->device), map_subwindow, (ii, x, y, dga)); } static int @@ -4313,6 +4642,12 @@ return IMAGE_SUBWINDOW_MASK; } +int +subwindow_governing_domain (void) +{ + return GOVERNING_DOMAIN_WINDOW; +} + /* Partially instantiate a subwindow. */ void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, @@ -4320,8 +4655,8 @@ int dest_mask, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - Lisp_Object frame = FW_FRAME (domain); + Lisp_Object device = image_instance_device (image_instance); + Lisp_Object frame = DOMAIN_FRAME (domain); Lisp_Object width = find_keyword_in_vector (instantiator, Q_pixel_width); Lisp_Object height = find_keyword_in_vector (instantiator, Q_pixel_height); @@ -4334,34 +4669,37 @@ ii->data = 0; IMAGE_INSTANCE_SUBWINDOW_ID (ii) = 0; IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 0; - IMAGE_INSTANCE_SUBWINDOW_FRAME (ii) = frame; - - /* #### This stuff may get overidden by the widget code and is - actually really dumb now that we have dynamic geometry - calculations. What should really happen is that the subwindow - should query its child for an appropriate geometry. */ - if (NILP (width)) - IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = 20; - else + + if (INTP (width)) { int w = 1; - CHECK_INT (width); if (XINT (width) > 1) w = XINT (width); - IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = w; + IMAGE_INSTANCE_WIDTH (ii) = w; + IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; } - if (NILP (height)) - IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = 20; - else + + if (INTP (height)) { int h = 1; - CHECK_INT (height); if (XINT (height) > 1) h = XINT (height); - IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = h; + IMAGE_INSTANCE_HEIGHT (ii) = h; + IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; } } +/* This is just a backup in case no-one has assigned a suitable geometry. + #### It should really query the enclose window for geometry. */ +static void +subwindow_query_geometry (Lisp_Object image_instance, int* width, + int* height, enum image_instance_geometry disp, + Lisp_Object domain) +{ + if (width) *width = 20; + if (height) *height = 20; +} + DEFUN ("subwindowp", Fsubwindowp, 1, 1, 0, /* Return non-nil if OBJECT is a subwindow. */ @@ -4377,7 +4715,7 @@ (subwindow)) { CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow); - return make_int ((int) XIMAGE_INSTANCE_SUBWINDOW_ID (subwindow)); + return make_int ((EMACS_INT) XIMAGE_INSTANCE_SUBWINDOW_ID (subwindow)); } DEFUN ("resize-subwindow", Fresize_subwindow, 1, 3, 0, /* @@ -4387,26 +4725,26 @@ (subwindow, width, height)) { int neww, newh; + Lisp_Image_Instance* ii; CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow); + ii = XIMAGE_INSTANCE (subwindow); if (NILP (width)) - neww = XIMAGE_INSTANCE_WIDTH (subwindow); + neww = IMAGE_INSTANCE_WIDTH (ii); else neww = XINT (width); if (NILP (height)) - newh = XIMAGE_INSTANCE_HEIGHT (subwindow); + newh = IMAGE_INSTANCE_HEIGHT (ii); else newh = XINT (height); - /* The actual resizing gets done asychronously by + /* The actual resizing gets done asynchronously by update_subwindow. */ - XIMAGE_INSTANCE_HEIGHT (subwindow) = newh; - XIMAGE_INSTANCE_WIDTH (subwindow) = neww; - - /* need to update the cachels as redisplay will not do this */ - update_subwindow_cachel (subwindow); + IMAGE_INSTANCE_HEIGHT (ii) = newh; + IMAGE_INSTANCE_WIDTH (ii) = neww; + IMAGE_INSTANCE_SIZE_CHANGED (ii) = 1; return subwindow; } @@ -4541,8 +4879,10 @@ /* We might need to kick redisplay at this point - but we also might not. */ MARK_DEVICE_FRAMES_GLYPHS_CHANGED - (XDEVICE (IMAGE_INSTANCE_DEVICE (ii))); - MARK_IMAGE_INSTANCE_CHANGED (ii); + (XDEVICE (image_instance_device (value))); + /* Cascade dirtiness so that we can have an animated glyph in a layout + for instance. */ + set_image_instance_dirty_p (value, 1); } } } @@ -4587,6 +4927,9 @@ void syms_of_glyphs (void) { + INIT_LRECORD_IMPLEMENTATION (glyph); + INIT_LRECORD_IMPLEMENTATION (image_instance); + /* image instantiators */ DEFSUBR (Fimage_instantiator_format_list); @@ -4594,22 +4937,22 @@ DEFSUBR (Fset_console_type_image_conversion_list); DEFSUBR (Fconsole_type_image_conversion_list); - defkeyword (&Q_file, ":file"); - defkeyword (&Q_data, ":data"); - defkeyword (&Q_face, ":face"); - defkeyword (&Q_pixel_height, ":pixel-height"); - defkeyword (&Q_pixel_width, ":pixel-width"); + DEFKEYWORD (Q_file); + DEFKEYWORD (Q_data); + DEFKEYWORD (Q_face); + DEFKEYWORD (Q_pixel_height); + DEFKEYWORD (Q_pixel_width); #ifdef HAVE_XPM - defkeyword (&Q_color_symbols, ":color-symbols"); + DEFKEYWORD (Q_color_symbols); #endif #ifdef HAVE_WINDOW_SYSTEM - defkeyword (&Q_mask_file, ":mask-file"); - defkeyword (&Q_mask_data, ":mask-data"); - defkeyword (&Q_hotspot_x, ":hotspot-x"); - defkeyword (&Q_hotspot_y, ":hotspot-y"); - defkeyword (&Q_foreground, ":foreground"); - defkeyword (&Q_background, ":background"); + DEFKEYWORD (Q_mask_file); + DEFKEYWORD (Q_mask_data); + DEFKEYWORD (Q_hotspot_x); + DEFKEYWORD (Q_hotspot_y); + DEFKEYWORD (Q_foreground); + DEFKEYWORD (Q_background); #endif /* image specifiers */ @@ -4620,14 +4963,13 @@ defsymbol (&Qimage_instancep, "image-instance-p"); - defsymbol (&Qnothing_image_instance_p, "nothing-image-instance-p"); - defsymbol (&Qtext_image_instance_p, "text-image-instance-p"); - defsymbol (&Qmono_pixmap_image_instance_p, "mono-pixmap-image-instance-p"); - defsymbol (&Qcolor_pixmap_image_instance_p, "color-pixmap-image-instance-p"); - defsymbol (&Qpointer_image_instance_p, "pointer-image-instance-p"); - defsymbol (&Qwidget_image_instance_p, "widget-image-instance-p"); - defsymbol (&Qsubwindow_image_instance_p, "subwindow-image-instance-p"); - defsymbol (&Qlayout_image_instance_p, "layout-image-instance-p"); + DEFSYMBOL (Qnothing_image_instance_p); + DEFSYMBOL (Qtext_image_instance_p); + DEFSYMBOL (Qmono_pixmap_image_instance_p); + DEFSYMBOL (Qcolor_pixmap_image_instance_p); + DEFSYMBOL (Qpointer_image_instance_p); + DEFSYMBOL (Qwidget_image_instance_p); + DEFSYMBOL (Qsubwindow_image_instance_p); DEFSUBR (Fmake_image_instance); DEFSUBR (Fimage_instance_p); @@ -4635,6 +4977,7 @@ DEFSUBR (Fvalid_image_instance_type_p); DEFSUBR (Fimage_instance_type_list); DEFSUBR (Fimage_instance_name); + DEFSUBR (Fimage_instance_domain); DEFSUBR (Fimage_instance_string); DEFSUBR (Fimage_instance_file_name); DEFSUBR (Fimage_instance_mask_file_name); @@ -4646,7 +4989,6 @@ DEFSUBR (Fimage_instance_foreground); DEFSUBR (Fimage_instance_background); DEFSUBR (Fimage_instance_property); - DEFSUBR (Fset_image_instance_property); DEFSUBR (Fcolorize_image_instance); /* subwindows */ DEFSUBR (Fsubwindowp); @@ -4657,21 +4999,21 @@ /* Qnothing defined as part of the "nothing" image-instantiator type. */ /* Qtext defined in general.c */ - defsymbol (&Qmono_pixmap, "mono-pixmap"); - defsymbol (&Qcolor_pixmap, "color-pixmap"); + DEFSYMBOL (Qmono_pixmap); + DEFSYMBOL (Qcolor_pixmap); /* Qpointer defined in general.c */ /* glyphs */ - defsymbol (&Qglyphp, "glyphp"); - defsymbol (&Qcontrib_p, "contrib-p"); - defsymbol (&Qbaseline, "baseline"); - - defsymbol (&Qbuffer_glyph_p, "buffer-glyph-p"); - defsymbol (&Qpointer_glyph_p, "pointer-glyph-p"); - defsymbol (&Qicon_glyph_p, "icon-glyph-p"); - - defsymbol (&Qconst_glyph_variable, "const-glyph-variable"); + DEFSYMBOL (Qglyphp); + DEFSYMBOL (Qcontrib_p); + DEFSYMBOL (Qbaseline); + + DEFSYMBOL (Qbuffer_glyph_p); + DEFSYMBOL (Qpointer_glyph_p); + DEFSYMBOL (Qicon_glyph_p); + + DEFSYMBOL (Qconst_glyph_variable); DEFSUBR (Fglyph_type); DEFSUBR (Fvalid_glyph_type_p); @@ -4682,21 +5024,18 @@ DEFSUBR (Fglyph_ascent); DEFSUBR (Fglyph_descent); DEFSUBR (Fglyph_height); + DEFSUBR (Fset_instantiator_property); /* Qbuffer defined in general.c. */ /* Qpointer defined above */ /* Unfortunately, timeout handlers must be lisp functions. This is for animated glyphs. */ - defsymbol (&Qglyph_animated_timeout_handler, - "glyph-animated-timeout-handler"); + DEFSYMBOL (Qglyph_animated_timeout_handler); DEFSUBR (Fglyph_animated_timeout_handler); /* Errors */ - deferror (&Qimage_conversion_error, - "image-conversion-error", - "image-conversion error", Qio_error); - + DEFERROR_STANDARD (Qimage_conversion_error, Qio_error); } static const struct lrecord_description image_specifier_description[] = { @@ -4779,7 +5118,7 @@ }; const struct struct_description iim_description = { - sizeof(struct image_instantiator_methods), + sizeof (struct image_instantiator_methods), iim_description_1 }; @@ -4813,13 +5152,16 @@ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (string, "string"); IIFORMAT_HAS_METHOD (string, validate); + IIFORMAT_HAS_SHARED_METHOD (string, governing_domain, subwindow); IIFORMAT_HAS_METHOD (string, possible_dest_types); IIFORMAT_HAS_METHOD (string, instantiate); IIFORMAT_VALID_KEYWORD (string, Q_data, check_valid_string); /* Do this so we can set strings. */ + /* #### Andy, what is this? This is a bogus format and should not be + visible to the user. */ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (text, "text"); - IIFORMAT_HAS_METHOD (text, set_property); + IIFORMAT_HAS_METHOD (text, update); IIFORMAT_HAS_METHOD (text, query_geometry); INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (formatted_string, "formatted-string"); @@ -4829,10 +5171,18 @@ IIFORMAT_HAS_METHOD (formatted_string, instantiate); IIFORMAT_VALID_KEYWORD (formatted_string, Q_data, check_valid_string); + /* Do this so pointers have geometry. */ + /* #### Andy, what is this? This is a bogus format and should not be + visible to the user. */ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (pointer, "pointer"); + IIFORMAT_HAS_SHARED_METHOD (pointer, query_geometry, subwindow); + /* subwindows */ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (subwindow, "subwindow"); IIFORMAT_HAS_METHOD (subwindow, possible_dest_types); + IIFORMAT_HAS_METHOD (subwindow, governing_domain); IIFORMAT_HAS_METHOD (subwindow, instantiate); + IIFORMAT_HAS_METHOD (subwindow, query_geometry); IIFORMAT_VALID_KEYWORD (subwindow, Q_pixel_width, check_valid_int); IIFORMAT_VALID_KEYWORD (subwindow, Q_pixel_height, check_valid_int); @@ -4979,12 +5329,53 @@ DEFVAR_SPECIFIER ("current-display-table", &Vcurrent_display_table /* *The display table currently in use. This is a specifier; use `set-specifier' to change it. -The display table is a vector created with `make-display-table'. -The 256 elements control how to display each possible text character. -Each value should be a string, a glyph, a vector or nil. -If a value is a vector it must be composed only of strings and glyphs. -nil means display the character in the default fashion. -Faces can have their own, overriding display table. + +Display tables are used to control how characters are displayed. Each +time that redisplay processes a character, it is looked up in all the +display tables that apply (obtained by calling `specifier-instance' on +`current-display-table' and any overriding display tables specified in +currently active faces). The first entry found that matches the +character determines how the character is displayed. If there is no +matching entry, the default display method is used. (Non-control +characters are displayed as themselves and control characters are +displayed according to the buffer-local variable `ctl-arrow'. Control +characters are further affected by `control-arrow-glyph' and +`octal-escape-glyph'.) + +Each instantiator in this specifier and the display-table specifiers +in faces is a display table or a list of such tables. If a list, each +table will be searched in turn for an entry matching a particular +character. Each display table is one of + +-- a vector, specifying values for characters starting at 0 +-- a char table, either of type `char' or `generic' +-- a range table + +Each entry in a display table should be one of + +-- nil (this entry is ignored and the search continues) +-- a character (use this character; if it happens to be the same as + the original character, default processing happens, otherwise + redisplay attempts to display this character directly; + #### At some point recursive display-table lookup will be + implemented.) +-- a string (display each character in the string directly; + #### At some point recursive display-table lookup will be + implemented.) +-- a glyph (display the glyph; + #### At some point recursive display-table lookup will be + implemented when a string glyph is being processed.) +-- a cons of the form (format "STRING") where STRING is a printf-like + spec used to process the character. #### Unfortunately no + formatting directives other than %% are implemented. +-- a vector (each element of the vector is processed recursively; + in such a case, nil elements in the vector are simply ignored) + +#### At some point in the near future, display tables are likely to +be expanded to include other features, such as referencing characters +in particular fonts and allowing the character search to continue +all the way up the chain of specifier instantiators. These features +are necessary to properly display Unicode characters. */ ); Vcurrent_display_table = Fmake_specifier (Qdisplay_table); set_specifier_fallback (Vcurrent_display_table, diff -r 72a7cfa4a488 -r abe6d1db359e src/glyphs.h --- a/src/glyphs.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/glyphs.h Mon Aug 13 11:35:02 2007 +0200 @@ -50,19 +50,21 @@ tiff color-pixmap bmp color-pixmap cursor-font pointer - mswindows-resource pointer + mswindows-resource pointer, color-pixmap font pointer subwindow subwindow inherit mono-pixmap autodetect mono-pixmap, color-pixmap, pointer, text button widget edit-field widget - combo -box widget + combo-box widget progress-gauge widget tab-control widget tree-view widget scrollbar widget - static widget + label widget + layout widget + native-layout widget */ /* These are methods specific to a particular format of image instantiator @@ -89,13 +91,22 @@ IMAGE_GEOMETRY, IMAGE_DESIRED_GEOMETRY, IMAGE_MIN_GEOMETRY, - IMAGE_MAX_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY = ~0 + IMAGE_MAX_GEOMETRY }; +#define IMAGE_UNSPECIFIED_GEOMETRY -1 +#define IMAGE_UNCHANGED_GEOMETRY -2 + #define WIDGET_BORDER_HEIGHT 4 #define WIDGET_BORDER_WIDTH 4 +enum governing_domain +{ + GOVERNING_DOMAIN_WINDOW, + GOVERNING_DOMAIN_FRAME, + GOVERNING_DOMAIN_DEVICE +}; + struct image_instantiator_methods { Lisp_Object symbol; @@ -118,7 +129,12 @@ that should be used in a glyph, for devices of type CONSOLE_TYPE. Signal an error if conversion fails. */ Lisp_Object (*normalize_method) (Lisp_Object instantiator, - Lisp_Object console_type); + Lisp_Object console_type, + Lisp_Object dest_mask); + + /* Governing domain method: Return an int indicating what type of + domain an instance in this format is governed by. */ + int (*governing_domain_method) (void); /* Possible-dest-types method: Return a mask indicating what dest types are compatible with this format. */ @@ -134,6 +150,11 @@ Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain); + /* Post instantiate method: finish instantiation of the image + instance. */ + void (*post_instantiate_method) (Lisp_Object image_instance, + Lisp_Object instantiator, + Lisp_Object domain); /* Property method: Given an image instance, return device specific properties. */ Lisp_Object (*property_method) (Lisp_Object image_instance, @@ -143,20 +164,24 @@ Lisp_Object (*set_property_method) (Lisp_Object image_instance, Lisp_Object property, Lisp_Object val); + /* Asynchronously update properties. */ + void (*update_method) (Lisp_Object image_instance, + Lisp_Object instantiator); + void (*redisplay_method) (Lisp_Object image_instance); /* Find out the desired geometry, as given by disp, of this image instance. Actual geometry is stored in the appropriate slots in the image instance. */ void (*query_geometry_method) (Lisp_Object image_instance, - unsigned int* width, unsigned int* height, + int* width, int* height, enum image_instance_geometry disp, Lisp_Object domain); /* Layout the instance and its children bounded by the provided - dimensions. */ - void (*layout_method) (Lisp_Object image_instance, - unsigned int width, unsigned int height, - Lisp_Object domain); + dimensions. Returns success or failure. */ + int (*layout_method) (Lisp_Object image_instance, + int width, int height, int xoffset, int yoffset, + Lisp_Object domain); }; /***** Calling an image-instantiator method *****/ @@ -185,7 +210,7 @@ the specified value */ #define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \ - (HAS_IIFORMAT_METH_P (mstruc, m) ? \ + ((mstruc && HAS_IIFORMAT_METH_P (mstruc, m)) ? \ IIFORMAT_METH (mstruc, m, args) : (given)) /***** Defining new image-instantiator types *****/ @@ -249,7 +274,7 @@ #define IIFORMAT_VALID_MULTI_KEYWORD(format, keyw, validate_fun) \ IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 1) -/* Same as IIFORMAT_VALID_KEYWORD execpt that the argument is not +/* Same as IIFORMAT_VALID_KEYWORD except that the argument is not copied by the specifier functions. This is necessary for things like callbacks etc. */ #define IIFORMAT_VALID_NONCOPY_KEYWORD(format, keyw, validate_fun) \ @@ -267,6 +292,10 @@ entry); \ } while (0) +#define IIFORMAT_VALID_CONSOLE2(con1, con2, format) \ + IIFORMAT_VALID_CONSOLE (con1, format); \ + IIFORMAT_VALID_CONSOLE (con2, format); + #define DEFINE_DEVICE_IIFORMAT(type, format) \ DECLARE_IMAGE_INSTANTIATOR_FORMAT(format); \ struct image_instantiator_methods *type##_##format##_image_instantiator_methods @@ -293,6 +322,11 @@ #define IIFORMAT_HAS_SHARED_DEVMETHOD(type, format, m, fromformat) \ (type##_##format##_image_instantiator_methods->m##_method = type##_##fromformat##_##m) +#define IIFORMAT_INHERITS_DEVMETHOD(type, from, format, m) \ + (type##_##format##_image_instantiator_methods->m##_method = from##_##format##_##m) +#define IIFORMAT_INHERITS_SHARED_DEVMETHOD(type, from, format, m, fromformat) \ + (type##_##format##_image_instantiator_methods->m##_method = from##_##fromformat##_##m) + struct image_instantiator_methods * decode_device_ii_format (Lisp_Object device, Lisp_Object format, Error_behavior errb); @@ -319,29 +353,33 @@ void check_valid_int (Lisp_Object data); void check_valid_face (Lisp_Object data); void check_valid_vector (Lisp_Object data); -void check_valid_item_list_1 (Lisp_Object items); +void check_valid_item_list (Lisp_Object items); void initialize_subwindow_image_instance (Lisp_Image_Instance*); void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain); +int subwindow_governing_domain (void); void widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain); void image_instance_query_geometry (Lisp_Object image_instance, - unsigned int* width, unsigned int* height, + int* width, int* height, enum image_instance_geometry disp, Lisp_Object domain); void image_instance_layout (Lisp_Object image_instance, - unsigned int width, unsigned int height, + int width, int height, int xoffset, int yoffset, Lisp_Object domain); +int layout_layout (Lisp_Object image_instance, + int width, int height, int xoffset, int yoffset, + Lisp_Object domain); int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w); DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator, int given_dest_mask, int desired_dest_mask)); -DECLARE_DOESNT_RETURN (signal_image_error (CONST char *, Lisp_Object)); -DECLARE_DOESNT_RETURN (signal_image_error_2 (CONST char *, Lisp_Object, Lisp_Object)); +DECLARE_DOESNT_RETURN (signal_image_error (const char *, Lisp_Object)); +DECLARE_DOESNT_RETURN (signal_image_error_2 (const char *, Lisp_Object, Lisp_Object)); /************************************************************************/ /* Image Specifier Object */ @@ -384,6 +422,18 @@ #define CHECK_IMAGE_INSTANCE(x) CHECK_RECORD (x, image_instance) #define CONCHECK_IMAGE_INSTANCE(x) CONCHECK_RECORD (x, image_instance) +#ifdef ERROR_CHECK_GLYPHS +void check_image_instance_structure (Lisp_Object instance); +void check_window_subwindow_cache (struct window* w); +#define ERROR_CHECK_IMAGE_INSTANCE(ii) \ + check_image_instance_structure (ii) +#define ERROR_CHECK_SUBWINDOW_CACHE(w) \ + check_window_subwindow_cache (w) +#else +#define ERROR_CHECK_IMAGE_INSTANCE(ii) +#define ERROR_CHECK_SUBWINDOW_CACHE(w) +#endif + enum image_instance_type { IMAGE_UNKNOWN, @@ -393,8 +443,7 @@ IMAGE_COLOR_PIXMAP, IMAGE_POINTER, IMAGE_SUBWINDOW, - IMAGE_WIDGET, - IMAGE_LAYOUT + IMAGE_WIDGET }; #define IMAGE_NOTHING_MASK (1 << 0) @@ -404,7 +453,13 @@ #define IMAGE_POINTER_MASK (1 << 4) #define IMAGE_SUBWINDOW_MASK (1 << 5) #define IMAGE_WIDGET_MASK (1 << 6) -#define IMAGE_LAYOUT_MASK (1 << 7) + +/* This depends on the fact that enums are assigned consecutive + integers starting at 0. (Remember that IMAGE_UNKNOWN is the + first enum.) I'm fairly sure this behavior is ANSI-mandated, + so there should be no portability problems here. */ +#define image_instance_type_to_mask(type) \ + ((int) (1 << ((int) (type) - 1))) #define IMAGE_INSTANCE_TYPE_P(ii, type) \ (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type) @@ -423,8 +478,6 @@ IMAGE_INSTANCE_TYPE_P (ii, IMAGE_SUBWINDOW) #define WIDGET_IMAGE_INSTANCEP(ii) \ IMAGE_INSTANCE_TYPE_P (ii, IMAGE_WIDGET) -#define LAYOUT_IMAGE_INSTANCEP(ii) \ - IMAGE_INSTANCE_TYPE_P (ii, IMAGE_LAYOUT) #define CHECK_NOTHING_IMAGE_INSTANCE(x) do { \ CHECK_IMAGE_INSTANCE (x); \ @@ -469,24 +522,33 @@ x = wrong_type_argument (Qwidget_image_instance_p, (x)); \ } while (0) -#define CHECK_LAYOUT_IMAGE_INSTANCE(x) do { \ - CHECK_IMAGE_INSTANCE (x); \ - if (!LAYOUT_IMAGE_INSTANCEP (x)) \ - x = wrong_type_argument (Qlayout_image_instance_p, (x)); \ -} while (0) - struct Lisp_Image_Instance { struct lcrecord_header header; - Lisp_Object device; + Lisp_Object domain; /* The domain in which we were cached. */ + Lisp_Object device; /* The device of the domain. Recorded + since the domain may get deleted + before us. */ Lisp_Object name; /* The glyph from which we were instantiated. This is a weak reference. */ - Lisp_Object glyph; + Lisp_Object parent; + /* The instantiator from which we were instantiated. */ + Lisp_Object instantiator; enum image_instance_type type; unsigned int x_offset, y_offset; /* for layout purposes */ - unsigned int width, height; + int width, height, margin_width; + unsigned long display_hash; /* Hash value representing the structure + of the image_instance when it was + last displayed. */ unsigned int dirty : 1; + unsigned int size_changed : 1; + unsigned int text_changed : 1; + unsigned int layout_changed : 1; + unsigned int optimize_output : 1; /* For outputting layouts. */ + unsigned int initialized : 1; /* When we're fully done. */ + unsigned int wants_initial_focus : 1; + union { struct @@ -510,21 +572,35 @@ } pixmap; /* used for pointers as well */ struct { - Lisp_Object frame; void* subwindow; /* specific devices can use this as necessary */ - unsigned int being_displayed : 1; /* used to detect when needs to be unmapped */ + struct + { /* We need these so we can do without + subwindow_cachel */ + unsigned int x, y; + unsigned 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 justification : 2; /* Left, right or center. */ - /* Face for colors and font. We specify this here becuase we + /* Face for colors and font. We specify this here because we want people to be able to put :face in the instantiator - spec. Using gyph-face is more inconvenient, although more + 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 gui_items or children */ + 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; } u; @@ -540,22 +616,51 @@ #define LAYOUT_JUSTIFY_RIGHT 1 #define LAYOUT_JUSTIFY_CENTER 2 +#define IMAGE_INSTANCE_HASH_DEPTH 0 + /* Accessor macros. */ +#define IMAGE_INSTANCE_DOMAIN(i) ((i)->domain) +#define IMAGE_INSTANCE_DOMAIN_LIVE_P(i) (DOMAIN_LIVE_P ((i)->domain)) #define IMAGE_INSTANCE_DEVICE(i) ((i)->device) +#define IMAGE_INSTANCE_FRAME(i) (DOMAIN_FRAME ((i)->domain)) #define IMAGE_INSTANCE_NAME(i) ((i)->name) -#define IMAGE_INSTANCE_GLYPH(i) ((i)->glyph) +#define IMAGE_INSTANCE_PARENT(i) ((i)->parent) +#define IMAGE_INSTANCE_INSTANTIATOR(i) ((i)->instantiator) +#define IMAGE_INSTANCE_GLYPH(i) (image_instance_parent_glyph(i)) #define IMAGE_INSTANCE_TYPE(i) ((i)->type) #define IMAGE_INSTANCE_XOFFSET(i) ((i)->x_offset) #define IMAGE_INSTANCE_YOFFSET(i) ((i)->y_offset) #define IMAGE_INSTANCE_WIDTH(i) ((i)->width) +#define IMAGE_INSTANCE_MARGIN_WIDTH(i) ((i)->margin_width) #define IMAGE_INSTANCE_HEIGHT(i) ((i)->height) +#define IMAGE_INSTANCE_INITIALIZED(i) ((i)->initialized) +#define IMAGE_INSTANCE_DISPLAY_HASH(i) ((i)->display_hash) #define IMAGE_INSTANCE_PIXMAP_TYPE_P(i) \ ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP) \ || (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP)) #define IMAGE_INSTANCE_DIRTYP(i) ((i)->dirty) +#define IMAGE_INSTANCE_NEEDS_LAYOUT(i) \ + ((IMAGE_INSTANCE_DIRTYP (i) && IMAGE_INSTANCE_LAYOUT_CHANGED (i)) \ + || (FRAMEP (IMAGE_INSTANCE_FRAME (i)) \ + && XFRAME (IMAGE_INSTANCE_FRAME (i))->size_changed)) #define IMAGE_INSTANCE_FACE(i) \ - XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) + (GLYPHP (IMAGE_INSTANCE_GLYPH (i)) ? \ + XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) : Qnil) +#define IMAGE_INSTANCE_WANTS_INITIAL_FOCUS(i) ((i)->wants_initial_focus) +/* Changed flags */ +#define IMAGE_INSTANCE_TEXT_CHANGED(i) ((i)->text_changed) +#define IMAGE_INSTANCE_SIZE_CHANGED(i) ((i)->size_changed) +#define IMAGE_INSTANCE_WIDGET_FACE_CHANGED(i) \ + ((i)->u.subwindow.face_changed) +#define IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED(i) \ + ((i)->u.subwindow.items_changed) +#define IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED(i) \ + ((i)->u.subwindow.action_occurred) +#define IMAGE_INSTANCE_LAYOUT_CHANGED(i) ((i)->layout_changed) +#define IMAGE_INSTANCE_OPTIMIZE_OUTPUT(i) ((i)->optimize_output) + +/* Text properties */ #define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string) #define IMAGE_INSTANCE_TEXT_WIDTH(i) \ IMAGE_INSTANCE_WIDTH(i) @@ -565,6 +670,7 @@ #define IMAGE_INSTANCE_TEXT_ASCENT(i) \ (IMAGE_INSTANCE_TEXT_HEIGHT(i) - IMAGE_INSTANCE_TEXT_DESCENT(i)) +/* Pixmap properties */ #define IMAGE_INSTANCE_PIXMAP_WIDTH(i) \ IMAGE_INSTANCE_WIDTH(i) #define IMAGE_INSTANCE_PIXMAP_HEIGHT(i) \ @@ -582,12 +688,15 @@ #define IMAGE_INSTANCE_PIXMAP_MAXSLICE(i) ((i)->u.pixmap.maxslice) #define IMAGE_INSTANCE_PIXMAP_TIMEOUT(i) ((i)->u.pixmap.timeout) -#define IMAGE_INSTANCE_SUBWINDOW_WIDTH(i) \ - IMAGE_INSTANCE_WIDTH(i) -#define IMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) \ - IMAGE_INSTANCE_HEIGHT(i) +/* Subwindow properties */ #define IMAGE_INSTANCE_SUBWINDOW_ID(i) ((i)->u.subwindow.subwindow) -#define IMAGE_INSTANCE_SUBWINDOW_FRAME(i) ((i)->u.subwindow.frame) +/* Display data. */ +#define IMAGE_INSTANCE_DISPLAY_X(i) ((i)->u.subwindow.display_data.x) +#define IMAGE_INSTANCE_DISPLAY_Y(i) ((i)->u.subwindow.display_data.y) +#define IMAGE_INSTANCE_DISPLAY_WIDTH(i) \ + ((i)->u.subwindow.display_data.width) +#define IMAGE_INSTANCE_DISPLAY_HEIGHT(i) \ + ((i)->u.subwindow.display_data.height) #define IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ ((i)->u.subwindow.being_displayed) #define IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP(i) \ @@ -598,11 +707,16 @@ ((i)->u.subwindow.orientation) #define IMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \ ((i)->u.subwindow.justification) +#define IMAGE_INSTANCE_SUBWINDOW_FACE(i) \ +((i)->u.subwindow.face) +/* Widget properties */ #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \ IMAGE_INSTANCE_WIDTH(i) #define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \ IMAGE_INSTANCE_HEIGHT(i) +#define IMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) ((i)->u.subwindow.width) +#define IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) ((i)->u.subwindow.height) #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.type) #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.props) #define SET_IMAGE_INSTANCE_WIDGET_FACE(i,f) \ @@ -612,33 +726,54 @@ !NILP (IMAGE_INSTANCE_FACE (i)) ? IMAGE_INSTANCE_FACE (i) : \ Vwidget_face) #define IMAGE_INSTANCE_WIDGET_ITEMS(i) ((i)->u.subwindow.items) +#define IMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \ + ((i)->u.subwindow.pending_items) #define IMAGE_INSTANCE_WIDGET_ITEM(i) \ (CONSP (IMAGE_INSTANCE_WIDGET_ITEMS (i)) ? \ XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \ IMAGE_INSTANCE_WIDGET_ITEMS (i)) #define IMAGE_INSTANCE_WIDGET_TEXT(i) XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEM (i))->name -#define IMAGE_INSTANCE_LAYOUT_CHILDREN(i) ((i)->u.subwindow.items) +/* Layout properties */ +#define IMAGE_INSTANCE_LAYOUT_CHILDREN(i) ((i)->u.subwindow.children) #define IMAGE_INSTANCE_LAYOUT_BORDER(i) ((i)->u.subwindow.props) +#define XIMAGE_INSTANCE_DOMAIN(i) \ + IMAGE_INSTANCE_DOMAIN (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_DOMAIN_LIVE_P(i) \ + IMAGE_INSTANCE_DOMAIN_LIVE_P (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_DEVICE(i) \ IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_FRAME(i) \ + IMAGE_INSTANCE_FRAME (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_NAME(i) \ IMAGE_INSTANCE_NAME (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_GLYPH(i) \ IMAGE_INSTANCE_GLYPH (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_PARENT(i) \ + IMAGE_INSTANCE_PARENT (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_INSTANTIATOR(i) \ + IMAGE_INSTANCE_INSTANTIATOR (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_TYPE(i) \ IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_DISPLAY_HASH(i) \ + IMAGE_INSTANCE_DISPLAY_HASH (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_XOFFSET(i) \ IMAGE_INSTANCE_XOFFSET (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_YOFFSET(i) \ IMAGE_INSTANCE_YOFFSET (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_DIRTYP(i) \ IMAGE_INSTANCE_DIRTYP (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_NEEDS_LAYOUT(i) \ + IMAGE_INSTANCE_NEEDS_LAYOUT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDTH(i) \ IMAGE_INSTANCE_WIDTH (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_MARGIN_WIDTH(i) \ + IMAGE_INSTANCE_MARGIN_WIDTH (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_HEIGHT(i) \ IMAGE_INSTANCE_HEIGHT (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_INITIALIZED(i) \ + IMAGE_INSTANCE_INITIALIZED (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_FACE(i) \ IMAGE_INSTANCE_FACE (XIMAGE_INSTANCE (i)) @@ -684,6 +819,10 @@ IMAGE_INSTANCE_WIDGET_WIDTH (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_HEIGHT(i) \ IMAGE_INSTANCE_WIDGET_HEIGHT (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) \ + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) \ + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_TYPE(i) \ IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \ @@ -696,32 +835,45 @@ IMAGE_INSTANCE_WIDGET_ITEM (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_ITEMS(i) \ IMAGE_INSTANCE_WIDGET_ITEMS (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \ + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_TEXT(i) \ IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED(i) \ + IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_LAYOUT_CHILDREN(i) \ IMAGE_INSTANCE_LAYOUT_CHILDREN (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_LAYOUT_BORDER(i) \ IMAGE_INSTANCE_LAYOUT_BORDER (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_SUBWINDOW_WIDTH(i) \ - IMAGE_INSTANCE_SUBWINDOW_WIDTH (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) \ - IMAGE_INSTANCE_SUBWINDOW_HEIGHT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_SUBWINDOW_ID(i) \ IMAGE_INSTANCE_SUBWINDOW_ID (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_SUBWINDOW_FRAME(i) \ - IMAGE_INSTANCE_SUBWINDOW_FRAME (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_DISPLAY_X(i) \ + IMAGE_INSTANCE_DISPLAY_X (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_DISPLAY_Y(i) \ + IMAGE_INSTANCE_DISPLAY_Y (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_DISPLAY_WIDTH(i) \ + IMAGE_INSTANCE_DISPLAY_WIDTH (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_DISPLAY_HEIGHT(i) \ + IMAGE_INSTANCE_DISPLAY_HEIGHT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \ IMAGE_INSTANCE_SUBWINDOW_ORIENT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \ IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_SUBWINDOW_FACE(i) \ + IMAGE_INSTANCE_SUBWINDOW_FACE (XIMAGE_INSTANCE (i)) #define MARK_IMAGE_INSTANCE_CHANGED(i) \ (IMAGE_INSTANCE_DIRTYP (i) = 1); +Lisp_Object image_instance_device (Lisp_Object instance); +Lisp_Object image_instance_frame (Lisp_Object instance); +Lisp_Object image_instance_window (Lisp_Object instance); +int image_instance_live_p (Lisp_Object instance); + #ifdef HAVE_XPM Lisp_Object evaluate_xpm_color_symbols (void); Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid); @@ -729,7 +881,7 @@ #ifdef HAVE_WINDOW_SYSTEM Lisp_Object bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot, int ok_if_data_invalid); -int read_bitmap_data_from_file (CONST char *filename, unsigned int *width, +int read_bitmap_data_from_file (const char *filename, unsigned int *width, unsigned int *height, unsigned char **datap, int *x_hot, int *y_hot); Lisp_Object xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file, @@ -819,12 +971,13 @@ extern Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y; extern Lisp_Object Q_foreground, Q_background, Q_face, Q_descriptor, Q_group; extern Lisp_Object Q_width, Q_height, Q_pixel_width, Q_pixel_height, Q_text; -extern Lisp_Object Q_items, Q_properties, Q_image, Q_percent, Qimage_conversion_error; -extern Lisp_Object Q_orientation; +extern Lisp_Object Q_items, Q_properties, Q_image, Qimage_conversion_error; +extern Lisp_Object Q_orientation, Q_margin_width; extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph; extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph; extern Lisp_Object Vxemacs_logo; + unsigned short glyph_width (Lisp_Object glyph, Lisp_Object domain); unsigned short glyph_ascent (Lisp_Object glyph, Lisp_Object domain); unsigned short glyph_descent (Lisp_Object glyph, Lisp_Object domain); @@ -843,13 +996,23 @@ void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain); +int tab_control_order_only_changed (Lisp_Object image_instance); Lisp_Object allocate_glyph (enum glyph_type type, void (*after_change) (Lisp_Object glyph, Lisp_Object property, Lisp_Object locale)); +Lisp_Object normalize_image_instantiator (Lisp_Object instantiator, + Lisp_Object contype, + Lisp_Object dest_mask); +void glyph_query_geometry (Lisp_Object glyph_or_image, int* width, int* height, + enum image_instance_geometry disp, + Lisp_Object domain); +void glyph_do_layout (Lisp_Object glyph_or_image, int width, int height, + int xoffset, int yoffset, + Lisp_Object domain); void query_string_geometry ( Lisp_Object string, Lisp_Object face, - unsigned int* width, unsigned int* height, - unsigned int* descent, Lisp_Object domain); + int* width, int* height, int* descent, + Lisp_Object domain); Lisp_Object query_string_font (Lisp_Object string, Lisp_Object face, Lisp_Object domain); Lisp_Object add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object device); @@ -884,18 +1047,55 @@ #define OCT_ESC_GLYPH_INDEX (glyph_index) 4 #define INVIS_GLYPH_INDEX (glyph_index) 5 -#define GLYPH_CACHEL(window, index) \ - Dynarr_atp (window->glyph_cachels, index) -#define GLYPH_CACHEL_GLYPH(window, index) \ - Dynarr_atp (window->glyph_cachels, index)->glyph -#define GLYPH_CACHEL_WIDTH(window, index) \ - Dynarr_atp (window->glyph_cachels, index)->width -#define GLYPH_CACHEL_ASCENT(window, index) \ - Dynarr_atp (window->glyph_cachels, index)->ascent -#define GLYPH_CACHEL_DESCENT(window, index) \ - Dynarr_atp (window->glyph_cachels, index)->descent -#define GLYPH_CACHEL_DIRTYP(window, index) \ - Dynarr_atp (window->glyph_cachels, index)->dirty +#ifdef ERROR_CHECK_GLYPHS + +#include "window.h" + +INLINE_HEADER int +GLYPH_CACHEL_WIDTH (struct window *window, int ind); +INLINE_HEADER int +GLYPH_CACHEL_WIDTH (struct window *window, int ind) +{ + int wid = Dynarr_atp (window->glyph_cachels, ind)->width; + assert (wid >= 0 && wid < 10000); + return wid; +} +INLINE_HEADER int +GLYPH_CACHEL_ASCENT (struct window *window, int ind); +INLINE_HEADER int +GLYPH_CACHEL_ASCENT (struct window *window, int ind) +{ + int wid = Dynarr_atp (window->glyph_cachels, ind)->ascent; + assert (wid >= 0 && wid < 10000); + return wid; +} +INLINE_HEADER int +GLYPH_CACHEL_DESCENT (struct window *window, int ind); +INLINE_HEADER int +GLYPH_CACHEL_DESCENT (struct window *window, int ind) +{ + int wid = Dynarr_atp (window->glyph_cachels, ind)->descent; + assert (wid >= 0 && wid < 10000); + return wid; +} + +#else /* not ERROR_CHECK_GLYPHS */ + +#define GLYPH_CACHEL_WIDTH(window, ind) \ + Dynarr_atp (window->glyph_cachels, ind)->width +#define GLYPH_CACHEL_ASCENT(window, ind) \ + Dynarr_atp (window->glyph_cachels, ind)->ascent +#define GLYPH_CACHEL_DESCENT(window, ind) \ + Dynarr_atp (window->glyph_cachels, ind)->descent + +#endif /* not ERROR_CHECK_GLYPHS */ + +#define GLYPH_CACHEL(window, ind) \ + Dynarr_atp (window->glyph_cachels, ind) +#define GLYPH_CACHEL_GLYPH(window, ind) \ + Dynarr_atp (window->glyph_cachels, ind)->glyph +#define GLYPH_CACHEL_DIRTYP(window, ind) \ + Dynarr_atp (window->glyph_cachels, ind)->dirty void mark_glyph_cachels (glyph_cachel_dynarr *elements); void mark_glyph_cachels_as_not_updated (struct window *w); @@ -920,31 +1120,19 @@ * Subwindow Object * ****************************************************************************/ -/* redisplay needs a per-frame cache of subwindows being displayed so - * that we known when to unmap them */ -typedef struct subwindow_cachel subwindow_cachel; -struct subwindow_cachel -{ - Lisp_Object subwindow; - unsigned int x, y; - unsigned int width, height; - unsigned int being_displayed : 1; - unsigned int updated : 1; -}; - -typedef struct -{ - Dynarr_declare (subwindow_cachel); -} subwindow_cachel_dynarr; - -void mark_subwindow_cachels (subwindow_cachel_dynarr *elements); -void mark_subwindow_cachels_as_not_updated (struct frame *f); -void reset_subwindow_cachels (struct frame *f); void unmap_subwindow (Lisp_Object subwindow); void map_subwindow (Lisp_Object subwindow, int x, int y, struct display_glyph_area *dga); -void update_frame_subwindows (struct frame *f); int find_matching_subwindow (struct frame* f, int x, int y, int width, int height); +void redisplay_widget (Lisp_Object widget); +void update_widget_instances (Lisp_Object frame); +void redisplay_subwindow (Lisp_Object subwindow); +Lisp_Object image_instance_parent_glyph (struct Lisp_Image_Instance*); +int image_instance_changed (Lisp_Object image); +void free_frame_subwindow_instances (struct frame* f); +void reset_frame_subwindow_instance_cache (struct frame* f); +int unmap_subwindow_instance_cache_mapper (Lisp_Object key, + Lisp_Object value, void* finalize); struct expose_ignore { diff -r 72a7cfa4a488 -r abe6d1db359e src/gmalloc.c --- a/src/gmalloc.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/gmalloc.c Mon Aug 13 11:35:02 2007 +0200 @@ -25,8 +25,6 @@ # define STDC_HEADERS #endif -#define __const const - /* DO NOT EDIT THIS FILE -- it is automagically generated. -*- C -*- */ /* Bwaa-haa-haa! Not a chance that this is actually true! */ @@ -273,7 +271,7 @@ /* Call WARNFUN with a warning message when memory usage is high. */ extern void memory_warnings __P ((__ptr_t __start, - void (*__warnfun) __P ((__const char *)))); + void (*__warnfun) __P ((const char *)))); #if 0 /* unused in this file, and conflicting prototypes anyway */ @@ -369,7 +367,7 @@ #endif /* How to really get more memory. */ -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) /* once dumped, free() & realloc() on static heap space will fail */ #define PURE_DATA(x) \ ((static_heap_dumped && (char*)x >= static_heap_base \ @@ -448,7 +446,7 @@ static int initialize () { -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) if (static_heap_dumped && __morecore == more_static_core) { __morecore = __default_morecore; @@ -1038,7 +1036,7 @@ int type; __malloc_size_t block, blocks, oldlimit; - if (PURE_DATA(ptr)) + if (PURE_DATA (ptr)) { result = malloc (size); memcpy(result, ptr, size); diff -r 72a7cfa4a488 -r abe6d1db359e src/gpmevent.c --- a/src/gpmevent.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/gpmevent.c Mon Aug 13 11:35:02 2007 +0200 @@ -140,10 +140,10 @@ /* Whow, wouldn't named defines be NICE!?!?! */ modifiers = 0; - if (ev.modifiers & 1) modifiers |= MOD_SHIFT; - if (ev.modifiers & 2) modifiers |= MOD_META; - if (ev.modifiers & 4) modifiers |= MOD_CONTROL; - if (ev.modifiers & 8) modifiers |= MOD_META; + if (ev.modifiers & 1) modifiers |= XEMACS_MOD_SHIFT; + if (ev.modifiers & 2) modifiers |= XEMACS_MOD_META; + if (ev.modifiers & 4) modifiers |= XEMACS_MOD_CONTROL; + if (ev.modifiers & 8) modifiers |= XEMACS_MOD_META; if (ev.buttons & GPM_B_LEFT) { @@ -309,7 +309,7 @@ } static Lisp_Object -tty_selection_exists_p (Lisp_Object selection) +tty_selection_exists_p (Lisp_Object selection, Lisp_Object selection_type) { return (Qt); } @@ -317,7 +317,8 @@ #if 0 static Lisp_Object -tty_own_selection (Lisp_Object selection_name, Lisp_Object selection_value) +tty_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, + Lisp_Object how_to_add, Lisp_Object selection_type) { /* There is no way to do this cleanly - the GPM selection ** 'protocol' (actually the TIOCLINUX ioctl) requires a start and @@ -569,7 +570,7 @@ conn.maxMod = ((1< #include "lisp.h" +#include "console-msw.h" +#include "redisplay.h" #include "gui.h" -#include "redisplay.h" +#include "glyphs.h" #include "frame.h" #include "elhash.h" -#include "console-msw.h" +#include "events.h" #include "buffer.h" /* @@ -36,76 +38,63 @@ * command if we return nil */ Lisp_Object -mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, DWORD id) +mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, LPARAM id) { /* Try to map the command id through the proper hash table */ - Lisp_Object data, fn, arg, frame; + Lisp_Object callback, callback_ex, image_instance, frame, event; + + XSETFRAME (frame, f); /* #### make_int should assert that --kkm */ assert (XINT (make_int (id)) == id); - data = Fgethash (make_int (id), - FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f), Qnil); - - if (NILP (data) || UNBOUNDP (data)) - return Qnil; - - MARK_SUBWINDOWS_STATE_CHANGED; - /* Ok, this is our one. Enqueue it. */ - get_gui_callback (data, &fn, &arg); - XSETFRAME (frame, f); - mswindows_enqueue_misc_user_event (frame, fn, arg); + image_instance = Fgethash (make_int (id), + FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f), Qnil); + /* It is possible for a widget action to cause it to get out of sync + with its instantiator. Thus it is necessary to signal this + possibility. */ + if (IMAGE_INSTANCEP (image_instance)) + XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (image_instance) = 1; + callback = Fgethash (make_int (id), + FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f), Qnil); + callback_ex = Fgethash (make_int (id), + FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f), Qnil); - return Qt; -} - -DEFUN ("mswindows-shell-execute", Fmswindows_shell_execute, 2, 4, 0, /* -Get Windows to perform OPERATION on DOCUMENT. -This is a wrapper around the ShellExecute system function, which -invokes the application registered to handle OPERATION for DOCUMENT. -OPERATION is typically \"open\", \"print\" or \"explore\" (but can be -nil for the default action), and DOCUMENT is typically the name of a -document file or URL, but can also be a program executable to run or -a directory to open in the Windows Explorer. - -If DOCUMENT is a program executable, PARAMETERS can be a string -containing command line parameters, but otherwise should be nil. + if (!NILP (callback_ex) && !UNBOUNDP (callback_ex)) + { + event = Fmake_event (Qnil, Qnil); -SHOW-FLAG can be used to control whether the invoked application is hidden -or minimized. If SHOW-FLAG is nil, the application is displayed normally, -otherwise it is an integer representing a ShowWindow flag: - - 0 - start hidden - 1 - start normally - 3 - start maximized - 6 - start minimized -*/ - (operation, document, parameters, show_flag)) -{ - Lisp_Object current_dir; - - CHECK_STRING (document); + 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); + } + else if (NILP (callback) || UNBOUNDP (callback)) + return Qnil; + else + { + Lisp_Object fn, arg; - /* Encode filename and current directory. */ - current_dir = current_buffer->directory; - if ((int) ShellExecute (NULL, - (STRINGP (operation) ? - XSTRING (operation)->data : NULL), - XSTRING (document)->data, - (STRINGP (parameters) ? - XSTRING (parameters)->data : NULL), - XSTRING (current_dir)->data, - (INTP (show_flag) ? - XINT (show_flag) : SW_SHOWDEFAULT)) - > 32) - return Qt; + event = Fmake_event (Qnil, Qnil); - error ("ShellExecute failed"); - return Qnil; + get_gui_callback (callback, &fn, &arg); + 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; + } + + mswindows_enqueue_dispatch_event (event); + /* The result of this evaluation could cause other instances to change so + enqueue an update callback to check this. */ + enqueue_magic_eval_event (update_widget_instances, frame); + return Qt; } void syms_of_gui_mswindows (void) { - DEFSUBR (Fmswindows_shell_execute); } diff -r 72a7cfa4a488 -r abe6d1db359e src/gui-x.c --- a/src/gui-x.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/gui-x.c Mon Aug 13 11:35:02 2007 +0200 @@ -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 Ben Wing. + Copyright (C) 1995, 1996, 2000 Ben Wing. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 1998 Free Software Foundation, Inc. @@ -23,6 +23,8 @@ /* Synched up with: Not in FSF. */ +/* This file Mule-ized by Ben Wing, 7-8-00. */ + #include #include "lisp.h" @@ -33,13 +35,13 @@ #include "gui-x.h" #include "buffer.h" #include "device.h" +#include "events.h" #include "frame.h" #include "gui.h" +#include "glyphs.h" #include "redisplay.h" #include "opaque.h" -Lisp_Object Qmenu_no_selection_hook; - /* we need a unique id for each popup menu, dialog box, and scrollbar */ static unsigned int lwlib_id_tick; @@ -151,8 +153,9 @@ static void print_widget_value (widget_value *wv, int depth) { - /* !!#### This function has not been Mule-ized */ - char d [200]; + /* strings in wv are in external format; use printf not stdout_out + because the latter takes internal-format strings */ + Extbyte d [200]; int i; for (i = 0; i < depth; i++) d[i] = ' '; d[depth]=0; @@ -210,9 +213,9 @@ popup_selection_callback (Widget widget, LWLIB_ID ignored_id, XtPointer client_data) { - Lisp_Object fn, arg; - Lisp_Object data; - Lisp_Object frame; + Lisp_Object data, image_instance, callback, callback_ex; + Lisp_Object frame, event; + int update_subwindows_p = 0; struct device *d = get_device_from_display (XtDisplay (widget)); struct frame *f = x_any_widget_or_parent_to_frame (d, widget); @@ -240,13 +243,49 @@ if (((EMACS_INT) client_data) == -1) { - fn = Qrun_hooks; - arg = Qmenu_no_selection_hook; + event = Fmake_event (Qnil, Qnil); + + 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; } else { - MARK_SUBWINDOWS_STATE_CHANGED; - get_gui_callback (data, &fn, &arg); + image_instance = XCAR (data); + callback = XCAR (XCDR (data)); + callback_ex = XCDR (XCDR (data)); + update_subwindows_p = 1; + /* It is possible for a widget action to cause it to get out of + sync with its instantiator. Thus it is necessary to signal + this possibility. */ + if (IMAGE_INSTANCEP (image_instance)) + XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (image_instance) = 1; + + if (!NILP (callback_ex) && !UNBOUNDP (callback_ex)) + { + event = Fmake_event (Qnil, Qnil); + + 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); + } + else if (NILP (callback) || UNBOUNDP (callback)) + event = Qnil; + else + { + Lisp_Object fn, arg; + + event = Fmake_event (Qnil, Qnil); + + get_gui_callback (callback, &fn, &arg); + XEVENT (event)->event_type = misc_user_event; + XEVENT (event)->channel = frame; + XEVENT (event)->event.eval.function = fn; + XEVENT (event)->event.eval.object = arg; + } } /* This is the timestamp used for asserting focus so we need to get an @@ -257,7 +296,12 @@ #else DEVICE_X_MOUSE_TIMESTAMP (d) = DEVICE_X_GLOBAL_MOUSE_TIMESTAMP (d); #endif - signal_special_Xt_user_event (frame, fn, arg); + if (!NILP (event)) + enqueue_Xt_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)) + enqueue_magic_eval_event (update_widget_instances, frame); } #if 1 @@ -274,11 +318,11 @@ ((void) (slot = (!NILP (form)))) #endif -char * -menu_separator_style (CONST char *s) +Extbyte * +menu_separator_style_and_to_external (const Bufbyte *s) { - CONST char *p; - char first; + const Bufbyte *p; + Bufbyte first; if (!s || s[0] == '\0') return NULL; @@ -298,19 +342,54 @@ ? NULL /* single etched is the default */ : xstrdup ("shadowDoubleEtchedIn")); else if (*p == ':') - return xstrdup (p+1); + { + Extbyte *retval; + + C_STRING_TO_EXTERNAL_MALLOC (p + 1, retval, Qlwlib_encoding); + return retval; + } return NULL; } +Extbyte * +add_accel_and_to_external (Lisp_Object string) +{ + int i; + int found_accel = 0; + Extbyte *retval; + Bufbyte *name = XSTRING_DATA (string); + + for (i = 0; name[i]; ++i) + if (name[i] == '%' && name[i+1] == '_') + { + found_accel = 1; + break; + } + + if (found_accel) + LISP_STRING_TO_EXTERNAL_MALLOC (string, retval, Qlwlib_encoding); + else + { + size_t namelen = XSTRING_LENGTH (string); + Bufbyte *chars = (Bufbyte *) alloca (namelen + 3); + chars[0] = '%'; + chars[1] = '_'; + memcpy (chars + 2, name, namelen + 1); + C_STRING_TO_EXTERNAL_MALLOC (chars, retval, Qlwlib_encoding); + } + + return retval; +} /* This does the dirty work. gc_currently_forbidden is 1 when this is called. */ int -button_item_to_widget_value (Lisp_Object gui_item, widget_value *wv, - int allow_text_field_p, int no_keys_p) +button_item_to_widget_value (Lisp_Object gui_object_instance, + Lisp_Object gui_item, widget_value *wv, + int allow_text_field_p, int no_keys_p, + int menu_entry_p, int accel_p) { - /* !!#### This function has not been Mule-ized */ /* This function cannot GC because gc_currently_forbidden is set when it's called */ Lisp_Gui_Item* pgui = 0; @@ -319,34 +398,45 @@ if (STRINGP (gui_item)) { wv->type = TEXT_TYPE; - wv->name = (char *) XSTRING_DATA (gui_item); - wv->name = xstrdup (wv->name); + if (accel_p) + wv->name = add_accel_and_to_external (gui_item); + else + LISP_STRING_TO_EXTERNAL_MALLOC (gui_item, wv->name, Qlwlib_encoding); return 1; } else if (!GUI_ITEMP (gui_item)) - signal_simple_error("need a string or a gui_item here", gui_item); + syntax_error ("need a string or a gui_item here", gui_item); pgui = XGUI_ITEM (gui_item); if (!NILP (pgui->filter)) - signal_simple_error(":filter keyword not permitted on leaf nodes", gui_item); + syntax_error (":filter keyword not permitted on leaf nodes", gui_item); #ifdef HAVE_MENUBARS - if (!gui_item_included_p (gui_item, Vmenubar_configuration)) + if (menu_entry_p && !gui_item_included_p (gui_item, Vmenubar_configuration)) { /* the include specification says to ignore this item. */ return 0; } #endif /* HAVE_MENUBARS */ + if (!STRINGP (pgui->name)) + pgui->name = Feval (pgui->name); + CHECK_STRING (pgui->name); - wv->name = (char *) XSTRING_DATA (pgui->name); - wv->name = xstrdup (wv->name); - wv->accel = LISP_TO_VOID (gui_item_accelerator (gui_item)); + if (accel_p) + { + wv->name = add_accel_and_to_external (pgui->name); + wv->accel = LISP_TO_VOID (gui_item_accelerator (gui_item)); + } + else + { + LISP_STRING_TO_EXTERNAL_MALLOC (pgui->name, wv->name, Qlwlib_encoding); + wv->accel = LISP_TO_VOID (Qnil); + } if (!NILP (pgui->suffix)) { - CONST char *const_bogosity; Lisp_Object suffix2; /* Shortcut to avoid evaluating suffix each time */ @@ -358,22 +448,20 @@ CHECK_STRING (suffix2); } - TO_EXTERNAL_FORMAT (LISP_STRING, suffix2, - C_STRING_ALLOCA, const_bogosity, - Qfile_name); - wv->value = (char *) const_bogosity; - wv->value = xstrdup (wv->value); + LISP_STRING_TO_EXTERNAL_MALLOC (suffix2, wv->value, Qlwlib_encoding); } wv_set_evalable_slot (wv->enabled, pgui->active); wv_set_evalable_slot (wv->selected, pgui->selected); - if (!NILP (pgui->callback)) - wv->call_data = LISP_TO_VOID (pgui->callback); + if (!NILP (pgui->callback) || !NILP (pgui->callback_ex)) + wv->call_data = LISP_TO_VOID (cons3 (gui_object_instance, + pgui->callback, + pgui->callback_ex)); if (no_keys_p #ifdef HAVE_MENUBARS - || !menubar_show_keybindings + || (menu_entry_p && !menubar_show_keybindings) #endif ) wv->key = 0; @@ -382,17 +470,17 @@ CHECK_STRING (pgui->keys); pgui->keys = Fsubstitute_command_keys (pgui->keys); if (XSTRING_LENGTH (pgui->keys) > 0) - wv->key = xstrdup ((char *) XSTRING_DATA (pgui->keys)); + LISP_STRING_TO_EXTERNAL_MALLOC (pgui->keys, wv->key, Qlwlib_encoding); else wv->key = 0; } else if (SYMBOLP (pgui->callback)) /* Show the binding of this command. */ { - char buf [1024]; + char buf[1024]; /* #### */ /* #### Warning, dependency here on current_buffer and point */ where_is_to_char (pgui->callback, buf); if (buf [0]) - wv->key = xstrdup (buf); + C_STRING_TO_EXTERNAL_MALLOC (buf, wv->key, Qlwlib_encoding); else wv->key = 0; } @@ -400,14 +488,16 @@ CHECK_SYMBOL (pgui->style); if (NILP (pgui->style)) { + Bufbyte *intname; /* If the callback is nil, treat this item like unselectable text. This way, dashes will show up as a separator. */ if (!wv->enabled) wv->type = BUTTON_TYPE; - if (separator_string_p (wv->name)) + EXTERNAL_TO_C_STRING (wv->name, intname, Qlwlib_encoding); + if (separator_string_p (intname)) { wv->type = SEPARATOR_TYPE; - wv->value = menu_separator_style (wv->name); + wv->value = menu_separator_style_and_to_external (intname); } else { @@ -440,24 +530,29 @@ #endif } else - signal_simple_error_2 ("Unknown style", pgui->style, gui_item); + syntax_error_2 ("Unknown style", pgui->style, gui_item); if (!allow_text_field_p && (wv->type == TEXT_TYPE)) - signal_simple_error ("Text field not allowed in this context", gui_item); + syntax_error ("Text field not allowed in this context", gui_item); if (!NILP (pgui->selected) && EQ (pgui->style, Qtext)) - signal_simple_error ( - ":selected only makes sense with :style toggle, radio or button", - gui_item); + syntax_error + (":selected only makes sense with :style toggle, radio or button", + gui_item); return 1; } /* parse tree's of gui items into widget_value hierarchies */ -static void gui_item_children_to_widget_values (Lisp_Object items, widget_value* parent); +static void gui_item_children_to_widget_values (Lisp_Object + gui_object_instance, + Lisp_Object items, + widget_value* parent, + int accel_p); static widget_value * -gui_items_to_widget_values_1 (Lisp_Object items, widget_value* parent, - widget_value* prev) +gui_items_to_widget_values_1 (Lisp_Object gui_object_instance, + Lisp_Object items, widget_value* parent, + widget_value* prev, int accel_p) { widget_value* wv = 0; @@ -465,12 +560,13 @@ /* now walk the tree creating widget_values as appropriate */ if (!CONSP (items)) { - wv = xmalloc_widget_value(); + wv = xmalloc_widget_value (); if (parent) parent->contents = wv; else prev->next = wv; - if (!button_item_to_widget_value (items, wv, 0, 1)) + if (!button_item_to_widget_value (gui_object_instance, + items, wv, 0, 1, 0, accel_p)) { free_widget_value_tree (wv); if (parent) @@ -479,55 +575,60 @@ prev->next = 0; } else - { - wv->value = xstrdup (wv->name); /* what a mess... */ - } + wv->value = xstrdup (wv->name); /* what a mess... */ } else { /* first one is the parent */ if (CONSP (XCAR (items))) - signal_simple_error ("parent item must not be a list", XCAR (items)); + syntax_error ("parent item must not be a list", XCAR (items)); if (parent) - wv = gui_items_to_widget_values_1 (XCAR (items), parent, 0); + wv = gui_items_to_widget_values_1 (gui_object_instance, + XCAR (items), parent, 0, accel_p); else - wv = gui_items_to_widget_values_1 (XCAR (items), 0, prev); + wv = gui_items_to_widget_values_1 (gui_object_instance, + XCAR (items), 0, prev, accel_p); /* the rest are the children */ - gui_item_children_to_widget_values (XCDR (items), wv); + gui_item_children_to_widget_values (gui_object_instance, + XCDR (items), wv, accel_p); } return wv; } static void -gui_item_children_to_widget_values (Lisp_Object items, widget_value* parent) +gui_item_children_to_widget_values (Lisp_Object gui_object_instance, + Lisp_Object items, widget_value* parent, + int accel_p) { widget_value* wv = 0, *prev = 0; Lisp_Object rest; CHECK_CONS (items); /* first one is master */ - prev = gui_items_to_widget_values_1 (XCAR (items), parent, 0); + prev = gui_items_to_widget_values_1 (gui_object_instance, XCAR (items), + parent, 0, accel_p); /* the rest are the children */ LIST_LOOP (rest, XCDR (items)) { Lisp_Object tab = XCAR (rest); - wv = gui_items_to_widget_values_1 (tab, 0, prev); + wv = gui_items_to_widget_values_1 (gui_object_instance, tab, 0, prev, + accel_p); prev = wv; } } widget_value * -gui_items_to_widget_values (Lisp_Object items) +gui_items_to_widget_values (Lisp_Object gui_object_instance, Lisp_Object items, + int accel_p) { - /* !!#### This function has not been Mule-ized */ /* This function can GC */ widget_value *control = 0, *tmp = 0; int count = specpdl_depth (); Lisp_Object wv_closure; if (NILP (items)) - signal_simple_error ("must have some items", items); + syntax_error ("must have some items", items); /* Inhibit GC during this conversion. The reasons for this are the same as in menu_item_descriptor_to_widget_value(); see @@ -538,11 +639,12 @@ /* Also make sure that we free the partially-created widget_value tree on Lisp error. */ - control = xmalloc_widget_value(); + control = xmalloc_widget_value (); wv_closure = make_opaque_ptr (control); record_unwind_protect (widget_value_unwind, wv_closure); - gui_items_to_widget_values_1 (items, control, 0); + gui_items_to_widget_values_1 (gui_object_instance, items, control, 0, + accel_p); /* mess about getting the data we really want */ tmp = control; @@ -619,7 +721,7 @@ void syms_of_gui_x (void) { - defsymbol (&Qmenu_no_selection_hook, "menu-no-selection-hook"); + INIT_LRECORD_IMPLEMENTATION (popup_data); } void @@ -641,14 +743,4 @@ Vpopup_callbacks = Qnil; staticpro (&Vpopup_callbacks); - -#if 0 - /* This DEFVAR_LISP is just for the benefit of make-docfile. */ - /* #### misnamed */ - DEFVAR_LISP ("menu-no-selection-hook", &Vmenu_no_selection_hook /* -Function or functions to call when a menu or dialog box is dismissed -without a selection having been made. -*/ ); -#endif - Fset (Qmenu_no_selection_hook, Qnil); } diff -r 72a7cfa4a488 -r abe6d1db359e src/gui-x.h --- a/src/gui-x.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/gui-x.h Mon Aug 13 11:35:02 2007 +0200 @@ -1,6 +1,6 @@ /* General GUI code -- X-specific header file. Copyright (C) 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1996 Ben Wing. + Copyright (C) 1996, 2000 Ben Wing. This file is part of XEmacs. @@ -21,6 +21,8 @@ /* Synched up with: Not in FSF. */ +/* This file Mule-ized by Ben Wing, 7-8-00. */ + #ifndef INCLUDED_gui_x_h_ #define INCLUDED_gui_x_h_ @@ -68,11 +70,14 @@ void free_popup_widget_value_tree (widget_value *wv); void popup_selection_callback (Widget widget, LWLIB_ID ignored_id, XtPointer client_data); -int button_item_to_widget_value (Lisp_Object desc, widget_value *wv, - int allow_text_field_p, int no_keys_p); -widget_value * gui_items_to_widget_values (Lisp_Object items); -Lisp_Object menu_name_to_accelerator (char *name); -char *menu_separator_style (CONST char *s); +Extbyte *add_accel_and_to_external (Lisp_Object string); +int button_item_to_widget_value (Lisp_Object gui_object_instance, + Lisp_Object gui_item, widget_value *wv, + int allow_text_field_p, int no_keys_p, + int menu_entry_p, int accel_p); +widget_value * gui_items_to_widget_values (Lisp_Object gui_object_instance, + Lisp_Object items, int accel_p); +Extbyte *menu_separator_style_and_to_external (const Bufbyte *s); Lisp_Object widget_value_unwind (Lisp_Object closure); #endif /* INCLUDED_gui_x_h_ */ diff -r 72a7cfa4a488 -r abe6d1db359e src/gui.c --- a/src/gui.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/gui.c Mon Aug 13 11:35:02 2007 +0200 @@ -23,16 +23,18 @@ /* Synched up with: Not in FSF. */ +/* This file not quite Mule-ized yet but will be when merged with my + Mule workspace. --ben */ + #include #include "lisp.h" #include "gui.h" #include "elhash.h" +#include "buffer.h" #include "bytecode.h" -Lisp_Object Q_active, Q_suffix, Q_keys, Q_style, Q_selected; -Lisp_Object Q_filter, Q_config, Q_included, Q_key_sequence; -Lisp_Object Q_accelerator, Q_label, Q_callback; -Lisp_Object Qtoggle, Qradio; +Lisp_Object Qmenu_no_selection_hook; +Lisp_Object Vmenu_no_selection_hook; static Lisp_Object parse_gui_item_tree_list (Lisp_Object list); @@ -52,10 +54,10 @@ #endif /* HAVE_POPUPS */ int -separator_string_p (CONST char *s) +separator_string_p (const Bufbyte *s) { - CONST char *p; - char first; + const Bufbyte *p; + Bufbyte first; if (!s || s[0] == '\0') return 0; @@ -73,11 +75,17 @@ void get_gui_callback (Lisp_Object data, Lisp_Object *fn, Lisp_Object *arg) { - if (SYMBOLP (data) - || (COMPILED_FUNCTIONP (data) - && XCOMPILED_FUNCTION (data)->flags.interactivep) - || (CONSP (data) && (EQ (XCAR (data), Qlambda)) - && !NILP (Fassq (Qinteractive, Fcdr (Fcdr (data)))))) + if (EQ (data, Qquit)) + { + *fn = Qeval; + *arg = list3 (Qsignal, list2 (Qquote, Qquit), Qnil); + Vquit_flag = Qt; + } + else if (SYMBOLP (data) + || (COMPILED_FUNCTIONP (data) + && XCOMPILED_FUNCTION (data)->flags.interactivep) + || (CONSP (data) && (EQ (XCAR (data), Qlambda)) + && !NILP (Fassq (Qinteractive, Fcdr (Fcdr (data)))))) { *fn = Qcall_interactively; *arg = data; @@ -108,10 +116,10 @@ Lisp_Object key, Lisp_Object val, Error_behavior errb) { - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); if (!KEYWORDP (key)) - signal_simple_error_2 ("Non-keyword in gui item", key, pgui_item->name); + syntax_error_2 ("Non-keyword in gui item", key, pgui_item->name); if (EQ (key, Q_suffix)) pgui_item->suffix = val; else if (EQ (key, Q_active)) pgui_item->active = val; @@ -121,7 +129,9 @@ else if (EQ (key, Q_style)) pgui_item->style = val; else if (EQ (key, Q_selected)) pgui_item->selected = val; else if (EQ (key, Q_keys)) pgui_item->keys = val; - else if (EQ (key, Q_callback)) pgui_item->callback = val; + else if (EQ (key, Q_callback)) pgui_item->callback = val; + else if (EQ (key, Q_callback_ex)) pgui_item->callback_ex = val; + else if (EQ (key, Q_value)) pgui_item->value = val; else if (EQ (key, Q_key_sequence)) ; /* ignored for FSF compatibility */ else if (EQ (key, Q_label)) ; /* ignored for 21.0 implement in 21.2 */ else if (EQ (key, Q_accelerator)) @@ -129,10 +139,11 @@ if (SYMBOLP (val) || CHARP (val)) pgui_item->accelerator = val; else if (ERRB_EQ (errb, ERROR_ME)) - signal_simple_error ("Bad keyboard accelerator", val); + syntax_error ("Bad keyboard accelerator", val); } else if (ERRB_EQ (errb, ERROR_ME)) - signal_simple_error_2 ("Unknown keyword in gui item", key, pgui_item->name); + syntax_error_2 ("Unknown keyword in gui item", key, + pgui_item->name); } void @@ -142,6 +153,7 @@ lp->name = Qnil; lp->callback = Qnil; + lp->callback_ex = Qnil; lp->suffix = Qnil; lp->active = Qt; lp->included = Qt; @@ -151,6 +163,7 @@ lp->selected = Qnil; lp->keys = Qnil; lp->accelerator = Qnil; + lp->value = Qnil; } Lisp_Object @@ -179,14 +192,14 @@ int length, plist_p, start; Lisp_Object *contents; Lisp_Object gui_item = allocate_gui_item (); - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); CHECK_VECTOR (item); length = XVECTOR_LENGTH (item); contents = XVECTOR_DATA (item); if (length < 1) - signal_simple_error ("GUI item descriptors must be at least 1 elts long", item); + syntax_error ("GUI item descriptors must be at least 1 elts long", item); /* length 1: [ "name" ] length 2: [ "name" callback ] @@ -221,7 +234,7 @@ { int i; if ((length - start) & 1) - signal_simple_error ( + syntax_error ( "GUI item descriptor has an odd number of keywords and values", item); @@ -251,10 +264,12 @@ void gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item) { - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); if (!NILP (pgui_item->callback)) Fplist_put (plist, Q_callback, pgui_item->callback); + if (!NILP (pgui_item->callback_ex)) + Fplist_put (plist, Q_callback_ex, pgui_item->callback_ex); if (!NILP (pgui_item->suffix)) Fplist_put (plist, Q_suffix, pgui_item->suffix); if (!NILP (pgui_item->active)) @@ -273,6 +288,8 @@ Fplist_put (plist, Q_keys, pgui_item->keys); if (!NILP (pgui_item->accelerator)) Fplist_put (plist, Q_accelerator, pgui_item->accelerator); + if (!NILP (pgui_item->value)) + Fplist_put (plist, Q_value, pgui_item->value); } /* @@ -293,35 +310,38 @@ Lisp_Object gui_item_accelerator (Lisp_Object gui_item) { - Lisp_Gui_Item* pgui = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui = XGUI_ITEM (gui_item); if (!NILP (pgui->accelerator)) return pgui->accelerator; else - return pgui->name; + return gui_name_accelerator (pgui->name); } Lisp_Object gui_name_accelerator (Lisp_Object nm) { - /* !!#### This function has not been Mule-ized */ - char* name = (char*)XSTRING_DATA (nm); + Bufbyte *name = XSTRING_DATA (nm); - while (*name) { - if (*name=='%') { - ++name; - if (!(*name)) - return Qnil; - if (*name=='_' && *(name+1)) + while (*name) + { + if (*name == '%') { - int accelerator = (int) (unsigned char) (*(name+1)); - return make_char (tolower (accelerator)); + ++name; + if (!(*name)) + return Qnil; + if (*name == '_' && *(name + 1)) + { + Emchar accelerator = charptr_emchar (name + 1); + /* #### bogus current_buffer dependency */ + return make_char (DOWNCASE (current_buffer, accelerator)); + } } + INC_CHARPTR (name); } - ++name; - } - return Qnil; + return make_char (DOWNCASE (current_buffer, + charptr_emchar (XSTRING_DATA (nm)))); } /* @@ -338,6 +358,19 @@ || !NILP (Feval (XGUI_ITEM (gui_item)->selected))); } +Lisp_Object +gui_item_list_find_selected (Lisp_Object gui_item_list) +{ + /* This function can GC. */ + Lisp_Object rest; + LIST_LOOP (rest, gui_item_list) + { + if (gui_item_selected_p (XCAR (rest))) + return XCAR (rest); + } + return XCAR (gui_item_list); +} + /* * Decide whether a GUI item is included by evaluating its :included * form if given, and testing its :config form against supplied CONFLIST @@ -347,7 +380,7 @@ gui_item_included_p (Lisp_Object gui_item, Lisp_Object conflist) { /* This function can call lisp */ - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); /* Evaluate :included first. Shortcut to avoid evaluating Qt each time */ if (!EQ (pgui_item->included, Qt) @@ -365,7 +398,7 @@ static DOESNT_RETURN signal_too_long_error (Lisp_Object name) { - signal_simple_error ("GUI item produces too long displayable string", name); + syntax_error ("GUI item produces too long displayable string", name); } #ifdef HAVE_WINDOW_SYSTEM @@ -379,13 +412,13 @@ * buffer. */ unsigned int -gui_item_display_flush_left (Lisp_Object gui_item, - char* buf, Bytecount buf_len) +gui_item_display_flush_left (Lisp_Object gui_item, + char *buf, Bytecount buf_len) { /* This function can call lisp */ char *p = buf; Bytecount len; - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); /* Copy item name first */ CHECK_STRING (pgui_item->name); @@ -429,9 +462,9 @@ */ unsigned int gui_item_display_flush_right (Lisp_Object gui_item, - char* buf, Bytecount buf_len) + char *buf, Bytecount buf_len) { - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); *buf = 0; #ifdef HAVE_MENUBARS @@ -444,16 +477,17 @@ if (!NILP (pgui_item->keys)) { CHECK_STRING (pgui_item->keys); - if (XSTRING_LENGTH (pgui_item->keys) > buf_len) + if (XSTRING_LENGTH (pgui_item->keys) + 1 > buf_len) signal_too_long_error (pgui_item->name); - strcpy (buf, (CONST char *) XSTRING_DATA (pgui_item->keys)); + memcpy (buf, XSTRING_DATA (pgui_item->keys), + XSTRING_LENGTH (pgui_item->keys) + 1); return XSTRING_LENGTH (pgui_item->keys); } /* See if we can derive keys out of callback symbol */ if (SYMBOLP (pgui_item->callback)) { - char buf2 [1024]; + char buf2[1024]; /* #### */ Bytecount len; where_is_to_char (pgui_item->callback, buf2); @@ -476,6 +510,7 @@ mark_object (p->name); mark_object (p->callback); + mark_object (p->callback_ex); mark_object (p->config); mark_object (p->suffix); mark_object (p->active); @@ -486,6 +521,7 @@ mark_object (p->selected); mark_object (p->keys); mark_object (p->accelerator); + mark_object (p->value); return Qnil; } @@ -495,16 +531,18 @@ { Lisp_Gui_Item *p = XGUI_ITEM (obj); - return HASH2 (HASH5 (internal_hash (p->name, depth + 1), + return HASH2 (HASH6 (internal_hash (p->name, depth + 1), internal_hash (p->callback, depth + 1), + internal_hash (p->callback_ex, depth + 1), internal_hash (p->suffix, depth + 1), internal_hash (p->active, depth + 1), internal_hash (p->included, depth + 1)), - HASH5 (internal_hash (p->config, depth + 1), + HASH6 (internal_hash (p->config, depth + 1), internal_hash (p->filter, depth + 1), internal_hash (p->style, depth + 1), internal_hash (p->selected, depth + 1), - internal_hash (p->keys, depth + 1))); + internal_hash (p->keys, depth + 1), + internal_hash (p->value, depth + 1))); } int @@ -520,8 +558,8 @@ return id; } -static int -gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +int +gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth) { Lisp_Gui_Item *p1 = XGUI_ITEM (obj1); Lisp_Gui_Item *p2 = XGUI_ITEM (obj2); @@ -530,6 +568,8 @@ && internal_equal (p1->callback, p2->callback, depth + 1) && + internal_equal (p1->callback_ex, p2->callback_ex, depth + 1) + && EQ (p1->suffix, p2->suffix) && EQ (p1->active, p2->active) @@ -542,11 +582,24 @@ && EQ (p1->style, p2->style) && - EQ (p1->selected, p2->selected) - && EQ (p1->accelerator, p2->accelerator) && - EQ (p1->keys, p2->keys))) + EQ (p1->keys, p2->keys) + && + EQ (p1->value, p2->value))) + return 0; + return 1; +} + +static int +gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +{ + Lisp_Gui_Item *p1 = XGUI_ITEM (obj1); + Lisp_Gui_Item *p2 = XGUI_ITEM (obj2); + + if (!(gui_item_equal_sans_selected (obj1, obj2, depth) + && + EQ (p1->selected, p2->selected))) return 0; return 1; } @@ -565,36 +618,87 @@ write_c_string (buf, printcharfun); } +static Lisp_Object +copy_gui_item (Lisp_Object gui_item) +{ + Lisp_Object ret = allocate_gui_item (); + Lisp_Gui_Item *lp, *g = XGUI_ITEM (gui_item); + + lp = XGUI_ITEM (ret); + lp->name = g->name; + lp->callback = g->callback; + lp->callback_ex = g->callback_ex; + lp->suffix = g->suffix; + lp->active = g->active; + lp->included = g->included; + lp->config = g->config; + lp->filter = g->filter; + lp->style = g->style; + lp->selected = g->selected; + lp->keys = g->keys; + lp->accelerator = g->accelerator; + lp->value = g->value; + + return ret; +} + +Lisp_Object +copy_gui_item_tree (Lisp_Object arg) +{ + if (CONSP (arg)) + { + Lisp_Object rest = arg = Fcopy_sequence (arg); + while (CONSP (rest)) + { + XCAR (rest) = copy_gui_item_tree (XCAR (rest)); + rest = XCDR (rest); + } + return arg; + } + else if (GUI_ITEMP (arg)) + return copy_gui_item (arg); + else + return arg; +} + /* parse a glyph descriptor into a tree of gui items. The gui_item slot of an image instance can be a single item or an arbitrarily nested hierarchy of item lists. */ -static Lisp_Object parse_gui_item_tree_item (Lisp_Object entry) +static Lisp_Object +parse_gui_item_tree_item (Lisp_Object entry) { Lisp_Object ret = entry; + struct gcpro gcpro1; + + GCPRO1 (ret); + if (VECTORP (entry)) { - ret = gui_parse_item_keywords_no_errors (entry); + ret = gui_parse_item_keywords_no_errors (entry); } else if (STRINGP (entry)) { CHECK_STRING (entry); } else - signal_simple_error ("item must be a vector or a string", entry); + syntax_error ("item must be a vector or a string", entry); - return ret; + RETURN_UNGCPRO (ret); } -Lisp_Object parse_gui_item_tree_children (Lisp_Object list) +Lisp_Object +parse_gui_item_tree_children (Lisp_Object list) { - Lisp_Object rest, ret = Qnil; + Lisp_Object rest, ret = Qnil, sub = Qnil; + struct gcpro gcpro1, gcpro2; + + GCPRO2 (ret, sub); CHECK_CONS (list); /* recursively add items to the tree view */ LIST_LOOP (rest, list) { - Lisp_Object sub; if (CONSP (XCAR (rest))) sub = parse_gui_item_tree_list (XCAR (rest)); else @@ -603,21 +707,30 @@ ret = Fcons (sub, ret); } /* make the order the same as the items we have parsed */ - return Fnreverse (ret); + RETURN_UNGCPRO (Fnreverse (ret)); } -static Lisp_Object parse_gui_item_tree_list (Lisp_Object list) +static Lisp_Object +parse_gui_item_tree_list (Lisp_Object list) { Lisp_Object ret; + struct gcpro gcpro1; CHECK_CONS (list); /* first one can never be a list */ ret = parse_gui_item_tree_item (XCAR (list)); - return Fcons (ret, parse_gui_item_tree_children (XCDR (list))); + GCPRO1 (ret); + ret = Fcons (ret, parse_gui_item_tree_children (XCDR (list))); + RETURN_UNGCPRO (ret); +} + +static void +finalize_gui_item (void* header, int for_disksave) +{ } DEFINE_LRECORD_IMPLEMENTATION ("gui-item", gui_item, mark_gui_item, print_gui_item, - 0, gui_item_equal, + finalize_gui_item, gui_item_equal, gui_item_hash, 0, Lisp_Gui_Item); @@ -625,21 +738,9 @@ void syms_of_gui (void) { - defkeyword (&Q_active, ":active"); - defkeyword (&Q_suffix, ":suffix"); - defkeyword (&Q_keys, ":keys"); - defkeyword (&Q_key_sequence,":key-sequence"); - defkeyword (&Q_style, ":style"); - defkeyword (&Q_selected, ":selected"); - defkeyword (&Q_filter, ":filter"); - defkeyword (&Q_config, ":config"); - defkeyword (&Q_included, ":included"); - defkeyword (&Q_accelerator, ":accelerator"); - defkeyword (&Q_label, ":label"); - defkeyword (&Q_callback, ":callback"); + INIT_LRECORD_IMPLEMENTATION (gui_item); - defsymbol (&Qtoggle, "toggle"); - defsymbol (&Qradio, "radio"); + DEFSYMBOL (Qmenu_no_selection_hook); #ifdef HAVE_POPUPS DEFSUBR (Fpopup_up_p); @@ -649,4 +750,9 @@ void vars_of_gui (void) { + DEFVAR_LISP ("menu-no-selection-hook", &Vmenu_no_selection_hook /* +Function or functions to call when a menu or dialog box is dismissed +without a selection having been made. +*/ ); + Vmenu_no_selection_hook = Qnil; } diff -r 72a7cfa4a488 -r abe6d1db359e src/gui.h --- a/src/gui.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/gui.h Mon Aug 13 11:35:02 2007 +0200 @@ -27,8 +27,9 @@ #ifndef INCLUDED_gui_h_ #define INCLUDED_gui_h_ -int separator_string_p (CONST char *s); +int separator_string_p (const Bufbyte *s); void get_gui_callback (Lisp_Object, Lisp_Object *, Lisp_Object *); +int gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth); extern int popup_up_p; @@ -43,6 +44,7 @@ struct lcrecord_header header; Lisp_Object name; /* String */ Lisp_Object callback; /* Symbol or form */ + Lisp_Object callback_ex; /* Form taking context arguments */ Lisp_Object suffix; /* String */ Lisp_Object active; /* Form */ Lisp_Object included; /* Form */ @@ -52,6 +54,7 @@ Lisp_Object selected; /* Form */ Lisp_Object keys; /* String */ Lisp_Object accelerator; /* Char or Symbol */ + Lisp_Object value; /* Anything you like */ }; DECLARE_LRECORD (gui_item, Lisp_Gui_Item); @@ -61,10 +64,6 @@ #define CHECK_GUI_ITEM(x) CHECK_RECORD (x, gui_item) #define CONCHECK_GUI_ITEM(x) CONCHECK_RECORD (x, gui_item) -extern Lisp_Object Q_accelerator, Q_active, Q_config, Q_filter, Q_included; -extern Lisp_Object Q_keys, Q_selected, Q_suffix, Qradio, Qtoggle; -extern Lisp_Object Q_key_sequence, Q_label, Q_callback; - void gui_item_add_keyval_pair (Lisp_Object, Lisp_Object key, Lisp_Object val, Error_behavior errb); @@ -73,6 +72,7 @@ void gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item); int gui_item_active_p (Lisp_Object); int gui_item_selected_p (Lisp_Object); +Lisp_Object gui_item_list_find_selected (Lisp_Object gui_item_list); int gui_item_included_p (Lisp_Object, Lisp_Object into); Lisp_Object gui_item_accelerator (Lisp_Object gui_item); Lisp_Object gui_name_accelerator (Lisp_Object name); @@ -85,6 +85,9 @@ Lisp_Object allocate_gui_item (void); void gui_item_init (Lisp_Object gui_item); Lisp_Object parse_gui_item_tree_children (Lisp_Object list); +Lisp_Object copy_gui_item_tree (Lisp_Object arg); + +extern Lisp_Object Qmenu_no_selection_hook, Qdelete_dialog_box_hook; /* this is mswindows biased but reasonably safe I think */ #define GUI_ITEM_ID_SLOTS 8 diff -r 72a7cfa4a488 -r abe6d1db359e src/gutter.c --- a/src/gutter.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/gutter.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,5 +1,5 @@ /* Gutter implementation. - Copyright (C) 1999 Andy Piper. + Copyright (C) 1999, 2000 Andy Piper. This file is part of XEmacs. @@ -47,6 +47,11 @@ Lisp_Object Vdefault_gutter_position; Lisp_Object Qgutter_size; +Lisp_Object Qgutter_visible; +Lisp_Object Qdefault_gutter_position_changed_hook; + +static void +update_gutter_geometry (struct frame *f, enum gutter_pos pos); #define SET_GUTTER_WAS_VISIBLE_FLAG(frame, pos, flag) \ do { \ @@ -83,9 +88,11 @@ return frame->right_gutter_was_visible; default: abort (); + return 0; /* To keep the compiler happy */ } } +#if 0 static Lisp_Object frame_topmost_window (struct frame *f) { @@ -100,6 +107,7 @@ return w; } +#endif static Lisp_Object frame_bottommost_window (struct frame *f) @@ -167,7 +175,6 @@ int *width, int *height) { struct window - * top = XWINDOW (frame_topmost_window (f)), * bot = XWINDOW (frame_bottommost_window (f)); /* The top and bottom gutters take precedence over the left and right. */ @@ -176,37 +183,34 @@ case TOP_GUTTER: *x = FRAME_LEFT_BORDER_END (f); *y = FRAME_TOP_BORDER_END (f); - *width = FRAME_RIGHT_BORDER_START (f) + *width = FRAME_RIGHT_BORDER_START (f) - FRAME_LEFT_BORDER_END (f); *height = FRAME_TOP_GUTTER_BOUNDS (f); break; case BOTTOM_GUTTER: *x = FRAME_LEFT_BORDER_END (f); - *y = WINDOW_BOTTOM (bot) - - FRAME_BOTTOM_GUTTER_BOUNDS (f); - *width = FRAME_RIGHT_BORDER_START (f) + *y = WINDOW_BOTTOM (bot); + *width = FRAME_RIGHT_BORDER_START (f) - FRAME_LEFT_BORDER_END (f); *height = FRAME_BOTTOM_GUTTER_BOUNDS (f); break; case LEFT_GUTTER: *x = FRAME_LEFT_BORDER_END (f); - *y = WINDOW_TEXT_TOP (top); + *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); *width = FRAME_LEFT_GUTTER_BOUNDS (f); *height = WINDOW_BOTTOM (bot) - - (WINDOW_TEXT_TOP (top) - + FRAME_BOTTOM_GUTTER_BOUNDS (f)); + - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); break; - + case RIGHT_GUTTER: *x = FRAME_RIGHT_BORDER_START (f) - FRAME_RIGHT_GUTTER_BOUNDS (f); - *y = WINDOW_TEXT_TOP (top); + *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); *width = FRAME_RIGHT_GUTTER_BOUNDS (f); *height = WINDOW_BOTTOM (bot) - - (WINDOW_TEXT_TOP (top) - + FRAME_BOTTOM_GUTTER_BOUNDS (f)); + - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); break; default: @@ -214,8 +218,39 @@ } } +/* Convert the gutter specifier into something we can actually + display. */ +static Lisp_Object construct_window_gutter_spec (struct window* w, + enum gutter_pos pos) +{ + Lisp_Object rest, *args; + int nargs = 0; + Lisp_Object gutter = RAW_WINDOW_GUTTER (w, pos); + + if (STRINGP (gutter) || NILP (gutter)) + return gutter; + + GET_LIST_LENGTH (gutter, nargs); + args = alloca_array (Lisp_Object, nargs >> 1); + nargs = 0; + + for (rest = gutter; !NILP (rest); rest = XCDR (XCDR (rest))) + { + /* We only put things in the real gutter that are declared to be + visible. */ + if (!CONSP (WINDOW_GUTTER_VISIBLE (w, pos)) + || + !NILP (Fmemq (XCAR (rest), WINDOW_GUTTER_VISIBLE (w, pos)))) + { + args [nargs++] = XCAR (XCDR (rest)); + } + } + + return Fconcat (nargs, args); +} + static void -output_gutter (struct frame *f, enum gutter_pos pos) +output_gutter (struct frame *f, enum gutter_pos pos, int force) { Lisp_Object frame; Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); @@ -225,22 +260,22 @@ int line, border_width; face_index findex; display_line_dynarr* ddla, *cdla; - struct display_line *dl; + struct display_line *dl = 0; int cdla_len; if (!WINDOW_LIVE_P (w)) return; border_width = FRAME_GUTTER_BORDER_WIDTH (f, pos); - findex = get_builtin_face_cache_index (w, Vgui_element_face); + findex = get_builtin_face_cache_index (w, Vwidget_face); - if (!f->current_display_lines) - f->current_display_lines = Dynarr_new (display_line); - if (!f->desired_display_lines) - f->desired_display_lines = Dynarr_new (display_line); + if (!f->current_display_lines[pos]) + f->current_display_lines[pos] = Dynarr_new (display_line); + if (!f->desired_display_lines[pos]) + f->desired_display_lines[pos] = Dynarr_new (display_line); - ddla = f->desired_display_lines; - cdla = f->current_display_lines; + ddla = f->desired_display_lines[pos]; + cdla = f->current_display_lines[pos]; cdla_len = Dynarr_length (cdla); XSETFRAME (frame, f); @@ -249,42 +284,108 @@ /* generate some display lines */ generate_displayable_area (w, WINDOW_GUTTER (w, pos), x + border_width, y + border_width, - width - 2 * border_width, + width - 2 * border_width, height - 2 * border_width, ddla, 0, findex); - /* Output each line. */ - for (line = 0; line < Dynarr_length (ddla); line++) + + /* We only output the gutter if we think something of significance + has changed. This is, for example, because redisplay can cause + new face cache elements to get added causing compare_runes to + fail because the findex for a particular face has changed. */ + if (force || f->faces_changed || f->frame_changed || + f->gutter_changed || f->glyphs_changed || + f->size_changed || f->subwindows_changed || + w->windows_changed || f->windows_structure_changed || + cdla_len != Dynarr_length (ddla) || + (f->extents_changed && w->gutter_extent_modiff[pos])) { - output_display_line (w, cdla, ddla, line, -1, -1); - } +#ifdef DEBUG_GUTTERS + printf ("gutter redisplay triggered by %s\n", force ? "force" : + f->faces_changed ? "f->faces_changed" : + f->frame_changed ? "f->frame_changed" : + f->gutter_changed ? "f->gutter_changed" : + f->glyphs_changed ? "f->glyphs_changed" : + f->size_changed ? "f->size_changed" : + f->subwindows_changed ? "f->subwindows_changed" : + w->windows_changed ? "w->windows_changed" : + f->windows_structure_changed ? "f->windows_structure_changed" : + cdla_len != Dynarr_length (ddla) ? "different display structures" : + f->extents_changed && w->gutter_extent_modiff[pos] ? + "f->extents_changed && w->gutter_extent_modiff[pos]" : ""); +#endif + /* Output each line. */ + for (line = 0; line < Dynarr_length (ddla); line++) + { + output_display_line (w, cdla, ddla, line, -1, -1); + } + + /* If the number of display lines has shrunk, adjust. */ + if (cdla_len > Dynarr_length (ddla)) + { + Dynarr_length (cdla) = Dynarr_length (ddla); + } + + /* grab coordinates of last line and blank after it. */ + if (Dynarr_length (ddla) > 0) + { + dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); + ypos = dl->ypos + dl->descent - dl->clip; + } + else + ypos = y; - /* If the number of display lines has shrunk, adjust. */ - if (cdla_len > Dynarr_length (ddla)) + redisplay_clear_region (window, findex, x + border_width , ypos, + width - 2 * border_width, height - (ypos - y) - border_width); + /* If, for some reason, we have more to display than we have + room for, and we are allowed to resize the gutter, then make + sure this happens before the next time we try and + output. This can happen when face font sizes change. */ + if (dl && dl->clip > 0 && EQ (w->gutter_size[pos], Qautodetect)) + { + /* #### Ideally we would just mark the specifier as dirty + and everything else would "just work". Unfortunately we have + two problems with this. One is that the specifier cache + won't be recalculated unless the specifier code thinks the + cached value has actually changed, even though we have + marked the specifier as dirty. Additionally, although doing + this results in a gutter size change, we never seem to get + back into redisplay so that the frame size can be updated. I + think this is because we are already in redisplay and later + on the frame will be marked as clean. Thus we also have to + force a pending recalculation of the frame size. */ + w->gutter_size[pos] = Qnil; + Fset_specifier_dirty_flag (Vgutter_size[pos]); + update_gutter_geometry (f, pos); + } + + /* bevel the gutter area if so desired */ + if (border_width != 0) + { + MAYBE_DEVMETH (d, bevel_area, + (w, findex, x, y, width, height, border_width, + EDGE_ALL, EDGE_BEVEL_OUT)); + } + } + else { - Dynarr_length (cdla) = Dynarr_length (ddla); + /* Nothing of significance happened so sync the display line + structs. */ + for (line = 0; line < Dynarr_length (ddla); line++) + { + sync_display_line_structs (w, line, 1, cdla, ddla); + } } - /* grab coordinates of last line and blank after it. */ - dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); - ypos = dl->ypos + dl->descent - dl->clip; - redisplay_clear_region (window, findex, x + border_width , ypos, - width - 2 * border_width, height - (ypos - y) - border_width); - /* bevel the gutter area if so desired */ - if (border_width != 0) - { - MAYBE_DEVMETH (d, bevel_area, - (w, findex, x, y, width, height, border_width, - EDGE_ALL, EDGE_BEVEL_OUT)); - } + w->gutter_extent_modiff [pos] = 0; } -/* sizing gutters is a pain so we try and help the user by detemining +/* Sizing gutters is a pain so we try and help the user by determining what height will accommodate all lines. This is useless on left and right gutters as we always have a maximal number of lines. */ static Lisp_Object calculate_gutter_size (struct window *w, enum gutter_pos pos) { struct frame* f = XFRAME (WINDOW_FRAME (w)); - int ypos; + int ypos, count; display_line_dynarr* ddla; struct display_line *dl; @@ -292,13 +393,20 @@ is no reasonable metric to use */ assert (pos == TOP_GUTTER || pos == BOTTOM_GUTTER); /* degenerate case */ - if (NILP (WINDOW_GUTTER (w, pos)) + if (NILP (RAW_WINDOW_GUTTER (w, pos)) || !FRAME_VISIBLE_P (f) || NILP (w->buffer)) return Qnil; + /* Redisplay code that we use relies on GC not happening. Make it + so. */ + count = specpdl_depth (); + record_unwind_protect (restore_gc_inhibit, + make_int (gc_currently_forbidden)); + gc_currently_forbidden = 1; + ddla = Dynarr_new (display_line); /* generate some display lines */ generate_displayable_area (w, WINDOW_GUTTER (w, pos), @@ -308,6 +416,10 @@ - FRAME_LEFT_BORDER_END (f), 200, ddla, 0, 0); + + /* Let GC happen again. */ + unbind_to (count, Qnil); + /* grab coordinates of last line */ if (Dynarr_length (ddla)) { @@ -329,7 +441,7 @@ int x, y, width, height; Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); face_index findex = get_builtin_face_cache_index (XWINDOW (window), - Vgui_element_face); + Vwidget_face); get_gutter_coords (f, pos, &x, &y, &width, &height); SET_GUTTER_WAS_VISIBLE_FLAG (f, pos, 0); @@ -337,16 +449,105 @@ redisplay_clear_region (window, findex, x, y, width, height); } +/* #### I don't currently believe that redisplay needs to mark the + glyphs in its structures since these will always be referenced from + somewhere else. However, I'm not sure enough to stake my life on it + at this point, so we do the safe thing. */ + +/* See the comment in image_instantiate_cache_result as to why marking + the glyph will also mark the image_instance. */ +void +mark_gutters (struct frame* f) +{ + enum gutter_pos pos; + GUTTER_POS_LOOP (pos) + { + if (f->current_display_lines[pos]) + mark_redisplay_structs (f->current_display_lines[pos]); + /* #### Do we really need to mark the desired lines? */ + if (f->desired_display_lines[pos]) + mark_redisplay_structs (f->desired_display_lines[pos]); + } +} + +/* This is called by extent_changed_for_redisplay, so that redisplay + knows exactly what extents have changed. */ +void +gutter_extent_signal_changed_region_maybe (Lisp_Object obj, + Bufpos start, Bufpos end) +{ + /* #### Start and end are currently ignored but could be used by a + more optimal gutter redisplay. We currently loop over all frames + here, this could be optimized. */ + Lisp_Object frmcons, devcons, concons; + + FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) + { + struct frame *f = XFRAME (XCAR (frmcons)); + enum gutter_pos pos; + Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); + struct window* w = XWINDOW (window); + + GUTTER_POS_LOOP (pos) + { + if (EQ (WINDOW_GUTTER (w, pos), obj)) + { + w->gutter_extent_modiff[pos]++; + } + } + } +} + +/* We have to change the gutter geometry separately to the gutter + update since it needs to occur outside of redisplay proper. */ +static void +update_gutter_geometry (struct frame *f, enum gutter_pos pos) +{ + /* If the gutter geometry has changed then re-layout the + frame. If we are in display there is almost no point in doing + anything else since the frame size changes will be delayed + until we are out of redisplay proper. */ + if (FRAME_GUTTER_BOUNDS (f, pos) != f->current_gutter_bounds[pos]) + { + int width, height; + pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), + &width, &height); + change_frame_size (f, height, width, 0); + } + + /* Mark sizes as up-to-date. */ + f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); +} + +void +update_frame_gutter_geometry (struct frame *f) +{ + if (f->gutter_changed || f->windows_structure_changed) + { + enum gutter_pos pos; + + /* If the gutter geometry has changed then re-layout the + frame. If we are in display there is almost no point in doing + anything else since the frame size changes will be delayed + until we are out of redisplay proper. */ + GUTTER_POS_LOOP (pos) + { + update_gutter_geometry (f, pos); + } + } +} + void update_frame_gutters (struct frame *f) { - if (f->gutter_changed || f->clear || - f->glyphs_changed || f->subwindows_changed || - f->windows_changed || f->windows_structure_changed || - f->extents_changed || f->faces_changed) + if (f->faces_changed || f->frame_changed || + f->gutter_changed || f->glyphs_changed || + f->size_changed || f->subwindows_changed || + f->windows_changed || f->windows_structure_changed || + f->extents_changed) { enum gutter_pos pos; - + /* We don't actually care about these when outputting the gutter so locally disable them. */ int local_clip_changed = f->clip_changed; @@ -358,10 +559,12 @@ GUTTER_POS_LOOP (pos) { if (FRAME_GUTTER_VISIBLE (f, pos)) - output_gutter (f, pos); + output_gutter (f, pos, 0); + else if (gutter_was_visible (f, pos)) - clear_gutter (f, pos); + clear_gutter (f, pos); } + f->clip_changed = local_clip_changed; f->buffers_changed = local_buffers_changed; f->gutter_changed = 0; @@ -371,8 +574,12 @@ void reset_gutter_display_lines (struct frame* f) { - if (f->current_display_lines) - Dynarr_reset (f->current_display_lines); + enum gutter_pos pos; + GUTTER_POS_LOOP (pos) + { + if (f->current_display_lines[pos]) + Dynarr_reset (f->current_display_lines[pos]); + } } static void @@ -388,6 +595,10 @@ if (((x + width) < g_x) || (x > (g_x + g_width))) return; +#ifdef DEBUG_WIDGETS + printf ("redrawing gutter after expose %d+%d, %dx%d\n", + x, y, width, height); +#endif /* #### optimize this - redrawing the whole gutter for every expose is very expensive. We reset the current display lines because if they're being exposed they are no longer current. */ @@ -396,7 +607,7 @@ /* Even if none of the gutter is in the area, the blank region at the very least must be because the first thing we did is verify that some portion of the gutter is in the exposed region. */ - output_gutter (f, pos); + output_gutter (f, pos, 1); } void @@ -404,25 +615,34 @@ int height) { enum gutter_pos pos; + + /* We have to be "in display" when we output the gutter - make it + so. */ + hold_frame_size_changes (); GUTTER_POS_LOOP (pos) { if (FRAME_GUTTER_VISIBLE (f, pos)) redraw_exposed_gutter (f, pos, x, y, width, height); } + unhold_one_frame_size_changes (f); } void free_frame_gutters (struct frame *f) { - if (f->current_display_lines) + enum gutter_pos pos; + GUTTER_POS_LOOP (pos) { - free_display_lines (f->current_display_lines); - f->current_display_lines = 0; - } - if (f->desired_display_lines) - { - free_display_lines (f->desired_display_lines); - f->desired_display_lines = 0; + if (f->current_display_lines[pos]) + { + free_display_lines (f->current_display_lines[pos]); + f->current_display_lines[pos] = 0; + } + if (f->desired_display_lines[pos]) + { + free_display_lines (f->desired_display_lines[pos]); + f->desired_display_lines[pos] = 0; + } } } @@ -466,14 +686,21 @@ list1 (Fcons (Qnil, Qzero))); set_specifier_fallback (Vgutter_border_width[new], Vdefault_gutter_border_width); + /* We don't really want the left and right gutters to default to + visible. */ set_specifier_fallback (Vgutter_visible_p[cur], - list1 (Fcons (Qnil, Qt))); + cur == TOP_GUTTER || cur == BOTTOM_GUTTER ? + list1 (Fcons (Qnil, Qt)) + : list1 (Fcons (Qnil, Qnil))); set_specifier_fallback (Vgutter_visible_p[new], Vdefault_gutter_visible_p); + Vdefault_gutter_position = position; unhold_frame_size_changes (); } + run_hook (Qdefault_gutter_position_changed_hook); + return position; } @@ -543,20 +770,28 @@ if (NILP (instantiator)) return; + /* Must be a string or a plist. */ + if (!STRINGP (instantiator) && NILP (Fvalid_plist_p (instantiator))) + signal_simple_error ("Gutter spec must be string, plist or nil", instantiator); + if (!STRINGP (instantiator)) - signal_simple_error ("Gutter spec must be string or nil", instantiator); + { + Lisp_Object rest; + + for (rest = instantiator; !NILP (rest); rest = XCDR (XCDR (rest))) + { + if (!SYMBOLP (XCAR (rest)) + || !STRINGP (XCAR (XCDR (rest)))) + signal_simple_error ("Gutter plist spec must contain strings", instantiator); + } + } } DEFUN ("gutter-specifier-p", Fgutter_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a gutter specifier. -Gutter specifiers are used to specify the format of a gutter. -The values of the variables `default-gutter', `top-gutter', -`left-gutter', `right-gutter', and `bottom-gutter' are always -gutter specifiers. -Valid gutter instantiators are called "gutter descriptors" -and are lists of vectors. See `default-gutter' for a description -of the exact format. +See `make-gutter-specifier' for a description of possible gutter +instantiators. */ (object)) { @@ -577,22 +812,50 @@ static void gutter_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) + Lisp_Object oldval, enum gutter_pos pos) { - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) + w->real_gutter[pos] = construct_window_gutter_spec (w, pos); + w->real_gutter_size[pos] = w->gutter_size[pos]; + + if (EQ (w->real_gutter_size[pos], Qautodetect) + && !NILP (w->gutter_visible_p[pos])) { - w->real_gutter_size[pos] = w->gutter_size[pos]; - if (EQ (w->real_gutter_size[pos], Qautodetect) - && !NILP (w->gutter_visible_p[pos])) - { - w->real_gutter_size [pos] = calculate_gutter_size (w, pos); - } + w->real_gutter_size [pos] = calculate_gutter_size (w, pos); } MARK_GUTTER_CHANGED; + MARK_MODELINE_CHANGED; MARK_WINDOWS_CHANGED (w); } +/* We define all of these so we can access which actual gutter changed. */ +static void +top_gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval) +{ + gutter_specs_changed (specifier, w, oldval, TOP_GUTTER); +} + +static void +bottom_gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval) +{ + gutter_specs_changed (specifier, w, oldval, BOTTOM_GUTTER); +} + +static void +left_gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval) +{ + gutter_specs_changed (specifier, w, oldval, LEFT_GUTTER); +} + +static void +right_gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval) +{ + gutter_specs_changed (specifier, w, oldval, RIGHT_GUTTER); +} + static void default_gutter_specs_changed (Lisp_Object specifier, struct window *w, Lisp_Object oldval) @@ -614,8 +877,9 @@ w->real_gutter_size [pos] = calculate_gutter_size (w, pos); } } - + MARK_GUTTER_CHANGED; + MARK_MODELINE_CHANGED; MARK_WINDOWS_CHANGED (w); } @@ -640,6 +904,9 @@ Lisp_Object oldval) { recompute_overlaying_specifier (Vgutter_visible_p); + /* Need to reconstruct the gutter specifier as it is affected by the + visibility. */ + recompute_overlaying_specifier (Vgutter); } @@ -659,12 +926,53 @@ DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a gutter-size specifier. + +See `make-gutter-size-specifier' for a description of possible gutter-size +instantiators. */ (object)) { return GUTTER_SIZE_SPECIFIERP (object) ? Qt : Qnil; } +DECLARE_SPECIFIER_TYPE (gutter_visible); +#define GUTTER_VISIBLE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_visible) +DEFINE_SPECIFIER_TYPE (gutter_visible); + +static void +gutter_visible_validate (Lisp_Object instantiator) +{ + if (NILP (instantiator)) + return; + + if (!NILP (instantiator) && !EQ (instantiator, Qt) && !CONSP (instantiator)) + signal_simple_error ("Gutter visibility must be a boolean or list of symbols", + instantiator); + + if (CONSP (instantiator)) + { + Lisp_Object rest; + + EXTERNAL_LIST_LOOP (rest, instantiator) + { + if (!SYMBOLP (XCAR (rest))) + signal_simple_error ("Gutter visibility must be a boolean or list of symbols", + instantiator); + } + } +} + +DEFUN ("gutter-visible-specifier-p", Fgutter_visible_specifier_p, 1, 1, 0, /* +Return non-nil if OBJECT is a gutter-visible specifier. + +See `make-gutter-visible-specifier' for a description of possible +gutter-visible instantiators. +*/ + (object)) +{ + return GUTTER_VISIBLE_SPECIFIERP (object) ? Qt : Qnil; +} + DEFUN ("redisplay-gutter-area", Fredisplay_gutter_area, 0, 0, 0, /* Ensure that all gutters are correctly showing their gutter specifier. */ @@ -681,19 +989,44 @@ { struct frame *f = XFRAME (XCAR (frmcons)); - if (FRAME_REPAINT_P (f)) - { - update_frame_gutters (f); - } - } + MAYBE_DEVMETH (d, frame_output_begin, (f)); + + /* Sequence is quite important here. We not only want to + redisplay the gutter area but we also want to flush any + frame size changes out so that the gutter redisplay happens + in a kosha environment. + + This is not only so that things look right but so that + glyph redisplay optimization kicks in, by default display + lines will be completely re-output if + f->windows_structure_changed is 1, and this is true if + frame size changes haven't been flushed out. Once frame + size changes have been flushed out we then need to + redisplay the frame in order to flush out pending window + size changes. */ + update_frame_gutter_geometry (f); - /* We now call the output_end routine for tty frames. We delay - doing so in order to avoid cursor flicker. So much for 100% - encapsulation. */ - if (DEVICE_TTY_P (d)) - DEVMETH (d, output_end, (d)); + if (f->windows_structure_changed) + redisplay_frame (f, 1); + else if (FRAME_REPAINT_P (f)) + { + /* We have to be "in display" when we output the gutter + - make it so. */ + hold_frame_size_changes (); + update_frame_gutters (f); + unhold_one_frame_size_changes (f); + } + + MAYBE_DEVMETH (d, frame_output_end, (f)); + } + + d->gutter_changed = 0; } + /* This is so that further changes to the gutters will trigger redisplay. */ + gutter_changed_set = 0; + gutter_changed = 0; + return Qnil; } @@ -707,6 +1040,7 @@ initialization. We need to recalculate autodetected gutters. */ GUTTER_POS_LOOP (pos) { + w->real_gutter[pos] = construct_window_gutter_spec (w, pos); w->real_gutter_size[pos] = w->gutter_size[pos]; if (EQ (w->gutter_size[pos], Qautodetect) && !NILP (w->gutter_visible_p[pos])) @@ -716,6 +1050,12 @@ MARK_WINDOWS_CHANGED (w); } } + + /* Keep a record of the current sizes of things. */ + GUTTER_POS_LOOP (pos) + { + f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); + } } void @@ -723,6 +1063,7 @@ { DEFSUBR (Fgutter_specifier_p); DEFSUBR (Fgutter_size_specifier_p); + DEFSUBR (Fgutter_visible_specifier_p); DEFSUBR (Fset_default_gutter_position); DEFSUBR (Fdefault_gutter_position); DEFSUBR (Fgutter_pixel_height); @@ -730,6 +1071,9 @@ DEFSUBR (Fredisplay_gutter_area); defsymbol (&Qgutter_size, "gutter-size"); + defsymbol (&Qgutter_visible, "gutter-visible"); + defsymbol (&Qdefault_gutter_position_changed_hook, + "default-gutter-position-changed-hook"); } void @@ -745,13 +1089,14 @@ specifier_type_create_gutter (void) { INITIALIZE_SPECIFIER_TYPE (gutter, "gutter", "gutter-specifier-p"); - SPECIFIER_HAS_METHOD (gutter, validate); SPECIFIER_HAS_METHOD (gutter, after_change); INITIALIZE_SPECIFIER_TYPE (gutter_size, "gutter-size", "gutter-size-specifier-p"); + SPECIFIER_HAS_METHOD (gutter_size, validate); - SPECIFIER_HAS_METHOD (gutter_size, validate); + INITIALIZE_SPECIFIER_TYPE (gutter_visible, "gutter-visible", "gutter-visible-specifier-p"); + SPECIFIER_HAS_METHOD (gutter_visible, validate); } void @@ -759,6 +1104,7 @@ { REINITIALIZE_SPECIFIER_TYPE (gutter); REINITIALIZE_SPECIFIER_TYPE (gutter_size); + REINITIALIZE_SPECIFIER_TYPE (gutter_visible); } void @@ -799,11 +1145,11 @@ using position-specific specifiers. That way, you will get sane behavior if the user changes the default gutter position. -The gutter value should be a string or nil. You can attach extents and -glyphs to the string and hence display glyphs and text in other fonts -in the gutter area. - -*/ ); +The gutter value should be a string, a property list of strings or +nil. You can attach extents and glyphs to the string and hence display +glyphs and text in other fonts in the gutter area. If the gutter value +is a property list then the strings will be concatenated together +before being displayed. */ ); Vdefault_gutter = Fmake_specifier (Qgutter); /* #### It would be even nicer if the specifier caching @@ -823,7 +1169,7 @@ Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter); set_specifier_caching (Vgutter[TOP_GUTTER], offsetof (struct window, gutter[TOP_GUTTER]), - gutter_specs_changed, + top_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter", @@ -840,7 +1186,7 @@ Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter); set_specifier_caching (Vgutter[BOTTOM_GUTTER], offsetof (struct window, gutter[BOTTOM_GUTTER]), - gutter_specs_changed, + bottom_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("left-gutter", @@ -857,7 +1203,7 @@ Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter); set_specifier_caching (Vgutter[LEFT_GUTTER], offsetof (struct window, gutter[LEFT_GUTTER]), - gutter_specs_changed, + left_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("right-gutter", @@ -874,7 +1220,7 @@ Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter); set_specifier_caching (Vgutter[RIGHT_GUTTER], offsetof (struct window, gutter[RIGHT_GUTTER]), - gutter_specs_changed, + right_gutter_specs_changed, 0, 0); /* initially, top inherits from default; this can be @@ -939,8 +1285,7 @@ Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size); set_specifier_caching (Vgutter_size[TOP_GUTTER], offsetof (struct window, gutter_size[TOP_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-height", &Vgutter_size[BOTTOM_GUTTER] /* @@ -952,8 +1297,7 @@ Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size); set_specifier_caching (Vgutter_size[BOTTOM_GUTTER], offsetof (struct window, gutter_size[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("left-gutter-width", &Vgutter_size[LEFT_GUTTER] /* @@ -965,8 +1309,7 @@ Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qnatnum); set_specifier_caching (Vgutter_size[LEFT_GUTTER], offsetof (struct window, gutter_size[LEFT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("right-gutter-width", &Vgutter_size[RIGHT_GUTTER] /* @@ -978,8 +1321,7 @@ Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qnatnum); set_specifier_caching (Vgutter_size[RIGHT_GUTTER], offsetof (struct window, gutter_size[RIGHT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); fb = Qnil; #ifdef HAVE_TTY @@ -1004,7 +1346,7 @@ #endif #ifdef HAVE_MS_WINDOWS fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb); - fb = Fcons (Fcons (list1 (Qmswindows), + fb = Fcons (Fcons (list1 (Qmswindows), make_int (DEFAULT_GUTTER_WIDTH)), fb); #endif if (!NILP (fb)) @@ -1047,8 +1389,7 @@ set_specifier_caching (Vgutter_border_width[TOP_GUTTER], offsetof (struct window, gutter_border_width[TOP_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-border-width", &Vgutter_border_width[BOTTOM_GUTTER] /* @@ -1061,8 +1402,7 @@ set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER], offsetof (struct window, gutter_border_width[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("left-gutter-border-width", &Vgutter_border_width[LEFT_GUTTER] /* @@ -1075,8 +1415,7 @@ set_specifier_caching (Vgutter_border_width[LEFT_GUTTER], offsetof (struct window, gutter_border_width[LEFT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("right-gutter-border-width", &Vgutter_border_width[RIGHT_GUTTER] /* @@ -1089,8 +1428,7 @@ set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER], offsetof (struct window, gutter_border_width[RIGHT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); fb = Qnil; #ifdef HAVE_TTY @@ -1127,7 +1465,7 @@ `default-gutter-visible-p' and all of the position-specific gutter visibility specifiers have a fallback value of true. */ ); - Vdefault_gutter_visible_p = Fmake_specifier (Qboolean); + Vdefault_gutter_visible_p = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vdefault_gutter_visible_p, offsetof (struct window, default_gutter_visible_p), @@ -1141,12 +1479,11 @@ See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qboolean); + Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vgutter_visible_p[TOP_GUTTER], offsetof (struct window, gutter_visible_p[TOP_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + top_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-visible-p", &Vgutter_visible_p[BOTTOM_GUTTER] /* @@ -1155,12 +1492,11 @@ See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qboolean); + Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER], offsetof (struct window, gutter_visible_p[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + bottom_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("left-gutter-visible-p", &Vgutter_visible_p[LEFT_GUTTER] /* @@ -1169,12 +1505,11 @@ See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qboolean); + Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER], offsetof (struct window, gutter_visible_p[LEFT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + left_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("right-gutter-visible-p", &Vgutter_visible_p[RIGHT_GUTTER] /* @@ -1183,12 +1518,11 @@ See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qboolean); + Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER], offsetof (struct window, gutter_visible_p[RIGHT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + right_gutter_specs_changed, 0, 0); /* initially, top inherits from default; this can be changed with `set-default-gutter-position'. */ diff -r 72a7cfa4a488 -r abe6d1db359e src/gutter.h --- a/src/gutter.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/gutter.h Mon Aug 13 11:35:02 2007 +0200 @@ -54,6 +54,8 @@ extern Lisp_Object Vgutter_size[4]; extern Lisp_Object Vgutter_border_width[4]; void update_frame_gutters (struct frame *f); +void update_frame_gutter_geometry (struct frame *f); +void mark_gutters (struct frame* f); void init_frame_gutters (struct frame *f); void init_device_gutters (struct device *d); void init_global_gutters (struct device *d); @@ -61,17 +63,21 @@ void redraw_exposed_gutters (struct frame *f, int x, int y, int width, int height); void reset_gutter_display_lines (struct frame* f); +void gutter_extent_signal_changed_region_maybe (Lisp_Object obj, + Bufpos start, Bufpos end); #define WINDOW_GUTTER_BORDER_WIDTH(w, pos) \ -(NILP ((w)->gutter_border_width[pos]) ? 0 : XINT ((w)->gutter_border_width[pos])) + (INTP ((w)->gutter_border_width[pos]) ? XINT ((w)->gutter_border_width[pos]) : 0) #define WINDOW_GUTTER_SIZE(w, pos) \ -(NILP ((w)->gutter_size[pos]) ? 0 : XINT ((w)->gutter_size[pos])) + (INTP ((w)->gutter_size[pos]) ? XINT ((w)->gutter_size[pos]) : 0) #define WINDOW_GUTTER_SIZE_INTERNAL(w, pos) \ -(NILP ((w)->real_gutter_size[pos]) ? 0 : XINT ((w)->real_gutter_size[pos])) + (INTP ((w)->real_gutter_size[pos]) ? XINT ((w)->real_gutter_size[pos]) : 0) #define WINDOW_GUTTER_VISIBLE(w, pos) \ -((w)->gutter_visible_p[pos]) + ((w)->gutter_visible_p[pos]) #define WINDOW_GUTTER(w, pos) \ -((w)->gutter[pos]) + ((w)->real_gutter[pos]) +#define RAW_WINDOW_GUTTER(w, pos) \ + ((w)->gutter[pos]) #define WINDOW_REAL_GUTTER_SIZE(w, pos) \ (!NILP (WINDOW_GUTTER_VISIBLE (w, pos)) \ @@ -90,17 +96,13 @@ /* these macros predicate size on position and type of window */ #define WINDOW_REAL_TOP_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_highest (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) #define WINDOW_REAL_BOTTOM_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_lowest (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) #define WINDOW_REAL_LEFT_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_leftmost (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) #define WINDOW_REAL_RIGHT_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_rightmost (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) #define FRAME_GUTTER_VISIBLE(f, pos) \ WINDOW_REAL_GUTTER_VISIBLE (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) diff -r 72a7cfa4a488 -r abe6d1db359e src/hash.c --- a/src/hash.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/hash.c Mon Aug 13 11:35:02 2007 +0200 @@ -34,10 +34,10 @@ static void rehash (hentry *harray, struct hash_table *ht, hash_size_t size); unsigned long -memory_hash (CONST void *xv, size_t size) +memory_hash (const void *xv, size_t size) { unsigned int h = 0; - unsigned CONST char *x = (unsigned CONST char *) xv; + unsigned const char *x = (unsigned const char *) xv; if (!x) return 0; @@ -52,6 +52,25 @@ return h; } +unsigned long +string_hash (const char *xv) +{ + unsigned int h = 0; + unsigned const char *x = (unsigned const char *) xv; + + if (!x) return 0; + + while (*x) + { + unsigned int g; + h = (h << 4) + *x++; + if ((g = h & 0xf0000000) != 0) + h = (h ^ (g >> 24)) ^ g; + } + + return h; +} + /* Return a suitable size for a hash table, with at least SIZE slots. */ static size_t hash_table_size (size_t requested_size) @@ -59,7 +78,7 @@ /* Return some prime near, but greater than or equal to, SIZE. Decades from the time of writing, someone will have a system large enough that the list below will be too short... */ - static CONST size_t primes [] = + static const size_t primes [] = { 19, 29, 41, 59, 79, 107, 149, 197, 263, 347, 457, 599, 787, 1031, 1361, 1777, 2333, 3037, 3967, 5167, 6719, 8737, 11369, 14783, @@ -85,8 +104,8 @@ return primes [high]; } -CONST void * -gethash (CONST void *key, struct hash_table *hash_table, CONST void **ret_value) +const void * +gethash (const void *key, struct hash_table *hash_table, const void **ret_value) { if (!key) { @@ -104,7 +123,7 @@ (unsigned long) key; unsigned int hcode = hcode_initial % size; hentry *e = &harray [hcode]; - CONST void *e_key = e->key; + const void *e_key = e->key; if (e_key ? KEYS_DIFFER_P (e_key, key, test_function) : @@ -188,7 +207,7 @@ } void -puthash (CONST void *key, void *contents, struct hash_table *hash_table) +puthash (const void *key, void *contents, struct hash_table *hash_table) { if (!key) { @@ -207,8 +226,8 @@ unsigned int hcode = hcode_initial % size; size_t h2 = size - 2; unsigned int incr = 1 + (hcode_initial % h2); - CONST void *e_key = harray [hcode].key; - CONST void *oldcontents; + const void *e_key = harray [hcode].key; + const void *oldcontents; if (e_key && KEYS_DIFFER_P (e_key, key, test_function)) { @@ -269,7 +288,7 @@ } void -remhash (CONST void *key, struct hash_table *hash_table) +remhash (const void *key, struct hash_table *hash_table) { if (!key) { @@ -287,7 +306,7 @@ ((unsigned long) key); unsigned int hcode = hcode_initial % size; hentry *e = &harray [hcode]; - CONST void *e_key = e->key; + const void *e_key = e->key; if (e_key ? KEYS_DIFFER_P (e_key, key, test_function) : diff -r 72a7cfa4a488 -r abe6d1db359e src/hash.h --- a/src/hash.h Mon Aug 13 11:33:40 2007 +0200 +++ b/src/hash.h Mon Aug 13 11:35:02 2007 +0200 @@ -22,12 +22,12 @@ typedef struct { - CONST void *key; + const void *key; void *contents; } hentry; -typedef int (*hash_table_test_function) (CONST void *, CONST void *); -typedef unsigned long (*hash_table_hash_function) (CONST void *); +typedef int (*hash_table_test_function) (const void *, const void *); +typedef unsigned long (*hash_table_hash_function) (const void *); typedef size_t hash_size_t; struct hash_table @@ -57,18 +57,18 @@ void free_hash_table (struct hash_table *hash_table); /* Returns a hentry whose key is 0 if the entry does not exist in HASH-TABLE */ -CONST void *gethash (CONST void *key, struct hash_table *hash_table, - CONST void **ret_value); +const void *gethash (const void *key, struct hash_table *hash_table, + const void **ret_value); /* KEY should be different from 0 */ -void puthash (CONST void *key, void *contents, struct hash_table *hash_table); +void puthash (const void *key, void *contents, struct hash_table *hash_table); /* delete the entry with key KEY */ -void remhash (CONST void *key, struct hash_table *hash_table); +void remhash (const void *key, struct hash_table *hash_table); -typedef int (*maphash_function) (CONST void* key, void* contents, void* arg); +typedef int (*maphash_function) (const void* key, void* contents, void* arg); -typedef int (*remhash_predicate) (CONST void* key, CONST void* contents, +typedef int (*remhash_predicate) (const void* key, const void* contents, void* arg); /* Call MF (key, contents, arg) for every entry in HASH-TABLE */ diff -r 72a7cfa4a488 -r abe6d1db359e src/hpplay.c --- a/src/hpplay.c Mon Aug 13 11:33:40 2007 +0200 +++ b/src/hpplay.c Mon Aug 13 11:35:02 2007 +0200 @@ -51,6 +51,8 @@ #include #include "lisp.h" +#include "nativesound.h" + #include #include #ifdef HPUX10 @@ -61,6 +63,7 @@ #include